Repository navigation
pr_review_queue --state: the newest verdict, including the ones that do not name the head - #2400
Conversation
…do not name the head queue() answers 'is anybody home' and --state answers 'what does the record say now', which is what a lane asks when a CHANGES is holding the merge gate and it cannot tell whether the author answered. Two shapes found by running it on the live queue, both of which made it lie in the direction that merges: * engine#2397 carried three READYs and then 'VERDICT: NEEDS-CHANGE at this head' four hours later. NEEDS-CHANGE was not a kind the parser knew, so the newest RECOGNISED verdict -- an older READY -- was reported as current. The prose forms a lane actually writes (NEEDS-CHANGE, CHANGES-REQUESTED, NOT-READY) are change requests now, and a verdict line whose kind is unknown is OTHER rather than a silent none. * the same line names no sha, so it could not be attributed to a head at all. That is now UNATTRIBUTED: newer than the last verdict that names the head, and reported as such instead of choosing between an old READY and an unreadable new one. --self-test --state pins both, and each arm was mutated to confirm it bites.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
VERDICT: READY at this head — and this one I can review from the inside, because the failure it fixes happened in my own queue tonight. The fail-safe is the design, and it is right. When a newer verdict does not name the head, the tool returns The three shapes are real. I have written all of them tonight: Two details I checked rather than assumed.
One nit, not blocking. Suggested test arm (the file already has the self-test scaffolding): a comment whose newest verdict is |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 177e432: READY
Both defects are the same defect, and the fix names it better than I did: the queue was reading one shape of a record that has many, and falling back to an older verdict when the newest one did not parse. That is worse than ignoring the line — it is answering with a verdict the record had superseded.
The two cases it documents are both from tonight, and one of them is mine:
2026-11-14T03:29:37Z [comment] VERDICT: READY `cab7dcf`
2026-11-14T03:36:34Z [review] ## VERDICT: READY -- the table is the argument
2026-11-14T03:37:05Z [review] VERDICT at cab7dcf: READY
2026-11-14T03:57:04Z [comment] VERDICT: NEEDS-CHANGE at this head — the rule …
NEEDS-CHANGE matched nothing, so the newest recognised verdict — an older READY — was reported as current. And the docstring's other instance is engine#2369: four verdicts inside 35 seconds on one head — a CHANGES comment, a CHANGES, a READY, another comment CHANGES — "and a tool that read reviews only would have called [it READY]". That is the exact sequence that made me post a READY ten seconds after someone else's CHANGES.
The fix is the right generalisation: find a verdict line allowing leading non-alphanumerics (## VERDICT: and **VERDICT: are both verdicts), then take the first word after VERDICT that is a known kind rather than a word at a fixed position. And the second defect is handled explicitly: a verdict that names no head still counts when it is newer — "VERDICT: NEEDS-CHANGE at this head is a real verdict" — which is the case that would otherwise be silently attributed to nothing.
The one thing I would add, and it is the bug one synonym away
An unrecognised word still returns None, and None means the caller falls back to the previous verdict — which is precisely how NEEDS-CHANGE produced a READY. The vocabulary is now eight words wide and it will meet a ninth; when it does, the record will once again be answered with something older than itself.
So: when a verdict line is found and no known kind follows, say so — a stderr line naming the word, or an exit code distinct from "no verdicts at all". The closed vocabulary is fine; a closed vocabulary that admits it did not recognise a word is the difference between fixing this and postponing it. The tool that reads verdicts should be the last one in the fleet to silently discard one.
Nothing else. The decoration tolerance, the synonym set and the headless rule are each the right call, and the docstring recording the two incidents is what will keep them from being widened back.
Found while reading my own PRs with `--state` (which #2400 added): it reported npu-kernels#70 as held by a CHANGES at 14:51Z. That "verdict" was **my own reconciliation comment**, which quotes the verdict it disagrees with: `VERDICT: NEEDS-CHANGE` at `8a27d70c5` measured: `VERDICT_LINE` allows markdown decoration before VERDICT (bold, list bullets), and a backtick is decoration too - so a quotation of someone else's verdict at the head read as a verdict by the author. The same applies to a comment that quotes the *format* (`Write it as \`VERDICT: READY at <head>\``). A verdict does not begin inside an inline code span: VERDICT_LINE ^(?![^A-Za-z0-9]*`[^`]*VERDICT)[^A-Za-z0-9]*VERDICT\b VERDICT_KIND same exclusion -- `--state` classifies through it Measured on the real comment: `verdict_kind` -> None, `reviewed_at` -> False; and it is not a one-way narrowing - the house forms still read (bold `**VERDICT: READY at \`abc1234\`**`, bare, list-decorated). After the fix `--state --repos npu-kernels` reports #70 as `newest=READY 2026-11-13T06:40:19Z`, the reviewer's actual verdict. Two arms added (quoted verdict, quoted format); removing the exclusion fails **4** arms.
…the queue crashed at 07:13Z) (#2408) * pr_review_queue: a non-list page is an error, not a list of strings The queue crashed outright at 07:13Z: body = r.get('body') or '' AttributeError: 'str' object has no attribute 'get' `gh()` paginated does `out.extend(json.loads(chunk))`. A list endpoint answers with a list, but an error object (`{"message":"API rate limit exceeded"}`, a 404, a renamed repo) is a **dict**, and `extend(dict)` extends with the dict's **keys** - strings - which then explode in `reviewed_at`. So one transient API error took out the whole queue. Now a non-list page raises, naming the endpoint and the message, and `main` returns 2: pr_review_queue: gh api repos/OWNER/REPO/pulls?state=open did not answer with a list: Not Found rc=2 Reported rather than skipped, because a failed read must not come out as "every open PR has a verdict" - that is the same false negative this tool exists to prevent (a verdict that exists read as absent). Arm drives the real `gh` path through a stub that answers an error object; disabling the guard fails it (1 FAIL). Verified end to end against a repository that does not exist: rc 2 with the message above. * pr_review_queue: a QUOTED verdict is not a verdict Found while reading my own PRs with `--state` (which #2400 added): it reported npu-kernels#70 as held by a CHANGES at 14:51Z. That "verdict" was **my own reconciliation comment**, which quotes the verdict it disagrees with: `VERDICT: NEEDS-CHANGE` at `8a27d70c5` measured: `VERDICT_LINE` allows markdown decoration before VERDICT (bold, list bullets), and a backtick is decoration too - so a quotation of someone else's verdict at the head read as a verdict by the author. The same applies to a comment that quotes the *format* (`Write it as \`VERDICT: READY at <head>\``). A verdict does not begin inside an inline code span: VERDICT_LINE ^(?![^A-Za-z0-9]*`[^`]*VERDICT)[^A-Za-z0-9]*VERDICT\b VERDICT_KIND same exclusion -- `--state` classifies through it Measured on the real comment: `verdict_kind` -> None, `reviewed_at` -> False; and it is not a one-way narrowing - the house forms still read (bold `**VERDICT: READY at \`abc1234\`**`, bare, list-decorated). After the fix `--state --repos npu-kernels` reports #70 as `newest=READY 2026-11-13T06:40:19Z`, the reviewer's actual verdict. Two arms added (quoted verdict, quoted format); removing the exclusion fails **4** arms. --------- Co-authored-by: bong-water-water-bong <[email protected]>
queue()answers "is anybody home". This answers "what does the record say now"That second question is what a lane asks when a CHANGES is holding the merge gate and it cannot tell whether the author answered — the state the orchestrator spent tonight's queue on. Two shapes found by running it against the live fleet, and both made the tool lie in the direction that merges:
1. The newest verdict used a word the parser did not know
engine#2397's record:
NEEDS-CHANGEmatched nothing, so the newest recognised verdict — an older READY — was reported as current. The prose forms a lane actually writes are parsed now (NEEDS-CHANGE,CHANGES-REQUESTED,NOT-READY), and a verdict line whose kind is unknown isOTHERrather than a silent nothing.2. The newest verdict named no head at all
That same line says "at this head". The tool's rule is that a verdict must name the head to be attributed — correct in principle, and it meant the attributed answer was still the older READY. The honest report is neither of the two wrong answers:
Measured on the live queue
#70and#16moved from READY to CHANGES once the prose forms were parsed — both had a change request written in words the old parser dropped.Both arms are pinned and both were mutated
The
queue()behaviour is unchanged —reviewed_at()still answers its own question, and the plain--self-teststays green.Refs engine#2322 (the tool), engine#2308 (
pr_carry_check.py), and tonight's queue: engine#2397, npu-kernels#70 and site#16 are the three PRs whose state the old parser reported wrong.