@@ -198,6 +198,45 @@ jobs:
198198 - name : scripts/ TypeScript parses go through one module
199199 run : pnpm check:parse-guard
200200
201+ # The comment-mask CORPUS sweep (#10640) — the other instrument for the
202+ # module the two gates above delegate "is this span a comment, or code?"
203+ # to. `js-comment-mask.mjs --self-test` pins the SHAPES someone wrote
204+ # down; this parses every .{ts,tsx,mts,cts,js,mjs,cjs,jsx} file in the
205+ # tree with @typescript-eslint/parser and diffs its comment ranges
206+ # against the mask's, byte for byte. Neither subsumes the other, and that
207+ # is measured in both directions on this tree rather than assumed:
208+ # deleting the `{` counting inside `${...}` fails a pinned case and the
209+ # sweep reads 0 disagreements over 4,741 files (the tree does not write
210+ # that shape), while dropping `return` from REGEX_AFTER_KEYWORD passes all
211+ # 23 pinned cases and the sweep names check-test-source-alias.mjs, where
212+ # `return /(^|[^a-z])dist\//` is written today.
213+ # The defect this would have caught shipped: 16 files disagreeing, 15 of
214+ # them reading commented-out text as live code, 10,252 comment bytes in
215+ # one file — and the instrument that found it lived in an agent's
216+ # scratchpad, which is why re-deriving it was impossible until this file.
217+ # WHY A HARD GATE ON EVERY PR, and not an on-demand flag: the sweep's
218+ # verdict depends on the CORPUS as much as on the masker, so a PR that
219+ # writes a shape the mask reads wrong turns ~20 source-scanning gates
220+ # into liars on that file, on a PR that never touched the masker. That
221+ # arrival is not detectable by any convention a human or an agent has to
222+ # remember at the right moment — the failure mode this repo has already
223+ # paid for at #4690 and again here.
224+ # WHY A STEP AND NOT A JOB: a new job's `name:` is a required-context
225+ # contract (scripts/check-required-contexts.mjs) that only a
226+ # maintainer-present Settings change can enrol, and an unenrolled job is
227+ # an advisory gate — #5617 verbatim. This job is already required.
228+ # Invoked as `node` rather than `pnpm check:*` for the same reason as the
229+ # other `node scripts/…` steps in this lane: that alias is a line in root
230+ # package.json, inside the @changesets/cli v3 fence (#9465).
231+ # Runs its own comparator self-test first — 12 cases proving the
232+ # comparison can still REPORT, because "0 files disagree" and "the
233+ # comparison is broken" otherwise print the same line.
234+ # Cost, measured on a contended 4-vCPU container: 4,741 files, 72 MB of
235+ # source, 45–48 s, of which the parser is 45 s. The step prints CI's own
236+ # number on every run.
237+ - name : Comment mask agrees with a real parser over the whole corpus
238+ run : node scripts/check-comment-mask-corpus.mjs
239+
201240 # Stack-collection enumerations vs the schema (#6242). `stack.zod.ts`
202241 # decides which collections a stack may declare; eight other enumerations
203242 # of that same set are hand-maintained (the map-format list, the
0 commit comments