CCDV-P Study Guide

8. Domain 8: Agent Fleet Operations for Software Delivery

8.2. 8.2 Verification and AI code review: from shadow mode to merge gate

CCDV-P · Domain 8 · Lesson 8.2 · 20 min read

When agents out-write your reviewers: layered verification, AI code review in shadow mode, calibration before it gates merges, and what stays with people.

Why the review queue became the riskiest step

Fenwick Digital Bank runs current accounts, savings and card payments for about two million customers. Its engineers now direct coding agents for most routine work. Two quarters ago the agents opened about 150 pull requests a week. Now they open 600, and the same 45 engineers still read every one before it merges.

The arithmetic broke quietly. A careful read of a typical agent pull request, about 380 changed lines, takes around 40 minutes, so 600 a week would cost 400 hours: nearly nine hours per reviewer on top of their own work. Nobody has that. Median time to first review rose from five hours to two days, and the time spent before approving an agent's change fell below four minutes. In October one of those approvals let through a change to how overdraft fees are rounded. It passed every test and overcharged about 9,000 customers by a few pence each for six days.

Ines, the staff engineer who owns Fenwick's delivery pipeline, sees what went wrong. Every pull request still had its approvals; what had gone was the reading. Generation scaled with compute, verification still scaled with people, and skimming closed the gap. The fix is verification operations: treating every check between "an agent wrote it" and "it merged" as one system with layers, capacity and measured accuracy, including an AI reviewer that earns its authority before it gets any.

When generation outpaces review

Here is the failure that trips teams up: the dashboards say review is working. Every pull request at Fenwick had its approvals, the merge rate was up fourfold and the queue, once reviewers began skimming, was shrinking again. Each of those numbers shows that review happened, not that it found anything.

This is the review bottleneck. A coding agent's output grows with the compute you give it; a reviewer's attention does not. When the two diverge, the queue grows first, and then people protect their time the only way they can, by approving faster. Approval turns into a ritual, and the defect rate of merged code drifts up while every process metric stays green. It looks like a backlog problem; it is an accuracy problem.

Is review at Fenwick working?

Every PR approved100% policy compliance
Merge rate up fourfold600 agent PRs a week
Queue shrinking againsince reviewers sped up
Measure what review catchesminutes per changed line, substantive comments, escaped defects
Process metrics show that approvals happen; only measures of what review catches show whether it works.

The signals worth watching measure the reading itself: reviewer minutes per hundred changed lines, the share of pull requests with a substantive comment, and escaped defects, bugs found after merge and traced back to the pull request that introduced them. At Fenwick the first fell tenfold while escapes doubled.

The tempting fixes fail on the same arithmetic. A minimum review time makes skimming slower, not deeper. Hiring grows linearly while agent output quadrupled in two quarters. Throttling the agents throws away the capacity you adopted them for. What works is changing what each layer of verification is responsible for.

Verification layers: what each one can catch

Why not hand the whole job to an AI reviewer? Because no single check catches every class of defect, and the classes that matter most to a bank fall into different layers.

Layer What it catches What it cannot see
Tests Behaviour that breaks a stated expectation; regressions on covered paths Anything nobody wrote a test for, like Fenwick's rounding rule
Types and static analysis Type mismatches, unsafe calls, known vulnerable patterns, secrets in code Code that is valid but wrong for the business
AI code review Logic errors, broken edge cases, missing checks, conflicts with surrounding code and team rules What the code does when it runs; intent nobody wrote down
Human review Wrong design, wrong intent, risk the organisation will not accept Volume: attention runs out long before the queue does

Order matters as much as membership. Deterministic layers come first: they are cheap and give the same answer every time, so a pull request that fails its tests never reaches a reviewer of either kind. AI review comes next, reading the change against the surrounding code the way a person does, at a cost that scales with compute. Human review comes last, spent on the questions the earlier layers cannot answer.

Each layer's limits decide what you trust it for. Anthropic's managed Code Review service examines the diff and surrounding code without building or running it. So it cannot replace a test suite, and its docs warn that a review with no findings does not mean the code is correct or secure. Equally, a green test run says nothing about a rule nobody tested: Fenwick's October defect passed both tests and static analysis.

Ines rebuilds the pipeline around that split. Every agent pull request must pass tests with coverage on changed lines, type checks and static analysis before any reviewer sees it. An AI code review layer reads each change next. Human reviewers then get smaller pull requests with the AI's findings attached. And the overdraft fee schedule finally gets a test.

Shadow mode: let the reviewer run before it rules

The AI reviewer is in the pipeline. Should its findings block merges from day one? No: nobody yet knows how often it is right on THIS codebase. A vendor benchmark measures someone else's code and someone else's idea of a bug.

Shadow mode answers that safely. The new reviewer runs on every real pull request and records its verdicts, but it cannot block, approve or count toward anything, and human review carries on unchanged. After a few weeks you hold two sets of verdicts on the same pull requests. A hospital trialling a new diagnostic test runs it alongside the established one and treats nobody on its result until the two are compared; shadow mode is that trial for a reviewer.

Three levels of authority for an AI reviewer

Silent shadow

