Repository navigation
feat(tooling): port the comment-mask corpus sweep and measure objectui#7882 residue - #8277
Conversation
…re the residue Ports `scripts/check-comment-mask-corpus.mjs` from objectstack (blob dd50cb13a) so this tree can answer "which direction does js-comment-mask fail in, and can it move a gate's verdict" against an independent parser rather than against hand-written cases. Part of objectui#7882. The reading on b6f821a: 4,418 files, ONE disagreement, 0 fabricated bytes, 1,517 over-masked bytes -- all of it apps/console/src/pages/ DocsIndex.tsx, where a `/` in JSX text followed by `*` opens a phantom block comment that runs to end of file. Of the seven gates importing the masker, two ever read that file and neither changes verdict. Four declared divergences from upstream: the oracle is reached through the already-declared `typescript-eslint` rather than a new root dependency; the 1,448-line prerequisite helper is inlined as one function; the skip list is this tree's own generated directories; and the posture is REPORT-with-a-ceiling rather than fail-on-any, because the residue is live and deliberately pinned. Also fixes an argument-parsing defect inherited from upstream: with `--masker` absent, `indexOf` returns -1 and the filter dropped argv[0] instead of the flag pair, so an unknown FIRST option was swallowed and the script ran a full sweep and exited 0. The four KNOWN LIMITS pins and `scanSource` itself are untouched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
|
ACCEPT (#7882, option 2 — the port; the measurement is on the card) — reviewed on the tree at head Verified from the diff, not the report:
Reading for the card, to be acted on after this lands: 4,418 files, 0 fabricated bytes, 1 disagreeing file ( Next: CI convergence → flip ready → post-flip guard → auto-merge SQUASH (method read back) → queue confirmation → landing probe ( Generated by Claude Code |
|
Armed: PR #8277 flipped ready at 2026-09-07T08:12:08Z on head Generated by Claude Code |
|
LANDED: merged at 2026-09-07T08:28:37Z as Generated by Claude Code |
Part of #7882 (port of objectstack's corpus sweep; the measurement is on the card)
This PR is the instrument. The measurement the ruling asked for is posted as a comment on #7882, and the PR deliberately carries no closing keyword: the PM decides on the reading whether that card closes or returns to the decision box.
The ruling this implements
Quoted from the card's ruling comment (
5565859060, 2026-09-07):scanSourceand the discriminator are untouched, and so are the fourKNOWN LIMITSpins (they still pass — 50 tests across both mask test files).The reading (on
b6f821a8b)The single disagreement is
apps/console/src/pages/DocsIndex.tsx. The JSX textsrc/docs/*.mdputs a/immediately before a*, so the masker opens a phantom block comment — not the phantom regex the card leads with — and because no terminator follows anywhere in the file, it runs from line 63 to EOF: 37 lines of live JSX handed to every masking gate as prose.No gate's verdict moves. Of the seven gates under
scripts/importing the masker, exactly two ever open that file (check-vi-mock-inherit,check-vi-mock-specifiers; the other five never read it). Both were run against the tree as-is and against a copy with the phantom closed by a one-character edit: both exit 0 either way, with byte-identical output.The card's headline number re-derives exactly (145 literal bytes, 28 files, 0 comment bytes moved) — but it is a different measurement from this sweep's, and the header says so rather than letting one be read as the other.
Four declared divergences from upstream
typescript-eslint, not@typescript-eslint/parser. The latter is not declared at this repo's root and does not even resolve there under pnpm's isolatednode_modules(measured:ERR_MODULE_NOT_FOUND). The meta-package is already a root devDependency at the same version and re-exports the same parser, so the port adds no new dependency and no lockfile movement.scripts/import-prerequisite.mjs(1,448 lines) for one function..cacheentry is objectstack-only; this tree's generated directories are named instead.apps/site/.sourcereally was in the corpus before this entry.Also repaired: an argument-parsing defect inherited from upstream
With
--maskerabsent,indexOfreturns-1, so the filter meant to drop the flag pair droppedargv[0]instead — removing an unknown FIRST option from the very list the unknown-option check reads.--anythingtherefore ran a full sweep and exited 0 rather than reporting a usage error. The port's own test caught it on its first run. Reported upstream as objectstack#16540.Gates (exit codes captured by redirect, never through a pipe)
vitest run scripts/__tests__/check-comment-mask-corpus.test.tsvitest run scripts/__tests__/js-comment-mask*.test.tsvitest run scripts/__tests__/(whole scripts suite)node scripts/check-comment-mask-corpus.mjs --self-testnode scripts/check-comment-mask-corpus.mjs(the sweep)--maskerat a blind maskernode scripts/check-comment-mask-corpus.mjs --no-such-flagpnpm check:phantom-depspnpm check:entry-guardpnpm check:control-bytespnpm check:upstream-port-paritypnpm type-check:scriptspnpm lint:rootnode scripts/check-changeset-presence.mjsnode scripts/check-governed-queue-guard.mjs --test(all 4 paths)The positive control is a blind masker in a temp dir, not the pre-#6891 masker: pointing
--maskerat the pre-fix implementation was measured and produces an identical reading (exit 0), because that phantom lives in the LITERAL flag array and moves zero comment bytes tree-wide. That is recorded in the header as a property of the instrument, not as a caveat — a comment-array comparator is blind to that half by construction.Files
scripts/check-comment-mask-corpus.mjs(new) — the portscripts/__tests__/check-comment-mask-corpus.test.ts(new) — verdicts read as numbers, sweep driven RED over fixture treesscripts/js-comment-mask.mjs— header only: the paragraph claiming the sweep is unported, plus a measured note that porting it did not close theREGEX_AFTER_KEYWORDmutation gap (checked, not assumed)package.json—check:comment-mask-corpus, next to its siblings. ⛔ No workflow edits; the script is not wired into CI by this PR.Generated by Claude Code