Skip to content

Commit c01f212

Browse files
committed
docs(pm): correct check-dispatch-gates' header on comment masking, and fix the sweep count
The header justified its unquoted repo paths with "watch-hint extraction ... does not skip comments". extractWatchHints has opened with maskComments since #8478, and that function's docblock names this file as the specimen it retires — so the file carrying the workaround was still explaining it as live behaviour. Measured with extractWatchHints, every repo path in the header rewritten into backticks: 1 hint today (the module-body constant, the same hint the file ships with) against 10 under the pre-masking extractor. Comment masking alone accounts for it. The incident is kept as history, the section now says the convention is no longer required, and the rule that survives is stated: a module-body literal is what masking cannot reach. The separate-gate-file argument gets today's numbers too — 4 hints, not 49, and three of them are directory bases wide enough to keep the decision standing on narrower grounds. Fixes #8604 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WuTtyckQa1VcXwgd52JpN
1 parent 0cb7a58 commit c01f212

2 files changed

Lines changed: 41 additions & 15 deletions

File tree

scripts/pm/check-dispatch-gates.mjs

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*
77
* node scripts/pm/check-dispatch-gates.mjs # runs the tool's --self-test
88
*
9-
* ⚠️ This header names repo paths UNQUOTED on purpose — see the last section.
10-
*
119
* ## Why the gate exists
1210
*
1311
* scripts/pm/dispatch-gates.mjs derives the "local gates for this card" line of
@@ -53,21 +51,48 @@
5351
* none"), so shipping it as the price of gating the tool would have taken more
5452
* from every dispatch prompt than the gate gives back.
5553
*
54+
* Those numbers are PRE-MASKING, and the decision they justify survives on
55+
* narrower grounds than they describe. maskSelfTests now blanks the fixture
56+
* half outright: measured on this tree, the tool's own source yields 4 hints,
57+
* not 49 — .github/workflows, which it really reads, and packages/plugins,
58+
* packages/drivers, packages/services, the bases its package resolver probes.
59+
* Those three are real reads and still cover three of the largest directories
60+
* in the tree, so a directly-wired gate would print MATCHED for every card
61+
* under them — a smaller fabrication than the fixture one, of the same kind.
62+
* The spec filter path from the incident above no longer matches at all.
63+
*
5664
* A separate gate file is also what the other two pm gates look like
5765
* (check-skill-line-ratchet.mjs, check-skill-id-lint.mjs). Its watch hints are
5866
* the one constant below: this gate is matched for a card that edits the tool,
5967
* and for nothing else — which is the blind spot #8162 is about.
6068
*
61-
* ## Why the paths above are unquoted
69+
* ## Why the paths above are unquoted, and why that is no longer required
6270
*
63-
* Watch-hint extraction reads any quoted-looking span, backticks included, and
64-
* does not skip comments. Written the ordinary way, with each path in backticks,
65-
* this header alone yielded ten hints — packages/spec/src, packages/objectql,
71+
* The incident is real and worth keeping. Watch-hint extraction reads any
72+
* quoted-looking span, backticks included, and it USED TO read comments as
73+
* well. Written the ordinary way, with each path in backticks, this header
74+
* alone yielded ten hints — packages/spec/src, packages/objectql,
6675
* packages/plugins, packages/drivers, .claude/agents, .changeset among them —
6776
* and reproduced, from the file explaining the pollution, the exact false
6877
* MATCHED leads it exists to avoid (measured, not predicted: the first draft of
69-
* this file did it). So paths are named unquoted here, and the only quoted path
70-
* in this file is the one input this gate genuinely has.
78+
* this file did it). Hence the convention.
79+
*
80+
* The extractor no longer works that way: extractWatchHints opens with
81+
* maskComments, whose own docblock names this file as the specimen it retires.
82+
* Measured on this tree, with every repo path this header names rewritten into
83+
* backticks: 1 hint under today's extractor — scripts/pm/dispatch-gates.mjs,
84+
* the same single hint the file ships with — against 10 under the pre-masking
85+
* one, reaching spec, objectql, plugins, drivers, .claude/agents and .changeset
86+
* exactly as the incident describes. Comment masking alone accounts for the
87+
* difference: masking self-test bodies instead changes nothing here, because
88+
* this file has none.
89+
*
90+
* So the unquoting is no longer load-bearing, and this section is history
91+
* rather than an instruction: quoting a path in a comment here is now free, and
92+
* the paths stay unquoted because rewriting them buys nothing. What is NOT free
93+
* is a path literal in a module body — masking cannot reach one — so the one
94+
* quoted path below is still the one input this gate genuinely has, and that is
95+
* the rule to carry into a new gate's header rather than the unquoting.
7196
*
7297
* Nothing else belongs in this file. Assertions go in the tool's own self-test,
7398
* beside the code they judge; this is the CI invocation and its reason.

scripts/pm/dispatch-gates.mjs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -728,13 +728,14 @@ export function i18nBundlePackageDirs() {
728728
* `--re-measure`, which is the half a new test file's type errors move. This
729729
* entry named the first while explaining the second, so a dev seat ran it in
730730
* good faith, reported the union green, and CI found four new type errors.
731-
* Swept over this tree when that was fixed: of the 73 families the workflows
732-
* discover, 8 resolve to a script some other family also resolves to — and 7
733-
* of those 8 are the other shape, a `check:` script beside a direct
734-
* `node scripts/check-x.mjs` step in a second workflow, which `derive`
735-
* discovers as its own family and prints with its own runnable invocation.
736-
* The pair below is the only one where two ROOT SCRIPTS differ by a flag, so
737-
* this is a one-off today and the rule is what generalises, not the fix.
731+
* Swept over this tree when that was fixed: the workflows discover 96
732+
* families resolving to 73 distinct script files, and 8 of those files are
733+
* reached by more than one family — 7 of the 8 in the other shape, a `check:`
734+
* script beside a direct `node scripts/check-x.mjs` step in a second
735+
* workflow, which `derive` discovers as its own family and prints with its
736+
* own runnable invocation. The pair below is the only one where two ROOT
737+
* SCRIPTS differ by a flag, so this is a one-off today and what generalises
738+
* is the rule, not the fix.
738739
* - Prose in a `why` is a MODULE-BODY string, so it is scanned for watch hints
739740
* like any other literal — comment masking cannot reach it. The ratchet
740741
* entry's remedy command therefore spells its `--filter` values unquoted (and

0 commit comments

Comments
 (0)