Skip to content

Commit 272d0c8

Browse files
refactor(docs): code analysis engine
changes: - file: settings_builders.py area: cli modified: [build_batch_settings] stats: lines: "+620/-1179 (net -559)" files: 9 complexity: "Stable complexity"
1 parent 36979df commit 272d0c8

File tree

13 files changed

+637
-1182
lines changed

13 files changed

+637
-1182
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
124124
- **Tree-sitter for all** — syntax validation for 165+ languages
125125
- **Example 07** — comprehensive multi-language demo with 8 languages
126126

127+
## [0.1.49] - 2026-03-23
128+
129+
### Docs
130+
- Update project/context.md
131+
132+
### Other
133+
- Update project/analysis.toon
134+
- Update project/analysis.yaml
135+
- Update project/dashboard.html
136+
- Update project/flow.toon
137+
- Update project/map.toon
138+
- Update project/project.toon
139+
- Update project/project.yaml
140+
127141
## [0.1.48] - 2026-03-23
128142

129143
### Other

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.48
1+
0.1.49

project/analysis.toon

Lines changed: 479 additions & 479 deletions
Large diffs are not rendered by default.

project/analysis.yaml

Whitespace-only changes.

project/context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- **Project**: vallm
66
- **Language**: python
77
- **Files**: 30
8-
- **Lines**: 7527
8+
- **Lines**: 7523
99
- **Functions**: 175
1010
- **Classes**: 31
1111
- **Avg CC**: 3.5

project/dashboard.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h1>
6767
<div class="card"><div class="value">175</div><div class="label">Functions</div></div>
6868
<div class="card"><div class="value">31</div><div class="label">Classes</div></div>
6969
<div class="card"><div class="value">30</div><div class="label">Files</div></div>
70-
<div class="card"><div class="value">7,527</div><div class="label">Lines</div></div>
70+
<div class="card"><div class="value">7,523</div><div class="label">Lines</div></div>
7171
<div class="card"><div class="value">2</div><div class="label">Languages</div></div>
7272
<div class="card"><div class="value">3.5</div><div class="label">Avg CC</div></div>
7373
<div class="card"><div class="value">8</div><div class="label">Critical (CC≥10)</div></div>
@@ -96,7 +96,7 @@ <h2 style="border:none;margin:0 0 .5rem;">Evolution (2026-03-23)</h2>
9696
<div class="evo-cards">
9797
<div class="card"><div class="value">3.5</div><div class="label">CC̄ ↓</div></div>
9898
<div class="card"><div class="value">8</div><div class="label">Critical →</div></div>
99-
<div class="card"><div class="value">7527</div><div class="label">Lines</div></div>
99+
<div class="card"><div class="value">7523</div><div class="label">Lines</div></div>
100100
</div>
101101
<p class="trend" style="margin-top:.5rem;">Run analysis multiple times to build a trend chart (≥3 data points needed).</p>
102102
</div>
@@ -482,7 +482,7 @@ <h2>Refactoring Priorities (3)</h2>
482482
</div>
483483
</div>
484484

485-
<footer>Generated by code2llm on 2026-03-23 21:04</footer>
485+
<footer>Generated by code2llm on 2026-03-23 21:11</footer>
486486

487487
<script>
488488
// Evolution chart disabled — fewer than 3 data points

project/flow.toon

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ PIPELINES[12] (Analysis:2, Core:3, Export:2, IO:1, NLP:1, Unknown:3):
88
→ from_path(cls, path:str | Path) → Optional[Language] CC=1 pure ■
99
PURITY: 2/4 pure BOTTLENECK: _check_lizard(CC=12)
1010

11-
Src [Unknown]: Proposal → Optional[int]
12-
→ validate(proposal:Proposal, context:dict) → ValidationResult CC=3 cache ▶
13-
→ _parse_response(response_text:str) → ValidationResult CC=4 IO
14-
→ _parse_issues(data:dict) → list CC=3 mutation
15-
→ _parse_line_number(line) → Optional[int] CC=4 pure ■
16-
PURITY: 1/4 pure BOTTLENECK: _parse_response(CC=4)
17-
1811
Src [Core]: Proposal → ?
1912
→ validate(proposal:Proposal, context:dict) → ValidationResult CC=2 pure ▶
2013
→ _validate_treesitter(code:str, language:str) → tuple[float, list[Issue]] CC=3 mutation
2114
→ tree_sitter_error_count(code:str, language:str) → int CC=1 mutation
2215
→ parse_code(code:str, language:str) CC=1 pure ■
2316
PURITY: 2/4 pure BOTTLENECK: _validate_treesitter(CC=3)
2417

