Commit f901632
feat(court): enhance reviewer and judge prompts to catch silent data corruption (#31)
## Summary
- Expands both Reviewer A (Claude) and Reviewer B (Codex) prompts with 4
high-risk pattern checks derived from the PR #3232 incident
- Adds a "Judge's Own Investigation" step to Phase 3 so the judge
proactively checks for these patterns even if neither reviewer flags
them
- The 4 patterns: called-but-not-changed code contracts, mutations on
read paths, blast radius from null/default initial state, data contract
completeness at merge boundaries
## Context
PR #3232 (`refreshMetricsIfStale()`) caused mass data corruption
because:
1. The bug lived in `MetricsCalculationService.calculate()` which was
**called but not changed** in the diff
2. A GET endpoint silently mutated data via fire-and-forget
3. All existing evals had `null` metricsRefreshedAt, so every record got
hit on first view
4. Object spread merged incomplete data over existing metrics, zeroing
out fields
None of these were visible in the diff alone. The current reviewer
prompts only say "review for bugs, security issues, and code quality" —
too generic to catch this class of issue.
## Test plan
- [ ] Run `crab court` on a test PR and verify both reviewers mention
the new checks in their findings
- [ ] Verify the judge's Phase 3 output includes the "Judge's Own
Investigation" section
- [ ] Confirm no regression in general review quality (reviewers still
catch standard bugs)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent b303372 commit f901632
1 file changed
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8107 | 8107 | | |
8108 | 8108 | | |
8109 | 8109 | | |
8110 | | - | |
| 8110 | + | |
| 8111 | + | |
| 8112 | + | |
| 8113 | + | |
| 8114 | + | |
| 8115 | + | |
| 8116 | + | |
| 8117 | + | |
| 8118 | + | |
| 8119 | + | |
| 8120 | + | |
| 8121 | + | |
| 8122 | + | |
8111 | 8123 | | |
8112 | 8124 | | |
8113 | 8125 | | |
8114 | 8126 | | |
8115 | 8127 | | |
8116 | 8128 | | |
8117 | | - | |
| 8129 | + | |
| 8130 | + | |
| 8131 | + | |
| 8132 | + | |
| 8133 | + | |
| 8134 | + | |
| 8135 | + | |
| 8136 | + | |
| 8137 | + | |
8118 | 8138 | | |
8119 | 8139 | | |
8120 | 8140 | | |
| |||
8135 | 8155 | | |
8136 | 8156 | | |
8137 | 8157 | | |
| 8158 | + | |
| 8159 | + | |
| 8160 | + | |
| 8161 | + | |
| 8162 | + | |
| 8163 | + | |
8138 | 8164 | | |
8139 | 8165 | | |
8140 | 8166 | | |
| |||
0 commit comments