ci: close two version/CI gaps a green PR cannot show you - #1500
Merged
Merged
Conversation
TASK-100, two of its three parts. The third (strict: true, so a PR's checks must have run against current main) is a branch-protection change with a measured blast radius and is raised separately. 1. The version guard could not see a PR PAIR. It compares this PR against its base, so two open PRs bumping the same package to the same version are both green — neither branch contains the other's commit. Measured, not assumed: two branches both taking cli 0.1.30 to 0.1.31 while touching different files under cli/src merge with NO conflict, and the result is a single 0.1.31 holding both PRs' source. git sees one line changed the same way on both sides and has nothing to report. npm then carries a version mapping to an artifact neither PR alone produced — the exact defect of #979 and #1017. Older PR keeps the version, newer picks the next, so one author can always clear it alone. Only an ADDED version line counts: every stale branch carries an old package.json and proposes nothing by doing so. 2. Stacked PRs are under-gated, and it reads as a full green. Every guard here is `branches: [main]`, so none runs on a PR based on another feature branch. The three open stacked PRs (#1219, #1172, #1132) carry 4-5 checks each against ~12 on a main-based PR; absent from all three are the version guard, the stale-base guard and CodeQL. Nothing counts checks, so a short green looks like a clean one. The new guard therefore has no branches filter — a check scoped to main cannot see the PRs it exists to catch. Both gh calls in the pairs arm fail closed. An unchecked error yields an empty version list, which reads as "this PR bumps nothing" and passes: the guard at its most reassuring exactly when blind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TASK-100, two of its three parts. The third —
strict: true, so a PR's checks must have run against current main — is a branch-protection change with a measured blast radius; numbers below, raised for @sam rather than done unilaterally.1. The version guard could not see a PR pair
It compares this PR against its base, so two open PRs bumping the same package to the same version are both green: neither branch contains the other's commit.
I assumed that pair would conflict on the version line. It does not — measured, two branches both taking cli
0.1.30→0.1.31while touching different files undercli/srcmerge with no conflict, producing a single0.1.31that holds both PRs' source. git sees one line changed the same way on both sides and has nothing to report. npm then carries a version mapping to an artifact neither PR alone produced, which is exactly #979 and #1017.Older PR keeps the version, newer picks the next — always clearable by one author alone. Failing both would deadlock.
Only an added version line counts. Every stale branch carries an old
package.jsonwithout proposing anything, and an earlier draft of my own measurement counted those: it reported 69 version claims across 33 PRs when the true number of PRs modifying a publishedpackage.jsonis 3.2. Stacked PRs are under-gated, and it reads as a full green
Every guard here is declared
branches: [main], so none of them runs on a PR based on another feature branch:docs/checklist-rule-18-source-assertionsdocs/checklist-rule-19-fail-noisydocs/ax-two-call-sitesmainAbsent from all three: the version guard, the stale-base guard, CodeQL analyze. Nothing counts checks, so a short green is indistinguishable from a clean one. A stacked base is also an auto-close dependency — when the parent merges and its branch is deleted, GitHub closes or silently retargets the child, and a retarget lands a diff that was never CI'd against main.
The new guard has no branches filter, deliberately: a check scoped to main cannot see the PRs it exists to catch.
Merging this reds those three PRs. That is the intent; they retarget to main and rebase.
Verification
commonly-mcpit merely carriesghcall failingPart 3, for @sam —
strict: truehas a blast radiusCurrently
strict: false, one required context (Test & Coverage), no required reviews. Turning on "require branches to be up to date":Worth knowing what the freeze already costs: #1215, #1217 and #1218 all show
Source changed ⇒ version bumpedgreen, from runs days old, and all three propose versions below current main (cli 0.1.19/0.1.20 vs main 0.1.30; mcp 0.3.5 vs 0.3.7). Today those runs would red. They conflict on the version line, so git stops the walk-back — the guard's green is stale, not load-bearing here, but it is stale.Suggested sequence: press the PRs you have already ruled on, then flip
strict: true, then rebase the rest.🤖 Generated with Claude Code