The fresh-context review pass — brief, protocol, checklist
The review lenses say what to look for. This page is the how: the brief a fresh-context reviewer gets, the verification protocol the author follows on its findings, and the checklist that keeps the author’s own fixes from becoming the next round’s findings. Every push batch gets this pass before it ships, and every external review round is folded through the same protocol.
When
Before pushing a batch: the NEW diff (unpushed commits + working tree
untracked files; for an open PR,
main...HEAD).
After each external review round: verify every comment against code, fix red-first or decline at the site, then run the pass on the fixes.
After each pass with findings: run it again on the fixes (lens L10), until a pass yields zero verified findings.
The brief
Give a reviewer that has NOT seen the session this, with the blanks filled:
You are a fresh-context adversarial reviewer for the repository at
<path>(branch<branch>). You did NOT write these changes. Find REAL defects, verified against code — not style. Do NOT edit the repository (probes in your scratchpad are fine). You may run the unit tier and, withAVELOXIS_TEST_DBbuilt from the local runlocal config (never printed), the integration tests you name; run them in the foreground and deliver ONE report.Scope:
<git diff HEAD | main...HEAD>plus untracked<files>. This is round<n>of fixes; the previous round’s findings, now applied:<one line each>. Checklist:docs/contributing/review-lenses.mdL1–L18, weight on L10 (the fixes are new code) and L11 (class sweep).Verify specifically:
<numbered list of the things the author is least sure of — each phrased as a question with the expected answer>.If a gopls MCP server is connected (for example
mcp-gopls), back every claim about a changed function’s callers with itsfind_referencesandget_hover_inforesults, and cross-check each references answer with grep. Use only its read-only tools, neverrun_go_mod_tidy,rename_symbol,format_documentorlist_code_actions.Output: a numbered list of VERIFIED findings only — file:line, lens, one-sentence claim, concrete failure scenario, one-line suggested fix — then a short “checked and sound” list and the test results you observed. If nothing real survives verification, say exactly that.
Two rules about the brief itself: it must name the previous round’s fixes (so L10 has a target), and its “verify specifically” list must include the author’s doubts — a reviewer that is only told what is right confirms it.
The protocol on findings
Verify each finding against the code before acting; a reviewer’s probe is evidence, not a verdict.
Fix red-first: the test that proves the defect exists BEFORE the fix (a mutation proof — revert the fix, watch the test fail — is the acceptable substitute when the defect is in a tripwire).
Decline only with the reason written at the site, and record the decline in the ledger.
For every fix, run the class sweep: grep the primitive the fix is built on (
sweep.sh <pattern>); recordpattern → N sites → all fixed / allowlistedin the findings table.Run every gate (unit suite, vet, gofmt, staticcheck, golangci-lint, the docs
-Wbuild, the integration tier). One unreproduced failure is recorded as unreproduced, never as fixed.Record the round in the release’s private ledger: pass, findings, taken/declined, headline items.
Pre-launch checklist (what shortened the tail)
Before running the next pass on your own fixes, check the fixes for the shapes that dominated eight consecutive rounds of one release:
The closing suite run is the skip census:
scripts/skip-census.shwithAVELOXIS_TEST_DBexported. It fails on any failing test and on any test that skipped without a reviewed environment reason. A test whose subject moved must fail, never skip — the reviewer checks that a moved function turned its tests red.Pins: every needle is counted on the comment-STRIPPED body, exactly once, and the statement that follows is matched as a PREFIX at that offset; ordering checks require both indexes ≥ 0; hand-written counts are derived from the source instead; the failure message says exactly what the pin enforces and nothing more.
Gates: a new gate has a test that makes its refusal FIRE, and every entry point that reaches the guarded machinery passes it (grep the callers of the machinery, not of the wrapper).
Keep-going loops: a loop that logs and continues accumulates and returns (bounded); a command whose work was refused exits nonzero; a canceled context is one exit, classified before the failure arm, and never logs “complete”.
Prose: every sentence in the touched comments, messages and docs is true against the code after the fix — including which deployment a size or duration was measured on.
Sweep: the primitive of each fix has been grepped and the sibling sites fixed or explained.
Callers, type-resolved (since v0.29.67): for every changed or exported function, list its callers with a gopls
find_references(through a gopls MCP server when one is connected, or the editor’s LSP), check at each caller withget_hover_infowhich value actually reaches the function, and cross-check the list with grep. In the first such pass this found a badge that normalized an already normalized key, which grep alone had not shown. Two limits: pins that read source as strings are invisible to gopls, so grep is still needed for “who depends on this spelling”; and the MCP wrappers forgo testandgovulncheckreturn only an exit status on failure, so run those two directly.Heuristic boundaries: when a second round moves the SAME boundary (a threshold, a word list, a “text vs list” rule), stop tuning it. Name the two error directions, keep the one whose failure is safer (for compliance data: losing information, never a false assertion), record the class decision at the site, in a pinning test and in the ledger, and tell later briefs that its variants are decided. v0.29.67 spent five rounds on one such boundary before deciding it.
Where the results go
The public rules: review-lenses.md gains a lens when a class recurs across releases.
The machine-checked rules: the registries described in testing.md.
The per-release story: the private ledger the release notes point to.