Repository navigation
Commit d2b6232
fix(pm): check:adr-anchors declares its whole-tree citation scan, so dispatch-gates derives it for every card (#34114)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi92Vt19B5bTPa1d6K7Nf4xkL)_
Fixes #34086
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:门禁 `check:adr-anchors` 在源码里声明「我读整棵树」(dispatch-gates 现有的
whole-tree-population 标记),派发工具 `dispatch-gates` 同步认得 `git grep`
这种全树读法;从此每张卡的 `--commands` 都会派出这个门禁。
- 为什么改:这个门禁用 `git grep` 扫全仓所有文本文件里的 `ADR-NNNN` 引用,却只声明了 4
个路径;改它们之外的文件时派发清单不点它,开发者本地全绿、CI 才红(PR #33975 就是一个 `scripts/pm/`
脚本里的测试字符串触发的)。
- 风险与回滚:只改三个工具脚本,不发布任何包。每张卡多派一条命令,实测约 11 秒。dispatch-gates
只在识别清单末尾追加一条,原有三条及其下标不动。回滚即还原本 PR。
- 先看:`scripts/check-adr-anchors.mjs` 的 `collectCitations` 上方新标记行与自测
`live-scan-population-is-declared`;`scripts/pm/dispatch-gates.mjs` 的
`REPO_ROOT_WALK_SPELLINGS` 第四条。
- 两分钟验证:`node scripts/pm/dispatch-gates.mjs --commands
scripts/pm/check-governed-merges.mjs | grep adr-anchors`,预期一行 `pnpm
check:adr-anchors`(修复前零行)。
- 需要你做的:无,席位落地(非受管面)。
## What changes
`check:adr-anchors`' third check (#6634) collects citations with `git
grep --untracked -IonE …` and no pathspec, so it reads every tracked and
every untracked-not-ignored text file. Its source spelled only four path
literals (`docs/adr`, its own script and the two release-owned
`CHANGELOG.md` files on its excuse list), so `dispatch-gates` placed the
family by those alone and scored it `silent` for any other file.
Measured on main f81e4b6: 10,237 tracked files cite an ADR, 10,078 of
them outside those literals; `--commands
scripts/pm/check-governed-merges.mjs` derived 33 commands and not this
one.
**Route: declare, don't narrow.** The whole-tree read is the point of
the check (a citation nobody resolves rots wherever it is written), so
the scan stays as it is. `wide-population` was also rejected: it keeps a
family out of `--commands`, which is the opposite of the acceptance and
of "a miss fails toward deriving more". The existing
`whole-tree-population` marker (the channel `check:nul-bytes` and seven
other families use) is the fit. No new declaration grammar.
| File | Change |
|:--|:--|
| `scripts/check-adr-anchors.mjs` | The `// dispatch-gates:
whole-tree-population -- …` line above `collectCitations`, with a note
on why the scan is not narrowed. A live self-test case,
`live-scan-population-is-declared`, holds the marker to the scan in both
directions: a scan reading more than one top-level root needs the
marker, and a marker over a one-root scan is red too. The live battery's
floor moves 21 → 22 for that case. |
| `scripts/pm/dispatch-gates.mjs` | `REPO_ROOT_WALK_SPELLINGS` gains
limb D, `a \`git grep\` search of the tracked corpus`, appended after
limbs 0–2 (unchanged). Without it the marker was REFUSED ("its own
source carries no recognised repo-root walk … EXTEND
REPO_ROOT_WALK_SPELLINGS"). The regex is held to the execFile shape
(`'git'` then an argv array holding `'grep'`), so the system
`spawnSync('grep', …)` over one named file in
`check-skill-compatibility-version.mjs` does not match. Out of the
card's file surface: declared to the seat before the edit and approved,
with the claim's surface amended. |
| `scripts/pm/dispatch-gates.self-test.mjs` | Two fixture cases beside
limbs A–C: limb D reads the execFile `git grep`; the system grep is not
a walk. |
## Tests
- `node scripts/check-adr-anchors.mjs --self-test`: 134 assertions pass,
floor included.
- `pnpm check:pm-dispatch-gates` (fast tier): 2207 cases pass, 335 s.
- Acceptance, before and after: on f81e4b6 `node
scripts/pm/dispatch-gates.mjs --commands
scripts/pm/check-governed-merges.mjs` printed 33 lines, 0 naming
`check:adr-anchors`; on a6876cc it prints 34, including `pnpm
check:adr-anchors`, placed under "Always runs (declared population)"
with the marker's reason. The always-runs block grows 8 → 9 families.
- No forced edits to existing test rows.
## Acceptance notes
- Price: every card's `--commands` now carries `pnpm check:adr-anchors`
(self-test plus scan, about 11 s measured here).
- Serial: PR #34080 (in the merge queue) and card #34084 also edit
`scripts/pm/dispatch-gates.mjs`, in other regions; whichever lands
second resolves.
- The claim's acceptance line asks for `check-governed-merges.mjs --pr`
and the tier; the reading is in the os-dev-report on the card.
## Verification
Local gates on a6876cc (main f81e4b6 is the base): `node
scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 33 commands; all 33 exit 0. `--ran`:
**33 derived, 33 run, 0 NOT-MEASURED, 0 UNRUN**. No package touched, so
no build closure and no package test is owed; no changeset
(`skip-changeset`).
<details><summary>The 33 commands and their exit codes</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-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:adr-anchors :: 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:declared-population-live :: 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:pm-governed-merges :: 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>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmT9YphoBfbtPDaBJrs)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c1c86a3 commit d2b6232
3 files changed
Lines changed: 59 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
295 | 295 | | |
296 | | - | |
| 296 | + | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
| 299 | + | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
1188 | 1199 | | |
1189 | 1200 | | |
1190 | 1201 | | |
| |||
2124 | 2135 | | |
2125 | 2136 | | |
2126 | 2137 | | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
2127 | 2161 | | |
2128 | 2162 | | |
2129 | 2163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4071 | 4071 | | |
4072 | 4072 | | |
4073 | 4073 | | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
4074 | 4086 | | |
4075 | 4087 | | |
4076 | 4088 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7018 | 7018 | | |
7019 | 7019 | | |
7020 | 7020 | | |
| 7021 | + | |
| 7022 | + | |
| 7023 | + | |
| 7024 | + | |
| 7025 | + | |
| 7026 | + | |
| 7027 | + | |
| 7028 | + | |
| 7029 | + | |
7021 | 7030 | | |
7022 | 7031 | | |
7023 | 7032 | | |
| |||
0 commit comments