aion-evolve 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aion_evolve-0.2.1/.aion.yaml +4 -0
- aion_evolve-0.2.1/.github/dependabot.yml +19 -0
- aion_evolve-0.2.1/.github/workflows/ci.yml +54 -0
- aion_evolve-0.2.1/.github/workflows/docs.yml +32 -0
- aion_evolve-0.2.1/.github/workflows/publish.yml +54 -0
- aion_evolve-0.2.1/.github/workflows/release-drafter.yml +19 -0
- aion_evolve-0.2.1/.gitignore +12 -0
- aion_evolve-0.2.1/.python-version +1 -0
- aion_evolve-0.2.1/CLAUDE.md +18 -0
- aion_evolve-0.2.1/PKG-INFO +89 -0
- aion_evolve-0.2.1/README.md +72 -0
- aion_evolve-0.2.1/docs/en/configuration.md +33 -0
- aion_evolve-0.2.1/docs/en/how-it-works.md +55 -0
- aion_evolve-0.2.1/docs/en/index.md +37 -0
- aion_evolve-0.2.1/docs/en/installation.md +35 -0
- aion_evolve-0.2.1/docs/en/usage.md +42 -0
- aion_evolve-0.2.1/docs/index.md +32 -0
- aion_evolve-0.2.1/docs/stylesheets/extra.css +103 -0
- aion_evolve-0.2.1/docs/zh/configuration.md +33 -0
- aion_evolve-0.2.1/docs/zh/how-it-works.md +55 -0
- aion_evolve-0.2.1/docs/zh/index.md +35 -0
- aion_evolve-0.2.1/docs/zh/installation.md +35 -0
- aion_evolve-0.2.1/docs/zh/usage.md +41 -0
- aion_evolve-0.2.1/main.py +15 -0
- aion_evolve-0.2.1/mkdocs.yml +85 -0
- aion_evolve-0.2.1/pyproject.toml +51 -0
- aion_evolve-0.2.1/setup.cfg +4 -0
- aion_evolve-0.2.1/src/aion/__init__.py +10 -0
- aion_evolve-0.2.1/src/aion/__main__.py +5 -0
- aion_evolve-0.2.1/src/aion/cli.py +304 -0
- aion_evolve-0.2.1/src/aion/config.py +83 -0
- aion_evolve-0.2.1/src/aion/context_extractor.py +243 -0
- aion_evolve-0.2.1/src/aion/evaluation.py +142 -0
- aion_evolve-0.2.1/src/aion/llm_analyzer.py +219 -0
- aion_evolve-0.2.1/src/aion/models.py +100 -0
- aion_evolve-0.2.1/src/aion/risk_heuristics.py +90 -0
- aion_evolve-0.2.1/src/aion/semgrep_runner.py +50 -0
- aion_evolve-0.2.1/src/aion_evolve.egg-info/PKG-INFO +89 -0
- aion_evolve-0.2.1/src/aion_evolve.egg-info/SOURCES.txt +64 -0
- aion_evolve-0.2.1/src/aion_evolve.egg-info/dependency_links.txt +1 -0
- aion_evolve-0.2.1/src/aion_evolve.egg-info/entry_points.txt +2 -0
- aion_evolve-0.2.1/src/aion_evolve.egg-info/requires.txt +7 -0
- aion_evolve-0.2.1/src/aion_evolve.egg-info/top_level.txt +1 -0
- aion_evolve-0.2.1/tests/eval/test_quality_eval.py +67 -0
- aion_evolve-0.2.1/tests/fixtures/labels.json +26 -0
- aion_evolve-0.2.1/tests/fixtures/safe/01_context.json +5 -0
- aion_evolve-0.2.1/tests/fixtures/safe/01_orm_correct.py +7 -0
- aion_evolve-0.2.1/tests/fixtures/safe/02_context.json +6 -0
- aion_evolve-0.2.1/tests/fixtures/safe/02_env_secret.py +7 -0
- aion_evolve-0.2.1/tests/fixtures/safe/03_context.json +5 -0
- aion_evolve-0.2.1/tests/fixtures/safe/03_with_auth_decorator.py +11 -0
- aion_evolve-0.2.1/tests/fixtures/vulnerable/01_context.json +5 -0
- aion_evolve-0.2.1/tests/fixtures/vulnerable/01_raw_sqlite3.py +10 -0
- aion_evolve-0.2.1/tests/fixtures/vulnerable/02_context.json +6 -0
- aion_evolve-0.2.1/tests/fixtures/vulnerable/02_hardcoded_secret.py +7 -0
- aion_evolve-0.2.1/tests/fixtures/vulnerable/03_context.json +5 -0
- aion_evolve-0.2.1/tests/fixtures/vulnerable/03_missing_auth_decorator.py +10 -0
- aion_evolve-0.2.1/tests/unit/test_cli.py +197 -0
- aion_evolve-0.2.1/tests/unit/test_config.py +24 -0
- aion_evolve-0.2.1/tests/unit/test_context_extractor.py +49 -0
- aion_evolve-0.2.1/tests/unit/test_evaluation.py +62 -0
- aion_evolve-0.2.1/tests/unit/test_fixtures.py +21 -0
- aion_evolve-0.2.1/tests/unit/test_llm_analyzer.py +51 -0
- aion_evolve-0.2.1/tests/unit/test_risk_heuristics.py +45 -0
- aion_evolve-0.2.1/tests/unit/test_semgrep_runner.py +53 -0
- aion_evolve-0.2.1/uv.lock +2516 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
groups:
|
|
8
|
+
github-actions:
|
|
9
|
+
patterns:
|
|
10
|
+
- "*"
|
|
11
|
+
|
|
12
|
+
- package-ecosystem: "pip"
|
|
13
|
+
directory: "/"
|
|
14
|
+
schedule:
|
|
15
|
+
interval: "weekly"
|
|
16
|
+
groups:
|
|
17
|
+
pip:
|
|
18
|
+
patterns:
|
|
19
|
+
- "*"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
name: Unit tests (Python ${{ matrix.python-version }})
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
run: python -m pip install uv
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: uv sync --group dev
|
|
33
|
+
|
|
34
|
+
- name: Run unit tests
|
|
35
|
+
run: uv run pytest tests/unit
|
|
36
|
+
|
|
37
|
+
build:
|
|
38
|
+
name: Build package
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
42
|
+
with:
|
|
43
|
+
fetch-depth: 0
|
|
44
|
+
|
|
45
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
46
|
+
with:
|
|
47
|
+
python-version: "3.11"
|
|
48
|
+
|
|
49
|
+
- name: Install build tooling
|
|
50
|
+
run: python -m pip install build
|
|
51
|
+
|
|
52
|
+
- name: Build sdist and wheel
|
|
53
|
+
run: python -m build
|
|
54
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Deploy Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- "docs/**"
|
|
9
|
+
- "mkdocs.yml"
|
|
10
|
+
- ".github/workflows/docs.yml"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
deploy:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.12"
|
|
27
|
+
|
|
28
|
+
- name: Install MkDocs
|
|
29
|
+
run: pip install mkdocs==1.6.1 mkdocs-material==9.7.6 pymdown-extensions==10.16.1
|
|
30
|
+
|
|
31
|
+
- name: Build and deploy
|
|
32
|
+
run: mkdocs gh-deploy --force
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
name: Build distribution
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
18
|
+
with:
|
|
19
|
+
fetch-depth: 0
|
|
20
|
+
|
|
21
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.11"
|
|
24
|
+
|
|
25
|
+
- name: Install build
|
|
26
|
+
run: python -m pip install build
|
|
27
|
+
|
|
28
|
+
- name: Build sdist and wheel
|
|
29
|
+
run: python -m build
|
|
30
|
+
|
|
31
|
+
- name: Upload build artifacts
|
|
32
|
+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
33
|
+
with:
|
|
34
|
+
name: dist
|
|
35
|
+
path: dist/
|
|
36
|
+
|
|
37
|
+
publish:
|
|
38
|
+
name: Publish to PyPI
|
|
39
|
+
needs: build
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
environment:
|
|
42
|
+
name: pypi
|
|
43
|
+
url: https://pypi.org/project/aion/
|
|
44
|
+
permissions:
|
|
45
|
+
id-token: write
|
|
46
|
+
steps:
|
|
47
|
+
- name: Download build artifacts
|
|
48
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
49
|
+
with:
|
|
50
|
+
name: dist
|
|
51
|
+
path: dist/
|
|
52
|
+
|
|
53
|
+
- name: Publish to PyPI
|
|
54
|
+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1 @ 2025-03-25
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Release Drafter
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
pull-requests: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
update_release_draft:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: release-drafter/release-drafter@139054aeaa9adc52ab36ddf67437541f039b88e2 # v7.1.1
|
|
18
|
+
with:
|
|
19
|
+
config-name: github:shenxianpeng/.github:/.github/release-drafter.yml
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
## Skill routing
|
|
3
|
+
|
|
4
|
+
When the user's request matches an available skill, ALWAYS invoke it using the Skill
|
|
5
|
+
tool as your FIRST action. Do NOT answer directly, do NOT use other tools first.
|
|
6
|
+
The skill has specialized workflows that produce better results than ad-hoc answers.
|
|
7
|
+
|
|
8
|
+
Key routing rules:
|
|
9
|
+
- Product ideas, "is this worth building", brainstorming → invoke office-hours
|
|
10
|
+
- Bugs, errors, "why is this broken", 500 errors → invoke investigate
|
|
11
|
+
- Ship, deploy, push, create PR → invoke ship
|
|
12
|
+
- QA, test the site, find bugs → invoke qa
|
|
13
|
+
- Code review, check my diff → invoke review
|
|
14
|
+
- Update docs after shipping → invoke document-release
|
|
15
|
+
- Weekly retro → invoke retro
|
|
16
|
+
- Design system, brand → invoke design-consultation
|
|
17
|
+
- Visual audit, design polish → invoke design-review
|
|
18
|
+
- Architecture review → invoke plan-eng-review
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aion-evolve
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: AION: The Self-Evolving Code Engine. Code Once, Live Forever.
|
|
5
|
+
Project-URL: Homepage, https://github.com/shenxianpeng/aion
|
|
6
|
+
Project-URL: Documentation, https://shenxianpeng.github.io/aion/
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/shenxianpeng/aion/issues
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: anthropic>=0.86.0
|
|
11
|
+
Requires-Dist: instructor>=1.14.5
|
|
12
|
+
Requires-Dist: openai>=2.30.0
|
|
13
|
+
Requires-Dist: pydantic>=2.11.0
|
|
14
|
+
Requires-Dist: rich>=14.3.3
|
|
15
|
+
Requires-Dist: semgrep>=1.156.0
|
|
16
|
+
Requires-Dist: typer>=0.23.1
|
|
17
|
+
|
|
18
|
+
# AION
|
|
19
|
+
|
|
20
|
+
[](https://shenxianpeng.github.io/aion/)
|
|
21
|
+
|
|
22
|
+
> **Code Once, Live Forever.**
|
|
23
|
+
|
|
24
|
+
`AION` is The Self-Evolving Code Engine — designed to end technical debt and keep your codebase in a perpetual state of health.
|
|
25
|
+
|
|
26
|
+
AI scans your code continuously, automatically rewrites outdated syntax and risky logic, and delivers an evolved codebase every day. Instead of treating every file in isolation, it builds a lightweight profile of the existing repository, runs `semgrep` as a fast first pass, and only asks the LLM to investigate files that have concrete risk signals or meaningful context gaps. The main differentiator is context-gap reporting, for example: "this file uses `sqlite3`, but the rest of the project uses `sqlalchemy` sessions."
|
|
27
|
+
|
|
28
|
+
## Current MVP
|
|
29
|
+
|
|
30
|
+
- Python-only scanning
|
|
31
|
+
- Project context extraction via `ast`
|
|
32
|
+
- `semgrep --config p/python` integration
|
|
33
|
+
- Anthropic-backed structured findings
|
|
34
|
+
- Anthropic and OpenAI providers
|
|
35
|
+
- AI-generated file detection via file markers, git history, or explicit `--ai-generated`
|
|
36
|
+
- Rich terminal output and JSON output
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uv sync
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
export ANTHROPIC_API_KEY=your_key
|
|
48
|
+
uv run aion scan ./path/to/project
|
|
49
|
+
uv run aion scan ./path/to/project --ai-generated ./path/to/project/generated_file.py
|
|
50
|
+
uv run aion scan ./path/to/project --output json
|
|
51
|
+
export OPENAI_API_KEY=your_key
|
|
52
|
+
uv run aion scan ./path/to/project --provider openai
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Config File
|
|
56
|
+
|
|
57
|
+
Create `.aion.yaml` in the project root:
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
provider: openai
|
|
61
|
+
model: gpt-4.1
|
|
62
|
+
ignore_paths:
|
|
63
|
+
- tests/*
|
|
64
|
+
- scripts/generated_*.py
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
CLI flags still override config values.
|
|
68
|
+
|
|
69
|
+
## Notes
|
|
70
|
+
|
|
71
|
+
- If `semgrep` is unavailable, the tool degrades to LLM-only mode and prints a warning.
|
|
72
|
+
- If no AI-generated markers are found, the tool scans all Python files and prints a warning.
|
|
73
|
+
- Context extraction cache is stored at `~/.aion-context.json`.
|
|
74
|
+
- Provider-specific defaults: Anthropic uses `claude-3-5-sonnet-latest`; OpenAI uses `gpt-4.1` unless `--model` is set.
|
|
75
|
+
|
|
76
|
+
## Tests
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
uv run pytest tests/unit
|
|
80
|
+
uv run pytest -m eval tests/eval
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Documentation
|
|
84
|
+
|
|
85
|
+
Full documentation is published with GitHub Pages:
|
|
86
|
+
|
|
87
|
+
- English: `docs/en/`
|
|
88
|
+
- 中文: `docs/zh/`
|
|
89
|
+
- Site URL: `https://shenxianpeng.github.io/aion/`
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# AION
|
|
2
|
+
|
|
3
|
+
[](https://shenxianpeng.github.io/aion/)
|
|
4
|
+
|
|
5
|
+
> **Code Once, Live Forever.**
|
|
6
|
+
|
|
7
|
+
`AION` is The Self-Evolving Code Engine — designed to end technical debt and keep your codebase in a perpetual state of health.
|
|
8
|
+
|
|
9
|
+
AI scans your code continuously, automatically rewrites outdated syntax and risky logic, and delivers an evolved codebase every day. Instead of treating every file in isolation, it builds a lightweight profile of the existing repository, runs `semgrep` as a fast first pass, and only asks the LLM to investigate files that have concrete risk signals or meaningful context gaps. The main differentiator is context-gap reporting, for example: "this file uses `sqlite3`, but the rest of the project uses `sqlalchemy` sessions."
|
|
10
|
+
|
|
11
|
+
## Current MVP
|
|
12
|
+
|
|
13
|
+
- Python-only scanning
|
|
14
|
+
- Project context extraction via `ast`
|
|
15
|
+
- `semgrep --config p/python` integration
|
|
16
|
+
- Anthropic-backed structured findings
|
|
17
|
+
- Anthropic and OpenAI providers
|
|
18
|
+
- AI-generated file detection via file markers, git history, or explicit `--ai-generated`
|
|
19
|
+
- Rich terminal output and JSON output
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uv sync
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
export ANTHROPIC_API_KEY=your_key
|
|
31
|
+
uv run aion scan ./path/to/project
|
|
32
|
+
uv run aion scan ./path/to/project --ai-generated ./path/to/project/generated_file.py
|
|
33
|
+
uv run aion scan ./path/to/project --output json
|
|
34
|
+
export OPENAI_API_KEY=your_key
|
|
35
|
+
uv run aion scan ./path/to/project --provider openai
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Config File
|
|
39
|
+
|
|
40
|
+
Create `.aion.yaml` in the project root:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
provider: openai
|
|
44
|
+
model: gpt-4.1
|
|
45
|
+
ignore_paths:
|
|
46
|
+
- tests/*
|
|
47
|
+
- scripts/generated_*.py
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
CLI flags still override config values.
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
|
|
54
|
+
- If `semgrep` is unavailable, the tool degrades to LLM-only mode and prints a warning.
|
|
55
|
+
- If no AI-generated markers are found, the tool scans all Python files and prints a warning.
|
|
56
|
+
- Context extraction cache is stored at `~/.aion-context.json`.
|
|
57
|
+
- Provider-specific defaults: Anthropic uses `claude-3-5-sonnet-latest`; OpenAI uses `gpt-4.1` unless `--model` is set.
|
|
58
|
+
|
|
59
|
+
## Tests
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uv run pytest tests/unit
|
|
63
|
+
uv run pytest -m eval tests/eval
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Documentation
|
|
67
|
+
|
|
68
|
+
Full documentation is published with GitHub Pages:
|
|
69
|
+
|
|
70
|
+
- English: `docs/en/`
|
|
71
|
+
- 中文: `docs/zh/`
|
|
72
|
+
- Site URL: `https://shenxianpeng.github.io/aion/`
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
Place a `.aion.yaml` file in the target repository root.
|
|
4
|
+
|
|
5
|
+
## Example
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
provider: openai
|
|
9
|
+
model: gpt-4.1
|
|
10
|
+
ignore_paths:
|
|
11
|
+
- tests/*
|
|
12
|
+
- scripts/generated_*.py
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Fields
|
|
16
|
+
|
|
17
|
+
| Field | Type | Description |
|
|
18
|
+
|-------|------|-------------|
|
|
19
|
+
| `provider` | string | `anthropic` or `openai` |
|
|
20
|
+
| `model` | string | Explicit model name |
|
|
21
|
+
| `ignore_paths` | list | Glob patterns to skip during scanning |
|
|
22
|
+
|
|
23
|
+
## Override order
|
|
24
|
+
|
|
25
|
+
CLI flags take precedence over `.aion.yaml`.
|
|
26
|
+
|
|
27
|
+
## Cache
|
|
28
|
+
|
|
29
|
+
Context extraction results are cached at:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
~/.aion-context.json
|
|
33
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# How It Works
|
|
2
|
+
|
|
3
|
+
AION is built as a staged pipeline.
|
|
4
|
+
|
|
5
|
+
## 1. Identify target files
|
|
6
|
+
|
|
7
|
+
The CLI resolves Python files from the input path and excludes common directories such
|
|
8
|
+
as `.git`, `.venv`, `node_modules`, and `__pycache__`.
|
|
9
|
+
|
|
10
|
+
It then narrows the scan to likely AI-generated files using:
|
|
11
|
+
|
|
12
|
+
- file markers such as `Generated by`
|
|
13
|
+
- Git history hints such as Copilot or Cursor signatures
|
|
14
|
+
- explicit `--ai-generated` targets
|
|
15
|
+
|
|
16
|
+
If no marker is found, it warns and scans all Python files.
|
|
17
|
+
|
|
18
|
+
## 2. Extract repository context
|
|
19
|
+
|
|
20
|
+
The context extractor samples the repository and builds a lightweight profile:
|
|
21
|
+
|
|
22
|
+
- imports
|
|
23
|
+
- auth decorators
|
|
24
|
+
- database access patterns
|
|
25
|
+
- function names
|
|
26
|
+
- likely ORM and HTTP client usage
|
|
27
|
+
|
|
28
|
+
That repository profile is what makes context-gap reporting possible.
|
|
29
|
+
|
|
30
|
+
## 3. Run Semgrep first
|
|
31
|
+
|
|
32
|
+
If `semgrep` is installed, AION runs it as a fast initial pass and collects
|
|
33
|
+
structured findings from `p/python`.
|
|
34
|
+
|
|
35
|
+
## 4. Escalate to LLM analysis only when needed
|
|
36
|
+
|
|
37
|
+
The LLM is used when:
|
|
38
|
+
|
|
39
|
+
- `semgrep` found something
|
|
40
|
+
- there are repository-specific fallback signals
|
|
41
|
+
- `semgrep` is unavailable
|
|
42
|
+
|
|
43
|
+
This keeps analysis more targeted than sending every file to the model.
|
|
44
|
+
|
|
45
|
+
## 5. Report findings
|
|
46
|
+
|
|
47
|
+
Each finding includes:
|
|
48
|
+
|
|
49
|
+
- issue summary
|
|
50
|
+
- severity
|
|
51
|
+
- line number
|
|
52
|
+
- context gap
|
|
53
|
+
- suggested fix
|
|
54
|
+
|
|
55
|
+
Output is available in rich terminal format or JSON.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# AION
|
|
2
|
+
|
|
3
|
+
**Code Once, Live Forever.**
|
|
4
|
+
|
|
5
|
+
AION is The Self-Evolving Code Engine — designed to end technical debt and keep your codebase in a perpetual state of health.
|
|
6
|
+
|
|
7
|
+
Instead of treating every file in isolation, it builds a lightweight profile of the
|
|
8
|
+
existing repository, uses `semgrep` as a fast first pass, and only asks the LLM to
|
|
9
|
+
investigate files that have concrete risk signals or meaningful context gaps.
|
|
10
|
+
|
|
11
|
+
## Why this exists
|
|
12
|
+
|
|
13
|
+
AI-generated code often looks locally reasonable while drifting away from project
|
|
14
|
+
conventions in ways that increase security risk:
|
|
15
|
+
|
|
16
|
+
- Raw `sqlite3` usage in a codebase that otherwise standardizes on ORM sessions
|
|
17
|
+
- Missing auth decorators in handlers that should follow an established access pattern
|
|
18
|
+
- Hardcoded secrets where the rest of the repository loads credentials from the environment
|
|
19
|
+
|
|
20
|
+
AION is designed to catch that mismatch between a generated file and the
|
|
21
|
+
rest of the repository.
|
|
22
|
+
|
|
23
|
+
## Core capabilities
|
|
24
|
+
|
|
25
|
+
- Scans Python files and repositories from the command line
|
|
26
|
+
- Detects AI-generated files via markers, Git history, or explicit targeting
|
|
27
|
+
- Extracts repository context using static analysis
|
|
28
|
+
- Runs `semgrep --config p/python` as a fast rule-based pass
|
|
29
|
+
- Uses an LLM to explain security findings in repository context
|
|
30
|
+
- Reports context gaps, fixes, and JSON output for automation
|
|
31
|
+
|
|
32
|
+
## Read next
|
|
33
|
+
|
|
34
|
+
- [Installation](installation.md)
|
|
35
|
+
- [Usage](usage.md)
|
|
36
|
+
- [Configuration](configuration.md)
|
|
37
|
+
- [How It Works](how-it-works.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
|
|
5
|
+
- Python 3.11 or newer
|
|
6
|
+
- `uv` for environment management
|
|
7
|
+
- Optional: `semgrep` for the rule-based first pass
|
|
8
|
+
|
|
9
|
+
## Local setup
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
git clone https://github.com/shenxianpeng/aion.git
|
|
13
|
+
cd aion
|
|
14
|
+
uv sync --dev
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## API keys
|
|
18
|
+
|
|
19
|
+
Choose at least one provider:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
export ANTHROPIC_API_KEY=your_key
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
or
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
export OPENAI_API_KEY=your_key
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Verify the CLI
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv run aion --help
|
|
35
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Usage
|
|
2
|
+
|
|
3
|
+
## Scan a repository
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
uv run aion scan ./path/to/project
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Scan known AI-generated files only
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
uv run aion scan ./path/to/project \
|
|
13
|
+
--ai-generated ./path/to/project/generated_file.py
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Use OpenAI instead of Anthropic
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
uv run aion scan ./path/to/project --provider openai
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Emit JSON
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv run aion scan ./path/to/project --output json
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Verbose mode
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv run aion scan ./path/to/project --verbose
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Verbose mode prints the extracted context profile, Semgrep findings, fallback reasons,
|
|
35
|
+
and token estimates to stderr.
|
|
36
|
+
|
|
37
|
+
## Typical workflow
|
|
38
|
+
|
|
39
|
+
1. Point the tool at a repository or a generated file.
|
|
40
|
+
2. Let it identify candidate Python files.
|
|
41
|
+
3. Review warnings about AI-generated detection or missing `semgrep`.
|
|
42
|
+
4. Inspect context-aware findings and suggested fixes.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
hide:
|
|
3
|
+
- navigation
|
|
4
|
+
- toc
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<div class="aca-hero">
|
|
8
|
+
<div class="aca-hero__eyebrow">self-evolving · end technical debt · code once, live forever</div>
|
|
9
|
+
<div class="aca-hero__headline">
|
|
10
|
+
AION
|
|
11
|
+
<span class="aca-accent">The Self-Evolving Code Engine.</span>
|
|
12
|
+
</div>
|
|
13
|
+
<p class="aca-hero__sub">
|
|
14
|
+
AI scans your code continuously, automatically rewrites outdated syntax and risky logic,
|
|
15
|
+
and delivers an evolved codebase every day — keeping your repository perpetually healthy.
|
|
16
|
+
</p>
|
|
17
|
+
<div class="aca-hero__facts">
|
|
18
|
+
<span class="aca-hero__fact">Python-first</span>
|
|
19
|
+
<span class="aca-hero__fact">Semgrep + LLM</span>
|
|
20
|
+
<span class="aca-hero__fact">Context-gap reporting</span>
|
|
21
|
+
<span class="aca-hero__fact">CLI and JSON output</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="aca-cta-group">
|
|
24
|
+
<a class="aca-btn aca-btn-primary" href="en/">Read in English</a>
|
|
25
|
+
<a class="aca-btn aca-btn-secondary" href="zh/">阅读中文文档</a>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
## Choose a language
|
|
30
|
+
|
|
31
|
+
- [English documentation](en/index.md)
|
|
32
|
+
- [中文文档](zh/index.md)
|