Runs on every PR
Findings stored, not shown
Blocks nothing

human verdicts stay independent

Advisory

Findings posted on the PR
Humans decide

helps reviewers, biases the baseline

Gate

Important findings block merge
Calibrated tiers only

needs measured misses and false alarms

A silent shadow keeps human verdicts independent for calibration; advisory and gating come only after the numbers are in.

There is a design choice inside shadow mode. Reviewers who can see the AI's comments anchor on them, checking what it flagged and skimming the rest, so their verdicts stop being an independent baseline. Fenwick therefore runs a silent shadow for four weeks, with findings stored for the calibration team and never posted. So that no known bug ships meanwhile, a calibration engineer reads the serious findings daily, after the human verdict is recorded, and raises confirmed defects with the author.

The managed Code Review service posts findings on the pull request, which makes it advisory, not silent. So Ines builds the shadow on Claude Code GitHub Actions, which runs Claude Code on Fenwick's own CI runners; given a prompt, it runs in automation mode and reports to the workflow run log. Look at the prompt line, which runs the code-review plugin's skill, and at the missing --comment flag, without which nothing is posted. The job is not a required check, so it never blocks a merge. The skill also skips some pull requests, such as ones it judges trivial or automated, so Fenwick logs every skip as no verdict.

# .github/workflows/ai-review-shadow.yml
name: AI review (shadow)
on:
  pull_request:
    types: [opened, synchronize, ready_for_review, reopened]
jobs:
  shadow-review:
    runs-on: ubuntu-latest
    permissions: { contents: read, pull-requests: read, issues: read, id-token: write }
    steps:
      - uses: actions/checkout@v6
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          plugin_marketplaces: "https://github.com/anthropics/claude-plugins-official.git"
          plugins: "code-review@claude-plugins-official"
          # no --comment: findings stay in the run log, never on the PR
          prompt: "/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"

Calibration: earning the right to block a merge

After four weeks Fenwick has the AI's verdicts and the humans' on 2,400 pull requests. What does it compare them against? Not the humans alone: October proved that first-pass review misses things too, so "agrees with the reviewer" cannot define "right".

Calibration here means measuring the AI reviewer against an agreed answer before it gets authority. Fenwick builds that ground truth three ways. Two senior engineers re-review 400 shadow-period pull requests slowly and independently, then settle disagreements together. Incidents are traced back to the pull requests that caused them. And 25 past pull requests whose defects reached production are replayed through the reviewer. Ines writes the bar down first: catch at least 85% of blocking defects, with false alarms under one in ten of its blocking findings, per risk tier.

First results on the 400 adjudicated pull requests, 60 of which held a blocking defect:

Measure AI reviewer (shadow) First-pass human review
Blocking defects caught (of 60) 51 (85%) 38 (63%)
Missed defects 9 22
False alarms (blocking findings on clean PRs) 19 of its 70 (27%) 6 of their 44 (14%)

The two agreed on block-or-pass for 358 of the 400, about 90%. Distrust that headline: most pull requests are clean, so two reviewers who pass nearly everything agree most of the time. The rows that decide authority are misses and false alarms, read by where they fall. Five defects were missed by both reviewers, which is why tests stay a gate.

Split by path, the pattern was clear. Thirteen of the 19 false alarms were on generated code and database migrations. Six of the 9 misses were authorisation checks spread across payments and identity services, visible only to someone who knows what another service assumes. The fixes went into the reviewer's instructions, not a bigger model: skip generated paths, and cite a file:line before any claim about behaviour. Two more weeks of shadow cut false alarms to 5 of 57 blocking findings outside payments and identity.

Two kinds of authority need different numbers. Authority to block a merge depends on false alarms: a gate that cries wolf trains engineers to override it, and then it guards nothing. Authority to stand in for a human approval depends on misses, because every defect it passes reaches production. Fenwick's results earn the first outside payments and identity, and the second only on its lowest-risk tier.

Fenwick's path from shadow to gate

SHADOWsilent, every PR, four weeks
CALIBRATEmisses and false alarms per tier
ADVISEfindings posted, humans decide
GATEImportant findings block, calibrated tiers only
MONITORsampled re-review, escapes traced
MONITOR → SHADOW · any change to the model, instructions or plugin
Authority is granted per risk tier on measured numbers, and any change to the reviewer sends it back through calibration.

For the advisory and gating stages Fenwick moves to the managed Code Review service, which marks findings Important, Nit or Pre-existing. Its check run, Claude Code Review, concludes as neutral and never fails a pull request by itself. So Fenwick's CI reads the severity counts the check run publishes and fails when the Important count is above zero. The docs are explicit that a missing count means no verdict, not zero findings: a gate that reads "no review" as "nothing found" fails open. Authority also expires: a new model, new instructions or a new plugin version is a new reviewer, and goes back to shadow.

Human oversight: what stays with people

With an AI reviewer that has earned some authority, what is left for Fenwick's 45 engineers? Different work, not lesser work. Human oversight is designed, not left over: you decide which decisions need a person, make sure a person really makes them, and watch the automated layers.

