anchor-guard: a stamped tree with no changeset is now a red check - #494
Open
brentrager wants to merge 1 commit into
Open
anchor-guard: a stamped tree with no changeset is now a red check#494brentrager wants to merge 1 commit into
brentrager wants to merge 1 commit into
Conversation
The guard already checked that a changeset names the right package. It did not check that one EXISTS — and that turned out to be the commoner failure with the same symptom: #470, #471, #474, #488 and the polyglot parity work all changed lockstep-stamped trees, merged green, and published nothing, because they carried no changeset at all. Nothing in this repo distinguishes merged from shipped, so the omission is invisible until someone reads a stale artifact. The original exemption was reaching for docs- and test-only PRs, on the reasoning that failing those would train everyone to ignore the check. In practice those don't touch a stamped tree: a stamped tree is a manifest's directory (`dotnet/server/src`), and tests live beside it in `dotnet/server/tests`. The old self-test asserted the exemption using `dotnet/server/src/Foo.cs` while calling it "docs/test-only" — the test itself encoded the wrong assumption, so it's replaced by the two cases it was conflating. Escape hatch is the one changesets already ships: `pnpm changeset --empty` declares "this deliberately releases nothing" and passes without naming the anchor. A decision rather than an omission, and no bypass flag to maintain. `evaluate` now returns `reason` so the two failures read differently — "carries NO changeset" and "no changeset names the anchor" have different fixes, and a guard that explains the wrong one is a guard people learn to skip. Self-check: 10 passed (was 8). The guard passes on this PR — scripts/ is not a stamped tree, so it needs no changeset itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LkCz96UfUxcai5RU4LwPnG
|
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.
The guard already checked that a changeset names the right package. It never checked that one exists — and that turned out to be the commoner failure with the identical symptom.
Five in a row
#470, #471, #474, #488 and the polyglot parity work all changed lockstep-stamped trees, merged green, and published nothing. Nothing in this repo distinguishes merged from shipped, so the omission stays invisible until someone reads a stale artifact — the same ending as #348 and #352, reached by a different route.
I contributed to it myself, by reasoning from #470's precedent rather than from the release mechanism. That's the tell that it's a system problem rather than five people being careless.
Why the old exemption bought nothing
The original code skipped the no-changeset case deliberately:
Sound reasoning, wrong premise: docs- and test-only PRs don't touch a stamped tree. A stamped tree is a manifest's directory (
dotnet/server/src); tests live beside it indotnet/server/tests. The exemption protected a case that was already safe, and cost five silent non-releases.The old self-test made the same mistake in miniature — it asserted the exemption using
dotnet/server/src/Foo.cswhile naming the case "docs/test-only". It's replaced by the two cases it was conflating.Escape hatch
pnpm changeset --empty— the one changesets already ships. An empty changeset declares "this deliberately releases nothing" and passes without naming the anchor: a decision rather than an omission, and no bypass flag for anyone to maintain.Two failures, two messages
evaluatenow returnsreason, so "carries NO changeset" and "no changeset names the anchor" read differently. They have different fixes, and a guard that confidently explains the wrong one is a guard people learn to skip.Verification
(was 8 — the replaced exemption became three cases: missing-changeset fails, genuinely-docs-only passes, empty-changeset passes.)
The guard passes on this PR:
scripts/is not a stamped tree, so it needs no changeset itself.🤖 Generated with Claude Code
https://claude.ai/code/session_01LkCz96UfUxcai5RU4LwPnG