Skip to content

chore(devx): the eight remaining comment-mask callers take maskCommentsAndLiterals from js-comment-mask (#15776) - #16300

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-15776-comment-mask-projection-callers
Sep 6, 2026
Merged

chore(devx): the eight remaining comment-mask callers take maskCommentsAndLiterals from js-comment-mask (#15776)#16300
baozhoutao merged 1 commit into
mainfrom
claude/issue-15776-comment-mask-projection-callers

Conversation

@claude

@claude claude Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Part of #15776.

scripts/js-comment-mask.mjs publishes maskCommentsAndLiterals (#15594, PR #15774),
which converted the two callers that ruling named. The card lists eight more that
re-derive the same comment | literal -> blank composition under eight more names,
each composing the shared scanner and carrying no scanning logic of its own. All eight
are converted here.

Part of rather than Fixes, because re-measuring the population on the tree found
three more under a spelling the card's grep could not see — see Residual below.
The card stays open on those three; they are named there and are deliberately not in this
diff, so the eight the PM cleared against open PRs stay the whole file surface.

The population, re-measured

Two of the card's own numbers moved between filing and now, both in the direction of less work:

  • scripts/check-adr-0087-registration.mjs — the ninth file triage found (comment
    5550291815) is already converted on main: PR refactor(devx): js-comment-mask publishes maskCommentsAndLiterals, and its two callers import it (#15594) #15774 took it as one of its two,
    and it imports the export at :363 today. Nothing owed.
  • scripts/measure-self-test-floor.mjs — the eight occurrences of the shared NAME the
    dispatch flagged are a local copy under that name, not a completed conversion. It
    defined its own export function maskCommentsAndLiterals at :296. Converted.

Per file

file copy located kind verdict
scripts/check-parse-guard.mjs :386 codeOnly (exported) import alias — two self-test row LABELS read codeOnly converted
scripts/check-test-source-alias.mjs :813 maskedProjections wrapper, keeps { commentsOnly, codeOnly } converted
scripts/check-stack-collection-maps.mjs :203 maskLiterals (exported) straight substitution, 4 call sites converted
scripts/docs-audit/affected-docs.mjs :2218 codeOnly import alias — ten prose references read codeOnly converted
scripts/check-console-intercept-disarm.mjs :106 maskProse straight substitution converted
scripts/check-error-status-conformance.mjs :416 projections wrapper, keeps { src, structural } converted
scripts/check-docs-section-name.mjs :450 project (exported) wrapper, keeps { codeOnly, comment, literal } — still reads scanSource for the raw flags a rule indexes directly converted
scripts/measure-self-test-floor.mjs :296 maskCommentsAndLiterals (exported) local copy under the shared name; import replaces it, same name re-exported converted

Two callers keep their own NAME for the projection through an import alias rather than a
substitution at each call site. That is not decoration: check-parse-guard's --self-test
prints two row labels that spell codeOnly, and renaming them would have broken the
byte-identical acceptance this card is graded on. affected-docs reads codeOnly in ten
comments explaining its scans. In both, the local name now BINDS the module's export and
there is no local composition left.

Each deleted docblock's gate-specific facts moved with the conversion — what each gate
needs the mask FOR — rather than being left as an assertion about a function that is gone.

Acceptance 1 — byte-identical gate output, before vs after

Plain run and --self-test, captured on origin/main before the edits and again after,
diffed. Exit code captured before any pipe.

gate plain diff plain exit (before -> after) --self-test diff self-test exit
check-parse-guard EMPTY 0 -> 0 EMPTY 0 -> 0
check-test-source-alias EMPTY 0 -> 0 EMPTY 0 -> 0
check-stack-collection-maps EMPTY 0 -> 0 EMPTY 0 -> 0
docs-audit/affected-docs (--all) EMPTY 0 -> 0 EMPTY 0 -> 0
check-console-intercept-disarm EMPTY 0 -> 0 EMPTY 0 -> 0
check-error-status-conformance EMPTY 0 -> 0 EMPTY 0 -> 0
check-docs-section-name EMPTY 0 -> 0 EMPTY 0 -> 0
measure-self-test-floor EMPTY 0 -> 0 EMPTY 0 -> 0

Sixteen runs, sixteen empty diffs, exit 0 on every side.

Two notes on how to read that table rather than just count it:

  • docs-audit/affected-docs.mjs's default plain run takes a sinceRef and is therefore a
    reading of the diff, not of the tree. --all (the header's second usage line, every
    hand-written doc) is the deterministic invocation and is what was captured.
  • measure-self-test-floor.mjs has no --self-test flag. Its controls (runControls())
    run inline in main() on every invocation, and an unrecognised argv is ignored, so its
    two rows above are the same run twice — byte-identical to each other before the edit as
    well as after. Recorded as measured, not claimed as two independent legs.

Acceptance 2 — the byte-identical diff is not, by itself, a measurement

An empty diff proves nothing unless the comparison could have failed. Two independent
ablations of the shared export in scripts/js-comment-mask.mjs, each with its restore
proven by git diff HEAD and by the blob hash, and with the on-disk landing of the
mutation proven by grep counts before reading any result:

ablation what it does runs moved (of 16)
flags[k] = comment[k] drops the literal half — the projection degrades to maskComments 9
return source blanks nothing at all — the mask becomes the identity 11

Every gate here has at least one leg that moves and goes red under an ablated mask —
except check-test-source-alias, whose plain run and --self-test are both unmoved by
both ablations.
For that one file the before/after diff is vacuous: it would read green
under a mask that blanks nothing. That is a pre-existing gap in that gate, not something
this PR introduces, and it is filed as #16299.

Acceptance 3 — the conversions proven differentially, which covers the vacuous leg

Because acceptance 1 is vacuous for one file, each of the eight DELETED spellings was run
against the shape that replaced it, byte for byte, over the tree:

corpus: 6204 files, 107,177,732 chars
  IDENTICAL -- check-parse-guard:codeOnly
  IDENTICAL -- check-test-source-alias:maskedProjections
  IDENTICAL -- check-stack-collection-maps:maskLiterals
  IDENTICAL -- affected-docs:codeOnly
  IDENTICAL -- check-console-intercept-disarm:maskProse
  IDENTICAL -- check-error-status-conformance:projections
  IDENTICAL -- check-docs-section-name:project
  IDENTICAL -- measure-self-test-floor:maskCommentsAndLiterals
control (comments-only vs comments+literals): 6174 of 6204 files disagree -- the comparison can fail

This is what actually retires the risk on check-test-source-alias. It also confirms the
card's own claim that the three spelling variants (| over a Uint8Array, || over one,
and a ? 1 : 0 normaliser) are equivalent through blank's truthiness — measured, not
argued.

Residual — a THIRD spelling, three more files, NOT in this diff

The card found its eight by the shape comment[i] | literal[i] / comment[i] || literal[i].
Three more files compose the identical projection by blanking twice in sequence, which
that shape does not match:

file copy shape
scripts/check-keyed-text-bounds.mjs :402 project PAIR { masked, struct }blank(source, comment) then blank(masked, literal)
scripts/check-runner-env-posture.mjs :258 inline in findRunnerEnvReads commentMasked then bothMasked, not extracted into a function
scripts/check-widget-option-census.mjs :183 structureMask (exported) blank(blank(source, flags.comment), flags.literal)

Measured to be the same projection over the same corpus, with the same live control:

corpus: 6206 files
  blank(blank(src, comment), literal)  vs maskCommentsAndLiterals            : 0 disagree
  { masked, struct } sequential PAIR   vs { maskComments, maskCommentsAndLiterals } : 0 disagree
control (comments-only vs comments+literals): 6176 of 6206 disagree -- the comparison can fail

They are left alone deliberately. The dispatch cleared exactly the card's eight paths
against every open PR's changed files; widening the diff would put three uncleared files
into it. #15776 remains open on them.

Checked and ruled OUT of the class, so nobody re-derives this list:

  • scripts/check-entry-guard.mjs:247 codeOnlycomment || (literal && !interpolation)
    is a DIFFERENT projection, and that file's own comment says the divergence is deliberate.
  • scripts/pm/dispatch-gates.mjs:3755 maskSelfTests — blanks self-test spans; it reads
    the scan flags as a code-position guard, not as a projection.
  • scripts/check-undeclared-dep-imports.mjs:460 and scripts/eslint-fatal-guard.mjs:429
    blank(source, comment) plus a per-index literal[...] guard at the match site. No
    comments+literals mask is ever materialised.

Gates

Derived on the final tree with
node scripts/pm/dispatch-gates.mjs --changed --commands --repo objectstack-ai/objectstack
(41 commands over the 8 changed paths) and reconciled with --ran. Results pinned to
67581c042. turbo ls --affected against the merge base reports 0 packages — the diff is
scripts/** only, so no package test/typecheck is owed, and no test file in the tree
imports any of the eight (only js-comment-mask.mjs itself is imported from package
tests, and it is unchanged).

dispatch-gates --ran: 41 derived famil(ies) accounted for -- 41 run, 0 NOT-MEASURED, 0 UNRUN.

exit | command
   0 | node packages/lint/scripts/check-reference-carrier-shape.mjs
   0 | node packages/lint/scripts/check-reference-carrier-shape.mjs --self-test
   0 | node scripts/check-ci-filter-parity.mjs
   0 | node scripts/check-closing-keyword-parity.mjs
   0 | node scripts/check-closing-keyword-parity.mjs --self-test
   0 | node scripts/check-comment-mask-corpus.mjs
   0 | node scripts/check-console-intercept-disarm.mjs
   0 | node scripts/check-console-intercept-disarm.mjs --self-test
   0 | node scripts/check-declaration-mirrors.mjs
   0 | node scripts/check-declaration-mirrors.mjs --self-test
   0 | node scripts/check-docs-section-name.mjs
   0 | node scripts/check-docs-section-name.mjs --self-test
   0 | node scripts/check-scripts-symbol-anchors.mjs
   0 | node scripts/check-scripts-symbol-anchors.mjs --self-test
   0 | node scripts/check-self-test-wired.mjs
   0 | node scripts/check-self-test-wired.mjs --self-test
   0 | node scripts/check-self-test-workflow-commands.mjs
   0 | node scripts/check-self-test-workflow-commands.mjs --self-test
   0 | node scripts/check-whole-set-label-write.mjs
   0 | node scripts/check-whole-set-label-write.mjs --self-test
   0 | node scripts/docs-audit/check-affected-docs.mjs
   0 | node scripts/docs-audit/check-drift-comment.mjs
   0 | node scripts/pm/bare-root-worklist.mjs --self-test
   0 | pnpm --filter @objectstack/spec run check:authorable-surface
   0 | pnpm check:agent-test-spelling
   0 | pnpm check:bash32-floor
   0 | pnpm check:cli-command-ids
   0 | pnpm check:cross-package-test-inputs
   0 | pnpm check:docs-audit-scope
   0 | pnpm check:driver-memory-census
   0 | pnpm check:entry-guard
   0 | pnpm check:error-status-conformance
   0 | pnpm check:nul-bytes
   0 | pnpm check:parse-guard
   0 | pnpm check:pm-dispatch-gates
   0 | pnpm check:pnpm-filter-targets
   0 | pnpm check:ratchet-remedy-authority
   0 | pnpm check:refd-timer-probe
   0 | pnpm check:stack-collection-maps
   0 | pnpm check:test-source-alias
   0 | pnpm check:watch-hint-literal

All 41 exit 0. Highlights for this diff:

  • node scripts/check-comment-mask-corpus.mjs — the parser-differential sweep over the
    whole tree, which is what makes the shared mask's green mean something. Exit 0.
  • pnpm check:parse-guard, pnpm check:stack-collection-maps, pnpm check:test-source-alias,
    pnpm check:error-status-conformance, pnpm check:docs-audit-scope,
    node scripts/check-console-intercept-disarm.mjs, node scripts/check-docs-section-name.mjs
    — the eight converted gates, each judged by its own family. Exit 0.
  • node scripts/check-scripts-symbol-anchors.mjs, node scripts/check-self-test-wired.mjs,
    node scripts/check-declaration-mirrors.mjs — the families that would red on a dropped
    export, an unwired self-test or a stale .d.mts. Exit 0.
  • pnpm check:nul-bytes exit 0; an independent control-byte scan over the eight files
    (grep -naP for the C0 range plus DEL) found none.

skip-changeset: internal gate scripts, nothing published from any package.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8


Generated by Claude Code

…jection from js-comment-mask

`js-comment-mask.mjs` publishes `maskCommentsAndLiterals` (#15594, PR #15774),
which converted the two callers that ruling named. Eight more spelled the same
`comment | literal` -> `blank` composition under eight more names, each composing
the shared scanner and carrying no scanning logic of its own, none with a shared
pin. All eight now read the module's export.

Three return a PAIR of projections and keep their return shape as a wrapper over
the exports rather than a straight substitution: `maskedProjections`
(`check-test-source-alias`), `projections` (`check-error-status-conformance`) and
`project` (`check-docs-section-name`, which still reads `scanSource` for the raw
`comment`/`literal` flags one of its rules indexes directly). Two keep their own
name for the projection through an import alias, because the file's self-test row
labels and its prose read that name: `codeOnly` in `check-parse-guard` and in
`docs-audit/affected-docs`.

`measure-self-test-floor.mjs` carried a local copy under the SHARED NAME -- a
local definition, not a completed conversion -- so the import replaces it and the
same name is re-exported.

Each deleted docblock's gate-specific facts move with the conversion rather than
becoming a stale assertion about a function that is gone.

Behaviour byte-identical, proven per gate by diffing plain and `--self-test`
output before and after: 16 runs, 16 empty diffs, exit 0 on every side.

Part of #15776

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
@claude claude Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 6, 2026
@github-actions github-actions Bot added the size/m label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 7beaaa32ccb1295eeaec73bdca4aea36e713232dpackageMentionDocs.

@baozhoutao
baozhoutao marked this pull request as ready for review September 6, 2026 13:17
@baozhoutao
baozhoutao enabled auto-merge September 6, 2026 13:17
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 6c546ab Sep 6, 2026
37 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-15776-comment-mask-projection-callers branch September 6, 2026 13:49
baozhoutao pushed a commit that referenced this pull request Sep 6, 2026
…s take maskCommentsAndLiterals

PR #16300 converted the eight callers the card named that spelled the
comments+literals projection as `comment[i] | literal[i]` -> `blank`. Three more
files spell the identical projection as a SEQUENTIAL double `blank` --
`blank(source, comment)` then `blank(masked, literal)` -- a shape the card's
grep could not match, measured in the Release (0 disagreements over 6,206
files vs the export, live control 6,176).

- `check-keyed-text-bounds.mjs`'s `project` keeps its pair-return shape
  `{ masked, struct }` as a wrapper over `maskComments` / `maskCommentsAndLiterals`
  called separately, following PR #16300's own precedent.
- `check-runner-env-posture.mjs`'s `findRunnerEnvReads` composes the two masks
  inline; both are now the module's own exports.
- `check-widget-option-census.mjs`'s exported `structureMask` is a straight
  substitution (no external importers).

`js-comment-mask.mjs` untouched: no new export, no semantics change.

Behaviour byte-identical, proven per gate by diffing plain and `--self-test`
output on origin/main before and after: 6 runs, 6 empty diffs, exit 0 on every
side. Ablation control (literal half dropped; identity mask) moves at least
one reading for every gate except `check-widget-option-census`'s plain run,
which is unmoved by both legs -- a pre-existing property of today's real
spec/parser corpus content, not introduced by this conversion (behaviour is
provably identical to the deleted code). Closed by a differential proof: the
deleted sequential-double-blank spelling vs the replacement over 6,192 files
(106,979,676 chars), 0 disagreements, live control (comments-only vs
comments+literals) disagreeing on 6,167 files.

Part of #15776.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
baozhoutao pushed a commit that referenced this pull request Sep 6, 2026
…vel anchors

Second round of the scripts/** unresolvable-citation migration PR #16301
started. Two of the six held files freed since that PR landed --
check-docs-section-name.mjs and docs-audit/affected-docs.mjs (PR #16300),
check-type-check-coverage.mjs (PR #16295) -- so their 7 citations migrate
now by the same method: the file named as a file-level anchor, the number
kept beside it as data, no digit repaired or repointed.

- check-docs-section-name.mjs: concept.mdx:426, doc-pages.mdx:257 and
  forms.mdx:183 each resolve to exactly one tracked file under
  content/docs/** (forms.mdx is ambiguous by basename alone -- two files
  share it -- but only content/docs/ui/forms.mdx has a line 183 carrying
  the cited "sections": [/* ... */] shape).
- check-type-check-coverage.mjs: engine.test.ts:2547/2577 resolves to
  packages/services/service-automation/src/engine.test.ts, named by the
  surrounding prose ("service-automation's note").
- docs-audit/affected-docs.mjs: three rest-server.ts citations resolve to
  packages/rest/src/rest-server.ts, the only tracked file of that name.

The corpus residual (scripts/check-scripts-symbol-anchors.mjs
--list-unresolvable) drops from 15 to 8, all 8 still held by open PRs
(#16215, #16202) -- none an ambiguity. judgeUntrackedLineAnchors stays
false per the #15809 fence (flips only at residual zero). Header prose
updated to record both dated readings.

Part of #15809.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant