Skip to content

Review: a review is recorded on the commit it read, the reviewer is graded against past PRs, and a checklist of bugs it missed - #1445

Merged
GLinnik21 merged 4 commits into
mainfrom
claude/kind-mccarthy-s92zsn
Nov 17, 2026
Merged

GLinnik21 merged 4 commits into
mainfrom
claude/kind-mccarthy-s92zsn

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Nothing measured whether pr-reviewer finds real bugs, a pull request could edit the rules it was judged by, and a review was not tied to the commit it read. This adds the three pieces.

What changes

A review is recorded on the commit it read. tools/pr-land.py reviewed N --sha S --blockers B --majors M --minors K writes a commit status named pr-reviewer on S (exit 5 if the PR's head is no longer S). gate, wait and merge read that row among the checks. A recorded BLOCKER is red like a failed check. A head with no record is judged by PLX_REVIEW_GATE:

  • observe (the default): stays green, and the verdict line says what enforce would refuse. Nothing lands differently until someone turns enforce on.
  • enforce: refuses (exit 3) a head that is otherwise green.
  • off: says nothing. Any other value is refused, not read as off.

The reviewer's rules come from the base. pr-reviewer reads every rule file with git show <merge-base>:<path> and opens its report with JUDGE CHANGED: <paths> when the diff touches a rule file, an agent, a ledger, the landing gate or the eval.

The reviewer is graded. tools/review-eval.py replays past squash commits as the reviewer would have met them: a clone with no ref but base and head and no reflog, so nothing leads to the fix. tools/review-eval/cases.json holds 21 cases in separate tune and test splits: 13 pull requests whose bug a later commit fixed (one-sentence answer key taken from the fix's message) and 8 controls no later commit names. A bug counts only when a finding describes that defect; a BLOCKER or MAJOR on a control counts against the reviewer.

A checklist of bugs that reached main. docs/review-checklist.md has seven items, each a trigger readable from a diff, the check to run when it matches, and the PR it came from. The reviewer runs only the items whose trigger matches.

What the eval measured

One run per case, graded by the session that wrote the cases, not by an independent reader.

bugs caught controls with a BLOCKER/MAJOR
tune, before the checklist (first 3 bugs, 2 controls only) 0/3 1/2
tune, with the checklist 7/7 0/4
test, before the checklist 2/6 1/4
test, with the checklist 2/6 1/4

The checklist was written from the tune bugs, so 7/7 there is expected and proves only that each item fires on its own case. On the held-out test split it changed nothing: the same recall and the same flagged control. The two test catches were also different cases before and after (#484 and #365, then #816 and #365), so single runs are noisy and 6 bugs is too few to resolve a small effect. By the tool's own rule (a gain tune shows and test does not is overfitting), the checklist has not yet earned its place beyond the seven bugs it encodes; it is kept here because each item is a real past defect and it flagged no control.

Not verified

  • reviewed against real GitHub. It is tested against the fake gh only (the session had no gh login). Not confirmed: that the token may write a commit status, and that the status appears as a row in gh pr checks --json. If it does not, the record needs another carrier; observe means nothing is blocked meanwhile.
  • No Rust changed, so the Rust half of make check was not run.

Gates

  • python3 tools/test_pr_land.py: Ran 100 tests ... OK
  • python3 tools/test_review_eval.py: Ran 13 tests ... OK
  • make check-python-rest on the first commit: check: 141 steps — all ok. A second run on the later commits was in progress when this was opened.
  • pr-reviewer on origin/main...36816ee45: 0 BLOCKER, 0 MAJOR, 1 MINOR (the replay kept a reflog naming the source HEAD), fixed in 49fca3a88. The head has not been reviewed again since.

Generated by Claude Code

…is graded against past PRs

pr-land.py gains `reviewed`, which writes a `pr-reviewer` commit status on the head a review read
(refused when the PR's head has moved), and gate/wait/merge read it: a recorded BLOCKER is red, and a
head with no record is judged by PLX_REVIEW_GATE (observe by default: green, and the verdict line says
what enforce would refuse).

pr-reviewer reads its rules from the base, never from the diff under review, and opens its report
with JUDGE CHANGED when the diff touches a rule file, an agent, a ledger or the landing gate.

tools/review-eval.py replays past squash commits as the reviewer would have met them (a clone with no
ref but base and head, so nothing leads to the fix) and scores reports against one-sentence answer
keys: recall on six pull requests whose bugs a later commit fixed, and the flag rate on four controls,
in separate tune and test splits.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6ZnFfPdMkJD7dPTNL8Aiy
…s own squash

Seven more bugs and four more controls. `check` now refuses a case whose commit subject does not end
(#N): a lookup by message had picked the FIX of #1252, whose body names it. The replay task tells the
reviewer to read its prompt from disk, so an edited prompt is the one under test.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6ZnFfPdMkJD7dPTNL8Aiy
…eached main

docs/review-checklist.md lists a trigger readable from a diff, the check to run when it matches and
the pull request the bug came from. pr-reviewer reads it from the base and runs only the items whose
trigger matches. The items come from the eval's tune split; the test split decides whether it stays.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6ZnFfPdMkJD7dPTNL8Aiy
…out's HEAD

`git clone` logs the commit it cloned from, and that commit has every fix behind it; deleting the refs
left the log. The replay now removes it, and the test walks `git log --reflog` as well as `--all`.
Found by pr-reviewer on this branch.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01P6ZnFfPdMkJD7dPTNL8Aiy
@GLinnik21
GLinnik21 merged commit 0f4f242 into main Nov 17, 2026
9 checks passed
@GLinnik21
GLinnik21 deleted the claude/kind-mccarthy-s92zsn branch November 17, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants