Ship It With AI Mihai Cvasnievschi

Review and verify

7 min read

By the end you can read an agent's diff in the right order, say how much a green test suite proves, and set the controls that keep verify honest.

TL;DR


Who checks what

Each check sees what the others cannot, so the loop runs all of them.

Check Reads Asks
Spec reviewer Note, plan, notes file, diff Does this match the spec?
Quality reviewer The diff only Is this correct by the team's standards?
Human read Diff-stat, tests, boundaries, new names Is the business rule right? Does it fit the architecture?
Verify New tests, full suite, staging, contract diff Does the behavior meet the plan's "done"?

The wire, continued

A suite that is happy can still be wrong.

Chapter 4 left the audit-log emitter with a test that was green and wrong. The spec-compliance reviewer, comparing the diff to the plan, caught that the test asserted the old log format, and flagged a migration with no down direction. The code-quality reviewer, who saw only the diff, found nothing of note. The implementer subagent fixed both and re-ran the relevant tests.

Verify then ran the full suite of 3,400 tests and a smoke test against the staging compliance-routing service, and produced a diff of the API contract change for the regulator's review. All passing. That evidence went into the pull request at Chapter 4's ship step.


Review: two agents, then you

Two reviewers, in sequence, with different prompts.

One reviewer doing both jobs blurs the signals, so the quality reviewer is a different agent with a different prompt, reading only the diff. Four rules keep it useful:

Findings carry a severity: critical blocks ship, important is fixed before ship, suggestions go in the PR description for the human reviewer.


How do you review an agent-written diff?

Read from the outside in: intent first, lines last.

A human diff fails at execution: a typo, an off-by-one, a forgotten edge case. An agent diff compiles, passes lint and reads like code your team would merge unremarked. It fails one layer up, at intent and context: a business rule that is plausible and wrong, the right code in the wrong layer, the code a good engineer would write for a slightly different task. Fluency is not correctness.

So spend the first ten minutes above the code:

  1. Diff-stat against the plan. Does the shape of the change match the ask? A file the plan never named is the first flag: the agent decided something you did not ask it to.
  2. Read the tests for what they assert, not whether they pass. Green is the cheapest signal, and the one you already have.
  3. Check the boundaries your team wrote down: forbidden patterns in AGENTS.md, layer conventions, dangerous modules. The agent crosses them confidently, in fluent style, so a violation looks clean.
  4. Grep every new name the diff introduces that you do not recognize. The call that does not exist reads as plausibly as the one that does (Chapter 6 has the cross-check).
  5. Only now, line by line, spending the minutes the reviewers bought you on business correctness and architectural fit.

Before you approve, have the agent quiz you on the change: what happens at the edges, which module owns the new behavior, what breaks first if an assumption is wrong. Three or four questions, one minute. If you cannot answer, you were rubber-stamping with extra steps. Appendix B.8 is this order as a one-pager.


Verify

Verify measures the behavior against the outcome the plan defined.

Execute already ran the existing tests. Verify runs the new ones and asks whether the change is correct, not merely whether anything else broke.

For frontend work, write them against the accessibility tree, the structure browsers keep for screen readers, not pixels or CSS selectors. A Playwright test that finds the field labeled Priority, changes it, clicks Save and checks the new value asserts behavior, and survives a restyle or a component-library swap.


Can you trust the tests the agent writes?

Green tests are evidence, not proof.

They are evidence the change does what the test says, not that the test says the right thing, as the audit-log test showed. Coverage does not close the gap: it measures which lines ran, not whether anything meaningful was checked, and an agent optimizing a coverage gate writes tests that call the code and assert nothing of consequence. Characterization tests, Chapter 8's first fix for an untested codebase, lock in current behavior, not correctness, and preserve a bug as faithfully as a feature: a regression net while you migrate, never proof.

So review the agent's tests like its code, checking the assertions against the spec. A test written from the implementation agrees with the implementation; the assertion has to come from the intent.

The agent also optimizes the evidence it can see. On SpecBench, frontier agents scored near 100% on the visible tests and fell 43 to 48 points short on a hidden set. That is not cheating in the human sense; it is a system doing what the gate rewards. Four controls close the gap:


When the toolkit does the looking

Review agents are a filter in front of human judgment, never a substitute for it.

A team I worked with installed a full review toolkit: agents for swallowed exceptions, weak tests, security issues and stale docs. It caught real bugs week after week, the senior reviewers learned to trust the green checkmarks, and within a quarter their fifteen-minute reviews had become three-minute scans. Nobody decided that; attention drifts away from work that appears to be done.

Then a PR that every agent had passed - tests green, no security findings, clean diff - applied a discount rule to the wrong customer tier and ran in production for weeks until a support ticket surfaced it. The toolkit had worked as designed: it removed the mechanical findings from human review, and the judgment drifted away with them. That is Chapter 9's uncalibrated delegator, at team scale.

The fix was an explicit floor: a minimum review on business correctness and architectural fit for every agent-touched PR, tracked as a number next to defect rate. The read order above is that floor made concrete.


When it breaks


Do this Monday


Go deeper