Skip to content

ci: close two version/CI gaps a green PR cannot show you - #1500

Merged
lilyshen0722 merged 1 commit into
mainfrom
guard/version-and-ci-discipline
Sep 2, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
guard/version-and-ci-discipline

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

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.300.1.31 while touching different files under cli/src merge with no conflict, producing a single 0.1.31 that 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.json without 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 published package.json is 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:

PR base checks
#1219 docs/checklist-rule-18-source-assertions 5
#1172 docs/checklist-rule-19-fail-noisy 4
#1132 docs/ax-two-call-sites 5
any main-based PR main ~12

Absent 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

pair, older PR claims the same version red, names the older PR
pair, no overlap pass
#1217 against real open PRs (proposes cli 0.1.20; older #1215 proposes 0.1.19) pass, and correctly reports "proposes no version" for the stale commonly-mcp it merely carries
either gh call failing red — an unchecked error yields an empty version list, which reads as "bumps nothing" and passes
base = main pass
base = feature branch red

Part 3, for @samstrict: true has a blast radius

Currently 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 bumped green, 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

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>
@lilyshen0722
lilyshen0722 merged commit 325c76c into main Sep 2, 2026
12 checks passed
@lilyshen0722
lilyshen0722 deleted the guard/version-and-ci-discipline branch September 2, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant