Repository navigation
Commit 181001f
fix(dispatch-gates): a package-root vitest config or manifest edit derives check-console-intercept-disarm (#29556)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ87YEMjdviwYR817rnQYfmc8)_
Fixes #29353
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`check-console-intercept-disarm` 在自己源码里声明它真正读的文件(各工作区包根的
`package.json` 与 `vitest.config.*`),`dispatch-gates`
据此把它派给改这些文件的卡;残差台账里它的两行随之删除。
- 为什么改:改包根 vitest 配置的卡,本地派生清单里没有这道门,只能等 CI 变红才知道(PR #29345 为此多跑了一轮)。
- 风险与回滚:只动工具脚本,不发布任何包;回滚即 revert 本 PR,派生回到原先的"无路径"状态。
-
先看:`scripts/check-console-intercept-disarm.mjs`(新声明与漂移检查)、`scripts/pm/dispatch-gates.self-test.mjs`(新增的实树钉子)、`scripts/pm/dispatch-gates.data.mjs`(删掉的两行)。
- 两分钟验证:`node scripts/pm/dispatch-gates.mjs --commands --paths
packages/services/service-sms/vitest.config.ts`,预期输出里出现这道门的两条命令(主扫描与
`--self-test`)。
- 需要你做的:无,席位落地。
## What changes
- **Landing is the gate's own file, not only
`dispatch-gates.data.mjs`.** The order expected the data table;
measured, the derivation reads a gate's population only from the gate's
own source (the `ROOT_DIR_WATCH_HINTS` idiom), and
`dispatch-gates.data.mjs`'s header says it is "not a watch surface". So
the producer-side fix is a declaration in
`scripts/check-console-intercept-disarm.mjs`:
- `ROOT_DIR_WATCH_HINTS`: one pair per workspace glob the gate parses,
`DIR/*/package.json` and `DIR/*/vitest.config.*`. A glob in a non-final
segment makes the derivation judge the hint as a pattern, one path
segment per star, so a test file or a config below the package root is
not covered.
- A drift check: `main()` exits 1 when the declaration and the parsed
`pnpm-workspace.yaml` globs disagree in either direction
(`watchHintDrift`), and the gate's self-test holds the real tree to it
plus both drift directions on fixtures. A literal array, as
`check:watch-hint-literal` requires.
- `workspaceGlobs()` is split out of `workspacePackageDirs()` with no
change in behaviour; the three gates that import `workspacePackageDirs`
are untouched.
- `scripts/pm/dispatch-gates.data.mjs`: the two
`ROOT_WALK_RESIDUE_LEDGER` rows for the gate and its `--self-test` are
retired, since both families have left the population. A note records
why, beside the two earlier departures.
- `scripts/pm/dispatch-gates.self-test.mjs`: the card's acceptance,
pinned against the live tree. Every package-root vitest config (80) and
the manifest beside it places both invocations. A new package's config
and manifest do too. No tracked test file under a package (6926) places
either, and neither does a brand-new test file or a config below a
package root.
## Why
The rows stated the population correctly and drew the wrong conclusion:
an EDITED package-root config moves the gate as surely as a new package
does. Because the rows only exempted the gate from the whole-tree
channel, no path derived it at all.
## Tests
- Reverse check, with the gate file restored to `399df5bb` (tree only,
then restored from HEAD; `git diff HEAD` empty, blob hash matched): 80
of 80 package-root configs place neither invocation, and the test-file
probe reads `undetermined`. With the fix, 0 of 80 are missed, and test
files read `silent`.
- `node scripts/check-console-intercept-disarm.mjs --self-test`:
`self-test OK: 15 cases + real-tree population floor + watch-hint
declaration.` Scan: `OK: 80 vitest-running package(s)`.
## Verification
Final union on head `1b3ea66a` (base `399df5bb`): `node
scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 32 commands from the 3 changed
paths; all 32 exit 0. `--ran` reconciliation: "32 derived famil(ies)
accounted for — 32 run, 0 NOT-MEASURED". `check:pm-dispatch-gates`:
"1945 cases pass" (fast tier). The first pass on `a39185ba` was 31 of
32: `check:watch-hint-literal` refused the `Object.freeze` wrapper,
fixed in `1b3ea66a`.
<details><summary>32 commands and exit codes on 1b3ea66</summary>
```text
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-console-intercept-disarm.mjs :: exit 0
node scripts/check-console-intercept-disarm.mjs --self-test :: exit 0
node scripts/check-declaration-mirrors.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs --self-test :: exit 0
node scripts/check-self-test-wired.mjs :: exit 0
node scripts/check-self-test-wired.mjs --self-test :: exit 0
node scripts/check-self-test-workflow-commands.mjs :: exit 0
node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0
node scripts/check-whole-set-label-write.mjs :: exit 0
node scripts/check-whole-set-label-write.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/pm/bare-root-worklist.mjs --self-test :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:bash32-floor :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:entry-guard :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:parse-guard :: exit 0
pnpm check:pm-dispatch-gates :: exit 0
pnpm check:pnpm-filter-targets :: exit 0
pnpm check:pnpm-flag-spellings :: exit 0
pnpm check:ratchet-remedy-authority :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:scripts-symbol-anchors :: exit 0
pnpm check:watch-hint-literal :: exit 0
```
</details>
## Acceptance notes
- Not derivable, by construction: `pnpm-workspace.yaml` and the root
`vitest.preset.mts` also move this gate, but neither carries a
separator, so no spelling of either is a hint the derivation admits.
Edits to those two files still learn of the gate from CI.
- Out of scope, reported to the seat and not fixed here: the gate's
workspace parse stops at the first comment line inside the `packages:`
list, so the four `ui` members below it are outside its population.
Measured: 40 `ui` workspace packages run vitest and none sets the
disarm. The declaration follows what the gate reads today, and its drift
check will ask for the `ui` pairs on the day the parse reads them.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (CI-owned run)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset. (publishes
nothing: `scripts/**` only, `skip-changeset`)
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JQwxbXV6v4rbiDvvaaabhb
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbXV6v4rbiDvvaaabhb)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 389de4a commit 181001f
3 files changed
Lines changed: 251 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
118 | 168 | | |
119 | 169 | | |
120 | 170 | | |
| |||
207 | 257 | | |
208 | 258 | | |
209 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
210 | 285 | | |
211 | 286 | | |
212 | 287 | | |
| |||
227 | 302 | | |
228 | 303 | | |
229 | 304 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
249 | 342 | | |
250 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
251 | 350 | | |
252 | 351 | | |
253 | 352 | | |
| |||
325 | 424 | | |
326 | 425 | | |
327 | 426 | | |
| 427 | + | |
328 | 428 | | |
329 | 429 | | |
330 | 430 | | |
331 | 431 | | |
332 | | - | |
| 432 | + | |
333 | 433 | | |
334 | 434 | | |
335 | 435 | | |
| |||
343 | 443 | | |
344 | 444 | | |
345 | 445 | | |
346 | | - | |
347 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
348 | 454 | | |
349 | 455 | | |
350 | 456 | | |
| |||
644 | 750 | | |
645 | 751 | | |
646 | 752 | | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
647 | 801 | | |
648 | 802 | | |
649 | 803 | | |
| |||
692 | 846 | | |
693 | 847 | | |
694 | 848 | | |
695 | | - | |
| 849 | + | |
696 | 850 | | |
697 | 851 | | |
698 | 852 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | 281 | | |
293 | 282 | | |
294 | 283 | | |
295 | 284 | | |
296 | 285 | | |
297 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
298 | 297 | | |
299 | 298 | | |
300 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7988 | 7988 | | |
7989 | 7989 | | |
7990 | 7990 | | |
| 7991 | + | |
| 7992 | + | |
| 7993 | + | |
| 7994 | + | |
| 7995 | + | |
| 7996 | + | |
| 7997 | + | |
| 7998 | + | |
| 7999 | + | |
| 8000 | + | |
| 8001 | + | |
| 8002 | + | |
| 8003 | + | |
| 8004 | + | |
| 8005 | + | |
| 8006 | + | |
| 8007 | + | |
| 8008 | + | |
| 8009 | + | |
| 8010 | + | |
| 8011 | + | |
| 8012 | + | |
| 8013 | + | |
| 8014 | + | |
| 8015 | + | |
| 8016 | + | |
| 8017 | + | |
| 8018 | + | |
| 8019 | + | |
| 8020 | + | |
| 8021 | + | |
| 8022 | + | |
| 8023 | + | |
| 8024 | + | |
| 8025 | + | |
| 8026 | + | |
| 8027 | + | |
| 8028 | + | |
| 8029 | + | |
| 8030 | + | |
| 8031 | + | |
| 8032 | + | |
| 8033 | + | |
| 8034 | + | |
| 8035 | + | |
| 8036 | + | |
| 8037 | + | |
| 8038 | + | |
| 8039 | + | |
| 8040 | + | |
| 8041 | + | |
| 8042 | + | |
| 8043 | + | |
| 8044 | + | |
| 8045 | + | |
| 8046 | + | |
| 8047 | + | |
| 8048 | + | |
| 8049 | + | |
| 8050 | + | |
| 8051 | + | |
| 8052 | + | |
| 8053 | + | |
| 8054 | + | |
7991 | 8055 | | |
7992 | 8056 | | |
7993 | 8057 | | |
| |||
0 commit comments