Context
pnpm pr:merge counted an AI-REVIEW verdict only for the exact head SHA, and the main ruleset requires a branch
to be up to date. So every merge to main forced each other open pull request to update its branch, which made a new
head SHA and voided its review, though the reviewed change was the same. The owner chose (2026-10-22, RW1 and RW2) to
build the merge queue of 0166 CI3 and to bind the
verdict to the change rather than the commit.
Decision
- A reviewer verdict for an earlier head SHA counts for the current head when the
git patch-id --verbatimof that SHA’s diff against its merge base with the base branch equals the current head’s. Any change to the diff, whitespace and context lines included, voids it; only a shift in line numbers keeps it.--stableis not used: it ignores whitespace, so it would carry a verdict onto a re-indented YAML key. The base ref must still match, and every identity rule of 0230 still applies. - A FAIL carries over the same way: a FAIL for an earlier head with the same patch id is sticky for the current head, whether it names the full SHA, a short SHA of 7 or more hex, or has text after the SHA.
- The reviewer writes
AI-REVIEW: PASS <full head sha> base=<base ref> patch=<patch id>.pr:mergerecomputes the patch id from the SHA; thepatch=value of an unedited verdict is used only when that commit can no longer be read, and a recomputed id always wins over it. Verdicts withoutpatch=keep counting. When the head’s patch id cannot be computed, nothing carries over and the PR needs a fresh review. - Where the repository has a merge queue on the base branch,
pr:mergeenqueues instead of merging; the queue runs theQuality Gateon the group commit before anything lands. Themerge_queuerule is applied only after STA-302 (a 30-second connect timeout and retries in the bot’s network layer) lands; untilbot-token.mjsdeclares that support,pr:mergerefuses to enqueue.
Consequences
- A clean rebase or update-branch keeps the review; only a real change to the diff needs a new one.
- A change in
mainnext to the pull request’s lines changes the patch id and asks for a new review. That is the conservative side. - The merge queue, not an up-to-date branch, proves the change against the newest
main.
Enforcement
tools/scripts/pr-merge.mjs (patchId, samePatchShas, aiReview; tests in
tools/scripts/__tests__/pr-merge.test.mjs); .agents/agents/code-reviewer.md (the patch= field);
.github/workflows/ci.yml (merge_group); .github/rulesets/main.json (the merge_queue rule, applied by the owner after STA-302); enqueueReady in
pr-merge.mjs refuses to enqueue before STA-302.
Supersedes and sources
Supersedes: none. Amends 0230 and 0119. Linear STA-233 and STA-234.