Golden cases in eval/golden_cases.jsonl are used to verify the reviewer's correctness
after changes.
pip install -e . # if not already installed
python scripts/evaluate_reviewer.pyThe script loads each golden case, runs it through review_code(code=..., use_rag=False),
and compares the result against the expected values.
| Field | Description |
|---|---|
id |
Unique identifier |
description |
Human-readable description |
file_path |
Simulated file path passed to the reviewer |
code |
Source code to review |
expected_issues |
Exact expected issue count (if deterministic) |
expected_min_issues / expected_max_issues |
Allowed issue count range (alternative to exact) |
expected_verdict |
One of APPROVE, WARNING, REQUEST_CHANGES |
expected_cwes |
List of expected CWE IDs |
- All 7 rule-based detectors fire correctly
- Multi-hit detection: up to
MAX_FINDINGS_PER_RULE=3per rule,MAX_TOTAL_FINDINGS=20total - Duplicate deduplication: same
(file, line, cwe_id, snippet)is reported only once - Safe code produces zero issues
- Verdict thresholds are respected (score 60+ → REQUEST_CHANGES, 20-59 → WARNING, <20 → APPROVE)
- Append a JSON object to
eval/golden_cases.jsonl - Run
python scripts/evaluate_reviewer.pyto confirm it passes - Commit both the new case and any reviewer changes together