ealeng

Episode 04 of 12 · Scoring reviewers

Same model, three harnesses: the AI reviewer is a classifier

One model (gpt-5.4-mini, low effort) in three harnesses: a single prompt with the diff, an agent that can search and read the whole repo, and the open-source PR-Agent. Same 40 pull requests, three runs each. The agent costs twice as much and its 2-point recall lead (−8 to +13) is too close to call, but it found a contract bug the diff can't show, in every run. PR-Agent is the most precise (82%) and misses the most. And a quarter of the 'false alarms' looked like real bugs: four were proven with tests and joined the answer key.

Lab 03 · The AI Reviewer Is a Classifier15 min read
Video transcript8:01

0:00Cold open

0:01

This pull request adds a default value to field mappings. When a column is empty, send this value instead.

0:08

Here’s the line that saves it. Look at the key it uses: default.

0:13

I gave this pull request to three AI reviewers, three times each. Two of them never flagged it, in any run.

0:20

The third found it every time. It opened a file this pull request never touches, and saw that the other side expects a different name.

0:30

So should every reviewer get the whole code base? It costs twice as much. Over thirty bugs, the answer surprised me.

0:38Intro

0:39

Hands-on AI code review. Part four.

0:42

Today: one AI model in three different harnesses, and what each harness buys you.

0:49Same model, three harnesses

0:50

I’m Valentina, a tech lead. In part three, I scored an AI reviewer on my test set of pull requests with planted bugs.

0:59

Now my team asks: should we buy a review tool, or call the model ourselves?

1:04

To answer that, I keep the model fixed. All three reviewers use the same model, at the same low effort.

1:11

What changes is the harness: everything around the model. What it’s shown, what it can look up, and how it’s asked.

1:18

Think of one chef in three kitchens. Same skill, different tools and different recipes.

1:24

The single prompt gets the pull request’s diff, in one call. It’s part three’s standard reviewer.

1:30

The agent gets the same, plus tools to search and read the whole code base, for up to twenty steps.

1:36

And PR-Agent is an open-source review tool, with its own prompt and its own view of the diff.

1:4301 · What a review costs

1:45

Each reviewer got the same forty pull requests as in part three, three times. Thirty have a planted bug. Ten are clean.

1:53

The single prompt costs about half a cent per review.

1:56

The agent costs twice as much, and takes about three times as long.

2:01

Why? Each step sends the whole conversation again. Luckily, text the provider has already seen is billed at a tenth of the price.

2:09

And all three write about the same number of comments: fewer than one bug comment per pull request.

2:1702 · Recall and precision

2:18

Now the scorecard. Recall is the share of the thirty planted bugs a reviewer found in its first run. As in part three, a comment must sit on the bug’s lines, and an AI judge confirms it’s the same problem.

2:32

The agent found twenty-four. PR-Agent, only nineteen.

2:37

But recall isn’t what the author of a pull request feels. They feel the comments that point at nothing.

2:44

So here’s a second number: precision. Of a reviewer’s bug comments, how many were right? Right means it matches a planted bug, or a real problem we’d already found.

2:54

PR-Agent has the best: eighty-two percent. The other two are near seventy.

3:00

Its prompt tells it to be certain before flagging smaller concerns, and not to flag style. That fits what we see: it stays silent on more pull requests, and is right more often when it speaks.

3:12

Remember the smoke alarm from part three? PR-Agent is set less sensitive: fewer wrong comments, and more missed fires.

3:2103 · Is the agent better?

3:22

So, back to my team’s question. In the first run, the agent found two more bugs than the single prompt, at twice the price.

3:30

Is the agent the better reviewer?

3:35

Not on this evidence. Here’s why.

3:38

Each reviewer ran three times. So for each bug, I take the share of runs that found it, and compare the two reviewers bug by bug.

3:46

Averaged over three runs, the agent is two points of recall ahead: less than one bug. And if I redraw the thirty bugs at random two thousand times, the gap lands anywhere from eight points behind to thirteen ahead.

4:00

Zero is inside that range. On thirty bugs, I can’t tell the two apart.

4:06

Yet they don’t find the same bugs. Each one finds two bugs the other never found, in any run.

4:1204 · The other side of the diff

4:14

Here’s one of the agent’s two. It’s the bug from the cold open.

4:18

