You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(devx): js-comment-mask publishes maskCommentsAndLiterals, and its two callers import it (#15594) (#15774)
* refactor(devx): js-comment-mask publishes the comments+literals projection
`js-comment-mask.mjs` published `stripComments` and `maskComments` but no
comments+literals projection -- the mask a gate needs when its signal is a
bare CODE position and a spelling inside prose *or* inside a string must not
satisfy it. Two gates on main re-derived it under two names.
Export `maskCommentsAndLiterals(source)`, documented beside `maskComments` in
the module's own terms (the `stripComments` docblock already argues the module
owns the projections rather than the callers), declared in the `.d.mts`, and
driven by nine new self-test rows under a literal roster and floor of their
own -- the shape the recogniser section established, so a deleted or renamed
row names itself in the refusal.
The rows live outside the `cases` table on purpose: that table asserts the
OPPOSITE property for quoted text (`REAL` code inside a string MUST survive
`maskComments`), and one fixture cannot state both directions.
Self-test: 44 -> 53 cases (23 mask/strip corpus, 12 interpolation view,
9 shared recogniser, 9 comments+literals projection).
Part of #15594
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
* refactor(devx): the two named callers import the projection instead of re-deriving it
`check-adr-0087-registration.mjs` spelled it `maskCommentsAndLiterals`
(`comment.map((c, i) => c || literal[i])`); `check-registry-log-declared.mjs`
spelled it `maskCode` (`comment[i] | literal[i]` over a Uint8Array). Same
projection, two names, no shared pin. Both are now the module's export, and
each file's now-unused `blank`/`scanSource` imports go with the local copy.
`maskCode`'s docblock said it stays "local only because js-comment-mask.mjs
publishes no comments+literals projection yet, and hoisting one waits on a
follow-up card". That card is this one, so the docblock moves with the
conversion rather than becoming a stale assertion: what survives is the fact
that belongs to THIS gate -- that it reads two projections of one source and
relies on them agreeing offset-for-offset.
Behaviour byte-identical, proven per gate by diffing plain and `--self-test`
output before and after (four diffs, exit 0 each):
check-adr-0087-registration ✓ ... no declared-breaking changeset
✓ ... 304 assertions over real temp git repos
check-registry-log-declared OK: 72 vitest-running package(s) walked, 8 ...
self-test OK: 16 cases + level-vocabulary read ...
Part of #15594
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments