Protocol
Pass 1 — Review
Spawn the code-reviewer agent with:
- Artifact: the file(s) or diff to review
- Criteria: what to review against
- Scope: what's in-bounds
- Output: Return a
ReviewOutput; set every finding'svalidated_bytoreviewer, leaveverdictandevidencenull, and list evaluated criteria and paths inchecks_run.
Auto-progression:
- Zero P0/P1 findings → terminate after Pass 1 and present the clean result in this shape:
**Review result — clean:** - Checks run: [criterion / file path checked, one per line] - P0/P1 findings: none - One or more P0/P1 findings → proceed automatically to Pass 2. No user prompt.
Pass 2 — Verify
Spawn the verifier agent with:
- Artifact: same as Pass 1
- Findings: the reviewer's full
Findingarray - Criteria: same as Pass 1
- Output: Return a
ReviewOutputwith the full findings array and populatedchecks_run.- Verdicts: Set every finding to
confirmed,demoted, orrejectedand provide evidence. - Severity: Adjust severity up under
confirmedor down underdemoted. - Validation: Set every finding's
validated_bytoverifier. - Boundary: Verify only Pass 1 findings; do not add findings.
- Verdicts: Set every finding to
Present to user
Report in this shape:
**Two-pass review results:**
- P0/P1 findings: [id: title — confirmed | demoted Px→Py | promoted Px→Py — evidence]
- Summary: [X] of [Y] P0/P1 confirmed, [W] demoted, [Z] rejected
- P2/P3 (FYI): [id: title — verdict]
- Disagreement: [none | reviewer/verifier split — rejected findings and verifier reasoning]
- Empty result: Write
None — zero P0/P1 findings after both passeswhen the P0/P1 list is empty. - Severity changes: Mark each demotion (
demoted P0 → P1) and promotion (promoted P2 → P1). - All rejected: Report zero confirmed P0/P1 findings, populate Disagreement with the rejected findings and verifier reasoning, and stop without another automatic review.
- Visibility: Hide rejected findings outside the all-rejected case and unverified P2/P3 findings unless the user asks.
Output Schema
Finding
Finding {
id: sequential number starting from 1,
severity: "P0" | "P1" | "P2" | "P3",
title: short title,
body: detailed explanation with evidence,
file: file path or null for global issues,
line_start: number or null,
line_end: number or null,
confidence: 0.0-1.0,
criterion: what was violated,
verdict: "confirmed" | "demoted" | "rejected" | null,
validated_by: "reviewer" | "verifier" | "machine" | null,
evidence: reasoning for verdict | null
}
ReviewOutput
Findings are wrapped in a ReviewOutput envelope:
ReviewOutput {
schema_version: "v1",
findings: Finding[],
checks_run: string[]
}
Severity calibration
- P0 — Must fix: breaks functionality, security breach, data loss, or violates criteria
- P1 — Fix before shipping: correct but incomplete, fragile, or reliability risk
- P2 — Should fix: quality issue, code smell, not blocking
- P3 — Nice to have: observation, style, minor improvement
Field notes
confidence— 1.0 means certain, below 0.5 means you're guessing. Be honest.criterion— required for P0/P1 findings. Name the specific criterion violated.verdict— initial reviewers setnull; verifiers populate it after adjudication. A caller may setconfirmedwhen routing an observed failure with honestvalidated_byandevidencevalues.validated_by—reviewermeans initial review only;verifiermeans independent verification;machinerequires the exact check and observed failure. Missing ornullmeans unverified.- A machine result proves only the observed failure, not an inferred cause.
evidence— reasoning or an exact observed result supporting the verdict; usenullbefore adjudication.checks_run— list every criterion evaluated, file path checked, or acceptance criterion verified. For ACs, useAC-NNN-XX: PASS — [evidence]orAC-NNN-XX: FAIL — [reason].