Does the agent use its tools? In almost two of every three reviews, it read a file the pull request doesn’t change. Here, in its first run, it took seven steps.

4:29

It read the model file, searched the worker for defaultValue, and finally opened the worker code that loads the mappings.

4:36

Here’s the bug. When the API saves a mapping, it stores the default under the key “default”.

4:42

The worker loads the saved mappings with this line.

4:46

And this rule, near the top of the model file, says names in the saved data are written in camel case, like defaultValue. So that’s the name the worker looks for. It never sees the default, and the fallback silently never applies.

5:01

Neither worker line is in the diff. A reviewer that reads only the diff can’t see the other side of the agreement.

5:08

That’s a contract bug: two parts of a system disagree about a name. The sample has three. In at least one of three runs, the agent found all three, the single prompt two, and PR-Agent one.

5:2105 · Are the false alarms false?

5:23

Now the comments that matched nothing on the answer key. In part three, I asked if those are all wrong.

5:29

Here, an AI read fifty of them, one by one, against the code.

5:34

Twelve were simply wrong. Twenty-four were debatable, a matter of taste. Thirteen looked like real bugs nobody planted. And one was a planted bug, cited too far from its lines.

5:47

That’s about one in four. But “looks real” is still an opinion. So I asked for proof.

5:52

A proof is a test that fails on the pull request, and passes once a fix is applied. If the fix makes it pass, the test really was catching this bug, not a typo.

6:0405 · One proof

6:05

Here’s one. Reviewers said this worker flag, dry-run with one sync named, previews every sync instead.

6:12

The test makes two syncs, then asks for a dry run of the first one only.

6:17

And it checks that the second sync isn’t in the output.

6:2205 · One proof

6:23

First, on the pull request.

6:26

It fails. Sync b is right there in the dry run, though only sync a was asked for.

6:32

Now with the fix applied. It passes. So this one isn’t a false alarm. It’s a bug, proven.

6:3905 · The answer key learns

6:41

The thirteen real-looking comments came down to five problems. Four were proven this way, each on three related pull requests.

6:49

Proven bugs join the answer key. So a reviewer that flags them gets credit, instead of a mark for noise.

6:57

PR-Agent gains the most. Its unmatched comments per pull request drop by a third. Its quiet comments were right more often than they looked.

7:07

Every scorecard in this video already counts these four.

7:11Back to Valentina

7:12

So, buy or build? On these thirty bugs, the agent and the single prompt found about as many. The harness changed which ones, and how noisy the review is.

7:23

The agent sees past the diff, at twice the cost. PR-Agent is quieter, and misses more.

7:29

And here’s a cheap trick: run a reviewer three times, and pool the comments. The single prompt and the agent both reach twenty-eight of thirty. At three times the cost and the reading.

7:40

What this can’t tell me: small differences, with only thirty bugs. Or how another model would rank them.

7:47

Next: what if the reviewer had to prove each finding itself, before anyone reads it?

7:53Summary

7:54

Same model, different harness: it decides what the reviewer can see.Valentina: Thanks for watching!

Key takeaways

  • ✓Keep the model fixed and change only the harness: what the reviewer is shown, what it can look up, and how it's asked. That answers the team's real question, buy a review tool or call the model ourselves, which a vendor comparison can't, because vendors change the model too.
  • ✓A reviewer is a classifier. Recall is the share of planted bugs it finds; precision is the share of its bug comments that are right. In run 1: single prompt 22/30 and 69%, agent 24/30 and 71%, PR-Agent 19/30 and 82%. PR-Agent is a less sensitive smoke alarm: fewer comments that point at nothing, more missed fires.
  • ✓The agent costs 0.97¢ a review against 0.49¢, and takes 10 s against 3 s (medians). Each step resends the conversation, but cached input is billed at a tenth of the price, so it's 2× and not 5×. All three write about the same number of bug comments: 0.8–0.9 per PR.
  • ✓Compare reviewers paired, on the same bugs, averaged over runs. Agent minus single prompt: +2 points, 95% interval −8 to +13. Zero is inside, so on 30 bugs the two can't be told apart. PR-Agent minus single: −14 (−29 to −1), just excluding zero.
  • ✓Same recall isn't the same bugs. The agent and the single prompt each found 2 bugs the other never found in any run. The agent found a contract bug in the PR that adds default values to field mappings (n33-d1): the API saves `default`, the worker reads `defaultValue`. It found it in 3 of 3 runs by opening a file the PR doesn't touch; the other two never did.
  • ✓'Unmatched' isn't 'wrong'. Of 50 comments that matched nothing in the answer key, AI labellers called 13 real, 24 debatable, 12 wrong and 1 a planted bug cited too far away. Four issues were proven with a test that fails on the PR and passes with a fix, and joined the key. PR-Agent's noise fell from 0.23 to 0.15 per PR.
  • ✓One run is one draw. Pooling three runs lifts the single prompt and the agent from 22 and 24 to 28 of 30, at three times the cost and the reading. PR-Agent only reaches 21: its misses are consistent, and re-rolling doesn't fix a blind spot.

