Repository navigation
fix(pm): check:adr-anchors declares its whole-tree citation scan, so dispatch-gates derives it for every card - #34114
Conversation
…ispatch-gates collectCitations runs `git grep --untracked` with no pathspec, so the gate reads every text file, but it declared only its path literals and dispatch-gates --commands called it silent for any card editing a file outside them. The gate now carries the whole-tree-population marker, and a live self-test case holds the marker to the scan in both directions. Claude-Session: https://claude.ai/code/session_01ADHkmT9YphoBfbtPDaBJrs Co-authored-by: Claude <noreply@anthropic.com>
…s a repo-root walk A whole-tree-population declaration is refused unless the gate's source spells a recognised repo-root walk, and `git grep` (which searches the tracked corpus by default) was not one of the spellings, so check:adr-anchors could not declare the scan it really performs. Limb D is appended to REPO_ROOT_WALK_SPELLINGS, held to the execFile shape so the system grep over one named file does not match; limbs 0-2 are unchanged. Claude-Session: https://claude.ai/code/session_01ADHkmT9YphoBfbtPDaBJrs Co-authored-by: Claude <noreply@anthropic.com>
|
domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19 Contract reviewServed-tier: No path of the diff is a governed-register or published-schema hit (all three sit under Check-runs on the head: all completed, none still running. 26 success, the rest skipped (opt-in and UI lanes), 0 failed. ① Derived judgments
② Semver levelNone. Three unpublished tool scripts under ③ Boundary flags
④ Design judgmentNo must-fix. should-fix (non-blocking, follow-up)
nit
Implemented-by: VERDICT: PASS |
|
domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19 席位核对 · ACCEPT · head
|
Requested by Steve · project thread
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 pm: the low-risk arm lands an add-only ADR note as Tier S; any other ADR change stays H #33975 就是一个scripts/pm/脚本里的测试字符串触发的)。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 withgit 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-ownedCHANGELOG.mdfiles on its excuse list), sodispatch-gatesplaced the family by those alone and scored itsilentfor 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.mjsderived 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-populationwas 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 existingwhole-tree-populationmarker (the channelcheck:nul-bytesand seven other families use) is the fit. No new declaration grammar.scripts/check-adr-anchors.mjs// dispatch-gates: whole-tree-population -- …line abovecollectCitations, 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.mjsREPO_ROOT_WALK_SPELLINGSgains 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 systemspawnSync('grep', …)over one named file incheck-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.mjsgit 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.node scripts/pm/dispatch-gates.mjs --commands scripts/pm/check-governed-merges.mjsprinted 33 lines, 0 namingcheck:adr-anchors; on a6876cc it prints 34, includingpnpm check:adr-anchors, placed under "Always runs (declared population)" with the marker's reason. The always-runs block grows 8 → 9 families.Acceptance notes
--commandsnow carriespnpm check:adr-anchors(self-test plus scan, about 11 s measured here).scripts/pm/dispatch-gates.mjs, in other regions; whichever lands second resolves.check-governed-merges.mjs --prand 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/objectstackderived 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).The 33 commands and their exit codes
Generated by Claude Code