From 1253ea0e98892639fdeefcd50868d21554726789 Mon Sep 17 00:00:00 2001 From: os-steve Date: Mon, 24 Aug 2026 16:08:35 +0000 Subject: [PATCH] fix(docs-audit): derive the declLead key-spelling pin's population from the source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `--self-test` pin labelled "every key spelling a call site passes comes back ANCHORED" compared a hand-kept three-element list against a literal, while the eight `new RegExp(declLead(…))` call sites pass four distinct spellings. `client` — the one `windowClientRe` passes — was missing, so the pin checked three quarters of what it named. Read the population out of the source instead of correcting the list: a corrected list re-rots the moment a ninth call site arrives. Only the INPUT is derived; the EXPECTED stays a literal, so the comparison is not vacuous. A second pin asserts all eight keys parse as literals, so a computed key fails loudly instead of dropping out of the derived list unseen. Measured: a `client`-only tightening of the allowlist left all 416 cases green before and fails exactly this pin after. --- scripts/docs-audit/affected-docs.mjs | 33 +++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/scripts/docs-audit/affected-docs.mjs b/scripts/docs-audit/affected-docs.mjs index 60ab693ca6..cabdeb3b38 100644 --- a/scripts/docs-audit/affected-docs.mjs +++ b/scripts/docs-audit/affected-docs.mjs @@ -3814,12 +3814,35 @@ function selfTest() { // from would leave the pin watching a door nobody uses any more. check('declLead', 'and the KEY anchor is spelled once too — no call site restates it', 'affected-docs.mjs', 0, (ownSource.match(/declLead\([^\n]*?(?:\\b|\(\? m[2]); + check('declLead', 'and all eight pass their key as a LITERAL — a computed one drops out of the list below unseen', 'affected-docs.mjs', + 8, passedKeys.length); check('declLead', 'every key spelling a call site passes comes back ANCHORED', 'declLead', - String.raw`(? declLead(k)).join(' | ')); + String.raw`(? declLead(k)).join(' | ')); // …and BEHAVIOURALLY the allowlist is a strict TIGHTENING of BOTH anchors it has replaced, // which is the invariant the population pricing rests on. Swept rather than argued, and // swept against the anchor it ACTUALLY replaces (#11710's lookbehind) as well as against the