Skip to content

Commit e7bf269

Browse files
committed
fix(gates): refuse the ledger-growth remedy in check-self-test-wired, and record the shape
check-ratchet-remedy-authority went red on this branch and is green on main: the remedy sentence is older than this PR, but a comment added here named SELF_TEST_RUN_OTHERWISE and its shrink-only nature one line apart, which pulled the target inside anchorFor's 400-character window for the first time. The message now says what the ledger's own docblock already said -- wiring the self-test is the whole remedy -- and the legitimate row is named as a maintainer's judgement of evidence. Shape recorded in the control corpus. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
1 parent 0d58ba2 commit e7bf269

2 files changed

Lines changed: 50 additions & 6 deletions

File tree

‎scripts/check-ratchet-remedy-authority.mjs‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,40 @@ const CONTROL = {
701701
why: 'PR for #11341. Refuses by binding a negation to the verb, over a shrink-only baseline holding only the child-environment leaks that predate the gate; their repair is a card per neighbourhood, so no authority is missing.',
702702
},
703703

704+
// The sixth refusal instance, and the first to arrive because a gate's own
705+
// SHRINK TESTIMONY MOVED rather than because its remedy did (#13489). Its
706+
// remedy sentence is unchanged from before that card and was reachable the
707+
// whole time; what changed is proximity. `anchorFor` reads the ±400 characters
708+
// around every mention of a DECLARED target, and this gate's `⛔ SHRINK-ONLY`
709+
// banner sits at the top of a docblock long enough to push the const's own
710+
// name out of that window. A comment added elsewhere in the file named
711+
// SELF_TEST_RUN_OTHERWISE and its shrink-only nature one line apart, stage 2
712+
// reached the target for the first time, and a remedy that had been offering
713+
// registry growth for as long as it existed became visible.
714+
//
715+
// ⛔ The lesson is about this detector, not about that comment: a gate whose
716+
// testimony sits just outside the window is INDISTINGUISHABLE here from one
717+
// with no ratchet at all, and the difference is a docblock's length. Recorded
718+
// rather than engineered around — the window is a deliberate precision choice
719+
// (widening it was measured and rejected), so the honest response is to know
720+
// that `excluded` can mean "not reached yet".
721+
//
722+
// Refusal — not marking — because the ledger's own docblock already says it:
723+
// "Nothing joins this list to silence a finding: a gate that really does ship
724+
// an unrun self-test gets wired instead." The author-facing message had been
725+
// contradicting that sentence; it now agrees with it. The legitimate row still
726+
// exists and is named, as a maintainer's judgement of evidence rather than as
727+
// an escape from wiring. Both refusal limbs fire on the rewritten sentence:
728+
// the negation bound to the verb, and the act denied as its own subject.
729+
//
730+
// ⚠️ The two shapes are quoted HERE and not in the `why` below. Putting them
731+
// in the string made this file read as an instance of its own convention and
732+
// reddened self-test case (1) — measured, on the first attempt at this entry.
733+
'check-self-test-wired.mjs': {
734+
expect: 'refused',
735+
why: 'PR for #13489. Refuses by both limbs at once over a shrink-only ledger — see the sentence quoted in the comment above — because wiring the self-test is the whole remedy and it is the landing author\'s. Reached for the first time when a comment elsewhere in that file put the ledger\'s name and its shrink-only nature one line apart, inside anchorFor\'s window; the remedy sentence itself is older than this card.',
736+
},
737+
704738
// The tenth, and the fourth to join as a NEW gate rather than by retrofit
705739
// (#13582). Marking rather than refusal, on the same reading as the seventh
706740
// through ninth: there IS a legitimate act here and it has an owner. The gate

‎scripts/check-self-test-wired.mjs‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ import { maskComments } from './js-comment-mask.mjs';
107107
const ROOT = join(fileURLToPath(new URL('.', import.meta.url)), '..');
108108
const WORKFLOW_DIR = '.github/workflows';
109109

110+
// The token every gate in this farm writes when it names a path belonging to a
111+
// maintainer rather than to the landing author (#8435). Declared per gate by
112+
// convention, and read out of AUTHOR-FACING strings — a comment mentioning it
113+
// tells an author nothing, so it has to live in the message itself.
114+
const RATCHET_AUTHORITY_MARKER = '⛔ MAINTAINER-ONLY';
115+
110116
/** Extensions whose files can be a `scripts/` entry point. */
111117
const SCRIPT_EXT = /\.(mjs|mts|js|sh)$/;
112118

@@ -263,10 +269,13 @@ export function auditPopulation({ carriers, named, selfTested, ledger }) {
263269
' `--self-test`, but no workflow ever executes it with that flag. An unrun\n' +
264270
' self-test is a phantom check, and for a gate whose defect class is its\n' +
265271
' matching rule it is also the ONLY instrument the rule has (#11150).\n' +
266-
` Wire \`node ${script} --self-test\` into the step that runs it. If the\n` +
267-
' self-test is already run some other way — the script drives another tool\'s,\n' +
268-
' or its ordinary run executes its own cases — add a SELF_TEST_RUN_OTHERWISE\n' +
269-
' row in scripts/check-self-test-wired.mjs naming the evidence for that.',
272+
` Wire \`node ${script} --self-test\` into the step that runs it. That is the\n` +
273+
' whole remedy, and it is the landing author\'s.\n' +
274+
' ⛔ Do not add a SELF_TEST_RUN_OTHERWISE row to clear this. That ledger is\n' +
275+
' shrink-only; adding an entry is not the fix, it is this finding written down\n' +
276+
' somewhere quieter. A row records that a self-test genuinely IS run another\n' +
277+
' way — a wrapper drives it, or the ordinary run executes its own cases — and\n' +
278+
` judging that evidence is ${RATCHET_AUTHORITY_MARKER}, never a way out of wiring.`,
270279
});
271280
}
272281
return findings;
@@ -706,8 +715,9 @@ function selfTest() {
706715
'\nA battery at or below its floor means cases STOPPED RUNNING — the battery is the bug,\n' +
707716
'not the number. Find what stopped registering (an early return, a deleted block, a guard\n' +
708717
'that now skips) and restore it. Raising a floor after ADDING cases is ordinary work;\n' +
709-
'LOWERING one is not a co-equal option — "the count legitimately moved" and "something\n' +
710-
'stopped running" need different edits, and only a measurement tells them apart.\n',
718+
`LOWERING one is ${RATCHET_AUTHORITY_MARKER}, not a co-equal option — "the count\n` +
719+
'legitimately moved" and "something stopped running" need different edits, and only a\n' +
720+
'measurement tells them apart.\n',
711721
);
712722
}
713723
process.exit(1);

0 commit comments

Comments
 (0)