Skip to content

Commit a235d9b

Browse files
refactor(docs): code analysis engine
changes: - file: cli_commands.py area: cli modified: [handle_report_command] - file: cli_parser.py area: analyzer modified: [create_parser] - file: project_yaml_exporter.py area: core modified: [ProjectYAMLExporter] - file: readme_exporter.py area: docs modified: [_get_existing_files, _generate_readme_content, READMEExporter] stats: lines: "+470/-357 (net +113)" files: 9 complexity: "Stable complexity"
1 parent 1dc6f9d commit a235d9b

21 files changed

Lines changed: 495 additions & 361 deletions

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
## [Unreleased]
22

3+
## [0.5.83] - 2026-03-26
4+
5+
### Docs
6+
- Update README.md
7+
- Update context.md
8+
- Update project/README.md
9+
- Update project/context.md
10+
11+
### Other
12+
- Update analysis.toon.yaml
13+
- Update batch_1/analysis.toon.yaml
14+
- Update code2llm/cli_commands.py
15+
- Update code2llm/cli_parser.py
16+
- Update code2llm/exporters/project_yaml_exporter.py
17+
- Update code2llm/exporters/readme_exporter.py
18+
- Update code2llm/exporters/report_generators.py
19+
- Update project/analysis.toon.yaml
20+
- Update project/batch_1/analysis.toon.yaml
21+
- Update project/root/analysis.toon.yaml
22+
- ... and 1 more files
23+
324
## [0.5.82] - 2026-03-26
425

526
### Other

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ cat map.toon.yaml | head -50
127127
grep "SIGNATURES" map.toon.yaml
128128
```
129129

130-
### `analysis_view.toon` - Compact Analysis View
130+
### `project.toon.yaml` - Compact Analysis View
131131
**Purpose**: Compact module view generated from project.yaml data
132132
**Status**: Legacy view generated on demand from unified project.yaml
133133

134134
**Example usage**:
135135
```bash
136136
# View compact project structure
137-
cat analysis_view.toon | head -30
137+
cat project.toon.yaml | head -30
138138

