chore(devx): the eight remaining comment-mask callers take maskCommentsAndLiterals from js-comment-mask (#15776) - #16300
Merged
baozhoutao merged 1 commit intoSep 6, 2026
Conversation
…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
Contributor
📓 Docs Drift CheckNothing 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
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
This was referenced Sep 6, 2026
baozhoutao
marked this pull request as ready for review
September 6, 2026 13:17
baozhoutao
enabled auto-merge
September 6, 2026 13:17
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #15776.
scripts/js-comment-mask.mjspublishesmaskCommentsAndLiterals(#15594, PR #15774),which converted the two callers that ruling named. The card lists eight more that
re-derive the same
comment | literal->blankcomposition under eight more names,each composing the shared scanner and carrying no scanning logic of its own. All eight
are converted here.
Part ofrather thanFixes, because re-measuring the population on the tree foundthree 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 (comment5550291815) is already converted onmain: 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
:363today. Nothing owed.scripts/measure-self-test-floor.mjs— the eight occurrences of the shared NAME thedispatch flagged are a local copy under that name, not a completed conversion. It
defined its own
export function maskCommentsAndLiteralsat:296. Converted.Per file
scripts/check-parse-guard.mjs:386codeOnly(exported)codeOnlyscripts/check-test-source-alias.mjs:813maskedProjections{ commentsOnly, codeOnly }scripts/check-stack-collection-maps.mjs:203maskLiterals(exported)scripts/docs-audit/affected-docs.mjs:2218codeOnlycodeOnlyscripts/check-console-intercept-disarm.mjs:106maskProsescripts/check-error-status-conformance.mjs:416projections{ src, structural }scripts/check-docs-section-name.mjs:450project(exported){ codeOnly, comment, literal }— still readsscanSourcefor the raw flags a rule indexes directlyscripts/measure-self-test-floor.mjs:296maskCommentsAndLiterals(exported)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-testprints two row labels that spell
codeOnly, and renaming them would have broken thebyte-identical acceptance this card is graded on.
affected-docsreadscodeOnlyin tencomments 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 onorigin/mainbefore the edits and again after,diffed. Exit code captured before any pipe.
--self-testdiffcheck-parse-guardcheck-test-source-aliascheck-stack-collection-mapsdocs-audit/affected-docs(--all)check-console-intercept-disarmcheck-error-status-conformancecheck-docs-section-namemeasure-self-test-floorSixteen 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 asinceRefand is therefore areading of the diff, not of the tree.
--all(the header's second usage line, everyhand-written doc) is the deterministic invocation and is what was captured.
measure-self-test-floor.mjshas no--self-testflag. Its controls (runControls())run inline in
main()on every invocation, and an unrecognised argv is ignored, so itstwo 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 restoreproven by
git diff HEADand by the blob hash, and with the on-disk landing of themutation proven by grep counts before reading any result:
flags[k] = comment[k]maskCommentsreturn sourceEvery 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-testare both unmoved byboth 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:
This is what actually retires the risk on
check-test-source-alias. It also confirms thecard's own claim that the three spelling variants (
|over aUint8Array,||over one,and a
? 1 : 0normaliser) are equivalent throughblank's truthiness — measured, notargued.
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:
scripts/check-keyed-text-bounds.mjs:402project{ masked, struct }—blank(source, comment)thenblank(masked, literal)scripts/check-runner-env-posture.mjs:258inline infindRunnerEnvReadscommentMaskedthenbothMasked, not extracted into a functionscripts/check-widget-option-census.mjs:183structureMask(exported)blank(blank(source, flags.comment), flags.literal)Measured to be the same projection over the same corpus, with the same live control:
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:247codeOnly—comment || (literal && !interpolation)is a DIFFERENT projection, and that file's own comment says the divergence is deliberate.
scripts/pm/dispatch-gates.mjs:3755maskSelfTests— blanks self-test spans; it readsthe scan flags as a code-position guard, not as a projection.
scripts/check-undeclared-dep-imports.mjs:460andscripts/eslint-fatal-guard.mjs:429—blank(source, comment)plus a per-indexliteral[...]guard at the match site. Nocomments+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 to67581c042.turbo ls --affectedagainst the merge base reports 0 packages — the diff isscripts/**only, so no packagetest/typecheckis owed, and no test file in the treeimports any of the eight (only
js-comment-mask.mjsitself is imported from packagetests, and it is unchanged).
All 41 exit 0. Highlights for this diff:
node scripts/check-comment-mask-corpus.mjs— the parser-differential sweep over thewhole 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 droppedexport, an unwired self-test or a stale
.d.mts. Exit 0.pnpm check:nul-bytesexit 0; an independent control-byte scan over the eight files(
grep -naPfor 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