Repository navigation
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
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nothing measured whether
pr-reviewerfinds 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 Kwrites a commit status namedpr-revieweronS(exit 5 if the PR's head is no longerS).gate,waitandmergeread that row among the checks. A recorded BLOCKER is red like a failed check. A head with no record is judged byPLX_REVIEW_GATE:observe(the default): stays green, and the verdict line says whatenforcewould refuse. Nothing lands differently until someone turnsenforceon.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-reviewerreads every rule file withgit show <merge-base>:<path>and opens its report withJUDGE 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.pyreplays past squash commits as the reviewer would have met them: a clone with no ref butbaseandheadand no reflog, so nothing leads to the fix.tools/review-eval/cases.jsonholds 21 cases in separatetuneandtestsplits: 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.mdhas 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.
tune, before the checklist (first 3 bugs, 2 controls only)tune, with the checklisttest, before the checklisttest, with the checklistThe checklist was written from the
tunebugs, so 7/7 there is expected and proves only that each item fires on its own case. On the held-outtestsplit it changed nothing: the same recall and the same flagged control. The twotestcatches 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 gaintuneshows andtestdoes 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
reviewedagainst real GitHub. It is tested against the fakeghonly (the session had noghlogin). Not confirmed: that the token may write a commit status, and that the status appears as a row ingh pr checks --json. If it does not, the record needs another carrier;observemeans nothing is blocked meanwhile.make checkwas not run.Gates
python3 tools/test_pr_land.py:Ran 100 tests ... OKpython3 tools/test_review_eval.py:Ran 13 tests ... OKmake check-python-reston the first commit:check: 141 steps — all ok. A second run on the later commits was in progress when this was opened.pr-revieweronorigin/main...36816ee45: 0 BLOCKER, 0 MAJOR, 1 MINOR (the replay kept a reflog naming the source HEAD), fixed in49fca3a88. The head has not been reviewed again since.Generated by Claude Code