From 5d9fb2f42a0c16dac62df7e120056faab880cc04 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Wed, 2 Dec 2026 11:49:23 -0800 Subject: [PATCH] Name the Held Title in the Merge Refusals and Scope Its Bind Word The status docstring dropped "inside it", so a first or last bind word read as held when the check passes it. The merge section of scripts/README.md listed each refusal except the held title that merge refuses as TITLE_NOT_CONVENTIONAL. Found by the local review of the develop to main promotion that carries the title gate. Co-Authored-By: Claude Opus 5.5 --- scripts/README.md | 2 +- scripts/pr_review.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index 3cfaff69d..c0702bf47 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -304,7 +304,7 @@ uv run --no-project --script scripts/pr_review.py merge 123 --repo ptr727/Projec Claude Code's auto-mode classifier refuses a hand-typed `gh pr merge --squash` on a pull request whose gate is met. It refuses most often inside a subagent, which sees neither the review nor the maintainer's go-ahead. A command matching the allow rule is settled before that classifier runs, so every check the merge needs lives here. Whether the merge is authorized stays with the skill that runs it. What the code checks is the Merge Gate's mechanically readable items, and that the merge is current, in the owner, and into `develop` only. The items no code reads, such as a finding the pull request's body lists, stay the driver's per `pr-review-conduct`'s Merge Gate. -Before any read it runs the write-scope check `cleanup` runs, so a `--cleanup` after a landed merge in a registered repository cannot refuse on scope. It reads the pull request live and refuses unless it is open, not a draft, based on `develop`, and headed in its own repository. A `main` base is refused by name, since a promotion merge belongs to `merge-and-release` with the maintainer's go-ahead. A permanent head branch, `develop`, `main`, or the default branch, is refused, and those are the only branches the fleet's rulesets cover. So a `main -> develop` pull request is never squashed into `develop`. It records the head, then reads the gate through `wait`'s own decision, so the two cannot drift apart. That read runs on a short bound and sends no review request, since `wait` is the step that waits and requests. A gate not met prints `wait`'s status line and returns its code unchanged. A `wait` exit of `0` does not decide every item, so a fresh read follows. It refuses unless coverage reads `full`, `table`, `carried:table`, or `local`, and no thread is unresolved, every page walked. Each count the digest builds of a finding no thread carries has to read zero. Otherwise every item under it carries an acknowledgment `comment --ack` posted. Those are `suppressed`, `previously_missed`, `cr_outside_diff`, `qodo_open`, and `FINDINGS WITH NO THREAD`. The code reads the fields the digest builds rather than its printed line. A count field the digest did not build refuses as `COUNT_UNREAD` rather than reading as zero. So does one holding no number, such as an `overview` count of `?`. A count built as no value reads zero only where its source is absent. That is a `previously_missed`, `cr_outside_diff`, or `qodo_open` with nothing to count, or an `overview` where no round covers the head. A `shapes=HELD` refuses as `UNPLACED_PARTS_UNACKNOWLEDGED` until its acknowledgment posts. A head round with no overview marker still refuses after it, as `COUNT_UNREAD` on `overview`, since item 3 reads no count there. A part under `REVIEWER OUTPUT NOTED` refuses as `OUTPUT_NOTED` until an acknowledgment answers its key, or its round's own head hold was acknowledged. A Copilot review request still pending refuses as `REVIEW_PENDING`. A request to a human or team reviewer is the driver's per `pr-review-conduct`. The fresh read refuses a hosted reviewer's check on the head that has neither passed nor failed as `CHECKS_PENDING`, whatever the merge state. A reviewer whose newest output is a rate limit posted since the check began is exempt. It also refuses an open registration grace as `CHECKS_PENDING`, on a line of its own naming when the grace ends. So a head no local pass covers cannot land inside the grace with no hosted reviewer's check on it. A `--checkout` that is not the primary clone of the target is refused before any merge. `cleanup`'s worktree and tip checks still run after it, so they can refuse once the merge has landed. The merge state has to read `CLEAN`, `UNSTABLE`, or `HAS_HOOKS`, the states `wait` treats as finished. Each unmet item prints its own `status=` line. Some of those counts span every round, such as `suppressed`, so an answer the acknowledgment does not name leaves the count standing. `FINDINGS WITH NO THREAD` reads the head's round alone, so an earlier round's no-thread finding stays the driver's. The head is read again after the gate, and a head that moved refuses as `HEAD_MOVED` before any unmet item prints. A merge `gh` refused on a head that moved prints `HEAD_MOVED` too. The merge runs as `gh pr merge "" --squash --match-head-commit ""`, never with `--admin`, `--auto`, or `--delete-branch`. Its output is printed whole. Reading the pull request back decides the outcome. A pull request read back merged at a head other than the gated one prints `status=PEER_MERGED` at exit `1`. This run merged nothing, so it runs no cleanup itself. A merge `gh` refused that reads back open is a refusal. A pull request that reads back closed is one too, whatever `gh` answered, since a closed pull request cannot merge later. A call that timed out or never ran, or a read back that stays ambiguous, may still have landed on the server. `--cleanup` runs `cleanup` on the same pull request once the merge is confirmed, with `--checkout` passed through to it, and its exit is the command's. +Before any read it runs the write-scope check `cleanup` runs, so a `--cleanup` after a landed merge in a registered repository cannot refuse on scope. It reads the pull request live and refuses unless it is open, not a draft, based on `develop`, and headed in its own repository. A `main` base is refused by name, since a promotion merge belongs to `merge-and-release` with the maintainer's go-ahead. A permanent head branch, `develop`, `main`, or the default branch, is refused, and those are the only branches the fleet's rulesets cover. So a `main -> develop` pull request is never squashed into `develop`. It records the head, then reads the gate through `wait`'s own decision, so the two cannot drift apart. That read runs on a short bound and sends no review request, since `wait` is the step that waits and requests. A gate not met prints `wait`'s status line and returns its code unchanged. A `wait` exit of `0` does not decide every item, so a fresh read follows. It refuses unless coverage reads `full`, `table`, `carried:table`, or `local`, and no thread is unresolved, every page walked. Each count the digest builds of a finding no thread carries has to read zero. Otherwise every item under it carries an acknowledgment `comment --ack` posted. Those are `suppressed`, `previously_missed`, `cr_outside_diff`, `qodo_open`, and `FINDINGS WITH NO THREAD`. The code reads the fields the digest builds rather than its printed line. A count field the digest did not build refuses as `COUNT_UNREAD` rather than reading as zero. So does one holding no number, such as an `overview` count of `?`. A count built as no value reads zero only where its source is absent. That is a `previously_missed`, `cr_outside_diff`, or `qodo_open` with nothing to count, or an `overview` where no round covers the head. A `shapes=HELD` refuses as `UNPLACED_PARTS_UNACKNOWLEDGED` until its acknowledgment posts. A head round with no overview marker still refuses after it, as `COUNT_UNREAD` on `overview`, since item 3 reads no count there. A part under `REVIEWER OUTPUT NOTED` refuses as `OUTPUT_NOTED` until an acknowledgment answers its key, or its round's own head hold was acknowledged. A held title refuses as `TITLE_NOT_CONVENTIONAL` on any head. A Copilot review request still pending refuses as `REVIEW_PENDING`. A request to a human or team reviewer is the driver's per `pr-review-conduct`. The fresh read refuses a hosted reviewer's check on the head that has neither passed nor failed as `CHECKS_PENDING`, whatever the merge state. A reviewer whose newest output is a rate limit posted since the check began is exempt. It also refuses an open registration grace as `CHECKS_PENDING`, on a line of its own naming when the grace ends. So a head no local pass covers cannot land inside the grace with no hosted reviewer's check on it. A `--checkout` that is not the primary clone of the target is refused before any merge. `cleanup`'s worktree and tip checks still run after it, so they can refuse once the merge has landed. The merge state has to read `CLEAN`, `UNSTABLE`, or `HAS_HOOKS`, the states `wait` treats as finished. Each unmet item prints its own `status=` line. Some of those counts span every round, such as `suppressed`, so an answer the acknowledgment does not name leaves the count standing. `FINDINGS WITH NO THREAD` reads the head's round alone, so an earlier round's no-thread finding stays the driver's. The head is read again after the gate, and a head that moved refuses as `HEAD_MOVED` before any unmet item prints. A merge `gh` refused on a head that moved prints `HEAD_MOVED` too. The merge runs as `gh pr merge "" --squash --match-head-commit ""`, never with `--admin`, `--auto`, or `--delete-branch`. Its output is printed whole. Reading the pull request back decides the outcome. A pull request read back merged at a head other than the gated one prints `status=PEER_MERGED` at exit `1`. This run merged nothing, so it runs no cleanup itself. A merge `gh` refused that reads back open is a refusal. A pull request that reads back closed is one too, whatever `gh` answered, since a closed pull request cannot merge later. A call that timed out or never ran, or a read back that stays ambiguous, may still have landed on the server. `--cleanup` runs `cleanup` on the same pull request once the merge is confirmed, with `--checkout` passed through to it, and its exit is the command's. With `--cleanup`, a `status=MERGED` line means the merge landed, and the exit is then `cleanup`'s own. Otherwise exit `0` is merged and confirmed. Exit `1` is a run that merged nothing. That is a refusal, a moved head, an unmet item, a registry refusal, or a merge `gh` refused. It is also a pull request another hand already merged, which still owes cleanup. Exit `2` is a read that did not answer or a usage error. It is also a merge call the read back could not settle, which may have happened on the server. Exit `64` is the owner check. Any other code is the gate's, from the `pr_review.py` exit codes above, and nothing was merged. diff --git a/scripts/pr_review.py b/scripts/pr_review.py index 2799d0207..44dc67799 100755 --- a/scripts/pr_review.py +++ b/scripts/pr_review.py @@ -79,8 +79,9 @@ excerpt under `UNPLACED ON THE HEAD`. A trusted comment acknowledging its fingerprint clears it, `shapes=ACKNOWLEDGED`. 50 is also a held title, `title=HELD` with each fix under `TITLE NOT CONVENTIONAL`. It is over 72 characters, ends in a period, or - holds a capitalized bind word. It exits 50 where a Copilot round covers the head and its - coverage does not read partial. A retitle clears it, and `merge` refuses it on any head. + holds a capitalized bind word inside it. It exits 50 where a Copilot round covers the + head and its coverage does not read partial. A retitle clears it, and `merge` refuses + it on any head. Dependabot's reads `title=exempt`. `coverage=` names how the head's diff is shown read: `full` or `PARTIAL` as the round states it, `UNKNOWN` for a statement this cannot believe or a body the reader failed