Skip to content

Commit 51792f8

Browse files
committed
fix(platform-checklist): count the binding pin over comment-MASKED source, and disclose what it still cannot see
F3, third pass. The pin demanded exactly one occurrence of each call site and counted RAW source, so the most ordinary severing gesture there is walked straight past it: commenting the call out IN PLACE left the commented line as the one occurrence, and `--self-test` stayed at 217/217 with the live gate at 264 active. The nastier variant did the same while inverting behaviour — comment the `mappedCount` gate out, add an ungated increment below it, and a kind mapped only to planned items is counted as covered on the OK line. The remedy is one line: `maskComments`, already imported in this file and already used twice in it, applied before counting. Masking also settles the decoy rule in the only consistent direction — a copy inside a comment is neither a call site nor a decoy, so it must neither satisfy the count nor inflate it. ⛔ And the claim is narrowed to the enforcement, which is the part that is not optional. This is a TEXT pin. It answers "is this call site still written, in live code, exactly once?" and it is NOT proof the call executes: shadowing, a call moved into a never-called helper, and a call left under a dead branch all keep the spelling intact and this pin reports nothing. The docblock says so and G12 asserts it, so nobody reads a green G1 as more than it is. Closing those needs the walk driven over a fixture ledger — a root knob or the walk factored into a callable — which is not built here by the seat's scope call. G9–G11 keep the mask: reverting it to a raw count reds those three rows and nothing else. The OFF legs' first-occurrence anchoring is noted where they are written. Claude-Session: https://claude.ai/code/session_01AmH9bKvGoLjiY86Q4Z3og2 Co-authored-by: Claude <noreply@anthropic.com>
1 parent b835196 commit 51792f8

1 file changed

Lines changed: 123 additions & 17 deletions

File tree

‎scripts/check-platform-checklist.mjs‎

Lines changed: 123 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -265,33 +265,77 @@ function coverageEntryProblems(ids, statusOf) {
265265
* read driven BOTH ways over ONE text, so a green is the binding holding and
266266
* not a read that matched everything, or nothing.
267267
*
268+
* ## ⛔ WHAT THIS PIN CANNOT SEE — read this before trusting it
269+
*
270+
* It is a TEXT pin over comment-masked source. It answers one question — "is
271+
* this call site still written, in live code, exactly once?" — and ⛔ it is not
272+
* a proof that the call EXECUTES. Three ordinary severings walk straight past
273+
* it, and all three were measured leaving `--self-test` at exit 0 and the live
274+
* gate at exit 0 on this file:
275+
*
276+
* - **shadowing** — `const statusFieldProblems = () => [];` above the call,
277+
* which stays written and starts returning nothing;
278+
* - **a dead helper** — the call moved into a function nobody invokes;
279+
* - **a dead branch** — the call left under a condition that never holds.
280+
*
281+
* Those are SEMANTIC, and no text pin can reach them: the spelling is intact in
282+
* every one. Closing them needs the walk driven over a fixture ledger, which
283+
* needs a root knob (`AREAS_DIR` is fixed from `import.meta.url`) or the walk
284+
* factored into a callable. That is deliberately NOT built here, and this
285+
* paragraph is the disclosure that makes the omission a recorded trade rather
286+
* than an implied guarantee. ⛔ Do not describe this function as proving the
287+
* bindings execute.
288+
*
289+
* What masking DOES close is the form that defeated the first version of this
290+
* pin: **commenting the call out in place**. The commented line was the one
291+
* occurrence, the raw-source count read 1, and everything stayed green — the
292+
* exact "commented-out draft" this function's own decoy note already named.
293+
* `maskComments` is applied before counting for that reason, and three OFF legs
294+
* below drive it.
295+
*
268296
* ⚠️ This pin is SPELLING-SENSITIVE on purpose, and that is its whole cost:
269297
* rewording a call site reds it. ⛔ The repair is to update the pinned spelling
270298
* in the same edit — ⛔ never to delete the row, which is indistinguishable
271299
* from severing the call it guards.
272300
*
273-
* @param {string} source this module's own text
274-
* @returns {string[]} one message per binding that is not present
301+
* Readings quoted above were taken on `claude/issue-19157-checklist-planned-status`
302+
* at `b835196bc1` (this repo) — a count without the tree it came from is not a
303+
* reading.
304+
*
305+
* @param {string} source this module's own text, raw; comments are masked here
306+
* @returns {string[]} one message per binding that is not present in LIVE code
275307
*/
276308
function statusBindingProblems(source) {
277309
const problems = [];
310+
// ⭐ Comments are masked BEFORE counting, and that one call is the whole
311+
// difference between a pin that fires on a commented-out call site and one
312+
// that does not. It also fixes the decoy rule's own blind spot in the right
313+
// direction: a copy of a pinned spelling sitting in a comment is not a live
314+
// call site, so it must neither satisfy the count nor inflate it.
315+
// ⛔ Do not switch this back to raw `source` to make a reword green.
316+
const live = maskComments(String(source));
278317
/**
279-
* EXACTLY ONE occurrence, not "at least one" — and the second direction is
280-
* the one this was rewritten for. The OFF legs below sever a call site over
281-
* a copy of this text, so anything that leaves a SECOND literal copy of a
282-
* pinned spelling anywhere in this file (a needle written out longhand, a
283-
* commented-out draft, a doc example) keeps this check green after the real
284-
* call is gone. That is a decoy, and the first draft of this very function
285-
* shipped one: its severing needles were plain string literals, the predicate
286-
* matched THOSE, and both OFF legs read as passes. The OFF legs caught it.
318+
* EXACTLY ONE occurrence in LIVE code, not "at least one" — and the second
319+
* direction is the one this was rewritten for. The OFF legs below sever a
320+
* call site over a copy of this text, so anything that leaves a SECOND
321+
* literal copy of a pinned spelling in live code (a needle written out
322+
* longhand, a doc example in a template string) keeps this check green after
323+
* the real call is gone. That is a decoy, and the first draft of this very
324+
* function shipped one: its severing needles were plain string literals, the
325+
* predicate matched THOSE, and both OFF legs read as passes. The OFF legs
326+
* caught it.
327+
*
328+
* A copy inside a COMMENT is neither a decoy nor a call site — masking removes
329+
* it from both sides of the count, which is the only consistent reading: the
330+
* same commented line must not satisfy the rule when the real call is gone.
287331
*/
288332
const bound = (re, what) => {
289-
const hits = source.match(re)?.length ?? 0;
333+
const hits = live.match(re)?.length ?? 0;
290334
if (hits === 1) return;
291335
problems.push(
292336
hits === 0
293337
? what
294-
: `${what} — and this spelling occurs ${hits} times in the file; a second literal copy of a pinned call site is a DECOY that holds this check green after the real one is severed`,
338+
: `${what} — and this spelling occurs ${hits} times in LIVE code; a second literal copy of a pinned call site is a DECOY that holds this check green after the real one is severed`,
295339
);
296340
};
297341
bound(
@@ -1019,10 +1063,17 @@ const SELF_TEST_BATTERIES = Object.freeze({
10191063
//
10201064
// 28 → 38: the fixtures above drive two PURE functions and so could say
10211065
// nothing about whether anything CALLS them. Both call sites were severed and
1022-
// measured green at 207/207, so the G-rows pin the BINDINGS by a source read
1023-
// driven ON and OFF, and two F-rows pin the `since` rule's own limit in the
1024-
// direction it deliberately does not go.
1025-
[BATTERY_PLANNED_STATUS]: 38,
1066+
// measured green at 207/207 (this branch, `22453417e1`), so the G-rows pin the
1067+
// BINDINGS by a source read driven ON and OFF, and two F-rows pin the `since`
1068+
// rule's own limit in the direction it deliberately does not go.
1069+
//
1070+
// 38 → 42: that first pin counted RAW source, so commenting a pinned call out
1071+
// IN PLACE left it green — the commented line was the one occurrence. Counting
1072+
// over comment-MASKED source closes it; G9–G11 are what keep the mask, and
1073+
// G12 records in an assertion what the pin still cannot see. Measured on this
1074+
// branch at `b835196bc1`: reverting the mask reds G9, G10 and G11 and nothing
1075+
// else.
1076+
[BATTERY_PLANNED_STATUS]: 42,
10261077
});
10271078
const SELF_TEST_BATTERY_FLOOR = 7;
10281079

@@ -2339,11 +2390,27 @@ function selfTestPlannedStatus() {
23392390
* counts occurrences precisely so such a decoy reds — and the split keeps this
23402391
* battery from being the thing that trips it. Each break falls INSIDE an
23412392
* identifier, so no contiguous copy exists in the source at rest.
2393+
*
2394+
* ⚠️ ORDER-SENSITIVE: `String.replace` with a string needle cuts the FIRST
2395+
* occurrence. Were a decoy copy ever to appear ABOVE the real call site, the
2396+
* cut would land on the decoy and the real call would survive — the leg still
2397+
* reds, but through the exactly-one row rather than the one it was written
2398+
* for. ⛔ Read the failure TEXT of a red leg, never just its exit code.
23422399
*/
23432400
const sever = (head, tail) => {
23442401
const text = OWN_SOURCE.replace(head + tail, '/* severed for the OFF leg */');
23452402
return { text, changed: text !== OWN_SOURCE };
23462403
};
2404+
/**
2405+
* Comment a line out IN PLACE — the severing gesture a RAW-text count misses
2406+
* entirely, because the commented line is still the one occurrence. Same
2407+
* two-half needle and the same first-occurrence caveat as `sever`.
2408+
*/
2409+
const commentOut = (head, tail) => {
2410+
const needle = head + tail;
2411+
const text = OWN_SOURCE.replace(needle, `// ${needle}`);
2412+
return { text, changed: text !== OWN_SOURCE };
2413+
};
23472414

23482415
t('G1 ON — every binding these rules ride on is present in this file',
23492416
statusBindingProblems(OWN_SOURCE).length === 0,
@@ -2373,6 +2440,45 @@ function selfTestPlannedStatus() {
23732440
OWN_SOURCE.length > 10000 && /const COVERAGE_BEARING_STATUSES = new Set/.test(OWN_SOURCE),
23742441
`${OWN_SOURCE.length} bytes read`);
23752442

2443+
// ── the COMMENT-OUT forms, which a raw-text count misses entirely ─────────
2444+
//
2445+
// Measured on this file before masking landed: commenting a pinned call out
2446+
// IN PLACE left `--self-test` at exit 0 with all 217 assertions passing AND
2447+
// the live gate at exit 0 over 264 active items, because the commented line
2448+
// IS the one occurrence a raw count finds. `maskComments` is what closes it,
2449+
// and these rows are what keep it closed — reverting the mask reds G9–G11
2450+
// instead of quietly restoring the hole.
2451+
const outWalk = commentOut('for (const msg of statusField', 'Problems(item)) where(msg);');
2452+
t('G9 OFF — commenting the item-walk call out IN PLACE FIRES, because the count is taken over comment-MASKED source',
2453+
outWalk.changed && statusBindingProblems(outWalk.text).some((p) => p.includes('statusFieldProblems(item)')),
2454+
statusBindingProblems(outWalk.text).join(' | '));
2455+
2456+
// ⭐ The nastiest of the set: comment the GATE out and add an ungated
2457+
// increment below it. The spelling survives in the comment, the behaviour
2458+
// inverts, and a kind mapped only to planned items is counted as covered on
2459+
// the OK line — silently, in the one number a reader trusts.
2460+
const gateLine = `if (bearing > 0) mapped${'Count++;'}`;
2461+
const ungated = `mapped${'Count++;'}`;
2462+
const outGateThenAdd = OWN_SOURCE.replace(gateLine, `// ${gateLine}\n ${ungated}`);
2463+
t('G10 OFF — commenting the `mappedCount` gate out and adding an UNGATED increment in its place FIRES: the spelling survives in the comment while the behaviour inverts, and a kind mapped only to planned items would be counted as covered on the OK line',
2464+
outGateThenAdd !== OWN_SOURCE
2465+
&& outGateThenAdd.includes(`// ${gateLine}`)
2466+
&& maskComments(outGateThenAdd).includes(ungated)
2467+
&& statusBindingProblems(outGateThenAdd).some((p) => p.includes('mappedCount')),
2468+
statusBindingProblems(outGateThenAdd).join(' | '));
2469+
2470+
t('G11 a copy of a pinned spelling inside a COMMENT neither satisfies the rule nor inflates it — the same masked line must not stand in for a call site that is gone',
2471+
statusBindingProblems(`${OWN_SOURCE}\n// for (const msg of statusField${'Problems(item)) where(msg);'}`).length === 0
2472+
&& statusBindingProblems(`${outWalk.text}\n// a second commented copy changes nothing`).some((p) => p.includes('statusFieldProblems(item)')));
2473+
2474+
// ⛔ And the disclosure, asserted rather than left to the docblock: the three
2475+
// SEMANTIC severings this pin cannot see. Each keeps the spelling intact, so
2476+
// the predicate reports no problem — that is the honest answer, and the row
2477+
// exists so nobody reads a green G1 as "the bindings execute".
2478+
const shadowed = `const statusFieldProblems = () => [];\n${OWN_SOURCE}`;
2479+
t('G12 DISCLOSED LIMIT — a shadowing redefinition leaves the spelling intact and this pin reports NOTHING. It is a TEXT pin; ⛔ never read it as proof the call executes',
2480+
statusBindingProblems(shadowed).length === 0);
2481+
23762482
// ── the live control ──────────────────────────────────────────────────────
23772483
// The fixtures prove the rules; this reads the ledger the gate actually
23782484
// validates and proves they are pointed at IT. Every assertion above would
@@ -2418,7 +2524,7 @@ if (process.argv.slice(2).includes('--self-test')) {
24182524
' and the `/meta` call-spelling refusal reads its vocabulary out of the live generated contract, fires on every folded spelling a `call` can instruct, and stays silent on the canonical singular, on parameter placeholders, and on the `why`/`expect`/`source`/`requires` prose that narrates the fold;' +
24192525
' and the line-citation limb DETECTS NOTHING ITSELF EITHER: the last forked grammar in this file went into the shared core at #18592, so what is pinned here is the BINDING — the corpus declaring `pathlessLineCitations`, a source read finding no citation regex and no detector while the same read DOES find the declaration, the binding driven ON and OFF against ONE text so the green is the declaration working rather than a text that would have matched anyway, the DARK case that a citation both grammars already agreed on keeps its verdict either way, the refusal to over-fire on this ledger\'s own HTTP statuses, config literals, URL ports, clock times and quoted JSON, and the live zero with the control that says it is a reading;' +
24202526
' and the symbol-anchor limb DETECTS NOTHING AND RESOLVES NOTHING ITSELF: it is a registered corpus (#18107), so the grammar, the walk and the verdict are all `scripts/symbol-anchors.mjs`\'s, pinned here by a source read that finds no local extension set, no anchor regex and no detector while the same read DOES find the registration, by the anchorable-extension vocabulary being the shared OBJECT rather than a copy of it, by the `runs/` exclusion driven three ways on the live corpus (the subtree holds files, none is swept, the areas beside it still are, and dropping the exclusion puts them back), and by the #16898 binding re-taken through the registration — a call site / import / local parameter / string-substring all reading ABSENT, the positive control that a declaration and a complete quoted token still resolve, a `.json` key resolving where a `.json` value does not, an INLINE object-literal key reading absent where one at the start of a line resolves — with the closed, grow-never residual and the per-file anchor floor held in both directions beside it;' +
2421-
` and the \`planned\` status is driven on fixtures rather than on a ledger that carries none of it — the accept set widened without losing its closure, \`since: null\`/no-steps/personas relaxed for planned alone while the ${plannedStatus.liveItems} live items are judged exactly as before, and the coverage ratchet held BOTH ways: a planned item beside an active one is silent, a kind whose only items are planned is UNMAPPED, and the bearing set is pinned NOT to contain \`planned\`; and the two CALL SITES those rules ride on are pinned by a source read driven ON and OFF, because severing either one left this very self-test green.`,
2527+
` and the \`planned\` status is driven on fixtures rather than on a ledger that carries none of it — the accept set widened without losing its closure, \`since: null\`/no-steps/personas relaxed for planned alone while the ${plannedStatus.liveItems} live items are judged exactly as before, and the coverage ratchet held BOTH ways: a planned item beside an active one is silent, a kind whose only items are planned is UNMAPPED, and the bearing set is pinned NOT to contain \`planned\`; and the two CALL SITES those rules ride on are pinned by a source read over comment-MASKED source driven ON and OFF, because severing either one — by deletion OR by commenting it out in place — left this very self-test green; \u26d4 that pin is a TEXT pin and G12 records the three semantic severings it cannot see.`,
24222528
);
24232529
process.exit(0);
24242530
}

0 commit comments

Comments
 (0)