139139
# Find largest files
140-
grep -E "^ .*[0-9]{3,}$" analysis_view.toon | sort -t',' -k2 -n -r | head -10
140+
grep -E "^ .*[0-9]{3,}$" project.toon.yaml | sort -t',' -k2 -n -r | head -10
141141
```
142142

143143
### `prompt.txt` - Ready-to-Send LLM Prompt

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.82
1+
0.5.83

analysis.toon.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# code2llm | 113f 21241L | python:108,shell:4,php:1 | 2026-03-26
2-
# CC̄=4.6 | critical:10/923 | dups:0 | cycles:0
1+
# code2llm | 113f 21404L | python:108,shell:4,php:1 | 2026-03-26
2+
# CC̄=4.6 | critical:10/931 | dups:0 | cycles:0
33

44
HEALTH[10]:
5-
🟡 CC _extract_declarations CC=65 (limit:15)
5+
🟡 CC _process_functions CC=34 (limit:15)
66
🟡 CC export_to_yaml CC=25 (limit:15)
77
🟡 CC export_flow_detailed CC=25 (limit:15)
88
🟡 CC export_flow_compact CC=23 (limit:15)
@@ -19,13 +19,13 @@ REFACTOR[1]:
1919
PIPELINES[637]:
2020
[1] Src [read_readme]: read_readme
2121
PURITY: 100% pure
22-
[2] Src [run_benchmark]: run_benchmark → load_previous
22+
[2] Src [save_report]: save_report
2323
PURITY: 100% pure
24-
[3] Src [main]: mainload_file → is_toon_file
24+
[3] Src [run_benchmark]: run_benchmarkload_previous
2525
PURITY: 100% pure
26-
[4] Src [save_report]: save_report
26+
[4] Src [main]: main → load_file → is_toon_file
2727
PURITY: 100% pure
28-
[5] Src [__init__]: __init__
28+
[5] Src [main]: main → create_html → get_shield_url
2929
PURITY: 100% pure
3030

3131
LAYERS:
@@ -46,13 +46,13 @@ LAYERS:
4646
│ file_analyzer 398L 1C 17m CC=12 ←0
4747
│ flow_exporter 391L 1C 14m CC=10 ←0
4848
│ pipeline 388L 3C 20m CC=10 ←0
49+
│ prompt 383L 0C 16m CC=13 ←1
50+
│ !! base 370L 0C 9m CC=34 ←8
4951
│ analyzer 333L 1C 9m CC=14 ←0
5052
│ entity_resolution 326L 3C 16m CC=13 ←0
5153
│ side_effects 324L 2C 17m CC=14 ←0
5254
│ cli_analysis 323L 0C 11m CC=14 ←1
5355
│ type_inference 321L 1C 19m CC=9 ←0
54-
│ !! base 312L 0C 4m CC=65 ←8
55-
│ prompt 299L 0C 13m CC=12 ←1
5656
│ intent_matching 297L 3C 15m CC=7 ←0
5757
│ cfg 293L 1C 17m CC=5 ←0
5858
│ data_analysis 286L 1C 18m CC=14 ←0
@@ -80,13 +80,13 @@ LAYERS:
8080
│ toon_view 157L 1C 9m CC=6 ←0
8181
│ prompt_engine 150L 1C 7m CC=12 ←0
8282
│ toon_parser 147L 0C 10m CC=8 ←1
83+
│ orchestrator 142L 0C 5m CC=11 ←1
8384
│ context_view 140L 1C 8m CC=11 ←0
8485
│ gitignore 139L 1C 6m CC=10 ←2
8586
│ !! ruby 135L 0C 2m CC=17 ←1
8687
│ prioritizer 131L 2C 4m CC=9 ←0
8788
│ code2logic 127L 0C 8m CC=6 ←1
8889
│ normalization 122L 2C 13m CC=6 ←0
89-
│ orchestrator 121L 0C 5m CC=11 ←1
9090
│ helpers 120L 0C 8m CC=8 ←3
9191
│ validate_project 118L 0C 3m CC=11 ←1
9292
│ yaml_exporter 108L 1C 7m CC=8 ←0
@@ -152,7 +152,7 @@ LAYERS:
152152
│ sample.go 46L 0C 4m CC=3 ←0
153153
│ sample.php 44L 2C 4m CC=2 ←2
154154
│ sample 40L 1C 4m CC=3 ←0
155-
│ sample.ts 26L 0C 1m CC=1 ←0
155+
│ sample.ts 26L 1C 1m CC=1 ←0
156156
157157
── zero ──
158158
code2llm/patterns/__init__.py 0L

batch_1/analysis.toon.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# code2llm | 113f 21241L | python:105,shell:2,php:1 | 2026-03-26
2-
# CC̄=4.6 | critical:10/923 | dups:0 | cycles:0
1+
# code2llm | 113f 21404L | python:105,shell:2,php:1 | 2026-03-26
2+
# CC̄=4.6 | critical:10/931 | dups:0 | cycles:0
33

44
HEALTH[10]:
55
🟡 CC main CC=17 (limit:15)
@@ -10,20 +10,20 @@ HEALTH[10]:
1010
🟡 CC export_flow_full CC=23 (limit:15)
1111
🟡 CC _export_mermaid CC=16 (limit:15)
1212
🟡 CC extract_calls_regex CC=16 (limit:15)
13-
🟡 CC _extract_declarations CC=65 (limit:15)
13+
🟡 CC _process_functions CC=34 (limit:15)
1414
🟡 CC analyze_ruby CC=17 (limit:15)
1515

1616
REFACTOR[1]:
1717
1. split 10 high-CC methods (CC>15)
1818

1919
PIPELINES[637]:
20-
[1] Src [read_readme]: read_readme
20+
[1] Src [run_benchmark]: run_benchmark → load_previous
2121
PURITY: 100% pure
22-
[2] Src [run_benchmark]: run_benchmarkload_previous
22+
[2] Src [main]: mainload_file → is_toon_file
2323
PURITY: 100% pure
2424
[3] Src [save_report]: save_report
2525
PURITY: 100% pure
26-
[4] Src [main]: main → load_file → is_toon_file
26+
[4] Src [read_readme]: read_readme
2727
PURITY: 100% pure
2828
[5] Src [__init__]: __init__
2929
PURITY: 100% pure
@@ -46,13 +46,13 @@ LAYERS:
4646
│ file_analyzer 398L 1C 17m CC=12 ←0
4747
│ flow_exporter 391L 1C 14m CC=10 ←0
4848
│ pipeline 388L 3C 20m CC=10 ←0
49+
│ prompt 383L 0C 16m CC=13 ←1
50+
│ !! base 370L 0C 9m CC=34 ←8
4951
│ analyzer 333L 1C 9m CC=14 ←0
5052
│ entity_resolution 326L 3C 16m CC=13 ←0
5153
│ side_effects 324L 2C 17m CC=14 ←0
5254
│ cli_analysis 323L 0C 11m CC=14 ←1
5355
│ type_inference 321L 1C 19m CC=9 ←0
54-
│ !! base 312L 0C 4m CC=65 ←8
55-
│ prompt 299L 0C 13m CC=12 ←1
5656
│ intent_matching 297L 3C 15m CC=7 ←0
5757
│ cfg 293L 1C 17m CC=5 ←0
5858
│ data_analysis 286L 1C 18m CC=14 ←0
@@ -80,13 +80,13 @@ LAYERS:
8080
│ toon_view 157L 1C 9m CC=6 ←0
8181
│ prompt_engine 150L 1C 7m CC=12 ←0
8282
│ toon_parser 147L 0C 10m CC=8 ←1
83+
│ orchestrator 142L 0C 5m CC=11 ←1
8384
│ context_view 140L 1C 8m CC=11 ←0
8485
│ gitignore 139L 1C 6m CC=10 ←2
8586
│ !! ruby 135L 0C 2m CC=17 ←1
8687
│ prioritizer 131L 2C 4m CC=9 ←0
8788
│ code2logic 127L 0C 8m CC=6 ←1
8889
│ normalization 122L 2C 13m CC=6 ←0
89-
│ orchestrator 121L 0C 5m CC=11 ←1
9090
│ helpers 120L 0C 8m CC=8 ←3
9191
│ validate_project 118L 0C 3m CC=11 ←1
9292
│ yaml_exporter 108L 1C 7m CC=8 ←0
@@ -152,7 +152,7 @@ LAYERS:
152152
│ sample.go 46L 0C 4m CC=3 ←0
153153
│ sample.php 44L 2C 4m CC=2 ←2
154154
│ sample 40L 1C 4m CC=3 ←0
155-
│ sample.ts 26L 0C 1m CC=1 ←0
155+
│ sample.ts 26L 1C 1m CC=1 ←0
156156
157157
── zero ──
158158
code2llm/patterns/__init__.py 0L

code2llm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
and entity resolution with multilingual support.
99
"""
1010

11-
__version__ = "0.5.82"
11+
__version__ = "0.5.83"
1212
__author__ = "STTS Project"
1313

1414
# Core analysis components (lightweight, always needed)

code2llm/cli_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def handle_report_command(args_list) -> int:
2424
"""Generate views from an existing project.yaml (legacy).
2525
2626
Usage:
27-
code2llm report --format toon # → analysis_view.toon (legacy)
27+
code2llm report --format toon # → project.toon.yaml (legacy)
2828
code2llm report --format context # → context.md
2929
code2llm report --format article # → status.md
3030
code2llm report --format html # → dashboard.html

code2llm/cli_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def create_parser() -> argparse.ArgumentParser:
2727
code2llm ./ -m static -v -o ./analysis # Static mode, verbose
2828
code2llm ./ --no-readme # Disable README generation
2929
code2llm ./ -f project-yaml # Legacy project.yaml export (opt-in)
30-
code2llm report --format toon # Generate analysis_view.toon from existing project.yaml
30+
code2llm report --format toon # Generate project.toon.yaml from existing project.yaml
3131
code2llm report --format all # All legacy views from existing project.yaml
3232
code2llm llm-flow # Generate LLM flow summary
3333
code2llm llm-context ./ # Generate LLM context only

code2llm/exporters/project_yaml_exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
class ProjectYAMLExporter(Exporter):
3636
"""Export unified project.yaml — single source of truth for diagnostics.
3737
38-
Combines data from analysis.toon, analysis_view.toon, context.md, and evolution.toon.yaml
38+
Combines data from analysis.toon, project.toon.yaml, context.md, and evolution.toon.yaml
3939
into one machine-parseable YAML file.
4040
"""
4141

code2llm/exporters/readme_exporter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,17 @@ def _generate_readme_content(self, project_path: str, output_dir: Path,
218218
grep "SIGNATURES" map.toon.yaml
219219
```
220220
221-
### `analysis_view.toon` - Compact Analysis View
221+
### `project.toon.yaml` - Compact Analysis View
222222
**Purpose**: Compact module view generated from project.yaml data
223223
**Status**: Legacy view generated on demand from unified project.yaml
224224
225225
**Example usage**:
226226
```bash
227227
# View compact project structure
228-
cat analysis_view.toon | head -30
228+
cat project.toon.yaml | head -30
229229
230230
# Find largest files
231-
grep -E "^ .*[0-9]{{3,}}$" analysis_view.toon | sort -t',' -k2 -n -r | head -10
231+
grep -E "^ .*[0-9]{{3,}}$" project.toon.yaml | sort -t',' -k2 -n -r | head -10
232232
```
233233
234234
### `prompt.txt` - Ready-to-Send LLM Prompt
@@ -427,7 +427,7 @@ def _get_existing_files(self, output_dir: Path) -> Dict[str, bool]:
427427
'evolution.toon.yaml': 'Refactoring queue',
428428
'flow.toon': 'Data flow analysis',
429429
'map.toon.yaml': 'Structural map',
430-
'analysis_view.toon': 'Project logic',
430+
'project.toon.yaml': 'Project logic',
431431
'prompt.txt': 'LLM prompt',
432432
'context.md': 'LLM narrative',
433433
'analysis.yaml': 'YAML data',

0 commit comments

Comments
 (0)