18+
Src [Unknown]: Proposal → Optional[int]
19+
→ validate(proposal:Proposal, context:dict) → ValidationResult CC=3 cache ▶
20+
→ _parse_response(response_text:str) → ValidationResult CC=4 IO
21+
→ _parse_issues(data:dict) → list CC=3 mutation
22+
→ _parse_line_number(line) → Optional[int] CC=4 pure ■
23+
PURITY: 1/4 pure BOTTLENECK: _parse_response(CC=4)
24+
2525
Src [Core]: Path | str → str
2626
→ matches(path:Path | str) → bool CC=4 pure ▶
2727
→ _match_pattern(rel_path:str, name:str, pattern:str) → bool CC=8 pure
@@ -43,20 +43,20 @@ PIPELINES[12] (Analysis:2, Core:3, Export:2, IO:1, NLP:1, Unknown:3):
4343
→ output_rich(result:ValidationResult, verbose:bool) → None CC=6 IO ■
4444
PURITY: 2/4 pure BOTTLENECK: _process_files(CC=26)
4545

46-
Examples [Unknown]: ? → ?
47-
→ main() CC=4 IO ▶
48-
→ run_autonomous_workflow(code_path:Path, max_iterations:int) CC=9 IO
49-
→ run_runtime_tests(code_path:Path, test_file:Optional[Path]) → Dict CC=8 IO
50-
→ create_basic_tests(code_path:Path, test_file:Path) CC=7 IO ■
51-
PURITY: 0/4 pure BOTTLENECK: run_autonomous_workflow(CC=9)
52-
5346
Src [Core]: ? → ?
5447
→ main() CC=9 IO ▶
5548
→ diff_python_code(before_code:str, after_code:str) → GraphDiffResult CC=1 pure
5649
→ diff_graphs(before:CodeGraph, after:CodeGraph) → GraphDiffResult CC=5 pure
5750
→ _diff_list(before, after, added:bool) CC=9 pure ■
5851
PURITY: 3/4 pure BOTTLENECK: main(CC=9)
5952

53+
Examples [Unknown]: ? → ?
54+
→ main() CC=4 IO ▶
55+
→ run_autonomous_workflow(code_path:Path, max_iterations:int) CC=9 IO
56+
→ run_runtime_tests(code_path:Path, test_file:Optional[Path]) → Dict CC=8 IO
57+
→ create_basic_tests(code_path:Path, test_file:Path) CC=7 IO ■
58+
PURITY: 0/4 pure BOTTLENECK: run_autonomous_workflow(CC=9)
59+
6060
Examples [Unknown]: ? → ?
6161
→ main() CC=5 IO ▶
6262
→ run_simple_workflow(code_path:Path, max_iterations:int) CC=9 IO
@@ -125,27 +125,6 @@ CONTRACTS:
125125
IN: cls, path:str | Path
126126
OUT: Optional[Language]
127127

128-
Pipeline: Src
129-
validate(proposal:Proposal, context:dict) → ValidationResult
130-
IN: proposal:Proposal, context:dict
131-
OUT: ValidationResult
132-
SIDE-EFFECT: cache(self.cache.get, self.cache.set)
133-
INVARIANT: raises on invalid input
134-
135-
_parse_response(response_text:str) → ValidationResult
136-
IN: response_text:str
137-
OUT: ValidationResult
138-
SIDE-EFFECT: IO(loads)
139-
140-
_parse_issues(data:dict) → list
141-
IN: data:dict
142-
OUT: list
143-
SIDE-EFFECT: pure
144-
145-
_parse_line_number(line) → Optional[int]
146-
IN: line
147-
OUT: Optional[int]
148-
149128
Pipeline: Src
150129
validate(proposal:Proposal, context:dict) → ValidationResult
151130
IN: proposal:Proposal, context:dict
@@ -167,6 +146,27 @@ CONTRACTS:
167146
IN: code:str, language:str
168147
OUT: None
169148

