| name | review-rig |
| description | The full Code Factory review — deterministic pre-pass (fallow + codebase-memory blast radius), toggleable dimension sub-agents (Standards, Spec, Correctness, Tests, Laziness, Boundaries), a graded verdict against review.schema.json, and optional auto-fix. Use for reviewing a branch, PR, or diff with the rig; for a quick two-axis pass use code-review instead. |
Review rig
A configurable review machine over the diff between HEAD and a fixed point. Evidence first, judgement second: a deterministic pre-pass gathers facts no reviewer should re-derive, then independent dimension sub-agents judge the change, then one synthesis grades it.
0. Configure
Pin the fixed point exactly as code-review does (three-dot diff, verify the ref resolves, non-empty diff — fail here, not inside six sub-agents).
Dimensions toggle per run. Default: all six on. The user can say "skip tests and boundaries" or "just correctness and laziness" — honour it, and record which ran in the verdict. Spec auto-skips (recorded, not silent) when no spec source exists after the code-review step-2 search.
1. Deterministic pre-pass → evidence pack
Facts before opinions, gathered mechanically:
- fallow —
npx fallow static analysis over the changed files: audit, decision-surface, duplicate, dead-code, and health outputs as available. Tool missing or erroring = note "fallow unavailable" and continue; the rig degrades, it doesn't stop.
- Blast radius — from the codebase-memory graph: for each changed symbol, its callers and dependents (
search_graph, trace_path, query_graph). The output is the list of things this diff can break that the diff doesn't show.
- Mechanical facts — diff stat, commit list, touched-file test coverage (do test files exist beside the changed code), typecheck/test suite status if cheap to run.
Bundle these into an evidence pack — a single text block every dimension receives. Done when the pack states blast radius per changed symbol (or "not indexed") and each fallow section is present or explicitly marked unavailable.
2. Dimension sub-agents
Spawn all enabled dimensions in parallel, one sub-agent each, every one receiving: the diff command, the commit list, the evidence pack, and its brief. Briefs live one per file — read only the enabled ones:
Each sub-agent returns findings in the schema's finding shape (dimension, severity, file:line, summary, evidence, fix).
3. Synthesize and grade
Merge the findings without reranking across dimensions — each dimension's verdict stands on its own (a spec failure is not "less important" than a correctness failure; they are different failures). Deduplicate only literal same-file-same-line-same-issue overlaps, keeping the more specific write-up.
Grade the run against review.schema.json: per-dimension pass | warn | fail, the findings array, and an overall verdict that is simply the worst per-dimension result. Emit the JSON block, then a human summary: one line per dimension, worst finding named.
4. Auto-fix (optional, off by default)
Only when the user asked for it: fix findings in ascending blast-radius order (from the evidence pack), re-running the affected dimension after each fix batch, until clean or the remaining findings need human judgement — list those explicitly. Auto-fix touches code, so it never runs from a read-only context: the Reviewer agent reports; the fixing happens in the caller's context or an Engineer dispatch.
Ultra mode
ultra widens the same backbone for whole-mission branches: the diff is partitioned per subsystem (from the codebase-memory architecture view), and each subsystem crosses each enabled dimension — a subsystem × dimension grid of sub-agents instead of one row. Reserve the strongest model for Correctness and Boundaries cells; Standards/Laziness cells run on the cheap tier. Auto-fix loops until the grid is clean. Expensive by design — confirm with the user before launching, stating the cell count.