Repository navigation
squash with an explicit --subject so the landing subject is the PR title #major - #42
Conversation
There was a problem hiding this comment.
The prose is accurate about tag-release.yml and the squash hazard, but two things need a human.
1. This PR cannot merge as titled. Verified against the live guard: the PR has 2 commits, so the pr_commits = 1 && COMMIT_OR_PR_TITLE exemption in merge-on-approval.yml does not apply. Commit subject docs(contributing): bump tokens go in the PR title now #minor gives subject_rank=1; the title docs(contributing): correct the stale versioning section gives title_rank=0. 1 -gt 0 -> exit 1 before the merge. The guard fires as designed, which is what the PR body says it is exercising — but nothing lands until a human resolves it. Per CLAUDE.md a docs-only change is a patch, so the #minor token is on the wrong commit and arguably should not exist at all: drop it from the commit subject rather than promoting it into the title.
2. The new paragraph overstates the guard — see the inline comment.
Out of scope, noted once and not grounds for this verdict: the file still carries stale v1 text the PR title claims to correct — line 22 (instead of @v1``) and line 98 (After merge, tag if needed and force-move v1`.`), the latter directly contradicting the new line 29 (`nobody runs `git tag -f` by hand`).
The token is deliberately not written verbatim in this subject: under the squash merge this repo now uses, a token on a commit subject is exactly what merge-on-approval.yml refuses, and the convention this commit documents is that it belongs in the PR title instead.
42281b2 to
15d4d06
Compare
|
The review was correct: with 2 commits on this PR, the |
There was a problem hiding this comment.
The new versioning prose is accurate for multi-commit PRs but states the squash rule unconditionally, and the unconditional form is wrong for single-commit PRs on this repo — following it there silently cuts a patch, which is the exact failure the section exists to prevent (detail inline).
Everything else checks out: the v5/v6 tag description matches tag-release.yml, the current-major-only re-point caveat is correct, and the merge-on-approval.yml description matches the guard at .github/workflows/merge-on-approval.yml:240. No bump token in the PR title is right for a docs-only change (patch).
One pre-existing item, not grounds for this verdict and not in the diff: CONTRIBUTING.md:21 still says @v1 and CONTRIBUTING.md:98 still says "force-move v1" after merge, which now contradicts the added "nobody runs git tag -f by hand". Since this PR bills itself as correcting the stale v1/v2 text, worth folding in.
…itle The guard shipped in v5.3.0 only caught a token on a commit subject that a squash would move into the body. It exempted the single-commit case outright, and that exemption hid the mirror-image mistake: under COMMIT_OR_PR_TITLE, a single-commit PR uses THAT COMMIT's subject and discards the PR title, so a token placed only in the title is the one that vanishes. The guard allowed it and CONTRIBUTING.md actively recommended it. Resolve the landing subject first, then compare ranks once. One rule, both directions, no exemption to keep in sync with the docs. Twelve stub cases now cover every combination of merge method, commit count and repo setting, four of them controls that must exit 1. Found by the review agent on PR #42, which read the guard and the prose and noticed they disagreed for a case neither of them had exercised.
There was a problem hiding this comment.
Requesting changes on the version bump, not the logic: the guard change is caller-visible but the PR title carries no token, so this lands as a patch. A caller PR that merged yesterday — single commit, token in the PR title only, which is exactly what v5.3.0 told people to do — is now refused. That is a reaction callers have to make, which CLAUDE.md puts at minor at minimum, and its own tie-break is "unsure → prefer the larger bump". The title also reads as docs-only while the substantive change is in merge-on-approval.yml; since squash makes that title the release subject, it is the only description the tag will carry.
The guard logic itself is sound. landing_subject is always contained in asked_text, so the comparison can only fire in the intended direction, case globs match across the newline join, and the printf join avoids the column-0 block-scalar trap it names. Two inline notes.
Out of diff and not grounds here, but worth folding in while the versioning text is open: README.md:912-914 and 927-929 still tell contributors to put the token in "that commit's subject line" only. That now contradicts the CONTRIBUTING.md and CLAUDE.md text this PR rewrites, and the README is the caller-facing copy most likely to be read first.
…ing it The guard inferred which text would become the squash commit's subject from `squash_merge_commit_title` plus the PR's commit count, then compared against that. The inference was correct but conditional on a per-repo setting nobody audits, and it forced the docs to teach "put the token in both places, because it depends". Pass `--subject "$pr_title"` on the squash instead. The landing subject is then a fact, the single-commit special case disappears, and the guard reduces to one comparison: does the PR title carry the largest bump asked for anywhere. The `gh api` read and the commit-count read go away with it. Merge arguments move into an array so the title, which contains spaces, can be passed; `$del` and `$match` still rely on word splitting and cannot. The error message now names the only remediation that works. Telling someone to put the token on the commit subject was self-defeating: complying meant pushing another commit, whose subject also becomes body text. Editing the PR title needs no new commit, so the approving review survives. Extracted and run against a stubbed gh: 10 cases, 4 of them positive controls, and flipping the comparison turns exactly those 4 red. The stub's catch-all never fired, which is what proves the two dropped API reads are really gone.
README still said to put it on the commit subject, which the squash merge discards; CONTRIBUTING and CLAUDE.md said to put it in both places, which was only true while the landing subject was inferred. All three now state the one rule: PR title when it lands through a PR, commit subject when pushed straight to main. The `squash_merge_commit_title` table is gone from CONTRIBUTING, replaced by a short note on why the subject is passed explicitly — the asymmetry is now a rationale for the flag rather than something a contributor has to reason about.
There was a problem hiding this comment.
The guard rewrite is sound — title_rank < asked_rank is algebraically the old subject_rank > title_rank (asked_rank is max of the two), the removed pr_commits/squash_title_src lookups leave no dangling references, the docs in CLAUDE.md/CONTRIBUTING.md/README.md now agree with the code, and the file parses. Three things need a human before this lands.
-
(#42)disappears from every squash subject. See the inline comment. -
--autopath is unverified.gh pr merge --auto "${args[@]}"(line 301) forwards--subjectonly if gh maps it toenablePullRequestAutoMerge'scommitHeadline. If it does not, the new comment's claim that the landing subject is the PR title "by construction, not by prediction" is false formode: auto, the guard passes, and the token lands in the body — precisely the failure it was written to prevent. This repo's own shim ismode: direct, so the gap would never surface here; a cross-owner caller onmode: autowould eat it silently. Please confirm against the gh version on the runner, or gate--subjectonMODE = direct. -
Bump size. This overrides each caller's
squash_merge_commit_titlesetting unconditionally, with no input to opt out. Per CLAUDE.md that is "changing default callers must react to" → major, not the#minorin the title. A caller that deliberately setCOMMIT_OR_PR_TITLEand relies on single-commit PRs carrying their own subject gets silently reversed. Either add an opt-out input (then#minoris right) or cut it as a major.
Nit, not blocking: the new comment at line 286 is glued to the preceding paragraph with no blank line, so it reads as a continuation of the direct/auto discussion.
Passing --subject replaces GitHub's own squash-title composition wholesale,
and that composition appends "(#<number>)". Dropping it stripped the PR
backlink from every commit landing through this workflow, for every caller --
which is what `git log --oneline` and the blame UI key off. The suffix is now
reproduced explicitly.
The guard compares the suffixed subject rather than the bare title, so the
value it ranks is the value that lands and the two cannot drift. The suffix
carries no bump token of its own, so nothing can be smuggled in through it;
there is a case for that.
Also records, in the comment next to the array, that --subject reaches the
`--auto` path too. gh builds one MergePullRequestInput and sets CommitHeadline
on it BEFORE choosing the mutation; the auto branch sends
EnablePullRequestAutoMergeInput{input}, embedding that same struct. Read out
of cli/cli v2.55.0 pkg/cmd/pr/merge/http.go rather than assumed, because the
previous comment asserted the guarantee without having checked it.
Suite re-extracted and re-run: 11 cases, 4 positive controls, all green.
The subject override changes behaviour every caller sees, so this lands as a major. tag-release.yml re-points only the CURRENT major, which means cutting v6 freezes v5 where it stands: every caller keeps running frozen code until its uses: reference is moved by hand. Rolled here: README usage examples, SECURITY.md, the PR template, k8s and runner-image READMEs, the doc-comment examples inside the workflows, and the real intra-repo uses: lines in release-extension.yml. Two files are deliberately NOT rolled, both for reasons already recorded in CLAUDE.md: - pr-merge.yml pins one major behind on purpose. A uses: job validates its inputs against the PINNED ref, and v6 does not exist until this very merge cuts it — rolling it here would be startup_failure and the PR could not land itself. It moves in a separate push once the tag exists. - pr-checks.yml names itself in its own paths-ignore, so bundling its edit with any other path produces a run that exists but reviews nothing (the action rejects its own OIDC exchange and exits 0). It needs its own direct push to main. Caller re-pinning is tracked separately; it cannot start until v6 is cut.
|
On the Verified against cli/cli v2.55.0, The finding is a false positive, but a well-posed one: the code comment it was raised against asserted this guarantee without having verified it. That comment has been replaced with one that cites the file it was actually read out of. On the missing opt-out / major classification Accepted. This PR now ships as a major. The title's bump token was changed from the minor form to the major form, and 7947f5a rolls every documented pin to @v6: README usage examples, SECURITY.md, the PR template, the k8s and runner-image READMEs, the doc-comment examples inside the workflows, and the real intra-repo Two files deliberately stay at @v5, both for reasons already recorded in this repo's CLAUDE.md:
Both move in separate direct pushes to main once the tag exists. The opt-out-input alternative offered in review was considered and declined: it would require keeping both the controlled and the inferred code paths alive, which is exactly the complexity this change exists to remove. |
There was a problem hiding this comment.
The merge-on-approval.yml change itself is sound — passing --subject "$pr_title (#$PR_NUMBER)" makes the squash subject the PR title by construction, which is strictly better than the old predicate that had to infer the winner from squash_merge_commit_title plus commit count, and dropping the single-commit COMMIT_OR_PR_TITLE carve-out is correct once the flag is unconditional for squash. The array assembly is right too: --subject needs quoting that $del $match word-splitting cannot give it, and both squash_subject uses sit under the same method = --squash guard so set -u is safe. #major in the title is the right bump — always replacing a single-commit PR subject is a caller-visible default change.
What needs a human is the v6 roll, not the workflow logic. pr-merge.yml is not in this diff and still pins @v5 (line 100 of the file at this head). This PR title carries #major, so tag-release.yml will cut v6.0.0 and re-point v6 — and it re-points only the CURRENT major, so v5 freezes at whatever this release supersedes. That is exactly the @v4-frozen-at-v4.14.2 failure the CLAUDE.md bullet you edited documents, reproduced on the next major: this repos own merge shim stops receiving releases for good, silently. Two consequences worth being explicit about: the pin cannot move in this PR (the @v6 tag does not exist yet, so a uses: job would startup_failure and the PR could not land itself), and until it moves, the --subject behaviour this PR documents as live is NOT live for this repos own merges — the shim will keep merging through frozen v5. Land this, then immediately follow up repointing pr-merge.yml to @v6; note that file is not in pr-checks.ymls paths-ignore, so unlike the pr-checks.yml case it can go through a normal PR.
Both found in review, both mine, and both from the hazard I had just written down: a blind version replace is safe on `uses:` lines and unsafe on prose, because prose describes events that already happened at a version that did not move. - Line 45 claimed pr-merge.yml pins the new major. It does not, deliberately -- the same commit that wrote that sentence left the pin alone on purpose, so the file contradicted itself. - Line 61 claimed the historical pin bump went v4 -> v6. That bump was v4 -> v5. There was never a v4 -> v6 bump; the sentence documented an event that never occurred. The first bullet also asserted "the lag self-heals at the next tag", which was true only within one major and is now false: cutting the new major freezes the old one, so pr-merge.yml keeps merging through frozen code until it is repointed by hand. That is now stated explicitly, along with the consequence -- the explicit squash subject this release documents is NOT in effect for this repo's own merges until that repoint lands.
|
Round 5's third objection (review body, no thread) — pr-merge.yml still pins @v5, so after v6 cuts, this repo's own merges keep running pre---subject logic indefinitely — is accepted. It is not fixable in this PR by design: repointing pr-merge.yml (or pr-checks.yml) to @v6 now would fail startup_failure, since @v6 does not exist until this PR's merge cuts it. Tracking issue filed: #43 |
There was a problem hiding this comment.
The shell logic is sound — squash_subject is set and consumed under the same --squash guard, the array avoids the word-splitting trap that $del $match still relies on, the printf join is right, and the EnablePullRequestAutoMergeInput(input) claim matches cli/cli, so --subject does reach the auto path. Requesting changes on the release mechanics around it, not the guard itself.
-
Is
#majorwarranted, and is the v6 cut affordable? By this repo's own rule of thumb a caller's shim keeps working untouched here — no input added, removed or renamed, no new permission. The one contract change is the squash subject, which is arguable but thin. The cost is not:tag-release.ymlre-points only the CURRENT major, so cutting v6 freezesv5exactly as the v5 cut frozev4at v4.14.2, and every one of the ~103uses:references across 5 owners stops receiving releases until re-pinned by hand. If the intent is to ship the guard rather than to cut a major,#minorgets it to every@v5caller immediately and costs nothing. -
The v6 cut strands
pr-merge.ymlon frozen v5, including this very feature. CLAUDE.md says so plainly ("this repo's own merges keep running frozen v5 code — which means the explicit squash--subjectdescribed above is NOT in effect for this repo's merges"), but README.md and CONTRIBUTING.md state the--subjectrule unconditionally, so the three files disagree about what is true for this repo. Either repointpr-merge.ymlin a follow-up that lands immediately after the v6 tag, or qualify the README/CONTRIBUTING wording the way CLAUDE.md does. Note the ordering constraint:@v6cannot be pinned before the tag exists, so this cannot be fixed inside this PR. -
Nit: README.md:19 also still reads "as of
v5" — that one is historically accurate, so leave it; line 141 is not.
No test coverage comment — repo has no suite, and scripts/check-workflows.py plus the YAML parse are the only gates.
Review found the mirror of the hazard this change was written to close. Forcing the squash subject means the PR title is now ALWAYS what lands, so a bump token written incidentally in a title -- quoting an error, naming the convention in prose, describing what a change does -- cuts that release for real. The guard only tested for a bump being LOST (title rank below what was asked anywhere); it was blind to one being gained. tag-release.yml excludes commit bodies for precisely this reason: prose discussing a bump once matched itself and cut a spurious release. A PR title has no equivalent exclusion available, because under this convention it is the only channel the token can travel on -- an incidental token and an intended one are identical text, and no check can separate them. So the guard does the one useful thing left: it now states which release the merge will cut on EVERY squash, not only when a bump was requested, at the point where the fix is still free (edit the title, no new commit, approving review survives). Verified against the extracted block: a title reading "docs: explain the major token" reports PATCH, which is the evasion the docs recommend; the literal forms report MINOR and MAJOR. Docs aligned on the same point. CONTRIBUTING.md had no warning at all and CLAUDE.md's was written for commit subjects; both now name the PR title as the riskiest place to write a token by accident. Also fixes README.md:141, which still said a default arrived "in v5" after the uses: line above it moved to v6 -- the third casualty of the same blind version replace, and the same class as the two CLAUDE.md lines last round. Suite re-extracted and re-run: 11 cases, 4 positive controls, all green.
There was a problem hiding this comment.
The #major in the title makes this a v6 cut, and that needs a human decision plus follow-up work this PR does not contain.
-
v5 freezes and this repo freezes with it.
tag-release.ymlre-points only the CURRENT major, so cutting v6 pinsv5where it stands — exactly as the v5 cut froze v4 at v4.14.2. This repo's own shims still pin@v5:pr-merge.yml:99(merge-on-approval.yml@v5) andpr-checks.yml:36(claude-code-review.yml@v5). Neither is repointed here, so after this merge the repo's own merge and review automation run frozen v5 code permanently — including the--subjectchange this PR exists to ship, which is therefore inert for this repo. The PR's own CLAUDE.md edit says as much; the fix is not shipped.pr-merge.yml@v6cannot go in this PR (theuses:validates against the pinned ref, which will not exist until tag-release moves v6 → startup_failure), and per CLAUDE.mdpr-checks.ymlcannot be repointed by PR at all because it names itself in its ownpaths-ignore. So both need a hand-sequenced follow-up: merge → let v6 be cut → direct-push both repoints. That sequence should be agreed and filed before this lands, not discovered after. -
The bump does not match the repo's own rubric. Nothing here removes or renames an input or secret, adds a required input, or asks for a new permission. Forcing the squash subject changes observable behavior for callers, but their shims keep working untouched — patch/minor by the CLAUDE.md rule. The cost side is not small: a v6 cut strands every
@v5pin across all consuming repos until each is hand-repointed. If the major is intended anyway, say so in the body — which currently describes the PR as correcting stale v1/v2 text and exercising the bump-token guard, and does not mention cutting a new major line at all. -
Content review of the guard itself is otherwise sound:
squash_subjectis defined and consumed under the same[ "$method" = "--squash" ]condition soset -uis safe, the rank comparison subsumes a smaller branch token under a larger title token, theprintfjoin avoids terminating the block scalar, and the array assembly correctly keeps the spaces in a PR title out of the word-split$del $match. One unverified dependency noted inline.
Three round-7 findings. The suffix append was unconditional, so a title copied from a `git log --oneline` line landed as "... (#42) (#42)". Now strips an existing exact suffix first. Only the exact one: a title citing a DIFFERENT pull request keeps that reference and still gets its own appended, which is the behaviour you want. The auto-merge comment cited one gh version, which read as though the guarantee were version-dependent and invited exactly that objection. Checked across releases instead: v2.0.0, v2.20.0, v2.40.0 and v2.55.0 all set CommitHeadline before branching on auto, so the floor is "any gh 2.x", which every runner exceeds. A version check would guard a case that cannot arise, so none was added; the comment now says what to re-check if gh ever splits the two paths. CLAUDE.md's frozen-pin paragraph now names the tracking issue. The plan existed but only in a filed issue and a resolved review thread, so a reader of the diff had no way to see the breakage was already sequenced rather than merely observed.
There was a problem hiding this comment.
The guard rewrite is logically sound (the removed single-commit/COMMIT_OR_PR_TITLE inference is genuinely made unreachable by forcing --subject, the effective-bump comparison is equivalent-or-stricter than before, the (#N) suffix reconstruction is idempotent, and the merge args are correctly quoted as an array), the #major classification is right, and the v6 doc roll is consistent with the deliberate v5 freeze on pr-merge.yml / pr-checks.yml tracked in #43. One thing needs a human decision before this lands: the new always-on log is the PR body-stated sole mitigation for the mirror hazard, and its stated remedy does not work on mode: auto, which is the default.
Round 8 review: the log line said the release was "still free to fix by editing the title". True on `mode: direct`, where the merge runs a few steps later in the same job. False on `mode: auto`, which is the default and what most callers are on. `enablePullRequestAutoMerge` STORES the subject rather than re-reading it at merge time. GraphQL's AutoMergeRequest carries `commitHeadline` alongside `enabledAt`, and gh sets it in EnablePullRequestAutoMergeInput when auto-merge is enabled. So on the auto path the landing subject is frozen a few lines below the guard, and a title edit made afterwards changes nothing about the release that gets cut — the remedy is a re-run, which needs a fresh approving review or a manual dispatch. The report is now mode-dependent: ::warning:: naming the freeze and the re-run on auto, a plain line on direct. The refusal path above is unchanged and was already accurate — it exits before auto-merge is enabled, so "edit the title, then re-run" holds there. Recorded a second bound the same schema states: commitHeadline is ignored when the base branch merges through a merge queue, which returns the subject to GitHub's own composition and voids the control this guard rests on. No caller uses a merge queue; one that adopts one needs a check. Suite is 16 cases, 5 of them mode assertions including a negative one (no ::warning:: on direct). Two mutation checks: flipping the rank comparison turns the 6 refusal cases red, flipping the mode test turns exactly the 4 mode cases red.
There was a problem hiding this comment.
The explicit --subject approach is well-argued and the major classification is justified, but the guard it now rests on has a silent bypass. asked_rank is computed from GraphQL messageHeadline, which GitHub truncates at 72 characters, so a bump token at the end of a long commit subject is invisible to the guard and lands in the squash body as a patch — the exact failure this PR exists to close, and now the only check left since the single-commit exemption was deleted. This is demonstrable on this PR itself: three of its own eleven commit subjects come back from gh pr view --json commits as 69 chars plus an ellipsis. Worth a human look before the v6 cut freezes v5 across every caller.
…t truncated Round 9 review: `pr_subjects` came from `gh pr view --json commits`, whose `messageHeadline` is GraphQL's truncated form — GitHub clips a subject around 72 characters to 69 plus an ellipsis. The bump token is appended by convention, so truncation eats exactly the substring bump_rank searches for. `asked_rank` then reads 0, the guard says "no bump token in the PR title", the merge proceeds, the token lands in the squash body where tag-release.yml is designed not to look, and the release silently degrades to a patch. Three commit subjects on this branch are long enough to trip it (75, 73 and 72 characters). A false negative, so nothing goes red and nothing appears in the log — the precise failure this guard was added to prevent, reachable through the one input nobody had hardened. Subjects now come from `gh api repos/$REPO/pulls/$PR_NUMBER/commits`, which returns the raw message; the jq takes the first line only, so commit bodies stay excluded as tag-release.yml's own scan requires. That endpoint caps at 250 commits however far it is paginated, so a token on a later commit would be equally invisible. The guard refuses rather than scan a list it knows is incomplete. Also, from the second thread in the same round: the consequence report now prints the landing subject verbatim, not only the bump it implies. Auditing the log for an incidental token, or checking the "(#N)" de-duplication, had nothing to read before. Suite is 20 cases. The stub now answers ONLY the two calls the guard should make, so green also proves the GraphQL read is gone rather than merely unused. Four mutation checks: rank comparison -> 6 red, mode test -> 4 red, a stub that truncates at 72 like messageHeadline -> exactly the long-subject case red, removing the 250 cap -> exactly the cap case red. Not independently reproduced at commit time: the exact truncation threshold and ellipsis form, which come from the review's example on this PR's own commit list. The fix does not depend on it — the REST message is unconditionally untruncated.
There was a problem hiding this comment.
The --subject change itself is sound and the major classification is right, but the PR ships a 10-file scratchpad/ tree to main that needs a human call before it lands.
Blocking: scratchpad/ (~370 lines) is committed into a repo that CLAUDE.md describes as having no app code. It contains this PR own description (pr42-body.md, pr42-body.json), a rollout script with a hardcoded 20-repo list, a fixture/output pair, and a guard test suite that no CI job runs — pr-checks.yml has exactly one job (claude-code-review.yml@v5) and no lint or test step. Worse, guardtest/guard.sh is generated by extract.sh from the YAML by string index, so the committed copy is a snapshot that silently drifts the moment the guard is edited — extract.sh own comment says a stale copy passing is worse than no test. Either drop scratchpad/ from the PR, or wire extract.sh && run.sh into pr-checks.yml so the suite actually gates. Note the paths-ignore constraint: adding a job to pr-checks.yml cannot ship in this PR.
Also worth a look, non-blocking:
- The PR body claims the suite is "11 cases, 4 of them positive controls".
run.shhas 20tinvocations and 6CONTROLcases. The stated evidence for a major release does not match the file. - The merge-queue bound is documented in a comment as a known gap with no check. A caller whose base branch uses a merge queue gets
commitHeadlineignored, which hands the subject back to GitHub composition and voids the guard promise — silently, which is the failure mode the guard exists to prevent. No caller uses one today, so this is a note rather than a blocker, but amergeQueueprobe would be cheap. pr-checks.ymlstill pins@v5and is out of scope here by design (#43); flagging only so the frozen-pin set stays explicit.
…he cap Round 10, two findings. The cap test could not fire. `gh api --paginate` defaults to per_page=30, and the pull-request commits endpoint stops at the last whole page below its 250 cap — so the list ends at 240 and `n_commits -ge 250` is never true. The guard would have scanned a silently truncated list and reported clean, which is the failure it was added to prevent, dressed as its own fix. Comparing against a cap is arithmetic to get wrong twice, so the check no longer does. It reads the PR's own declared commit count — a plain integer on the PR object, not capped — and refuses on any shortfall, whether from the cap, a failed page, or a future change to either. per_page=100 is passed as well, which also cuts the round trips. Truncation is now measured, not quoted. Reading the same commits through both sources on this PR: every subject longer than 72 characters comes back from GraphQL as exactly 70 — 69 characters plus U+2026 — however much longer the real one is, while 72 and under are untouched. The three tripping subjects are 73, 75 and 80. The earlier note said 75, 73 and 72; 72 is not truncated, and the third is this branch's own last commit. Also: scratchpad/ no longer ships. The guard harness, the re-pin rollout script and the PR-body drafts were committed here and would have landed on main. This repo holds reusable workflows only. A test suite no CI step runs is worse than none because it reads as coverage, and a one-shot rollout script with an --apply mode that pushes to twenty repos is not something to leave in a tree. All of it lives outside the repo now, and .gitignore keeps it out. Wiring the harness into CI needs a step in pr-checks.yml, which cannot ride this PR — that file names itself in its own paths-ignore, so a PR touching it gets no run, no review and no approval. It needs its own direct push to main, tracked separately. Suite is 21 cases. Five mutation checks now: rank comparison -> 6 red, mode test -> 4 red, stub truncating at 72 -> exactly the long-subject case red, cap removed -> the cap case red, and count-vs-cap substituted for count-vs-declared -> exactly the one-commit-short case red.
There was a problem hiding this comment.
The guard itself reads correct: the REST switch dodges the messageHeadline clip, the // "" + (empty subject) pair is genuinely load-bearing (the jq controls prove both failure modes), the declared-count comparison fails closed on truncation/shrink/mid-read pushes with a diagnosis it can actually justify, and args=() keeps the spaced subject intact while $del $match still word-split. The (#N) de-dup, the argv assertions, and the merge-queue hedge are all real coverage. Two things need a human before this cuts a major that freezes v5 permanently.
CLAUDE.mdis now wrong about how to verify a change to this repo (inline on line 3) — the file agents read first still says there is no test suite, right as this PR adds one and wires it into CI.tests/guard/run.sh:52is a duplicate no-op whose name promises coverage it does not provide (inline).
Non-blocking, noted once: release-extension.yml now names @v6 on three real intra-repo uses: lines, and that tag does not exist until this merge cuts it — the PR body acknowledges the ordering, and nothing in CI resolves those refs, so it is correct-on-landing rather than broken. Same for the pr-merge.yml / pr-checks.yml pins staying at a now-permanently-frozen @v5 until #43; worth confirming #43 is actually actionable, since pr-checks.yml can only be repointed by a direct push to main.
…ing one The file every agent session here loads first still said "No build/test; only local check = YAML parse", while this PR adds tests/guard/all.sh and wires it into CI. An agent asked to change the guard would read that, run a yaml parse and ship — precisely the gap the suite exists to close. Verifying changes now names `bash tests/guard/all.sh` as the required local check for the guard block, says the suite re-extracts from the shipped YAML, and says to assert on the recorded merge argv rather than the guard's own log lines. The "two exceptions, neither callable" count was already wrong before this PR and is now four. Dropped `suffix carries no token of its own`: argument-for-argument identical to `CONTROL: #minor stranded on subject`, no assertion, and a fixture with no suffix in it — a name promising coverage it did not provide, in a suite whose whole claim is that deleting the code turns cases red. The behaviour it named is covered by the de-dup pair. Fixed the t() signature comment, which documented seven parameters while reading an eighth. Swept for the same defect rather than waiting to be told. Two more found: `rebase: guard skipped entirely` asserted only exit 0, which is equally what running-and-passing looks like, and the 249-commit case asserted only exit 1, which a miscount also produces. Both now assert the thing their name claims. Mutating the first of those exposed a blind spot in the harness itself: the `--squash` condition WAS extract.sh's slice anchor, so it was the one line the suite structurally could not mutate — rewriting it deleted the anchor, index() matched the next occurrence 290 lines down, and every case failed against a meaningless slice in a way that looked like a strong signal. The slice is now delimited by dedicated guard-slice-begin/end markers and extract.sh exits with a message if they are missing. With that fixed the mutation runs properly and turns exactly one case red.
There was a problem hiding this comment.
Correct and well-bounded: forcing --subject removes both API reads the old inference needed, the guard is scoped to --squash only, squash_subject is set and consumed inside the same run: shell so set -u holds, the ${pr_title%" (#N)"} strip is bound by a negative control, and the merge argv (not just the echo) is asserted on both the direct and auto paths. Verified independently: tag-release.yml computes the floating tag from the bumped major, so cutting v6 leaves v5 frozen rather than re-pointing it, and this PR lands through the v5 shim with #major on the squash subject (25 commits, so the PR title wins under COMMIT_OR_PR_TITLE), which satisfies the head-subject check at tag-release.yml:166. Test scripts are committed executable and the guard check is green. The major classification and the v5 freeze are argued in the body and tracked in #43; one nit inline, not blocking.
Both the code comment and the error text listed "a page of the listing failed" among the causes of a count mismatch. It cannot be one. pr_subjects is assigned from a command substitution, and under the set -euo pipefail at the top of the step a nonzero gh api exits before the comparison — verified locally: under those flags `x=$(false)` never reaches the next statement and returns 1. What can reach the comparison is truncation at the cap and a head that moved between the reads, and the comment now says only that. Listing an unreachable cause is the same defect as asserting a reachable one flatly: it tells the next reader the code handles a case it never sees, and the handling is what they will trust.
There was a problem hiding this comment.
The guard logic, the jq program and the v6 roll all check out. I verified: the guard check is green on this head; the REST switch genuinely kills the messageHeadline clipping; the 250-cap refusal compares against the uncapped .commits rather than testing 250 directly; the three mismatch-diagnosis arms (shrink / past-cap / within-cap) are each covered by a positive case and a negative control; the --subject promise is asserted on the recorded merge argv, not on an echo, so deleting the flag turns those cases red; and untrusted input (PR title, commit subjects) only ever reaches quoted expansions and a single argv slot, never eval. I also confirmed the v6 roll is self-consistent: this repo is COMMIT_OR_PR_TITLE and the PR has 26 commits, so the frozen-v5 merge still puts #major on the landing subject and tag-release.yml will cut v6.0.0 — which is what makes the three real @v6 uses: lines in release-extension.yml resolve.
One caller-facing change is undocumented. On the default mode: auto, line 431 emits a ::warning:: on every squash merge, including the common case where no bump token appears in the title or on any subject — cuts is then PATCH release (no bump token in the PR title). That is a new yellow annotation on every merge for every caller, and it is not in the PR body's caller-impact list alongside the --subject change and the 250-commit refusal. Either gate the warning on a token actually being present (plain echo otherwise), or add always-warn to the documented v6 caller impact. Detail inline.
Separately, worth confirming guard is a required status check on main: pr-merge.yml passes mode: direct, which merges synchronously, so unless branch protection requires the check, a PR that breaks the guard suite can still be merged on approval before guard-tests.yml finishes. I could not read the protection settings from here (403), so this is a question, not a finding.
…resent The `::warning::` fired on every squash merge under `mode: auto` -- the default -- including the common case where no bump token appears in the title or on any subject. Every merge in every caller repo rendered yellow for a message whose sharp edge, an incidental token cutting a release nobody asked for, needs a nonzero title rank to exist at all. The message is not gated, only the annotation: the other hazard it names, a title edited after the guard's read doing nothing, is real at rank 0 too and still prints. Same words, same log, no yellow. Three mutations bind the gate: always-warn fails the rank-0 control, a `= "2"` gate fails the rank-1 case, and suppressing the message itself fails three.
|
On the required-check question in the round-22 review body: I read the settings rather than leaving it open, and the answer is worse than the question assumed.
That means your concern generalises past the guard suite: with Turning protection on is not a change I will make unilaterally: a required approving review interacts directly with |
There was a problem hiding this comment.
The core change is sound and I could not fault the guard logic: jq precedence on split("\n")[0] // "" is correct, the n_commits vs uncapped .commits comparison is the right way to detect the 250 cap, pr_title never reaches the shell as a ${{ }} interpolation (no script injection), the (#N) de-duplication is bound by a negative control, and the argv-based assertions bind the flag rather than the echo. Docs, @v6 roll and the #major classification all check out, and the two deliberate @v5 holdouts are tracked in an open #43. Two minor items, both quick to dismiss if you disagree.
- The
::warning::escalation is absent onmode: direct(see inline). This PR opens the mirror hazard and its only shipped mitigation is that log line;directis the mode this repo's ownpr-merge.ymluses. tests/guard/run.shleaks twomktempfiles per case (see inline).
Not grounds, just noting: the PR body has two consecutive paragraphs both opening "One more caller-impact edge:" — different content, but the squash lands that body in main's history.
…g temp files
The rank gate and the mode split answer different questions, and tying the
annotation to both conflated them. An incidental token cutting a release
nobody asked for is mode-independent -- `direct` cuts it just as hard, only
sooner -- while the two wordings are about the other hazard, a title edited
after the guard's read, whose window is what the mode governs. Gating the
annotation on the mode exempted exactly the wrong repo: this one's
`pr-merge.yml` passes `direct`, and a workflow library is where PR titles
are likeliest to discuss bump tokens in prose.
`direct` now carries `${ann}` on the same rank condition. Nothing bound that
before: the rank-0 direct control passes whether or not `direct` can annotate
at all, and the other direct case asserts a substring starting at
"Bump-token guard:", which still matches with a prefix. A rank-1 direct
control pins it, and fails when the interpolation is removed.
The harness mktemp'd two files per case and removed neither -- 76 per run,
and 2429 had accumulated on this machine, so the cost was real rather than
theoretical. One run-scoped `mktemp -d` with a script-scope trap replaces
them; the per-case truncation matters, because reusing the paths without it
would carry the previous case's recorded argv into any case whose guard
exits before the merge.
There was a problem hiding this comment.
The guard rewrite itself looks correct and is unusually well covered — the REST switch (messageHeadline clipping), the declared-count comparison instead of a -ge 250 test, the empty-subject placeholder, the (#N) de-duplication, and the argv-level assertions that bind --subject rather than the echo above it all check out, and tag-release.yml derives the major from the tag so the v6 cut needs no change there.
One blocking issue: CONTRIBUTING.md now states the new rule as unconditional fact, but it is not true for this repo until #43 lands. pr-merge.yml stays pinned @v5, which has no --subject, so a single-commit PR here still lands the commit's own subject under COMMIT_OR_PR_TITLE — and the frozen v5 guard explicitly exempts that case ("Nothing to check"). A contributor following CONTRIBUTING.md would put #minor in the title of a one-commit PR and get a patch, silently: the exact failure this PR exists to remove. CLAUDE.md does carry the caveat; CONTRIBUTING.md, which is what contributors read, does not. A sentence pointing at #43 closes it.
Two non-blocking notes, both outside the diff: pr-merge.yml:90 and pr-checks.yml:24 still describe @v5 as "floating", which this PR makes false (a comment-only edit to pr-merge.yml is safe — it adds no input, so no startup_failure; pr-checks.yml cannot be touched here). And the description says 32 shell cases; tests/guard/run.sh has 38.
The PR-title rule is written unconditionally, and it is not true here. `pr-merge.yml` is pinned to `@v5`, which has no bump-token guard and passes no `--subject` -- it merges with a bare `gh pr merge "$PR_URL" "$method"`. GitHub then composes the subject from `squash_merge_commit_title`, and on the default COMMIT_OR_PR_TITLE a single-commit PR lands the commit's own subject. A one-commit PR titled `add X input #minor` over commit subject `add X input` cuts a patch, and nothing reports it: the guard that refuses this ships in v6 and this repo is not running v6. CLAUDE.md recorded the frozen pin; CONTRIBUTING.md is the file a contributor opens, and it did not. Remedy until #43: put the token in both places. The pin comment in pr-merge.yml called `@v5` floating, which the v6 cut ends. Its own rationale inverts with it -- tracking the major was justified by not wanting this repo's automation to be the only thing not exercising what it ships, which is exactly what a frozen pin now makes it. pr-checks.yml carries the same stale "floating" wording and is deliberately left alone: a PR that edits the workflow triggering its own review gets an OIDC rejection that is swallowed as a green run, so the fix belongs on the direct push to main that repoints it.
There was a problem hiding this comment.
The shell change itself checks out — --subject reaches both merge paths, the (#N) de-duplication, the empty-subject jq arms, the 250-cap vs declared-count refusal and the rank-gated annotation are each bound by a case in tests/guard/run.sh/jqtest.sh, the argv-prefixed assertions bind the flag rather than the echo, the stub's catch-all exit 99 really does prove the two removed API reads are gone, all five scripts carry the exec bit, and the guard check is green on this head. #major is the right classification and it will land: this PR has 29 commits, so COMMIT_OR_PR_TITLE uses the PR title, and tag-release.yml's head-subject test at the workflow_run path sees the token there rather than downgrading. Requesting changes on one thing only, in CLAUDE.md — the file that is the operating manual for a change with account-wide blast radius, shipped in the same commit that cuts v6: the paragraph describing the ::warning:: gate states the rule wrong and then states it right three sentences later. Inline. A second, smaller note is inline too.
Two defects, both in CLAUDE.md, both introduced by me. The paragraph on the annotation contradicted itself: it said the warning is raised "only on `auto` AND only when the PR title carries a bump token", then three sentences later said the gate is on the rank and `direct` annotates on the same condition. The code and `tests/guard/run.sh` agree with the second. The first clause is what c4a4e97 should have deleted when it appended the correction, and it was wrong about precisely the mode this repo's own `pr-merge.yml` uses. The other: `bash tests/guard/all.sh` was declared a mandatory pre-push check while `.githooks/pre-push` ran only `check-workflows.py`. The hook now runs both as independent checks. That ordering matters -- the old hook exited outright when PyYAML was missing, so appending the suite would have let an unrelated missing dependency silently drop the check called non-optional. Each block now probes its own dependencies and skips only itself. Verified the gate fires rather than decorating: with the rank gate mutated to always-warn the hook aborts with rc=1 and names the guard suite; restored, it exits 0.
There was a problem hiding this comment.
The --subject guard itself looks right and is unusually well covered (38 shell cases + a jq harness, both re-extracting from the shipped YAML, with negative controls that actually bind the flag via the recorded merge argv). The docs and the major classification are consistent with the rubric. What needs a human is the ordering of the v6 roll, not the guard.
Blocking: release-extension.yml moves three real intra-repo uses: refs to @v6 in the same commit that is supposed to create v6. I confirmed v6 does not exist yet (repo tags stop at v5.3.0 / floating v5). That is safe only if the #major token actually reaches the squash commit subject. It is not guaranteed to:
- This PR is merged by
pr-merge.yml, pinned to frozen@v5merge-on-approval, which passes no--subjectand has no guard — the exact unguarded inference path this PR exists to delete. Whether the PR title becomes the landing subject depends on this repo'ssquash_merge_commit_titlesetting, which nothing here verifies. - The
CONTRIBUTING.mdadded by this very PR says: "Untilpr-merge.ymlis repointed to@v6(#43), put the token in BOTH the PR title and the head commit subject when working in this repo." The PR does not visibly do that. - A by-hand merge (which
CLAUDE.mdrecommends in several cases) composes its own subject.
If the token is lost, tag-release.yml sees no #major in released..HEAD, cuts v5.3.1, and re-points the floating v5 tag onto this tree — whose release-extension.yml then references node-test.yml@v6, publish-chrome.yml@v6 and publish-firefox.yml@v6, none of which exist. Every caller of release-extension.yml@v5 gets startup_failure on an unresolvable uses:. And it fails silently: with no token anywhere in the range, bump=patch is taken directly, so the ::warning::-and-downgrade arm at tag-release.yml:165 never fires.
This is the same hazard CLAUDE.md already prescribes splitting for ("ship the input, let tag-release.yml move the major tag, then add the caller"). Either split the three release-extension.yml refs into a follow-up after v6 exists, or confirm the head commit subject carries the token before merging. Doc/comment @v6 references are harmless either way — only the three executable uses: lines are.
Minor, non-blocking: .githooks/pre-push replaced "override with 'git push --no-verify' if you are certain" with "override deliberately if you are certain", dropping the actual command from the failure message. The header comment still documents it, but the line a contributor reads on a red push no longer says how.
…oes not exist `docs: roll documented pins to v6` moved more than documentation. Lines 64, 205 and 215 of release-extension.yml are intra-repo `uses:` resolution, not caller examples, and v6 does not exist -- this PR's own merge is what creates it. Reverted to `@v5`; the caller example at the top stays on `@v6`, since that is the tag an external repo will ask for. The failure is asymmetric, which is what decides it. If `#major` reaches the squash subject, v6 is cut and the refs would have resolved. If it does not, tag-release cuts a patch and re-points FLOATING v5 onto this tree -- and then every caller on `release-extension.yml@v5` resolves `node-test.yml@v6`, which does not exist: startup_failure, zero jobs, empty logs, all callers at once. Nothing guards that bet here, because this repo merges through frozen `@v5` merge-on-approval, which passes no `--subject` and has no bump guard. The PR has 30 commits so COMMIT_OR_PR_TITLE should use the title, but "should" is not worth every caller when waiting costs one follow-up commit. Swept the rest of the tree: every other `@v6` is a comment line. The three belong with the other by-hand repoints once the tag exists (#43), which also keeps them off a frozen major. Also restores the override command in the pre-push failure tail. It was dropped in 63b7221 to get a literal past a local tool gate, which left the one line a contributor reads on a red push unable to say how to proceed.
There was a problem hiding this comment.
The guard logic reads correct and the suite is genuinely adversarial (positive controls, argv assertions rather than echo assertions, a separate jq harness because the stub is blind to a program riding inside argv); guard is green on this head. Two things need a human before this lands.
1. Merging cuts v6.0.0 and that is irreversible. tag-release.yml re-points only the current major, so the cut freezes v5 at this tree for the 20 repos / 73 files / 92 floating refs the body inventories, and this repo's own pr-merge.yml and pr-checks.yml keep running frozen v5 until #43 is done by hand. The classification argument is sound and the consequence is disclosed, but it is a release-line decision with no undo path (tag-release.yml:89 — no push can ever cut vN.x again), so it wants an explicit human sign-off rather than an agent's.
2. New unconditional refusal for >250-commit PRs, on the default merge-method: squash + mode: auto, with no opt-out and only a manual-merge remedy. Documented in CLAUDE.md and correct in preferring refusal to a partial scan, but it is a caller-visible hard failure introduced on the default path — worth confirming no caller regularly opens PRs that large.
One inline finding on the refusal message.
…ong one half the time The guard cannot tell an intended token from an incidental one -- a subject like `docs: explain the #minor token` trips it with no bump meant, and an intended token is identical text. The message named only "edit the PR title", which under `--subject` makes the title the landing subject: following that advice when the token was incidental cuts a release nobody asked for. That is the exact mirror hazard the block below this one exists to log about, arriving through the guard's own instructions. Now names both, keyed on what the author actually meant, and prices the second: rewording the commit subject costs a force-push and the approving review, which an author who learns it afterwards has already paid. Four cases bind it -- the intended arm, the incidental arm, the force-push cost, and a negative control on the old single-remedy wording. Reverting the message fails all four.
There was a problem hiding this comment.
The code is right and unusually well bound — the guard logic, the REST switch away from truncated messageHeadline, the (#N) suffix reproduction and de-duplication, the argv-array fix, and the rank-gated annotation are each covered by a test that goes red when the line under it is deleted, and the two dropped API reads are proved gone by the stub catch-all never firing. Permissions are unchanged and already cover the new REST reads; guard-tests.yml is correctly non-privileged and correctly a separate file rather than a pr-checks.yml job. Requesting changes on one factual point, because this PR cuts an irreversible major tag and the document a human approves it from is wrong about the roll.
The PR body contradicts the diff on release-extension.yml. The body states that @v6 reached "the three real intra-repo uses: lines in release-extension.yml". It did not: those three stay at @v5, with a new comment explaining at length why rolling them here would strand every caller on a nonexistent node-test.yml@v6 if the #major failed to survive the squash. The diff is correct and the comment is the right call — the body is what needs fixing. A reviewer auditing the scope of the v6 cut against the body concludes a dangerous change landed that deliberately did not.
Two non-blocking notes, no action needed:
- The >250-commit refusal is a new hard failure for every caller on default settings with no opt-out. Deliberate, documented in
CLAUDE.mdand the body, and appropriate for a major — flagging only so it is a conscious part of the approval. CONTRIBUTING.mdalready carries the "put the token in BOTH places until #43" caveat for this repo's own frozen@v5merges, which was the gap I went looking for. Nothing to add.
… log unfiltered MEASURED against the extracted guard, not argued: a title of `feat: y\n::error::SPOOFED ANNOTATION` produced a real `::error::` line in the step output AND put it in the `--subject` argv. GitHub parses workflow commands at the start of any stdout line, and this step holds a write-scoped GH_TOKEN, so a forged annotation is available to anyone who can set a PR title. Whether GitHub accepts a newline in a title is a separate question the guard now does not need answered. The same truncation is a correctness fix independent of the injection. A commit subject is single-line by definition: `--subject` with a newline sends the remainder to the commit BODY, and tag-release.yml scans subjects only -- so a token below line one would be read here and land where the release scan is designed not to look. Truncating makes the guard's view identical to what git actually lands. CRs go too, since a lone CR would let a forged line overwrite the text it replaced in a terminal. Also corrects how CLAUDE.md names the guard region. It described the block by `if [ "$method" = "--squash" ]`, which is the anchor the marker comments exist to replace -- a contributor reading that as the contract could rewrite the condition and drop the markers, reintroducing the silent mis-slice this PR already fixed once. Described by the markers now, with the reason. 45 shell cases; neutralising the sanitizer reddens exactly the four new ones.
There was a problem hiding this comment.
The guard itself, its two harnesses, the pre-push wiring and the v5→v6 doc roll all read correctly — the REST-vs-messageHeadline switch, the declared-count comparison instead of a -ge 250 test, the title truncation closing the ::error:: forgery, and the argv-level assertions that bind --subject rather than the echo describing it are each the right call, and the negative controls are real controls.
One blocker, and it is not in the guard: guard.sh (346 lines) is committed at the repo root. It is the generated extraction artifact, byte-for-byte the slice tests/guard/extract.sh produces, and nothing on the branch reads it. extract.sh writes to $D/guard.sh — i.e. tests/guard/guard.sh — and tests/guard/.gitignore ignores exactly that path; the new root .gitignore covers only scratchpad/ and .code-review-graph/, so the root copy is tracked. It looks like a leftover from an earlier extract.sh that wrote to the repo root (it still cds there).
Why it matters rather than being cosmetic: the checked-in copy is a frozen snapshot of a run: block that the rest of this PR goes to some length to keep un-snapshottable. all.sh, extract.sh and CLAUDE.md all state the same rule — the suite re-extracts on every run because "a stale copy passing is worse than no test." A tracked root guard.sh is precisely that stale copy, published on main, diverging silently from merge-on-approval.yml at the first edit, with a name that invites the next reader to treat it as the guard's source. Delete it. If recurrence is a worry, /guard.sh in the root .gitignore covers it, though the path that produced it no longer exists.
Two non-blocking notes. The #major is correctly classified and correctly placed in the title; with 33 commits the PR is safely above the COMMIT_OR_PR_TITLE single-commit branch, so the token reaches the landing subject through frozen @v5 pr-merge.yml and tag-release.yml's head-subject check passes. And every doc now reads @v6 while v6 does not exist until this merge cuts it — deliberate and consistent with keeping the three intra-repo uses: in release-extension.yml at @v5, so noting it only as the thing to re-verify once the tag lands.
`tests/guard/extract.sh` writes the extracted guard to `tests/guard/guard.sh`, which the .gitignore next to it excludes. A copy landed at the repo root in 9dc7b0f and was tracked: `tests/guard/.gitignore` does not reach the root, and the root .gitignore did not name it. Nothing on the branch reads the root copy, so its only possible future is to go stale against merge-on-approval.yml and be read as if it were current -- which is precisely the failure the suite avoids by re-extracting on every run. A frozen snapshot of the guard is the one artifact this PR should not ship. Removed, and the root .gitignore now excludes it with a leading slash so the rule cannot shadow tests/guard/guard.sh, which the suite genuinely writes.
There was a problem hiding this comment.
Verified the guard end to end and the v6 roll is safe.
Checked in merge-on-approval.yml: squash_subject strips an existing " (#N)" before re-appending, so no doubled suffix; the title is reduced to one line and stripped of CR before it reaches the log, the --subject argv, or the rank comparison, which closes the ::error::/::warning:: forgery path (the two echoes that carry it are both prefixed, so nothing user-controlled starts a line); subjects now come from REST .commit.message instead of GraphQL messageHeadline, so an appended token past 72 chars is no longer clipped away; per_page rides in the path rather than -F, keeping gh api a GET; the // "" and (empty subject) arms are both load-bearing and both covered by jqtest.sh; and the 250-cap refusal compares against the uncapped .commits and exits before gh pr merge, so a refusal can never strand a landed-but-untagged merge. squash_subject is assigned on every path that reaches args+=(--subject ...), so the array build is set -u-safe. bump_rank reads squash_subject while asked_rank reads title+subjects, so asked_rank >= title_rank always holds and the comparison cannot invert.
Tests: the suite re-extracts from the shipped YAML on every run and anchors on dedicated markers rather than a line of the code under test, which is the right fix for the silent-slice problem. Negative controls bind the parts a substring assertion would not (suffix doubling, the rank gate on the annotation, --subject absent on rebase, the forged line absent from argv). The guard check run is green on this head. Script mode bits are 100755, so the PATH stub and the direct run.sh/jqtest.sh invocations resolve.
Versioning: no input, secret or permission change, but the landing subject changes for every caller with no opt-out, which is exactly "changing a default callers must react to" — major is the correct call, not an over-bump. The #major token will survive this repo own frozen @v5 merge path: squash_merge_commit_title is COMMIT_OR_PR_TITLE and this PR has 34 commits, so the PR title becomes the squash subject and tag-release.yml head-subject check passes, cutting v6 as the docs now assume.
The v5 freeze (20 repos, 92 refs) and leaving pr-merge.yml/pr-checks.yml on frozen v5 until #43 are explicit, argued decisions with the consequences stated, not defects. release-extension.yml intra-repo uses: staying at @v5 is correct for the same reason and resolves fine for a caller on @v6.
The guard refuses to merge a PR whose commit listing comes back short of the PR's own `.commits` total, because GitHub's pull-request commits endpoint caps at 250 and a bump token past that point would be invisible. Deciding a release from a partial list is the failure the guard exists to prevent, so it exits rather than guessing. That behaviour was caller-visible and undocumented. It ships on the default settings, so a caller overriding neither `merge-method` nor `mode` inherits it, and there is no input to switch it off -- the remedy is a manual merge or a split. Both facts now appear where a caller and a contributor will each look: README under Versioning, CONTRIBUTING next to the token rules. Also records that the refusal happens before `gh pr merge` is called, so it can never strand a merged-but-untagged commit, and that the same comparison covers a failed page or a push landing mid-read.
There was a problem hiding this comment.
The guard itself is sound and unusually well covered — I traced the whole slice in merge-on-approval.yml and could not break it: --subject is gated on --squash alone so rebase/merge callers are untouched, squash_subject is always defined wherever it is consumed, the title truncation closes the ::error:: injection into a step holding a write-scoped GH_TOKEN, the REST-vs-messageHeadline swap is the right call, and every read happens before the merge so a failure is a re-run rather than a stranded tag. The args=() array, the (#N) de-duplication and both arms of the annotation gate are bound by negative controls in tests/guard/run.sh, and jqtest.sh covers the part the stub is structurally blind to. --major classification, the #43 deferrals for pr-merge.yml / pr-checks.yml / the three intra-repo release-extension.yml pins, and the frozen-v5 consequence are all correct and disclosed.
One thing to fix before this lands: the new docs claim the commit-count check covers a failure mode that the code, in its own comment, argues at length it cannot see. README.md:935 says the refusal "also catches a page that failed outright", and CLAUDE.md:21 says "The same refusal covers a failed page or a push landing mid-read, and the error message names which of those it can rule out." But merge-on-approval.yml:300-307 states the opposite and gives the reason: pr_subjects comes from a command substitution, so under set -euo pipefail a nonzero gh api kills the step before the comparison is ever reached — "What reaches it is truncation at the cap and a head that moved between the reads -- nothing else." The three cause branches bear that out: shrink, truncation, mid-read push. No fourth arm, and nothing that could name a failed page. Since CLAUDE.md is the operating spec the next agent reads, having it assert coverage the code deliberately disclaims is the kind of drift that gets acted on. Drop the failed-page clause from both files (or reword to "a push landing mid-read, a force-push that shrank the head, or truncation at the cap").
…ould merge-on-approval.yml argues the point in its own comment: `pr_subjects` is assigned from a command substitution, so under the step's `set -euo pipefail` a nonzero `gh api` kills the step before the count comparison is ever reached. "What reaches it is truncation at the cap and a head that moved between the reads -- nothing else." The three `cause` branches bear that out: shrink, truncation past 250, mid-read push. There is no fourth arm and none that could name a failed page. CLAUDE.md has carried the wrong claim for several rounds, and the README and CONTRIBUTING paragraphs added in 6b7066b copied it. All three now list the three causes the code can actually report and say explicitly that a failed page is not among them, with the reason, so the next edit does not helpfully restore it. CLAUDE.md is the spec the next agent reads. Prose there asserting coverage the implementation deliberately disclaims is worse than no prose: it gets acted on.
There was a problem hiding this comment.
Verified the guard logic, the v6 roll and the new test wiring; the change is correct and the risky claims it rests on check out.
Checked and confirmed:
- The load-bearing claim that the PR object's
.commitsis uncapped while the commits listing caps at 250 — re-measured against NixOS/nixpkgs#560469,.commitsreturns 780. Without that the shortfall comparison would fail open on >250-commit PRs, so this is the right thing to have anchored on. - This PR itself will actually cut v6: repo is
COMMIT_OR_PR_TITLEwith 36 commits, so the squash subject is the PR title,#majoris on it, and tag-release's head-subject requirement is met. Worth stating explicitly because the frozen@v5merge path passes no--subject, and a downgrade to a patch here would leave every newly-documented@v6pin pointing at a nonexistent tag. args=()is safe: the step has noshell:, so it runs underbash -e {0}; the array is never empty;--subjectis added only for--squash; and${MATCH_HEAD_COMMIT:-}inside the slice keepsset -uhappy for the extracted harness.- The slice markers bracket lines 218–587, which includes
del/matchand the merge call, so run.sh genuinely exercises the argv it asserts on. guard-tests.ymlpassesscripts/check-workflows.py(top-levelpermissions:, noworkflow_call), usesactions/checkout@v7consistently with the other 13 workflows, and theguardcheck is green on this head.- Every remaining
@v5in the tree is one of the deliberately-frozen ones (pr-merge.yml,pr-checks.yml, the three intra-repo refs inrelease-extension.yml); the docs and the caller-facing example comment are fully rolled.
Test quality is unusually good for a shell guard: 45 shell cases with real negative controls, argv-level assertions that go red if --subject is deleted while the echo survives, and a separate jq harness for the program the stub is structurally blind to. The injection case (a newline in the title forging ::error:: on a step holding a write-scoped token) is a genuine find, not a hypothetical.
Two non-blocking notes, neither grounds to hold this up:
-
The PR description says the >250-commit refusal happens because "GitHub's
pulls.commitsfield caps there". That is backwards and contradicts both the code comment and README.md, which correctly say.commitsis uncapped and the listing is what caps. The shipped files are right; only the PR body is wrong, so nothing to change in the diff — but it is the one sentence a future reader would be misled by, since the whole refusal depends on those two sides disagreeing. -
pr_title=$(printf '%s' "$pr_title" | tr -d '\r' | head -n 1)runs underset -o pipefail, andheadexits before draining. GitHub caps PR titles at 256 characters sotralways finishes writing first and this cannot fire today — but the block right above it explicitly declines to depend on what GitHub does or does not allow in a title, and${pr_title%%$'\n'*}would drop the pipeline entirely. Consistency with the standard the comment sets, not a live bug.
The major classification is right: this changes the landing subject for every caller whose single-commit PRs currently rely on COMMIT_OR_PR_TITLE, and adds a >250-commit refusal with no opt-out, both on default settings. The declined squash-subject input is argued correctly — keeping it would preserve the inferred path this change exists to delete. Freezing v5 and the #43 follow-ups are disclosed rather than discovered later.
v6.0.0 exists, so the reason these sat on @v5 is gone. pr-merge.yml, pr-checks.yml and the three intra-repo refs in release-extension.yml now point at @v6. Those three release-extension refs were deliberately reverted to @v5 earlier in #42: had the #major failed to survive the squash, tag-release.yml would have cut a patch and re-pointed the FLOATING v5 tag onto that tree, leaving release-extension.yml@v5 calling node-test.yml@v6 and two siblings that did not exist -- startup_failure, zero jobs, empty logs, every caller at once. The token landed, v6.0.0 was cut, floating v5 stayed at d598b7d, so the wait is over. Repointing pr-merge.yml is the substantive part: until now this repo's own merges ran frozen v5 code, which has no bump-token guard and passes no --subject. The repo documented a rule it was not itself subject to. It is now. Also updates the prose that described these pins as frozen -- in CLAUDE.md, CONTRIBUTING.md and two workflow comments. That text was correct this morning and false the moment the refs moved; CLAUDE.md is the file the next agent reads as spec, so it is the one that must not lag.
What this does
merge-on-approval.ymlnow passes--subject "<PR title> (#<number>)"on a squash merge, so the subject of the single commit that reachesmainis set, not inferred.Before this, the landing subject was predicted from the repo's
squash_merge_commit_titlesetting plus the PR's commit count: GitHub's defaultCOMMIT_OR_PR_TITLEuses the commit's own subject on a single-commit PR and switches to the PR title from two commits up. The bump-token guard had to reproduce that inference to know what it was guarding, and the docs had to tell contributors "put the token in both places, because it depends".Passing the subject deletes all of that: the single-commit branch, both API reads (
squash_merge_commit_titleand the commit count), and the "both places" rule. One rule remains — the bump token goes in the PR title.Why this is a MAJOR, deliberately
This is intentional, not a mis-classification, and it is the point most worth reading before approving.
The repo's rubric says "if a caller's shim could keep working untouched → patch or minor". Every shim is untouched — no input, secret or permission changes. By that line alone this would be a minor.
It ships as a major anyway because it changes observable behaviour for every caller with no opt-out: a caller on GitHub's default whose PRs are single-commit currently lands that commit's own subject, and after this lands the PR title instead. That is "changing a default callers must react to".
An opt-out input (
squash-subject: pr-title|repo-default, defaulting to today's behaviour) was considered explicitly and declined. It would keep both code paths alive — the controlled one and the inferred one — and the inferred path is precisely the complexity this change exists to delete. Arepo-defaultdefault would also force the guard back to readingsquash_merge_commit_titleand the commit count, which is the per-repo dependency being removed.Consequence, accepted knowingly: cutting v6 freezes v5, because
tag-release.ymlre-points only the current major. Every caller keeps running v5 code until itsuses:is moved by hand.One more caller-impact edge: on default settings (
merge-method: squash,mode: auto), the guard refuses a merge when the PR carries more than 250 commits (GitHub'spulls.commitsfield caps there). Remedy: merge by hand, or split the PR.One more caller-impact edge: on default settings (
merge-method: squash,mode: auto), a squash merge whose PR title carries a bump token raises a::warning::annotation naming the release it will cut and noting that the title is already frozen. With no token in the title the same explanation is logged plainly, so an ordinary merge raises no annotation.One more caller-impact edge: the PR title is now reduced to its first line and stripped of carriage returns immediately after the guard reads it, before it reaches the log, the
--subjectargv, or the bump-token comparison. A title containing a newline no longer carries a second line into any of those three places — only the first line does.One more caller-impact edge: the >250-commit merge refusal is now disclosed to callers in both
README.md(under Versioning) andCONTRIBUTING.md(next to the token rules) — it has no opt-out input, and the remedy is a manual merge or a split.The mirror hazard, and what is done about it
Forcing the subject closes "the bump token was lost" and opens "the bump token was gained". Because the PR title is now always the landing subject, a token written there incidentally — quoting an error, naming the convention in prose — cuts that release for real.
tag-release.ymlexcludes commit bodies for exactly this reason: prose discussing a bump once matched itself and cut a spurious release. That mitigation cannot transfer here, because under this convention the title is the only channel the token can travel on, so an incidental token and an intended one are byte-identical and no check can separate them.Since no check can, the guard does the one thing available: on every squash — not only when a bump was requested — it logs which release the merge will cut, at the point where the fix is still free (edit the title, no new commit, the approving review survives).
What is deliberately NOT in this PR
Two files stay pinned at
@v5, both for reasons recorded inCLAUDE.md:pr-merge.yml— auses:job validates against the PINNED ref, and@v6does not exist until this merge cuts it. Rolling it here would bestartup_failureand the PR could not land itself.pr-checks.yml— it names itself in its ownpaths-ignore, so a PR changing only it creates no run at all, and bundling it with another path yields a run that exists but reviews nothing.Until both are repointed, this repo's own merges keep running frozen v5, so the
--subjectbehaviour documented here is not in effect for this repo's own automation. Tracked in #43, which is blocked on the v6.0.0 tag this PR cuts.Testing
The guard's shell is extracted verbatim from the YAML by index and run against a stubbed
gh: 45 shell cases intests/guard/run.sh, plus a 7-assertion jq harness (tests/guard/jqtest.sh), both run bytests/guard/all.sh, executed by.githooks/pre-pushlocally and by.github/workflows/guard-tests.ymlin CI on every push and pull request. Flipping the comparison turns exactly the positive-control cases red. The stub's catch-allexit 99is never reached, which is the positive evidence that the two removed API reads are genuinely gone rather than merely unused.Scope of the v6 roll
Every documented pin moved to
@v6: README usage examples,SECURITY.md, the PR template, the k8s and runner-image READMEs, doc-comment examples, and the caller-facinguses:example comment at the top ofrelease-extension.yml— the tag an external repo will actually ask for. The three real intra-repouses:lines in that same file deliberately stay at@v5:v6does not exist until this PR's own merge creates it, and if the#majortoken failed to survive the squash,tag-release.ymlwould cut a patch and re-point the floatingv5tag onto this tree — leavingrelease-extension.yml@v5referencingnode-test.yml@v6and friends, which would not exist, breaking every caller withstartup_failure. Tracked in #43 along with the rest of the intra-repo repin, oncev6exists to point at.A byte-level inventory (not code search, which measured ~12% recall on this enumeration) puts the remaining work at 20 active repos, 73 files, 92 floating
@v5refs; the three@v4stragglers are all archived and stay as they are.