@@ -151,31 +151,31 @@ Content outside the markers is preserved when regenerating. Enable this with `sy
151151
152152```
153153vallm/
154- ├── bump_version ├── cli/├── examples/ ├── hookspecs ├── vallm/ ├── __main__ ├── base ├── logical ├── complexity ├── validators/ ├── security ├── semantic_cache ├── syntax ├── lint ├── semantic ├── imports/ ├── graph_diff ├── core/ ├── ast_compare ├── proposal ├── gitignore ├── scoring ├── output_formatters ├── batch_processor ├── languages ├── sandbox/ ├── base ├── javascript_imports ├── python_imports ├── go_imports ├── c_imports ├── rust_imports ├── utils ├── wrapper ├── factory ├── java_imports ├── main_template ├── main ├── main ├── claude_autonomous_demo ├── main ├── ollama_simple_demo ├── iteration_1 ├── best_version ├── iteration_2 ├── main ├── main ├── main ├── main_template ├── main ├── main ├── refactored_output ├── mcp_demo ├── runner ├── utils/ ├── save_analysis_data ├── extraction ├── extract_code_from_response ├── logging_utils ├── validation_runner ├── order_processor ├── main ├── simple_buggy ├── load_config ├── utils/ ├── process_user_input ├── calculate_total ├── main ├── save_data├── project ├── run ├── run ├── docker-entrypoint ├── run ├── docker-entrypoint ├── run ├── docker-entrypoint ├── data_processor ├── config ├── command_handlers```
154+ ├── hookspecs ├── cli/ ├── bump_version ├── vallm/ ├── __main__├── examples/ ├── complexity ├── logical ├── security ├── base ├── validators/ ├── semantic_cache ├── syntax ├── lint ├── imports/ ├── semantic ├── graph_diff ├── core/ ├── scoring ├── gitignore ├── languages ├── output_formatters ├── ast_compare ├── batch_processor ├── proposal ├── sandbox/ ├── base ├── javascript_imports ├── python_imports ├── go_imports ├── c_imports ├── rust_imports ├── utils ├── wrapper ├── factory ├── java_imports ├── main_template ├── main ├── main ├── claude_autonomous_demo ├── main ├── ollama_simple_demo ├── iteration_1 ├── best_version ├── iteration_2 ├── main ├── main ├── main ├── main_template ├── main ├── main ├── runner ├── refactored_output ├── utils/ ├── extraction ├── save_analysis_data ├── mcp_demo ├── extract_code_from_response ├── validation_runner ├── logging_utils ├── order_processor ├── main ├── process_user_input ├── load_config ├── utils/ ├── simple_buggy ├── calculate_total ├── main ├── save_data├── project ├── run ├── run ├── docker-entrypoint ├── run ├── docker-entrypoint ├── run ├── docker-entrypoint ├── data_processor ├── command_handlers ├── config```
155155
156156## API Overview
157157
158158### Classes
159159
160160- **`VallmSpec`** — Hook specifications that validators must implement.
161- - **`BaseValidator`** — Base class for all vallm validators.
162- - **`LogicalErrorValidator`** — Validator for logical errors using pyflakes.
163161- **`ComplexityValidator`** — Tier 2: Cyclomatic complexity, maintainability index, and function metrics.
162+ - **`LogicalErrorValidator`** — Validator for logical errors using pyflakes.
164163- **`SecurityValidator`** — Tier 2: Security analysis using built-in patterns and optionally bandit.
164+ - **`BaseValidator`** — Base class for all vallm validators.
165165- **`SemanticCache`** — Cache for semantic validation results to improve performance.
166166- **`SyntaxValidator`** — Tier 1: Fast syntax validation.
167167- **`LintValidator`** — Validator for linting issues using ruff.
168168- **`SemanticValidator`** — Tier 3: LLM-as-judge semantic code review.
169169- **`GraphDiffResult`** — Result of comparing two code graphs.
170- - **`Proposal`** — A code proposal to be validated.
171- - **`GitignoreParser`** — Parse .gitignore files and match paths against patterns.
172170- **`Verdict`** — —
173171- **`Severity`** — —
174172- **`Issue`** — A single issue found during validation.
175173- **`ValidationResult`** — Result from a single validator.
176174- **`PipelineResult`** — Aggregated result from all validators.
177- - **`BatchProcessor `** — Handles batch validation of multiple files .
175+ - **`GitignoreParser `** — Parse .gitignore files and match paths against patterns .
178176- **`Language`** — Supported programming languages with their tree-sitter identifiers.
177+ - **`BatchProcessor`** — Handles batch validation of multiple files.
178+ - **`Proposal`** — A code proposal to be validated.
179179- **`BaseImportValidator`** — Base class for all import validators.
180180- **`JavaScriptImportValidator`** — JavaScript/TypeScript import validator.
181181- **`PythonImportValidator`** — Python-specific import validator.
@@ -187,10 +187,10 @@ vallm/
187187- **`JavaImportValidator`** — Java import validator.
188188- **`Colors`** — —
189189- **`Colors`** — —
190- - **`OrderManager`** — Class with single responsibility - adheres to SOLID principles.
191- - **`Colors`** — —
192190- **`ExecutionResult`** — Result of sandboxed code execution.
193191- **`SandboxRunner`** — Unified interface for running code in a sandbox.
192+ - **`OrderManager`** — Class with single responsibility - adheres to SOLID principles.
193+ - **`Colors`** — —
194194- **`Colors`** — ANSI color codes for terminal output.
195195- **`OrderManager`** — Class with mixed responsibilities - SOLID violation.
196196- **`BadClass`** — Class with multiple issues.
@@ -208,19 +208,14 @@ vallm/
208208- `create_validator(settings)` — Factory function for LintValidator.
209209- `diff_graphs(before, after)` — Compare two CodeGraphs and return the diff.
210210- `diff_python_code(before_code, after_code)` — Convenience function: build graphs from code strings and diff them.
211- - `parse_code(code, language)` — Parse code using tree-sitter and return the tree.
212- - `parse_python_ast(code)` — Parse Python code using the built-in ast module. Returns None on failure.
213- - `normalize_python_ast(tree)` — Normalize a Python AST by replacing identifiers with canonical names.
214- - `python_ast_similarity(code1, code2)` — Compute structural similarity between two Python code snippets.
215- - `tree_sitter_node_count(code, language)` — Count the number of nodes in a tree-sitter parse tree.
216- - `tree_sitter_error_count(code, language)` — Count syntax errors reported by tree-sitter.
217- - `structural_diff_summary(code1, code2, language)` — Return a summary of structural differences between two code snippets.
211+ - `compute_verdict(results, settings)` — Compute the aggregate verdict from a list of validation results.
212+ - `validate(proposal, settings, validators, context)` — Run the full validation pipeline on a proposal.
218213- `load_gitignore(path)` — Load .gitignore from a directory.
219214- `get_default_excludes()` — Get default exclude patterns used when no .gitignore exists.
220215- `create_default_gitignore_parser()` — Create a parser with default exclude patterns.
221216- `should_exclude(path, gitignore_parser, use_defaults)` — Check if a path should be excluded.
222- - `compute_verdict(results, settings )` — Compute the aggregate verdict from a list of validation results .
223- - `validate(proposal, settings, validators, context )` — Run the full validation pipeline on a proposal .
217+ - `detect_language(source )` — Auto-detect language from file path, extension, or name .
218+ - `get_language_for_validation(source, explicit )` — Get tree-sitter language ID for validation .
224219- `output_validate_result(result, output_format, verbose)` — Output validation result in the specified format.
225220- `output_batch_results(results_by_language, filtered_files, passed_count, failed_files)` — Output batch validation results in the specified format.
226221- `output_batch_empty(output_format)` — Output empty results.
@@ -234,8 +229,13 @@ vallm/
234229- `output_batch_toon(results_by_language, filtered_files, passed_count, failed_files)` — Output TOON format batch summary with detailed per-file results.
235230- `print_summary_header()` — Print summary header for batch results.
236231- `build_results_table(results_by_language)` — Build results table for rich output.
237- - `detect_language(source)` — Auto-detect language from file path, extension, or name.
238- - `get_language_for_validation(source, explicit)` — Get tree-sitter language ID for validation.
232+ - `parse_code(code, language)` — Parse code using tree-sitter and return the tree.
233+ - `parse_python_ast(code)` — Parse Python code using the built-in ast module. Returns None on failure.
234+ - `normalize_python_ast(tree)` — Normalize a Python AST by replacing identifiers with canonical names.
235+ - `python_ast_similarity(code1, code2)` — Compute structural similarity between two Python code snippets.
236+ - `tree_sitter_node_count(code, language)` — Count the number of nodes in a tree-sitter parse tree.
237+ - `tree_sitter_error_count(code, language)` — Count syntax errors reported by tree-sitter.
238+ - `structural_diff_summary(code1, code2, language)` — Return a summary of structural differences between two code snippets.
239239- `walk(root, project_root, gitignore_matcher, skip_tests)` — Walk directory tree yielding Python files.
240240- `validate_import_path(import_path, source_file, project_root, known_modules)` — Validate if an import path is resolvable.
241241- `main()` — —
@@ -297,6 +297,13 @@ vallm/
297297- `save_data(data, filename)` — Save data safely using json.dump.
298298- `process_order(data)` — Process order data with proper error handling and validation.
299299- `main()` — —
300+ - `save_analysis_data(example_name, result_data)` — Save analysis data to .vallm folder.
301+ - `run_validation_examples(example_name, good_code, bad_code, complex_code)` — Run standard validation examples (good, bad, complex code).
302+ - `validate_code_example(name, code, settings, all_results)` — Validate a code example and store results.
303+ - `print_summary(all_results)` — Print summary of all validation results.
304+ - `extract_code_from_response(response, language)` — Extract code from LLM response.
305+ - `extract_json_from_response(response)` — Extract JSON object from LLM response.
306+ - `save_analysis_data(example_name, result_data)` — Save analysis data to JSON file.
300307- `log_section(title)` — Print a section header.
301308- `log_step(step, description)` — Print a step.
302309- `log_code(label, code, max_lines)` — Log code with label.
@@ -306,19 +313,12 @@ vallm/
306313- `generate_refactoring_prompt(code, analysis)` — Generate prompt for LLM to refactor code.
307314- `run_mcp_workflow(code_path, max_iterations)` — Run the complete MCP workflow.
308315- `main()` — Main entry point.
309- - `save_analysis_data(example_name, result_data)` — Save analysis data to .vallm folder.
310- - `run_validation_examples(example_name, good_code, bad_code, complex_code)` — Run standard validation examples (good, bad, complex code).
311- - `validate_code_example(name, code, settings, all_results)` — Validate a code example and store results.
312- - `print_summary(all_results)` — Print summary of all validation results.
313- - `save_analysis_data(example_name, result_data)` — Save analysis data to JSON file.
314- - `extract_code_from_response(response, language)` — Extract code from LLM response.
315- - `extract_json_from_response(response)` — Extract JSON object from LLM response.
316316- `extract_code_from_response(response)` — Extract Python code from LLM response.
317+ - `run_validation_examples(example_name, good_code, bad_code, complex_code)` — Run standard validation examples (good, bad, complex code).
317318- `log_section(title)` — Print a section header.
318319- `log_step(step, description)` — Print a step indicator.
319320- `log_code(label, code, max_lines)` — Log code with label and truncation.
320321- `log_result(status, message)` — Log a result with appropriate color.
321- - `run_validation_examples(example_name, good_code, bad_code, complex_code)` — Run standard validation examples (good, bad, complex code).
322322- `process_order(data)` — Process order data - has multiple issues.
323323- `load_config()` — Load config - security issue with eval.
324324- `save_data(data, filename)` — Save data - uses pickle without validation.
@@ -332,15 +332,15 @@ vallm/
332332- `validate_with_vallm(project_path)` — Validate all Python files with vallm.
333333- `generate_report(code2llm_result, vallm_result, output_path)` — Generate combined analysis report.
334334- `main()` — Main example function.
335+ - `process_user_input(user_input)` — Process user input with standard logic.
336+ - `load_config()` — Load configuration with default values.
335337- `process_user_input(user_input)` — Process user input with security issues.
336338- `load_config()` — Load configuration with eval.
337339- `save_data(data, filename)` — Save data without validation.
338340- `calculate_total(items)` — Calculate total with no error handling.
339341- `duplicate_function()` — Another duplicate function.
340342- `unused_function()` — This function is never used.
341343- `main()` — Main function with problems.
342- - `load_config()` — Load configuration with default values.
343- - `process_user_input(user_input)` — Process user input with standard logic.
344344- `calculate_total(items)` — Calculate total price from items list.
345345- `run_demo_main()` — Run the standard demo main function pattern.
346346- `save_data(data, filename)` — Save data to JSON file.
0 commit comments