149+
Pipeline: Src
150+
validate(proposal:Proposal, context:dict) → ValidationResult
151+
IN: proposal:Proposal, context:dict
152+
OUT: ValidationResult
153+
SIDE-EFFECT: cache(self.cache.get, self.cache.set)
154+
INVARIANT: raises on invalid input
155+
156+
_parse_response(response_text:str) → ValidationResult
157+
IN: response_text:str
158+
OUT: ValidationResult
159+
SIDE-EFFECT: IO(loads)
160+
161+
_parse_issues(data:dict) → list
162+
IN: data:dict
163+
OUT: list
164+
SIDE-EFFECT: pure
165+
166+
_parse_line_number(line) → Optional[int]
167+
IN: line
168+
OUT: Optional[int]
169+
170170
Pipeline: Src
171171
matches(path:Path | str) → bool
172172
IN: path:Path | str
@@ -225,6 +225,24 @@ CONTRACTS:
225225
OUT: None
226226
SIDE-EFFECT: IO(print, print, print)
227227

228+
Pipeline: Src
229+
main()
230+
IN: ()
231+
OUT: None
232+
SIDE-EFFECT: IO(print, print, print)
233+
234+
diff_python_code(before_code:str, after_code:str) → GraphDiffResult
235+
IN: before_code:str, after_code:str
236+
OUT: GraphDiffResult
237+
238+
diff_graphs(before:CodeGraph, after:CodeGraph) → GraphDiffResult
239+
IN: before:CodeGraph, after:CodeGraph
240+
OUT: GraphDiffResult
241+
242+
_diff_list(before, after, added:bool)
243+
IN: before, after, added:bool
244+
OUT: None
245+
228246
Pipeline: Examples
229247
main()
230248
IN: ()
@@ -246,24 +264,6 @@ CONTRACTS:
246264
OUT: None
247265
SIDE-EFFECT: IO(read_text, write_text, print)
248266

249-
Pipeline: Src
250-
main()
251-
IN: ()
252-
OUT: None
253-
SIDE-EFFECT: IO(print, print, print)
254-
255-
diff_python_code(before_code:str, after_code:str) → GraphDiffResult
256-
IN: before_code:str, after_code:str
257-
OUT: GraphDiffResult
258-
259-
diff_graphs(before:CodeGraph, after:CodeGraph) → GraphDiffResult
260-
IN: before:CodeGraph, after:CodeGraph
261-
OUT: GraphDiffResult
262-
263-
_diff_list(before, after, added:bool)
264-
IN: before, after, added:bool
265-
OUT: None
266-
267267
Pipeline: Examples
268268
main()
269269
IN: ()
@@ -355,17 +355,17 @@ DATA_TYPES (by cross-function usage) [242 annotated, 0 inferred / 316 functions]
355355
ValidationResult consumed:5 produced:18
356356
Proposal consumed:16 produced:1 !! HUB-TYPE → split interface
357357
str, Any consumed:6 produced:10
358-
Dict consumed:7 produced:6
359358
VallmSettings consumed:11 produced:2 !! HUB-TYPE → split interface
359+
Dict consumed:7 produced:6
360360
list[Path] consumed:6 produced:2
361361
float consumed:4 produced:4
362362
Issue consumed:1 produced:4
363363
Language consumed:0 produced:4 narrow scope
364+
str | Path consumed:3 produced:0 narrow scope
365+
list[Issue] consumed:0 produced:3 narrow scope
364366
ExecutionResult consumed:0 produced:3 narrow scope
365367
GitignoreParser consumed:1 produced:2 narrow scope
366-
str | Path consumed:3 produced:0 narrow scope
367368
list[str] consumed:2 produced:1 narrow scope
368-
list[Issue] consumed:0 produced:3 narrow scope
369369

370370
HUB TYPES (consumed ≥10):
371371
str → 186 consumers → split into:
@@ -386,21 +386,21 @@ DATA_TYPES (by cross-function usage) [242 annotated, 0 inferred / 316 functions]
386386
- (analyze consumers to suggest sub-interfaces)
387387

