forked from cleveragents/cleveragents-core
85cc67aa5a
Problems fixed:
- Generation prompt was vague ("produce production-ready code") with no
output format specification. LLM had to guess the multi-file format.
- Validation was fake: `is_valid = "PASS" in text or len(code) > 10`
auto-passed any code longer than 10 chars.
- Single-file fallback used keyword guessing ("test" -> test_generated.py)
instead of parsing the filename from LLM output.
Changes:
- Rewrite analyze_prompt with structured sections (Files to Create,
Dependencies, Key Requirements, Architecture Notes)
- Rewrite generate_prompt with explicit multi-file output format rules
(**filename.ext** + fenced code block) and quality constraints
- Rewrite validate_prompt with specific review checklist
- Replace fake validation with real Python syntax check (compile()) +
LLM review where first line must be PASS or FAIL
- Add _extract_single_file() for robust single-file fallback that
parses the filename from the LLM output header
- Remove keyword-based path guessing (test/error/generated.py)
- Re-ran SIM1: now produces todo.py (matching DoD) instead of main.py
1 line
2 B
JSON
1 line
2 B
JSON
[] |