fix(tooling): error-status gate names the real cause when a code leaves the ungraded set (#9563) - #9577
Merged
Merged
Conversation
…es the ungraded set (#9563) check-error-status-conformance.mjs's nowPinnedMessage() hard-coded a single cause ("a producer now declares its status") for ANY baselined-unpinned code that left result.unpinned -- but that subtraction has two distinct causes, split at the documented.has(code) juncture reconcile() already branches on: - a producer appeared (runtime.size > 0), or - the code's doc entry was removed, so documented.has(code) went false, with no producer either. Split the derivation into a pure nowPinned() function returning a reason per code, and two message functions (nowPinnedProducerMessage / nowPinnedDocRemovedMessage) so each cause gets its own accurate sentence. Both remedies stay `--update`; no baseline, catalog, or grading-model change. Added self-test cases 21/21b (producer branch) and 22/22b (doc-removed branch), following the file's own ENTRY_HEADING_SHAPES precedent that an unexercised branch is the defect. CASES: 36 -> 40.
os-steve
marked this pull request as ready for review
August 18, 2026 12:15
This was referenced Aug 18, 2026
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 #9563
check-error-status-conformance.mjs'snowPinnedMessage()computed theratchet-down trigger as a subtraction (
baselined \ result.unpinned) buthard-coded a single cause for it: "a producer now declares its status."
result.unpinneddrops a code for either of two unrelated reasons —reconcile()'s own branch atdocumented.has(code)shows why:A baselined code leaves
unpinnedbecause a producer appeared(
runtime.size > 0), or because its doc entry was removed(
!documented.has(code), with no producer either). Only the first cause hada sentence.
Before — the false diagnosis, reproduced
Per the issue's counterfactual: temporarily deleted the
## Batch Operation Errorssection fromcontent/docs/api/error-catalog.mdx(its three entries—
BATCH_PARTIAL_FAILURE,BATCH_COMPLETE_FAILURE,TRANSACTION_FAILED—are all in
scripts/error-status-unpinned-baseline.jsonand none has a realproducer) and ran the gate on
main, before this fix:No producer declares a status for any of the three (verified by grep across
packages/,examples/,apps/— the only hits outside the enumdeclaration are two spec tests). The message is simply false on this route.
Restored the doc file (
git restore --source=HEAD) before touching any code.After — the same counterfactual, this fix applied
Truthful now, and
--updateis still the correct remedy either way — theratchet direction and remedy are unchanged, only the stated cause. Doc file
restored to a clean tree again afterward;
git status --porcelainis emptyon
mainHEAD for that path throughout.What changed (
scripts/only)nowPinnedMessage()-> split intonowPinnedProducerMessage()andnowPinnedDocRemovedMessage(), each naming its real cause.nowPinned({ baselined, unpinned, vocabulary, documented }),placed beside
reconcile(): derives{ code, reason }[]at the samedocumented.has(code)juncturereconcile()branches on, so the messageselection isn't guessing — it reuses the same fact reconcile() already
computed.
runFixture()now also returnsdocumented(the parsed doc-side set), sofixture-level self-tests can call
nowPinned()directly.diagnosis text + self-tests only.
Self-test — 2 new cases per branch (36 -> 40)
while remaining documented is named
reason: 'producer', andnowPinnedProducerMessage()names a producer, not a doc removal.error-catalog.mdxpublishes some error statuses only in prose or a JSON example, socheck:error-status-conformancegrades them as nothing — three entries publish no status it can read at all #9266 /check:error-status-conformance'snowPinnedMessagemisdiagnoses the retirement route — it says "a producer now declares its status" when the real cause is the catalog entry being removed #9563 counterfactualreduced to a fixture (no producer, doc entry gone) is named
reason: 'doc-removed', andnowPinnedDocRemovedMessage()names a removeddoc entry, not a producer.
ratchet-down messages (neither carries the MAINTAINER-ONLY marker).
Reverse verification
Committed the fix, then temporarily forced
nowPinned()'s branch to alwaysreturn
reason: 'producer'(reverting only the causal split, keeping the newself-test cases) and re-ran
--self-test. Predicted: case 22 (doc-removedbranch) goes red, everything else stays green. Observed exactly that:
Restored the fix from the branch (
git checkout claude/issue-9563-gate-diagnosis-split -- scripts/check-error-status-conformance.mjs); re-ran--self-test, back to 40/40 green.Gates
node scripts/pm/dispatch-gates.mjs scripts/check-error-status-conformance.mjs-> 1 matched family:
pnpm check:error-status-conformance(lint.yml).pnpm check:error-status-conformance(self-test + real run) — green, athead
f173b99db:pnpm check:nul-bytes(self-test + real run, under the shared/tmp/os-heavy-verify.lock) — green:check-nul-bytes: OK (scanned 6157 text file(s) … no raw ASCII control bytes).git log --oneline -- scripts/check-error-status-conformance.mjsshows the file's last two substantive commits (fix(scripts): six source-scanning gates share one string-aware comment masker #9445, fix(gates): reconcile the HTTP status the docs publish for ledger error codes, and report an entry heading the parser cannot read #9268) shipped
without one — root-level
scripts/tooling isn't part of any package in.changeset/config.json'sfixedlist. Followed the house convention.Serial constraint (#9266)
#9266 (
needs-user-decision, same file's subject matter) is still open withno linked PR as of this branch's base — no re-run of the observation was
needed. No
content/docs/releases/edits, no baseline rewrite, no catalogedit landed by this PR.
Generated by Claude Code