Skip to content

Commit 76b6c65

Browse files
committed
fix(tooling): assemble the fixture's declaration name at runtime
`const <the rostered name> =` spelled out inside a template literal IS a declaration site to check:watch-hint-literal, which reads them out of source text — so the fixture gate handed that gate a COMPUTED declaration in a file that declares nothing, and it reds `every live declaration is a literal`. Measured, then fixed the way that gate's own probe helper already does it: interpolate the name. Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4022dae commit 76b6c65

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎scripts/pm/bare-root-worklist.mjs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2892,10 +2892,18 @@ function selfTest() {
28922892
// literals, for the reason `SPELLINGS` follows the same rule: a glob literal
28932893
// in this file would hand a reporting tool a population it does not read, and
28942894
// the assertion two batteries up refuses it in as many words.
2895+
//
2896+
// ⚠️ The declaration NAME is assembled at runtime for the same class of
2897+
// reason the hints are: spelled out, `const <the rostered name> =` inside this
2898+
// file IS a declaration to `check:watch-hint-literal`, which reads declaration
2899+
// sites out of source TEXT — so a fixture written the obvious way hands that
2900+
// gate a computed declaration in a file that declares nothing. Measured: it
2901+
// reds `every live declaration is a literal` on this file.
2902+
const idiomName = ['ROOT', 'DIR', 'WATCH', 'HINTS'].join('_');
28952903
const fixtureGate = (segments) => {
28962904
const hint = segments.join('/');
28972905
const declared = auditSource('scripts/check-fixture-gate.mjs',
2898-
`const ROOT_DIR_WATCH_HINTS = ['${hint}'];\n`)
2906+
`const ${idiomName} = ['${hint}'];\n`)
28992907
.filter((d) => d.ok).flatMap((d) => d.hints).filter((h) => h.split('/')[0] === segments[0]);
29002908
return { hint, declared };
29012909
};

0 commit comments

Comments
 (0)