Metadata-Version: 2.4
Name: aicheck
Version: 0.1.0
Summary: Catch AI-generated code issues before they catch you
Author-email: Mahesh Makvana <maheshmakvana@users.noreply.github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/maheshmakvana/ai-check
Project-URL: Repository, https://github.com/maheshmakvana/ai-check
Project-URL: BugTracker, https://github.com/maheshmakvana/ai-check/issues
Keywords: ai verification,code review,hallucination detection,llm code,ai code quality,code analysis,static analysis,python
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.31.0
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: ruff>=0.3.0; extra == "test"
Requires-Dist: mypy>=1.8.0; extra == "test"
Dynamic: license-file

# aicheck

**Catch AI-generated code issues before they catch you.**

`aicheck` is a static analysis toolkit that detects common failure patterns in AI-generated Python code:

- **Hallucinated imports** — modules LLMs frequently invent (e.g. `utils`, `helpers`, `misc`)
- **Dead code** — unused variables, unreachable branches, code after `return`/`raise`
- **Suspicious API usage** — wrong method names for stdlib modules, `open().read()` patterns
- **Confidence scoring** — each file gets a 0–100 score based on findings severity

## Installation

```bash
pip install aicheck
```

## Quick Start

```bash
# Check a single file
aicheck check my_file.py

# Check an entire project
aicheck check src/

# JSON output for CI integration
aicheck check src/ --format json
```

## Sample Output

```
[FAIL] src/suspicious.py  (score: 62.0)
    high  L1:0  [hallucinated_import] Potentially hallucinated module: 'utils'
           ↳ Verify 'utils' exists; check PyPI or project dependencies
  medium  L14:4  [unreachable_code] Unreachable branch: condition is always False
     low  L11:4  [dead_code] Possibly unused variable: 'unused_var'

Files: 1  Passed: 0  Failed: 1
Average confidence score: 62.0/100
```

## CLI Reference

| Command | Description |
|---|---|
| `aicheck check <path>` | Analyze a file or directory |
| `aicheck check <path> --format json` | Output as JSON |
| `aicheck version` | Show version |

## Score Interpretation

| Score | Meaning |
|---|---|
| 100–90 | Clean |
| 89–70 | Minor issues |
| 69–50 | Moderate issues — review recommended |
| <50 | Critical — do not commit without review |

## Development

```bash
git clone https://github.com/maheshmakvana/ai-check.git
cd ai-check
python -m venv venv && source venv/bin/activate
pip install -e ".[test]"
pytest tests/ -v
ruff check src/
mypy src/
```

## License

MIT
