fix(canary): read a breaking change only from the title's ! (#1571)

Merged
DO
7d ago
+874-15

Why

The canary autocut takes a major bump from a BREAKING CHANGE: line anywhere in a commit message. Once a repo's squash message is the pull request body (#1568), that body is free text, so a quoted footer would force a major release by accident, and a skip-CI marker would land the merge on main unchecked. The Maintainer ruled on 2026-11-23 that only the title's ! (plus the existing workflow_call interface check) marks a breaking change. Closes #1571.

What changed

  • scripts/canary-rollout.sh: _autocut_commit_signals and _autocut_range_signals read a break only from the subject's !. The body footer match is gone; the comments say why. The range path now also accepts a hyphenated type (ci-fix!:), as the scoped path already did.
  • scripts/lib/pr-body-markers.sh (new, pure) and scripts/check-pr-body-markers.sh (new, CLI): fail when the body or a branch commit message has a BREAKING CHANGE: or BREAKING-CHANGE: line but the title has no !, or when the title, body or a commit message holds one of the five bracketed skip-CI markers or a skip-checks: true trailer. Commit messages count because they are the squash body until a repo opts in to the body. A commit that carries the footer also needs ! in its own subject: a one-commit squash under COMMIT_OR_PR_TITLE (.github-private) or a rebase merge lands that subject on main, and the autocut reads it. The reusable writes each commit message NUL-ended so the check can read each subject.
  • .github/workflows/pr-body-markers-reusable.yml (new, workflow_call): the check as a reusable, so other repos call it at a channel instead of carrying a copy. It checks out the scripts from combsmith/.github at its own commit (job.workflow_sha), so a caller runs the check of the channel it pinned. The title and body reach the script through env: only; the commit messages are read with the job token (pull-requests: read) into a file. An event with no pull request (a merge queue's merge_group) passes without reading anything.
  • .github/workflows/pr-body-markers.yml (new, thin caller): calls the reusable by a local ref (ring0 dogfood, so a change to the check runs on its own pull request), on every pull request, on title and body edits, and on merge_group. Neither this repo nor .github-private has a merge queue today; the trigger is there so a later required ruleset cannot hold one.
  • standards/canary-rings.json: registers pr-body-markers with the standard rings (next is .github-private), watching only its two scripts, with a benign class for its own refusal step (Reject the pull request content that carries a marker; not version-independent, so a candidate that wrongly refuses still counts). and scripts/lib/ring-pins.sh RING_REUSABLES and the canary-rollout.yml dispatch list name it too, as their agreement tests require. The autocut then ships each change to pr-body-markers/v1-next.
  • .github/workflows/pr-body-markers-tests.yml (new): shellcheck and bats for the check, plus static guards on the reusable and its caller (test/scripts/pr-body-markers/workflow.bats).
  • tests/canary_rollout.bats: four new tests (a footer on a feat gives a minor, on a fix a patch, on a script-only change a minor; a script-only ci-fix!: gives a major). The page-cap test now uses a feat!: subject instead of a footer, and the section comments say the footer is not read.
  • standards/canary-rings.json: the autocut note says the footer is not read.

What to look at

  • Order: this must merge and reach stable before any repo is added to the squash opt-in list (#1569), and before the prose ADR (#1566) merges. The .github-private caller, combsmith/.github-private#2607, merges the same day, right after this one.
  • After this merges, before combsmith/.github-private#2607 and before the next canary sweep (minute 33 of every fourth hour): an org admin cuts the first release, pr-body-markers/v1.0.0 and pr-body-markers/v1-next, at the merge commit (scripts/cut-release.sh pr-body-markers 1.0.0 --ref <sha> --channel next --push in .github-private; that pull request teaches the script the agent). If the sweep runs first, the autocut sees a new agent with no tags and creates pr-body-markers/v0.0.1 plus an unversioned pr-body-markers/next (and later promotion may add an unversioned ring0). Those strays are harmless to callers, which pin v1-next, but should be deleted once the v1 line exists. The new reusable is pure workflow_call, so the standard wants it set to disabled in the Actions settings (a setting, so not done here).
  • Required check: the Maintainer has said yes to requiring this check on combsmith/.github and combsmith/.github-private once this and #2607 have merged. The context is pr-body-markers / Body markers, and it reports on merge_group too (it passes there). The ruleset is applied separately; this pull request touches no ruleset or setting.
  • The check is advisory until the ruleset above is applied. Here a pull request runs its own copy of the script, so it catches honest mistakes. In .github-private it runs the channel's copy. Callers in other repos come when each opts in to the body (#1569).
  • Matching is strict on purpose: a footer line counts even when indented or inside an HTML comment, since a body squash message keeps both. The words mid-line (as in the default template's guidance) do not count.
  • Risk: low. A footer-only break now ships as a minor or patch, which is the ruled behaviour, and the new check catches that mistake before merge. Rollback: revert this pull request. Monitoring: the autocut's bump line in the canary sweep log, and the pr-body-markers / Body markers result on each pull request.

Decisions and protected edits

None added; this carries out the Maintainer's ruling of 2026-11-23 under the prose ADR (#1565). No protected edits.

Checks and reviews
  • Reusable (be9c54a to 6d87e60): bats test/scripts/pr-body-markers/ passes 31 of 31; on this pull request pr-body-markers / Body markers ran the scripts from the reusable and passed; actionlint clean with CI's ignores; test/scripts/lib/ring-pins.bats, test/workflows/dependabot/canary-registry.bats, test/scripts/apply-repo-settings/reusable-contract.bats, the bootstrap, compliance and required-checks suites, and the registry and drift tests of tests/canary_rollout.bats pass (one local failure there is the same on the earlier head).

  • Tests: the four new autocut tests failed on main's script and pass on this branch. bats tests/canary_rollout.bats shows the same 67 local failures on main and on this branch (macOS-only environment differences; CI on Linux is the judge). bats test/scripts/pr-body-markers/ passes 18 of 18; a mutant that makes the title's ! optional fails 4 of them, and the large-input test fails on the earlier pipe version. shellcheck and actionlint are clean.

  • Claude review: 8 findings. Taken: branch commit messages are checked too; the check is called advisory; stale test comments; mid-test negations; the hint names the issue; the template test renamed; [^)]. The ADR and template lines in #1566 now state the rule. Security read: no high; medium (the guard covers this repo only, .github-private has none) answered by the reusable and combsmith/.github-private#2607; low (hyphenated type on the range path) taken; low (advisory only) stated above. Gemini: 2, taken. Graphite and CodeRabbit: SIGPIPE under pipefail on a large input, taken; CodeRabbit: a head commit's skip marker suppresses the check, declined for now (the check is advisory, and every other check is skipped on that head too).

  • Reusable readers: Claude review, no blockers; taken: the autocut can create missing tags (the merge plan above), a benign class for the refusal step, narrower watched paths. Security read: no high or medium; lows: channel-tag creation is not covered by the tag ruleset (cut promptly after merge; adding a creation rule is a ruleset change, the Maintainer's), the merge_group pass does not re-read a queued pull request (stated in the header), and here a pull request runs its own copy (stated). Gemini, on #2607: taken. cubic: 7; taken (with dev-lead's 3516bd3 and 6d87e60): an unset title or body is a fault, a bounded retry on the commit read, the registry in the test paths, a stricter #839 guard; declined: the jq regex (correct as written, verified), skip-checks: true anywhere in the body (deliberately strict, since the body becomes the squash message), disabling the reusable (an Actions setting, after merge).

  • Restored in 1003b26: 7f9c2db and 7fb155d had removed the reusable and its registration on a CodeRabbit out-of-scope warning. The reusable is decided scope (the Solution Architect's ruling of 2026-11-23; #1571 now says so), and CodeRabbit's medium read be9c54a, before the benign class. pr-review (822f20b): the description matches the diff again; the jq ^ concern does not hold, since jq anchors ^ at the start of the string ("fix: a\n\nfeat!: b" | test("^[a-z]+!:") is false on jq 1.8), as the autocut already relied on for feat:.

  • Readers on 1003b26 and 6b63554 (first pushed as 87bbc73 and 4b0fd58): security read: no high; medium taken in 6b63554 (a footer commit without ! in its own subject passed on the title's !, then landed as a minor through a one-commit squash or a rebase merge); low (whoever merges can still edit the squash message after the check) stated here, and holds once the check is required. Claude review: no blocker; minor (ring 1 has no caller, so stable promotion needs an override) declined, because tests/canary_rollout.bats holds the idle waiver to pr-review alone (#1513). bats test/scripts/pr-body-markers/ 33 of 33; the two new tests fail on the earlier scripts. On 6b63554: Claude review, no blocker; both readers: a NUL inside a message would split it, taken in the same commit. Security read: medium (the title's ! is lost when a one-commit squash or a rebase lands a commit subject without it and no footer is present) is older than this pull request and turns on the merge settings, so it is follow-on #1583; low (a read error mid-file) declined as theoretical. The check then refused this branch: the first message of that commit wrapped so that a line began with the footer. Its message was rewritten (6b63554, same tree), which is the check doing its job.

  • cubic (3, on 4b0fd58 and earlier): taken in 6599d81: findings exit 3, so a set -e fault (exit 1) can no longer reach the rejection step and the benign class; a NUL inside a message becomes a newline, not nothing. Deferred: the merge_group pass does not read the queued pull request (neither repo has a queue; stated in the header). Readers on 6599d81: Claude review, minor taken in 9e8cb02 (only a findings return of 1 becomes exit 3; any other status keeps its code); security read, lows taken in 9e8cb02 (a NUL-holding message is checked with the NUL as a newline and removed; the header no longer over-claims). Readers on 9e8cb02: none. bats test/scripts/pr-body-markers/ 35 of 35. dev-lead's 3aceab6 (a grep fault in the lib returns 2, never clean) and b66c553 (lint wrap) kept. pr-review cycle 3 (3aceab6): its major was CI still running; taken in cf4abb3: the reusable fails first unless job.workflow_sha resolves to a commit, the 250-commit refusal says how to get past it, two autocut tests pin that a type!: line below the subject is not a major; declined with evidence: cancelled runs (the gate counts only failures) and the byte-identical-only benign class (by design; the Maintainer's trade-off). Readers on cf4abb3: none. bats 37 of 37; the six #1571/#1573 autocut tests pass locally.

🤖 Generated with Claude Code