388388
SIDE_EFFECTS:
389-
IO: main, LogicalErrorValidator._check_pyflakes, SecurityValidator._try_bandit, SemanticCache.__init__, SemanticCache.get, SemanticCache.set, SemanticCache.clear, SemanticValidator._call_http, SemanticValidator._parse_response, LintValidator._check_ruff
389+
IO: main, LogicalErrorValidator._check_pyflakes, SemanticCache.__init__, SemanticCache.get, SemanticCache.set, SemanticCache.clear, SecurityValidator._try_bandit, SemanticValidator._call_http, SemanticValidator._parse_response, LintValidator._check_ruff
390390
Cache: SemanticCache.get_cache_stats, get_semantic_cache, clear_semantic_cache, SemanticValidator.__init__, SemanticValidator.validate
391-
Mutation: _initialize_validators, _run_validation_pipeline, _get_default_validators, ComplexityValidator.__init__, ComplexityValidator.validate, ComplexityValidator._check_python_complexity, ComplexityValidator._check_lizard, LogicalErrorValidator.__init__, SecurityValidator.validate, SecurityValidator._check_patterns
391+
Mutation: _initialize_validators, _run_validation_pipeline, _get_default_validators, LogicalErrorValidator.__init__, ComplexityValidator.__init__, ComplexityValidator.validate, ComplexityValidator._check_python_complexity, ComplexityValidator._check_lizard, SecurityValidator.validate, SecurityValidator._check_patterns
392392
Pure: bump_version, VallmSpec.validate_proposal, VallmSpec.get_validator_name, VallmSpec.get_validator_tier, Issue.__str__, compute_verdict, validate, _initialize_settings, _initialize_context, BaseValidator.validate
393393

394394
PIPELINE PURITY:
395395
Src ██░░ 50% pure
396-
Src █░░░ 25% pure
397396
Src ██░░ 50% pure
397+
Src █░░░ 25% pure
398398
Src ███░ 75% pure
399399
Src ███░ 75% pure
400400
Src ██░░ 50% pure
401-
Examples ░░░░ 0% pure
402401
Src ███░ 75% pure
403402
Examples ░░░░ 0% pure
403+
Examples ░░░░ 0% pure
404404
Examples ██░░ 50% pure
405405
Examples ░░░░ 0% pure
406406
Examples ██░░ 50% pure