Should a team buy an AI code review tool or call a model itself? This chapter answers with one model in three harnesses. A harness is everything around the model: what it's shown, what it can look up, and how it's asked. Think of one chef in three kitchens: same skill, different tools and recipes. Each harness reviewed the same 40 pull requests three times, and the lab scored them the way you'd score any classifier.

The source is Lab 03 of the code review labs ("The AI Reviewer Is a Classifier"), scripts 01_run_reviewers.py (cost, and what the agent reads), 03_scorecard.py (recall, precision, paired comparisons) and 04_unmatched.py (are the false alarms false?), recorded in October 2026. It is part 4 of the "Hands-on AI code review" video series. No person reviewed anything here: the three reviewers are AI, the judge that matches comments to bugs is AI, and the labels on unmatched comments are by AI subagents. The pull requests come from the testbed of Chapters 1 and 2: a made-up app with planted bugs and an answer key. The 40 PRs are the sample from Chapter 3, where a stand-in reviewer (an LLM given a reviewer's brief) was scored on them.

How the PRs are named. Each pull request has an id like n33-d1. The first part is the change: n33 is one feature, adding default values to field mappings. (c changes come from the app's own history, n changes were written for the test set.) The second part is the version: n33-clean is the correct PR, and n33-d1, n33-d2 are copies of it with one planted bug each.

Same model, three harnesses

All three reviewers run gpt-5.4-mini at low reasoning effort. Only the harness changes.

Reviewer What it sees How it works
Single prompt the brief and the line-numbered diff one call: Chapter 3's standard stand-in
Agent the same, plus the whole repo at the PR's head up to 20 tool calls (search, read a file, list a folder), then it submits a review
PR-Agent PR-Agent's own prompt and view of the diff the open-source PR-Agent 0.49.0 /review, run locally

The 40 PRs hold 30 planted bugs, one each, and 10 are clean. Every reviewer ran three times, so 120 reviews each. The single prompt's runs are copied from Chapter 3's lab; the agent and PR-Agent cost $1.64 together, and the judge $0.17.

What a review costs

Reviewer Per review Median seconds Bug comments per PR Reviews with no bug comment
Single prompt 0.49¢ 3 0.9 25%
Agent 0.97¢ 10 0.9 21%
PR-Agent 0.40¢ 5 0.8 36%

The agent costs twice as much and takes about three times as long. Each step sends the whole conversation again, but text the provider has already seen (cached input) is billed at a tenth of the price: $0.075 per million tokens instead of $0.75. That's why it's 2× and not 5×. All three write about the same number of comments: fewer than one bug comment per PR.

Does the agent use its tools? Median 5 tool calls per review. 14 of 120 reviews (12%) made none. 76 of 120 (63%) read a file the PR doesn't change, and 12 hit the 20-call limit. Searches (302) and file reads (298) were about even; it listed a folder only 9 times.

Recall and precision

A reviewer's bug comment is a prediction: "there's a problem here". So a reviewer is a classifier, with the same two numbers:

  • Recall: the share of the 30 planted bugs it found. A comment finds a bug if it sits on the bug's lines (same file, within 3 lines, checked by code) and an AI judge confirms it describes the same problem, as in Chapter 3.
  • Precision: of its bug comments, the share that were right: they match a planted bug or a known issue.
  • Noise per PR: bug comments per PR that match nothing. That's what the author of a pull request feels: comments that point at nothing.
Try it · Same model, three harnessesLab 03 · 40 PRs (30 planted bugs, 10 clean) · 3 runs each
Single prompt22/30 · 73% (56–86%)

Sees the brief and the line-numbered diff, in one call.

Agent24/30 · 80% (63–90%)

Sees the same, plus tools to search and read the whole repo (up to 20 calls).

PR-Agent19/30 · 63% (46–78%)

Sees PR-Agent 0.49.0's own prompt and view of the diff, one call.

Share of the 30 planted bugs found in the first run, with a 95% interval. On 30 bugs, one run's interval is about ±17 points wide.

Highlighted: the best value (higher is better). Precision and noise count the 4 issues proven in this lab as known issues. All three wrote about the same number of bug comments: 0.9, 0.9 and 0.8 per PR.

Reviewer Recall, run 1 (95% interval) Runs 1 / 2 / 3 Precision, run 1 Noise per PR Clean PRs flagged (of 10)
Single prompt 22/30, 73% (56–86%) 22 / 23 / 24 24/35 (69%) 0.28 4
Agent 24/30, 80% (63–90%) 24 / 22 / 25 27/38 (71%) 0.28 3
PR-Agent 19/30, 63% (46–78%) 19 / 18 / 19 27/33 (82%) 0.15 3

PR-Agent has the best precision and half the noise, and the lowest recall. Its prompt tells it to be certain before flagging lower-severity concerns, and not to flag stylistic preferences. That fits what we see: it stays silent on more PRs (36%), is right more often when it speaks, and finds only 1 of the 4 broken conventions (the other two find all 4). Remember the smoke alarm from Chapter 3: PR-Agent is set less sensitive, so fewer comments that point at nothing and more missed fires. It isn't fewer false alarms on clean code, though: it flagged 3 of the 10 clean PRs, the same as the agent.

Is the agent better?

In run 1, the agent found two more bugs than the single prompt, at twice the price. That's one draw. To compare fairly, the lab gives each reviewer a score per bug, the share of its three runs that found it (0, ⅓, ⅔ or 1), and compares the two reviewers paired, bug by bug. A paired bootstrap then redraws the 30 bugs at random, with replacement, 2,000 times, to see how much the difference moves.

Comparison (mean of 3 runs) Difference 95% interval Found only by the first Found only by the second
Agent − single prompt +2 points −8 to +13 2 2
PR-Agent − single prompt −14 points −29 to −1 1 8

Averaged over three runs, the agent is 2 points ahead: less than one bug. Zero is inside the interval, so on 30 bugs, the two can't be told apart. That doesn't show they're equal; it shows this sample is too small to see a gap that size. PR-Agent is 14 points behind, an interval that only just excludes zero.

Yet they don't find the same bugs: each finds two the other never found, in any run. Explore it bug by bug:

Try it · Bug by bug: who found what?Lab 03 · 03_scorecard.py · 30 planted bugs × 3 runs
Compare the single prompt with
Agent − single
+2 pts
Found only by the single prompt
2
Found only by Agent
2

Difference in mean recall over 3 runs (single 77%, agent 79%), paired on the same bugs. 95% interval from 2,000 resamples of the 30 bugs: -8 to +13 points. Zero is inside: on 30 bugs, the two can't be told apart. “Found only by” means in at least one run, and never by the other in any run.

Planted bug (PR)TypeSingle promptAgentPR-Agent
n36-d2 Let each destination set how many times to retryreliability
c18-d2 Filter syncRuns by statuslogic
n17-d2 Add --sync to run-oncesecurity
n22-d1 Show the exact time of the last run on hoverui
n05-d2 Paginate the syncs querysecurity
n27-d2 Pick the destination in the sync form, grouped by kindai-shaped
c16-d2 Don't send email subscribers without an addressperformance
n32-d4 Count rows skipped for a missing key separately from failurestests
worker-release-d2 Worker release: delivery, scheduling, signing and safety fixeslogic
n31-d3 Let teams pause a sync with a reasonconvention
c38-d2 Send the partner's token header on webhook requestssecurity
n26-d2 Ask before deleting a syncconvention
c20-d2 Add a per-sync batch sizetests
n33-d1 Add default values to field mappingscontract
n29-d3 Add a sync detail page with recent-run statsui
n02-d2 Add deleteDestination, refused while syncs use itperformance
n09-d2 Add updateSync for editing name, mode, mappings and scheduleai-shaped
c02-d1 Return NOT_FOUND when deleting a sync that doesn't existai-shaped
c28-d1 Split run_pending into claim_next_run and execute_runreliability
n24-d2 Filter the sync list by name or source tablesecurity
n30-d2 Colour status badges by outcomeconvention
n34-d2 Give webhook destinations their own URLcontract
n19-d3 Skip records that haven't changed since the last runperformance
n10-d2 Show how many syncs use each destination, and allow renaminglogic
n16-d1 Log one JSON line per finished runcontract
n28-d3 Make the sync form usable with a screen readerconvention
n23-d2 Add a run history tableui
c35-d3 Fail runs that crash instead of leaving them RUNNINGsecurity
n25-d2 Clearer schedule errors in the sync formui
c27-d3 Inject the transport into destination clientsreliability

Each dot is one run: filled means that run found the planted bug. Shaded rows: one of the two found it and the other never did. Every bug was found by some reviewer in some run; 19 of 30 were found by all three.

The other side of the diff

One of the agent's two is the field-mapping PR, n33-d1, "Add default values to field mappings": when a column is empty, send this value instead. Its planted bug is a mismatch between the API and the worker. The agent found it in 3 of 3 runs. The single prompt and PR-Agent: 0 of 3.

The API saves each mapping's default under the key default. The worker loads the saved mappings with FieldMapping.model_validate(...), and a rule near the top of its model file says names in saved data are camel case, so it looks for defaultValue. It never sees the default, and the fallback silently never applies. Neither worker line is in the diff.

Try it · Follow the agentLab 03 · n33-d1 "Add default values to field mappings" · agent, run 1

Single prompt

0 of 3 runs

Agent

3 of 3 runs

PR-Agent

0 of 3 runs

    The pull request adds a default value to field mappings: when a column is empty, send this value instead. The agent has the diff plus tools to search and read the whole repo. Step through what it did.

    That's a contract bug: two parts of a system disagree about a name. A reviewer that reads only the diff can't see the other side of the agreement. Every one of the agent's runs on this PR opened worker/harbor_worker/models.py; in run 1 it took 7 steps to get there. The sample has 3 contract bugs. In at least one of three runs, the agent found all 3, the single prompt 2, and PR-Agent 1.

    Are the false alarms false?

    A comment that matches nothing in the answer key might be a bug nobody planted. The lab sampled 50 unmatched bug comments from all three runs (17 single prompt, 17 agent, 16 PR-Agent), and AI subagents read each one against the code:

    Label Count Example
    Real 13 run-once --dry-run --sync syn_a previews every sync, not just syn_a
    Debatable 24 Retry-After in HTTP-date form, where the class documents seconds
    Wrong 12 a race between check and delete, in an API that's synchronous and single-threaded
    Planted 1 the planted duration_seconds bug, cited on its docstring 10 lines away

    About 1 in 4 (26%, interval 16–40%) looked real, at about the same rate for every reviewer. But "looks real" is still an opinion, so the lab asked for proof. A proof is a test that fails on the PR and passes once a fix is applied. Passing with the fix is what shows the test fails because of this bug, not a typo or a missing fixture.

    The 13 real-looking comments came down to 5 distinct problems. Four were proven, each on the three variant PRs of one change (12 of 12):

    Issue PRs What the test shows
    f1 n17, add --sync to run-once (3 variants) run-once --sync skips a named sync that isn't due, though re-running a sync now is what the flag is for
    f2 n17, the same change (3) --dry-run ignores --sync: a dry run of syn_a also prints syn_b
    f3 n34, give webhook destinations their own URL (3) the private-host check lets https://[::ffff:127.0.0.1]/ and https://[::]/ through
    f4 n36, let each destination set how many times to retry (3) the "with retries" badge assumes 100 records per request; an EMAIL run of 120 rows (3 requests, no retry) shows it

    The fifth (the badge counting a failed batch as a retry) isn't proven: the UI doesn't get enough data to tell the two apart, so its fix is a design change, not a line.

    Proven issues join the answer key, so a reviewer that flags them gets credit instead of a mark for noise. Noise per PR in run 1, before and after: single prompt 0.30 → 0.28, agent 0.33 → 0.28, PR-Agent 0.23 → 0.15, down by a third. Its quiet comments were right more often than they looked. Every scorecard above already counts these four. False alarms on the clean PRs don't change, because all four issues sit in changes whose sample PR is a buggy variant.

    Pool the runs

    The same reviewer on the same PR finds different things each run. The single prompt found 18 bugs in all 3 runs and 10 in only 1 or 2; those are coin flips. Read all three runs' comments together (the union) and the single prompt and the agent both reach 28 of 30 (93%, 79–98%). That costs three times the money (still under 3¢ a PR) and three times the reading. PR-Agent's union only reaches 21 (70%): it never found 9 bugs in any run. Re-rolling finds coin flips, not blind spots.

    Also in the lab

    From the lab's README (its own run, October 2026), beyond the video:

    • The judge was checked by verdict. It said "different problem" to only 15 of 232 candidate comments on a bug's lines, so a random 100 would hold about 6. The check labelled all 15 "different" and 85 "same": 100 of 100 agreed. About 1 in 15 comments on a bug's lines is about something else, for every reviewer, so line overlap alone over-counts. The labels are from AI subagents blind to the verdicts, not people.
    • The 3-line window decides little here. Widening it to 8 lines added 0–1 candidates per reviewer, and the judge rejected them all: these reviewers cite the line they mean. The one planted find the matcher missed was 10 lines away.
    • Per type, 19 of 30 bugs were found by all three reviewers, and none was missed by all. Those 19 are the candidates for Chapter 6: if a type check or a contract test finds them for free, no reviewer should spend attention on them.
    • Cost per PR depends on what you average. Over all 120 reviews, 0.49¢ / 0.97¢ / 0.40¢ (the numbers in this chapter and the video). The scorecard's run 1 alone averages 0.54¢ / 1.20¢ / 0.60¢, and the agent's run-1 median is 11 s.
    • Structured output cut comments short on one PR: 4 of 325 comments ended where the model meant to quote "batch_size". Valid JSON, broken comment.

    What to do

    • Fix the model, change the harness, when you choose between a review tool and your own prompt. Then change one thing at a time.
    • Report recall and precision together, with noise per PR and cost. A higher recall bought with twice the comments costs every author reading time.
    • Compare reviewers paired on the same bugs, averaged over runs, with an interval. Overlapping intervals from separate runs aren't the test.
    • Look at which bugs each reviewer finds, not only how many. Two reviewers with the same recall that find different bugs are worth combining.
    • Give a reviewer the repo when bugs live between files. Contract bugs need the other side of the agreement.
    • Read the unmatched comments. Prove the real ones with a test that fails on the PR and passes with the fix, and add them to the answer key.

    Caveats

    • 30 bugs is small. One run's recall has an interval about ±17 points wide. Small differences (agent vs single prompt) and per-type rates (2–5 bugs a type) can't be measured here; large and qualitative ones can.
    • No person reviewed. The reviewers, the judge and the labels of unmatched comments are all AI. The judge is the same model as the reviewers; the stratified check is the guard, and it was labelled by AI subagents too.
    • One model, one effort. A stronger model might use tools better, or need them less. How another model would rank the harnesses is open.
    • A sample, not the corpus. The 40 PRs are Chapter 3's sample, which over-weights large PRs. The full testbed has 173 bugs, including 18 contract bugs.
    • Planted bugs are findable by design. They sit in or near the diff; there are no missing-file bugs or design mistakes.
    • "Debatable" is its own number. 24 of 50 unmatched comments were matters of spec or taste. They cost reading time like wrong ones, but a team may want some of them.

    The checklist

    1. Pin the model and effort across every reviewer you compare.
    2. Run each reviewer at least three times on the same PRs with planted bugs, and keep every review.
    3. Match comments by lines and a judge, and check the judge on a sample stratified by its verdict.
    4. Report recall with its interval, precision, noise per PR, false alarms on clean PRs, cost and time.
    5. Compare paired, on the mean of runs per bug, and list the bugs found by only one reviewer.
    6. Label a sample of unmatched comments, prove the real ones with fail-then-pass tests, and add them to the answer key before re-scoring.

    Practice: score a reviewer like a classifier

    Count recall per run and pooled, find the bugs only one reviewer found, run the paired bootstrap, compute precision, and decide when a test proves a bug. The tests use the lab's recorded runs on the 30 planted bugs and expect its numbers: 22/23/24, 24/22/25 and 19/18/19 per run; 28, 28 and 21 pooled; +2 (−8 to +13) and −14 (−29 to −1) paired.

    Try it · Practice in PythonRuns in your browser · ⌘/Ctrl + Enter to run
    harness_practice.py62 lines

    Quiz

    Try it · Check your understanding0 of 6 answered
    1. 1.Why do all three reviewers in the lab run on the same model at the same effort?

    2. 2.PR-Agent has the best precision (82%) and the lowest recall (19 of 30 in run 1). What does that mean?

    3. 3.Averaged over three runs, the agent's recall is 2 points above the single prompt's, with a 95% interval of −8 to +13. What can you conclude?

    4. 4.A PR adds default values to field mappings, with a planted contract bug (n33-d1). Why did the agent find it when the single prompt and PR-Agent never did?

    5. 5.A reviewer's comment matches nothing in the answer key. Is it wrong?

    6. 6.A proof test fails on the pull request. Why must it also pass once a fix is applied?

    Check your understanding

    Try each question before opening its answer.

    What is a harness, and why keep the model fixed when comparing them?

    Everything around the model: what it's shown, what it can look up, and how it's asked. With gpt-5.4-mini at low effort for all three reviewers, differences in recall, precision and cost come from the harness alone. That's the choice a team faces when it picks a review tool or builds its own; a vendor comparison changes the model too.

    The agent's recall is +2 points over a single prompt (−8 to +13) at twice the cost. Is reading the repo worth it?

    Not for recall on average, on these 30 bugs: the interval includes zero. But it finds different bugs. The contract bug in the field-mapping PR (n33-d1) can't be seen in the diff, and the agent found it in all 3 runs by reading the worker's models; the single prompt never did. Reading the repo pays for bugs that live between files. At 0.97¢ against 0.49¢, both are close to free next to a person's minute; latency (10 s vs 3 s) matters more if the review blocks a merge.

    PR-Agent has the best precision and the lowest recall. Which reviewer would you put in front of your team?

    It depends on what the team will tolerate, which is why you measure both. PR-Agent writes about half the noise (0.15 vs 0.28 per PR) and 82% of its bug comments are right, but it finds 14 points fewer bugs (−29 to −1) and 1 of 4 broken conventions. A team that ignores bots may prefer its precision; a team that relies on the bot to catch things needs recall.

    Why report the union of three runs, and what does it cost?

    One run is one draw, and many bugs are coin flips. Reading all three runs lifts the single prompt and the agent from about 77% to 93% (28 of 30). It costs three times the money and three times the comments to read. PR-Agent's union reaches only 21 of 30, because it never finds 9 bugs: re-rolling doesn't fix a blind spot.

    A quarter of unmatched comments looked like real bugs. What does that do to noise and precision?

    It makes them partly a measurement of the answer key: an unmatched comment only means the key didn't know about it. Of 50 sampled, 13 looked real, 24 debatable, 12 wrong and 1 was a planted bug cited 10 lines away. After 4 issues were proven and added to the key, PR-Agent's noise fell from 0.23 to 0.15 per PR. Each proven issue makes every later score more honest.

    Why must a proof test also pass once the fix is applied?

    A test can fail for the wrong reason: a typo, a missing fixture, or another bug on the same lines. Failing on the PR and passing after one targeted fix shows it catches this bug. On the PR that gives webhook destinations their own URL, with its planted bug (n34-d1), the first test of the private-host check still failed with the fix, because that planted bug also let 169.254/16 through; that case was dropped, and the rest still proved the bypass on all three variants.

    A vendor says their AI reviewer has 90% recall. What do you ask?

    Recall of what, on whose code, matched how, and at what precision? Ask for the bug types and counts, the interval, how a comment counted as a find (line overlap alone over-counts by about 1 in 15 here), how many comments per PR it writes and how many are right, and whether it's one run or the best of several. Better: run it on your own PRs with known bugs, paired against your current reviewer.

    Next up: Chapter 5 asks what happens if the reviewer has to prove each finding itself, before anyone reads it: prove it or drop it.

    Learning something useful?

    New labs, articles, and videos on evaluating and testing AI systems come out regularly. Follow along so you don't miss the next one.