Analyze the nulang codebase and generate a comprehensive codebase analysis and improvement report.
Working directory: /home/dporkka/dev/nulang Integrity mode: benchmark
Perform a deep analysis of the Rust source code in src/ and compare it against the architectural/design specifications found in DESIGN_*.md and SPEC*.md.
The analysis must address the following five areas:
- Architectural & Design Review: Analyze the compiler pipeline, typechecker, effect checker, escape analysis, and VM/JIT runtime.
- Performance & Optimization: Identify at least 3 concrete areas for performance optimization (e.g., VM loop, JIT compilation, allocation patterns).
- Code Quality & Rust Idioms: Identify at least 5 areas where code safety, error handling, or idiomatic Rust conventions can be improved.
- Verification & Test Coverage: Review the existing unit, integration, and stress tests to find coverage gaps.
- Specification Alignment: Evaluate how well the current implementation aligns with the written specifications (e.g.,
DESIGN_AI_SDK.md,DESIGN_WEB_FRAMEWORK.md,SPEC.md,SPEC2.md).
Generate a single markdown report at /home/dporkka/dev/nulang/codebase_analysis_report.md. The report must:
- Have clear headings for each of the five core analysis areas.
- For each recommendation, provide specific file names, functions/structs, and code snippets showing both the current implementation and the proposed refactored version.
- Include a checklist of actionable steps for each recommendation.
Use the verification script at /home/dporkka/dev/nulang/verify_report.py to programmatically validate the structure and content of the report. The analysis task is only complete when this script exits successfully (exit code 0).
- The file
/home/dporkka/dev/nulang/codebase_analysis_report.mdmust exist and be non-empty. - The report must contain sections matching the five core analysis areas.
- At least 3 performance optimizations must be described with specific code snippets.
- At least 5 code quality/idiom improvements must be described with specific code/diff snippets.
- Every file path referenced in the report must exist in the
/home/dporkka/dev/nulangrepository. - The verification script
verify_report.pymust run and exit with code 0.