Skip to content

Commit 3f111c8

Browse files
committed
docs(scripts): spell out the sweep that measures this scanner, and what it missed
The header pointed at "the sweep" without saying how to run one. It now names the corpus, the parser and the comparison, so the 16-file census is re-derivable from the file itself rather than from a PR description. Also records the result that ranks the two instruments: deleting the `{` counting inside `${...}` passed every pinned case AND the whole 4,739-file sweep, because the tree does not happen to write that shape. The case that holds it now was written from the mutation, not from the corpus. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
1 parent 08fd7b3 commit 3f111c8

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

scripts/js-comment-mask.mjs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,27 @@
5151
* afternoon proving the sentence it quoted meant the opposite.
5252
*
5353
* This header used to state that as a property -- "cannot fabricate a lead".
54-
* It was not one. Measured on 2026-08-21 (#10427) by diffing this scan's mask
55-
* against `@typescript-eslint/parser`'s comment ranges over 4,733 files: 16
56-
* disagreed, and 15 of them in the FABRICATES direction, up to 10,252 comment
57-
* bytes handed to a caller as live code in a single file. The cause was the
58-
* template scan above; the same sweep after the fix disagrees on 0 files.
54+
* It was not one. Measured on 2026-08-21 (#10427): walk every
55+
* `.{ts,tsx,mts,cts,js,mjs,cjs,jsx}` file in the tree (minus `node_modules`,
56+
* `dist`, `.next`, `build`, `.turbo`, `coverage`), parse each with
57+
* `@typescript-eslint/parser` (`{ comment: true, range: true }`), and diff the
58+
* comment ranges it reports against this scan's `comment` array byte for byte.
59+
* Over 4,739 files, 16 disagreed -- 15 in the FABRICATES direction, up to
60+
* 10,252 comment bytes handed to a caller as live code in a single file. The
61+
* cause was the template scan above; the same sweep after the fix disagrees on
62+
* 0 files.
5963
*
6064
* The lesson is about the claim, not the bug. A failure DIRECTION is a
6165
* property of an implementation, not of an intention, and this one cannot be
6266
* read off the code -- it took an independent parser over the whole tree to
6367
* find out which way the module actually failed. So the honest statement is
64-
* the one that can be re-derived: the shapes below are pinned, the sweep that
65-
* measured them is the way to check the rest, and neither direction is
66-
* promised by construction. Re-run it after touching `scanSource`.
68+
* the one that can be re-derived: the shapes below are pinned, the sweep just
69+
* described is the way to check the rest, and neither direction is promised by
70+
* construction. Re-run it after touching `scanSource` -- and note that the
71+
* sweep is the STRONGER instrument of the two. A mutation that deleted the
72+
* brace counting inside `${...}` passed every case below AND the whole sweep,
73+
* because the tree did not happen to write the shape; the case that now holds
74+
* it was written from the mutation, not from the corpus.
6775
*/
6876

6977
/** A character that can end an identifier -- i.e. a value, so `/` is division. */

0 commit comments

Comments
 (0)