project/map.toon

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,6 @@ D:
230230
examples/12_ollama_simple_demo/utils/process_user_input.py:
231231
e: process_user_input
232232
process_user_input(user_input)
233-
examples/08_code2llm_integration/main.py:
234-
e: create_sample_project,analyze_with_code2llm,validate_with_vallm,generate_report,main
235-
create_sample_project(base_path)
236-
analyze_with_code2llm(project_path)
237-
validate_with_vallm(project_path)
238-
generate_report(code2llm_result;vallm_result;output_path)
239-
main()
240233
examples/12_ollama_simple_demo/legacy_code/simple_buggy.py:
241234
e: BadClass,process_user_input,load_config,save_data,calculate_total,duplicate_function,duplicate_function,unused_function,main
242235
BadClass: __init__(0),process_data(1),another_method(0) # Class with multiple issues...
@@ -248,6 +241,13 @@ D:
248241
duplicate_function()
249242
unused_function()
250243
main()
244+
examples/08_code2llm_integration/main.py:
245+
e: create_sample_project,analyze_with_code2llm,validate_with_vallm,generate_report,main
246+
create_sample_project(base_path)
247+
analyze_with_code2llm(project_path)
248+
validate_with_vallm(project_path)
249+
generate_report(code2llm_result;vallm_result;output_path)
250+
main()
251251
src/vallm/validators/imports/python_imports.py:
252252
e: PythonImportValidator
253253
PythonImportValidator(BaseImportValidator): validate(2),extract_imports(1),module_exists(1),get_language(0),_get_error_message(1),_get_rule_name(0) # Python-specific import validator...
@@ -315,12 +315,12 @@ D:
315315
examples/03_security_check/main.py:
316316
e: main
317317
main()
318-
src/vallm/validators/semantic.py:
319-
e: SemanticValidator
320-
SemanticValidator(BaseValidator): __init__(1),validate(2),_build_prompt(1),_call_llm(1),_call_ollama(1),_call_litellm(1),_call_http(1),_parse_response(1),_extract_json_from_response(1),_create_parse_error_result(1),_create_json_error_result(1),_parse_scores(1),_parse_issues(1),_parse_severity(1),_parse_line_number(1) # Tier 3: LLM-as-judge semantic code review...
321318
src/vallm/validators/syntax.py:
322319
e: SyntaxValidator
323320
SyntaxValidator(BaseValidator): validate(2),_validate_python(1),_validate_treesitter(2) # Tier 1: Fast syntax validation...
321+
src/vallm/validators/semantic.py:
322+
e: SemanticValidator
323+
SemanticValidator(BaseValidator): __init__(1),validate(2),_build_prompt(1),_call_llm(1),_call_ollama(1),_call_litellm(1),_call_http(1),_parse_response(1),_extract_json_from_response(1),_create_parse_error_result(1),_create_json_error_result(1),_parse_scores(1),_parse_issues(1),_parse_severity(1),_parse_line_number(1) # Tier 3: LLM-as-judge semantic code review...
324324
src/vallm/core/ast_compare.py:
325325
e: parse_code,parse_python_ast,normalize_python_ast,python_ast_similarity,tree_sitter_node_count,tree_sitter_error_count,structural_diff_summary
326326
parse_code(code;language)
@@ -337,15 +337,15 @@ D:
337337
examples/06_multilang_validation/main.py:
338338
e: main
339339
main()
340+
src/vallm/config.py:
341+
e: VallmSettings
342+
VallmSettings(BaseSettings): from_toml(1) # vallm configuration with layered sources: defaults → TOML → ...
340343
src/vallm/validators/imports/base.py:
341344
e: BaseImportValidator
342345
BaseImportValidator(ABC): validate(2),extract_imports(1),module_exists(1),get_language(0),_get_error_message(1),_get_rule_name(0),create_validation_result(4) # Base class for all import validators...
343346
src/vallm/validators/imports/rust_imports.py:
344347
e: RustImportValidator
345348
RustImportValidator(BaseImportValidator): get_language(0),_get_error_message(1),_get_rule_name(0),extract_imports(1),module_exists(1) # Rust import validator...
346-
src/vallm/config.py:
347-
e: VallmSettings
348-
VallmSettings(BaseSettings): from_toml(1) # vallm configuration with layered sources: defaults → TOML → ...
349349
examples/utils/extract_code_from_response.py:
350350
e: extract_code_from_response
351351
extract_code_from_response(response)
@@ -398,12 +398,12 @@ D:
398398
examples/12_ollama_simple_demo/utils/load_config.py:
399399
e: load_config
400400
load_config()
401-
examples/12_ollama_simple_demo/utils/main.py:
402-
e: run_demo_main
403-
run_demo_main()
404401
examples/12_ollama_simple_demo/utils/save_data.py:
405402
e: save_data
406403
save_data(data;filename)
404+
examples/12_ollama_simple_demo/utils/main.py:
405+
e: run_demo_main
406+
run_demo_main()
407407
examples/__init__.py:
408408
src/vallm/cli/__init__.py:
409409
src/vallm/__init__.py:
@@ -424,15 +424,16 @@ Attributes:
424424
e: run_example
425425
run_example()
426426
examples/11_claude_code_autonomous/docker-entrypoint.sh:
427-
examples/12_ollama_simple_demo/run.sh:
428-
examples/12_ollama_simple_demo/docker-entrypoint.sh:
429427
examples/11_claude_code_autonomous/run.sh:
430428
e: print_section,print_step,print_success,print_warning,print_error
431429
print_section()
432430
print_step()
433431
print_success()
434432
print_warning()
435433
print_error()
434+
examples/12_ollama_simple_demo/docker-entrypoint.sh:
435+
examples/12_ollama_simple_demo/run.sh:
436+
examples/10_mcp_ollama_demo/docker-entrypoint.sh:
436437
examples/10_mcp_ollama_demo/run.sh:
437438
e: print_section,print_step,print_success,print_warning,print_error,print,print,print,print
438439
print_section()
@@ -444,4 +445,3 @@ Attributes:
444445
print()
445446
print()
446447
print()
447-
examples/10_mcp_ollama_demo/docker-entrypoint.sh:

0 commit comments

Comments
 (0)