Four things stay with people at Fenwick:

  1. Accountability. A named engineer approves every merge to a production service, as the bank's change-management policy requires. Neither the agent that wrote the change nor the AI that reviewed it can answer for it.
  2. Design and intent. Whether this is the right change at all. An AI reviewer checks the diff against the code; only someone who knows what the business asked for can check it against that.
  3. Security-sensitive paths. Payments, the ledger and identity need two engineers who did not write the change, whatever the AI says, because a miss there moves money or exposes accounts.
  4. The verification system itself. Review instructions, CI workflows and approval policies. A change that weakens the checks weakens every later pull request, so no agent may merge one alone.

The platforms enforce part of this. Code Review reads its review instructions, REVIEW.md, from the base or default branch, never from the pull request's own changes, so a change cannot rewrite those instructions. Claude Approvals, in public beta for Team and Enterprise plans, turns rules like Fenwick's into a policy file, .claude/approvals.yml, whose check blocks merges once you make it required in GitHub. It treats its policy files, the root REVIEW.md and CODEOWNERS files as protected, needing a person, but not CLAUDE.md, so Fenwick's third rule names it.

Its mode: observe is shadow mode for the policy itself: the check shows what the rules would decide, and the docs advise enforcing once that matches your reviewers' decisions. In Fenwick's pilot policy, look at the pr/authors exclusion, which keeps out whoever wrote or pushed the change, and at claude: comments, which means Claude approves nothing yet.

# .claude/approvals.yml (Fenwick, pilot weeks)
version: 1
mode: observe            # show what the rules would decide; enforce nothing yet
rules:
  - purpose: "Every change: one person who did not write it. Claude's review is advisory."
    paths: ["**"]
    verdict: { claude: comments, seats: [{ count: 1, from: [humans, "!pr/authors"] }] }
    advisory: [claude/code_review]
  - purpose: "Payments, ledger and identity: two people who did not write it."
    paths: ["services/payments/**", "services/ledger/**", "services/identity/**"]
    verdict: { claude: comments, seats: [{ count: 2, from: [humans, "!pr/authors"] }] }
  - purpose: "CI workflows, agent configuration and CLAUDE.md: two people."
    paths: [".github/**", "**/.claude/**", "**/CLAUDE.md"]
    verdict: { claude: comments, seats: 2 }

Oversight continues after the reviewer gets authority. Each week a senior engineer re-reviews a risk-weighted sample of pull requests the AI passed, every escape is traced to the layer that should have caught it, and each quarter the security team tries to slip a malicious change through. Anthropic describes the same practices for its own development: AI reviewers in shadow mode until they earn trust, code tiered by risk, humans sampling automated approvals and owning final approval.

The exam traps

Every trap here either trusts a check before it has been measured or measures the wrong thing.

  • ✗ Asking reviewers to go faster, or setting a minimum review time, when the queue explodes. ✓ Redistribute verification across layers and spend human attention where only people can judge. Neither speed nor a timer adds reading capacity.
  • ✗ Letting a new AI reviewer block or approve merges from day one because its benchmark looks strong. ✓ Run it in shadow mode on your own pull requests and grant authority after calibration. A benchmark measures someone else's code.
  • ✗ Calibrating by headline agreement with reviewers who could see the AI's comments. ✓ Keep the shadow silent, build ground truth from adjudicated re-review and traced incidents, and read misses and false alarms per tier. Anchored verdicts on mostly clean PRs flatter the AI.
  • ✗ Dropping tests or static analysis because AI review "reads everything". ✓ Keep the deterministic layers first. A reviewer that reads code without running it complements tests and never replaces them.
  • ✗ Treating a missing review as a pass, or letting a pull request change its own review rules. ✓ Fail closed on no verdict, read review instructions from the protected base branch, and require people for changes to the verification system.

Put it together: take an AI reviewer from shadow to gate

Now make it yours with a miniature calibration, then an attack on the reviewer's instructions.

The rest of this domain builds on this pipeline. Unattended and event-driven agents (8.3) add pull requests nobody watched being written, which makes a fail-closed, calibrated gate matter more. Organisation-wide configuration (8.4) turns policies like Fenwick's into settings every team inherits.

Key takeaways

  • ✓ When generation outpaces review, approvals turn into skims while process metrics stay green, so measure what review catches, including escaped defects.
  • ✓ Layer verification: tests and static analysis first, AI review for logic and consistency at scale, human review for design, intent and risk.
  • ✓ Introduce an AI reviewer in silent shadow mode, with no authority, so human verdicts stay an independent baseline for comparison.
  • ✓ Calibrate against adjudicated ground truth and judge the reviewer on missed defects and false alarms per risk tier, not on headline agreement.
  • ✓ Grant blocking authority where false alarms are low and approval authority only where misses are low, fail closed on a missing verdict, and re-calibrate after any change.
  • ✓ Keep accountability, design and intent, security-sensitive paths and the verification system itself with people, enforced by policy outside the model and audited by sampling.

Practise this

Practice questions for CCDV-P are being written and are not in this course yet. Read this lesson on the web to answer its check questions, with every option explained: https://claude.termidy.com/learn/ccdv-p/agent-fleet-operations/verification-ai-code-review/.

Sources