fix(scripts): the ADR-0087 gate's own header stops hand-enumerating CATEGORIES - #16214
Merged
Merged
Conversation
…ATEGORIES `check-adr-0087-registration.mjs`'s header docblock listed five disposition marker forms and omitted `type-surface-only`, the sixth -- a third, unchecked copy of the same set the file already pins against ADR-0087 in both directions (#8299). Per the #14378 precedent for this exact defect class, the enumeration is deleted rather than patched: the header now shows the marker grammar once, generically, and points at `CATEGORIES` for the actual vocabulary, so it cannot drift again the way it just did. Adds one self-test battery (H1) that reads the gate's own source and refuses if the header ever names a `CATEGORIES` member again -- reverse- verified: it goes red when the old enumeration shape is reintroduced, and green once removed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
baozhoutao
marked this pull request as ready for review
September 6, 2026 06:29
baozhoutao
enabled auto-merge
September 6, 2026 06:29
baozhoutao
deleted the
claude/issue-15915-adr-0087-header-marker-list
branch
September 6, 2026 06:56
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.
Fixes #15915
What changed
check-adr-0087-registration.mjs's header docblock hand-enumerated the fivenot-required (<category> ...)marker forms plusregistered, and omittedtype-surface-only-- the sixth. Per the #14378 precedent for this exact defect class, the enumeration is deleted, not patched:The header now shows the marker grammar once, generically, and points readers at
export const CATEGORIES(already pinned against ADR-0087's addendum in both directions, #8299) instead of restating its members. A restatement that must be kept in step with a real list is the same defect twice over -- adding a category updates the const and the ADR, and the header would still drift, forever, no matter how many members exist.The prose at
:2274("The sixth category:type-surface-only") already agreed with reality; only the header disagreed. It is left as-is (historical, not a running count) and is now consistent with the header, which no longer asserts a count of its own.Anti-drift pin
Added one self-test battery, H1 (#15915), that reads the gate's own source at self-test time and refuses if the header ever names a
CATEGORIESmember again as(nameinside the rule section. Reverse-verified by hand before commit:not-required (type-surface-only ...)line →--self-testwent red with the H1 message naming the exact category.--self-testgreen again, byte-identical to the pre-mutation file (diffed).SELF_TEST_BATTERIESgained theH1entry (floor 7: 1 anchor-sanity assert + 1 generic-line assert + 5CATEGORIESmembers) andSELF_TEST_BATTERY_FLOORmoved 49 → 50.Why the file's own #8299 pin couldn't see this (context, not new work)
assertInputspinsCATEGORIESagainst ADR-0087's addendum in both directions, so the const and the ADR cannot disagree. The header prose was a third, unchecked copy of the same set -- invisible to that pin by construction, since the pin only ever compares the const and the ADR to each other. This PR does not touch that pin; it removes the third copy instead of teaching the pin to read a fourth thing.Scope
File surface is exactly
scripts/check-adr-0087-registration.mjs(header docblock + its own self-test, for the new pin). No other file touched. No changeset: this script ships nothing underpackages/**--skip-changesetapplied.The optional sweep triage suggested ("how many other gate headers under
scripts/**restate their own consts") was not run: a trustworthy positively-controlled measurement of that shape needs its own designed grep, and a low-confidence number would be worse than none. Left for a separate finding if someone wants to build that measurement.Tests
node scripts/check-adr-0087-registration.mjs --self-test-- green, 332 assertions (up from 325 pre-change; H1 added 7).node scripts/check-adr-0087-registration.mjs --base origin/main-- green (this PR adds no declared-breaking changeset).node scripts/check-scripts-symbol-anchors.mjs(+--self-test) -- green, no anchor pins this file's line numbers.node scripts/check-declaration-mirrors.mjs(+--self-test) -- green (unrelated to this file; this file has no.d.mtsmirror).node scripts/pm/dispatch-gates.mjs --commands, re-derived after rebasing onto freshorigin/main) -- all 34 commands run, all green.check:pm-dispatch-gatesrun under the shared verify lock (OS_VERIFY_LOCK_SLOT=issue-15915).🤖 Generated with Claude Code
https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
Generated by Claude Code