Found while working #13800 (verdict handshake, PR #14960), which got a clean reading on scripts/pm/dispatch-gates.mjs by hand-anchoring past this limitation. Filed unassigned. Sibling of #14842, which is the same census reporting NOT MEASURED for a different root cause (a missing ENTRY_BY_HAND row).
The mechanism
injectEarlyReturn(src, name) in scripts/measure-self-test-floor.mjs takes src.match(re) — the FIRST match of
new RegExp(`(?:async\\s+)?function\\s+${name}\\s*\\([^)]*\\)\\s*(?::\\s*...)?\\{`)
The pattern is run against raw source with no literal masking, so it matches inside string and template literals just as happily as at a real definition. In scripts/pm/dispatch-gates.mjs the first match is a FIXTURE — a function selfTest() { embedded in a test string — so return; is injected inside a template literal and the probe copy can only ever produce a SyntaxError. Hence the ledger row:
// Injecting into this file produces a SyntaxError (the anchor lands inside a
// template literal), so no run of it measures anything.
'scripts/pm/dispatch-gates.mjs': null,
That row is accurate about the instrument and was read for months as a property of the file. It is not: anchoring on the real definition (line-start match, or masking literals first) measures it in ONE run. Done by hand in #14960 — before the repair, an early return took that gate from 1288 cases pass to ZERO bytes of output and exit 0; after, exit 1 with the named diagnostic.
Why it matters beyond one file
The census's whole subject is "a green that asserted nothing", and its header says so. An anchor that silently prefers a fixture over a definition produces NOT MEASURED rows that read as "unmeasurable" — a survey shrinking itself for a reason nothing records. The repo already ships the tool this needs: scripts/js-comment-mask.mjs, which measure-self-test-floor.mjs imports for maskComments and could extend to string and template literals; a line-anchored match is the cheaper half.
Worth a control if this is taken: the mask must not blank the file's own controls, which are deliberately fixture strings containing --self-test dispatch spellings.
Second, smaller row in the same ledger
ENTRY_BY_HAND says of scripts/check-platform-checklist.mjs:
// The dispatch calls FOUR self-test functions and combines their statuses
There are FIVE (selfTestSourceLineCitations was added after that note was written), and PR #14960 leaves it five. Stale count in a ledger comment; a one-word fix, listed here so it is not lost rather than because it deserves its own card.
Generated by Claude Code
Found while working #13800 (verdict handshake, PR #14960), which got a clean reading on
scripts/pm/dispatch-gates.mjsby hand-anchoring past this limitation. Filed unassigned. Sibling of #14842, which is the same census reporting NOT MEASURED for a different root cause (a missingENTRY_BY_HANDrow).The mechanism
injectEarlyReturn(src, name)inscripts/measure-self-test-floor.mjstakessrc.match(re)— the FIRST match ofThe pattern is run against raw source with no literal masking, so it matches inside string and template literals just as happily as at a real definition. In
scripts/pm/dispatch-gates.mjsthe first match is a FIXTURE — afunction selfTest() {embedded in a test string — soreturn;is injected inside a template literal and the probe copy can only ever produce a SyntaxError. Hence the ledger row:That row is accurate about the instrument and was read for months as a property of the file. It is not: anchoring on the real definition (line-start match, or masking literals first) measures it in ONE run. Done by hand in #14960 — before the repair, an early return took that gate from
1288 cases passto ZERO bytes of output and exit 0; after, exit 1 with the named diagnostic.Why it matters beyond one file
The census's whole subject is "a green that asserted nothing", and its header says so. An anchor that silently prefers a fixture over a definition produces NOT MEASURED rows that read as "unmeasurable" — a survey shrinking itself for a reason nothing records. The repo already ships the tool this needs:
scripts/js-comment-mask.mjs, whichmeasure-self-test-floor.mjsimports formaskCommentsand could extend to string and template literals; a line-anchored match is the cheaper half.Worth a control if this is taken: the mask must not blank the file's own controls, which are deliberately fixture strings containing
--self-testdispatch spellings.Second, smaller row in the same ledger
ENTRY_BY_HANDsays ofscripts/check-platform-checklist.mjs:There are FIVE (
selfTestSourceLineCitationswas added after that note was written), and PR #14960 leaves it five. Stale count in a ledger comment; a one-word fix, listed here so it is not lost rather than because it deserves its own card.Generated by Claude Code