Repository navigation
fix(pm): the queue guard and governed register read paths with -z, so a non-ASCII or newline path stays governed - #33804
Conversation
…governed The queue guard's enumerateRows and the register's --branch list, sweep commitChanges and workflow-split ls-tree read paths without -z. Git then C-quotes a name holding a non-ASCII or control character, and the quoted spelling matches no governed prefix, so the queue leg never saw that governed file. Every one now reads -z and splits on NUL; real-git self-test rows (gitFreeEnv) with a non-ASCII name and a name holding a newline under skills/ and .github/workflows/ prove each is governed. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mbkhYE1nRMP6v8ysa
|
domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb Contract reviewServed-tier: Read: card #33620 body and its 3 comments (triage 6888758949, claim 6893186109, os-dev-report 6893465272); PR #33804 body and file list (2 files, +146 / -26); the net diff of the head against its merge base Check-runs on the head when this record was written: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: FAIL Adopted by the seat 2026-11-15T11:19Z · isolated sub-agent at CONTRACT_REVIEW_TIER (served model verified by the seat) · Ruling-ref: Leehom card cmsg_01TenzsRopZj4jMbvjX8uz1XFhuiZmTH8VFgMmHRmpiGAb, option A, tapped 2026-11-14T15:37Z |
…-z argv readWorkflowDiff now lists names with `ls-tree -r -z --name-only`, so the executor self-test's fake reads the revision and directories one index later and answers NUL-separated names, as git does. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mbkhYE1nRMP6v8ysa
|
domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb Contract-review-handoff: review#1 — CONTRACT_REVIEW_TIER unavailable (maintainer routing ruling for this account's seats: contract reviews go to review#1, 2026-11-15T11:38Z) · head f1a04f7 |
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract-review-claim: session_016WV4cy7hQ5MvQ83ByNZ8ZH · head f1a04f7 · 2026-11-15T11:39:47Z |
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract reviewServed-tier: Delta review of the fix for the one graded finding of (record ID: 6893545108), from head Read: card #33620 body and its 3 comments; PR #33804 body, file list (3 files) and its comments; the prior record; ① Derived judgmentsM1 (must-fix): closed
No must-fix, no should-fix. ② Semver levelUnchanged: ③ Boundary flags
Implemented-by: VERDICT: PASS Reviewing session model: claude-fable-5-2. The face read off the PR's file list is the declaration face, so the record states the tier name the template gives for it. |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mbkhYE1nRMP6v8ysa
|
domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb Contract-review-handoff: review#1 — CONTRACT_REVIEW_TIER unavailable (maintainer routing ruling for this account's seats: contract reviews go to review#1, 2026-11-15T12:25Z) · head 3b083cc |
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract-review-claim: session_016WV4cy7hQ5MvQ83ByNZ8ZH · head 3b083cc · 2026-11-15T12:27:30Z |
|
review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH Contract reviewServed-tier: Merge-only delta review, from head Read: the new head's commit object; plain git reads of the old head, the merged main commit and the head; the PR file list (3 files, unchanged); the PR comments since the prior record; the check-runs on the head. Nothing built or run. ① Derived judgments
No must-fix, no should-fix. ② Semver levelUnchanged: ③ Boundary flags
Implemented-by: VERDICT: PASS Reviewing session model: claude-opus-5-5. The face read off the PR's file list is the declaration face, so the record states the tier name the template gives for it. |
|
domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb 席位核对Verdict: ACCEPT, seat lands (ungoverned, scripts/pm/)** · head
|
objectstack-ai#33962) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9PaNqu2SSrzw7UtdmjG9BE7)_ Fixes objectstack-ai#33846 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:两个受管合并守卫自测里的真实 git 夹具,在 git 命令行上钉住 `core.quotePath=true`。 - 为什么改:夹具只剥 GIT_* 环境变量,不挡用户或系统 gitconfig;机器上设了 `core.quotePath=false` 时,两条 CONTROL 断言会误红(只会红,不会假绿)。 - 风险与回滚:只动自测夹具,不动守卫判定逻辑,断言数不变(530 / 745);回滚即 revert 本 PR。 - 先看:`scripts/pm/check-governed-queue-guard.mjs` 的夹具 `g`,再看 `scripts/pm/check-governed-merges.mjs` 的夹具 `fg`。 - 两分钟验证:`HOME=$(mktemp -d) sh -c 'git config --global core.quotePath false && node scripts/pm/check-governed-merges.mjs --self-test'`,预期 745 条全绿。 - 需要你做的:无,席位落地。 ## What changes The CONTROL rows of the NUL-path fixtures (from PR objectstack-ai#33804) witness that git C-quotes the fixture names when a read runs without `-z`. Both fixture wrappers run real git under `gitFreeEnv()`, which strips every `GIT_` key but leaves `HOME` / `XDG_CONFIG_HOME` and `/etc/gitconfig` in reach, so a box with `core.quotePath=false` in any config file spells the non-ASCII names raw and reds the two CONTROL rows. The fix adds `-c core.quotePath=true` to the command-line pins each wrapper already carries (`user.email`, `user.name`, `init.defaultBranch`, `commit.gpgsign`): - `scripts/pm/check-governed-queue-guard.mjs`: the `g` wrapper of the quoted-path fixture (`guard-quoted-paths-`). - `scripts/pm/check-governed-merges.mjs`: the `fg` wrapper of the quoted-path fixture (`governed-merges-quoted-paths-`). **Why the `-c` pin rather than `GIT_CONFIG_GLOBAL=/dev/null` + `GIT_CONFIG_NOSYSTEM=1`:** command-line `-c` outranks every config file level (system, global, XDG, local), so one pin covers all of them. The env route needs two variables to cover only global and system, and it would have to go through `gitFreeEnv()`, which strips every `GIT_` key by design, so it means changing the shared helper and its callers. The `-c` pin also sits in the same place as the fixture's existing identity pins. `scripts/git-env.mjs` is not changed, so no caller of `gitFreeEnv()` moves. Forced test edits: none. No assertion, expected value or case count changed. Only the two fixture wrappers' git argument lists and their comments changed. ## Tests The acceptance asked for these runs: each self-test with `core.quotePath=false` set in a throwaway global config, before and after the fix. `gitFreeEnv()` strips `GIT_CONFIG_GLOBAL`, so the throwaway config goes in through `HOME`, plus one `XDG_CONFIG_HOME` run. | run | queue-guard `--self-test` | governed-merges `--self-test` | |:---|:---|:---| | base 895783a, default config | exit 0, 530 cases | exit 0, 745 assertions | | base 895783a, `HOME` with `core.quotePath=false` (ablation) | **exit 1**, 1 of 530 failed: the CONTROL row | **exit 1**, 1 failure: the objectstack-ai#33620 CONTROL row | | head cd7b9ac, `HOME` with `core.quotePath=false` | exit 0, 530 cases | exit 0, 745 assertions | | head cd7b9ac, `XDG_CONFIG_HOME` with `core.quotePath=false` | exit 0, 530 cases | exit 0, 745 assertions | | head cd7b9ac, default config | exit 0, 530 cases | exit 0, 745 assertions | <details><summary>Ablation output at base (core.quotePath=false)</summary> ```text check-governed-queue-guard: ✗ ⛔ CONTROL the-fixture-names-are-ones-git-C-quotes-without--z: ["\"skills/a/two\\nlines.md\"","skills/a/文档.md"] ✗ check-governed-queue-guard self-test: 1 of 530 case(s) failed. check-governed-merges: ✗ check-governed-merges --self-test — 1 failure(s) • ⛔ objectstack-ai#33620 CONTROL the-fixture-names-are-ones-git-C-quotes-without--z: [".github/workflows/café.yml","\"skills/a/two\\nlines.md\"","skills/a/文档.md"] ``` The newline name stays quoted under `core.quotePath=false`. Only the non-ASCII names lose their quotes, which is the `every(startsWith('"'))` limb the CONTROL row reads. </details> ## Acceptance notes - The card's mechanism assumptions held: no `core.quotePath` pin existed in either fixture at 895783a, and `gitFreeEnv()` does not cover config files. One small correction: at base, neither file's comment named `core.quotePath`. The governed-merges comment said only "git would C-quote". Both comments now name it. - The `lowrisk-rename-` real-git fixture in check-governed-queue-guard is in the low-risk arm region (another card is working there) and was left alone. It uses only ASCII names, so it does not depend on `core.quotePath`. - A system-level `/etc/gitconfig` leg was not run, because it would mean writing a file outside the workspace. `-c` outranks the system level by git's documented precedence. ## Verification Gates: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` on head cd7b9ac derived 35 commands. All 35 exited 0. `--ran` reconciliation: "35 derived famil(ies) accounted for — 35 run, 0 NOT-MEASURED (a DERIVED zero — all 35 recorded an exit code and none of them is 3)". CI runs every other family on this PR. <details><summary>Derived gate list, each exit 0 at cd7b9ac</summary> ```text node scripts/check-closing-keyword-parity.mjs (+ --self-test) node scripts/check-comment-mask-corpus.mjs node scripts/check-declaration-mirrors.mjs (+ --self-test) node scripts/check-self-test-wired.mjs (+ --self-test) node scripts/check-self-test-workflow-commands.mjs (+ --self-test) node scripts/check-skills-token-ratchet.mjs (+ --self-test) node scripts/check-whole-set-label-write.mjs (+ --self-test) node scripts/ci/plan-test-core-shards.mjs --self-test node scripts/pm/bare-root-worklist.mjs --self-test node scripts/pm/check-governed-queue-guard.mjs --self-test pnpm check:agent-test-spelling · check:bash32-floor · check:ci-filter-parity · check:cli-command-ids pnpm check:closing-target-claim · check:cross-package-test-inputs · check:driver-memory-census · check:entry-guard pnpm check:gitlink-declared · check:nul-bytes · check:parse-guard · check:pm-dispatch-gates pnpm check:pm-governed-merges · check:pnpm-filter-targets · check:pnpm-flag-spellings · check:ratchet-remedy-authority pnpm check:refd-timer-probe · check:scripts-symbol-anchors · check:watch-hint-literal ``` </details> This PR changes only `scripts/pm/**` and publishes nothing, so it takes `skip-changeset`. No governed surface is touched. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmSDNFF5uczb7BL5Bdf)_ Co-authored-by: Claude <noreply@anthropic.com>
…I governed path keeps its tier (objectstack-ai#33998) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi916SWCJMeiaqJP9Bb2wnp2s)_ Fixes objectstack-ai#33847 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:派发工具 `dispatch-gates.mjs` 的 `changedPathsFromGit` 读变更路径(已提交、未提交、未跟踪三份清单)时改成加 `-z`、按 NUL 切分,三份清单走同一个读取函数,`-z` 由该函数统一插入。 - 为什么改:不加 `-z` 时 git 会把含中文等非 ASCII 字符或换行的路径打印成带引号的转义串,它对不上任何 glob,于是 `skills/**` 下这样命名的受管文件在派发时算不出复审档位,派生的门禁清单也漏掉它;未跟踪的这种文件还被记成「读不到、0 行」。 - 风险与回滚:只改 `scripts/pm/**` 一个工具脚本和它的自测,不发布任何包;所有 ASCII 路径的读数逐字节不变。回滚即还原本 PR。 - 先看:`scripts/pm/dispatch-gates.mjs` 的 `gitPathList`(新读取函数)与 `changedPathsFromGit` 的三处调用;自测文件里 `quoted-names` 场景。 - 两分钟验证:在一个分支上提交 `skills/objectstack-data/文档.md` 后跑 `node scripts/pm/dispatch-gates.mjs --tier`,预期 stderr 列出原样的中文路径,stdout 给出契约复审档位(修复前是带引号的转义串、无档位)。 - 需要你做的:无,席位落地(非受管面)。 ## What changes `changedPathsFromGit` (it feeds `--tier`, `--commands` and the changed-line size) read its three path lists line by line, with no `-z`: | Read | Was | Now | |:--|:--|:--| | committed | `diff --name-only --no-renames MERGE_BASE HEAD`, split on newline, trimmed | `diff -z --name-only --no-renames MERGE_BASE HEAD`, split on NUL, not trimmed | | working tree | `diff --name-only --no-renames HEAD`, same | `diff -z …`, same | | untracked | `ls-files --others --exclude-standard`, same | `ls-files -z …`, same | | `changedLinesFromGit` fallback (no `untracked` passed) | the untracked read above | the same `-z` read | Git C-quotes a path holding a non-ASCII byte, a double quote or a control character (a file named in Chinese prints as a quoted octal string), and that spelling starts with a quote mark, so it matched no glob. Measured on a real repo before the fix: a committed `skills/x/` file named in Chinese plus an untracked one derived `tier: null`, and the untracked one was counted as 1 unreadable file of 0 lines. After: both raw, tier `CONTRACT_REVIEW_TIER`, 0 unreadable. All four reads now go through one reader, `gitPathList`, which splices `-z` in after the subcommand itself, so no caller in this file can list paths the other way. The old `gitLines` had no other caller and is gone. Not done, per the card: `core.quotePath=false` alone, which would still split a newline name in two. Not changed: the size read `diff --numstat -M` (summed by `parseNumstat` in `check-governed-merges.mjs`) only adds the two counts, which quoting never touches; the same call was left as is in objectstack-ai#33804 for the same reason. ## Tests `node scripts/pm/dispatch-gates.mjs --self-test` on acb82a3: **2520 cases pass**, exit 0 (lock VERDICT command-exit 0). Five new cases, in the slow tier's real-git section, on a fixture repo that sets `core.quotePath true` itself so it quotes on any machine. Each of the three reads carries one name git quotes: a committed file named in Chinese, an uncommitted edit to another, and an untracked file whose name holds a newline. - CONTROL: the plain read (no `-z`) of the same branch quotes all three, and they derive no tier and name no gate family. - The derived change set lists each name raw (committed 1, worktree 1, untracked 1). - Those raw names derive `CONTRACT_REVIEW_TIER` through `skills/**` (3 hits). - They name `check:skill-*` gate families, the ones the derived `--commands` list is built from. - The untracked newline-named file is counted from disk: 0 unreadable, +3 lines. No existing test was edited. <details><summary>Ablation: the old reader restored on disk, exactly the four new rows red, restored (head acb82a3)</summary> Each mutation through `node scripts/ablation-replace.mjs` (anchor hits 1 then 0 on disk, blob changed), the self-test under `os-verify-lock.sh`; restore: blob == HEAD (`6343de57fbce`) and `git diff HEAD` empty, both legs. ```text leg 2 (the card's ablation): gitPathList body back to the old gitLines body (no -z, split on newline, trimmed) -> VERDICT command-exit 1, 4 of 2520 failed: the derived change set spells each C-quoted name as it is on disk: committed, uncommitted and untracked (newline included) and those raw names derive the contract-review tier through the skills/** glob and they name the skill gate families the derived --commands list is built from and the untracked newline-named file is counted from disk, not as an unreadable file of 0 lines (the CONTROL row stays green, as it must) leg 1: only the spliced -z dropped, NUL split kept -> VERDICT command-exit 1, 12 of 2520 failed: the four rows above, plus 8 older real-git derivation rows: without -z the whole newline-joined listing comes back as ONE name, so -z and the NUL split are bound in one reader and cannot drift apart ``` </details> ## Acceptance notes - Every ASCII path reads byte-identically: the 2515 cases that existed before all stay green on the fix. - `derivationProvenance` prints one path per stderr line, so a path with a newline in its name now prints raw across two lines there. That is display only (stdout and the tier are unaffected); not changed. - Serial: objectstack-ai#33848 edits the same two files and waits for this PR to merge. ## Verification Local subset on acb82a3 (final head): `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 30 commands; all 30 exit 0 (each exit captured before any pipe). `--ran` with every line annotated `:: exit N`: **30 derived, 30 run, 0 NOT-MEASURED, 0 UNRUN** (a derived zero, all 30 recorded an exit code). `pnpm check:pm-dispatch-gates` is in that 30 (its fast tier, 2205 cases); the full both-tier battery is the 2520 above. The script's other callers of `changedPathsFromGit` are only `check-dispatch-gates.mjs`, covered there. No package touched, so no build closure and no package test is owed; CI runs the rest. <details><summary>The 30 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 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: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_01ADHkmPfzYmYaFdzt3TJ9w2)_ Co-authored-by: Claude <noreply@anthropic.com>
…/pm module, transitively (objectstack-ai#34080) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9MG4BPhsDcJCksmNwyRu6xu)_ Fixes objectstack-ai#33848 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:派发工具 `dispatch-gates.mjs` 新增「import 图」匹配键:改动落在 `scripts/pm/**` 下的某个模块时,所有直接或间接 import(含动态 import、再导出)它的门禁脚本所属的门禁族都会被派生出来,输出里打印从门禁脚本到该模块的整条 import 链。 - 为什么改:PR objectstack-ai#33804 第一版只改了 `check-governed-queue-guard.mjs` 和 `check-governed-merges.mjs`,`--commands` 派生 35 条、漏了 `check:pm-fleet-write-execute`(它的脚本 import 了被改的函数),开发者「35 条全绿」而 CI 红。现在同一组文件派生 62 条,含 fleet-write 的执行器、校验器和派发器。 - 风险与回滚:只改 `scripts/pm/**` 下一个工具脚本和它的自测,不发布任何包。新键排在所有旧键之后,旧匹配的键与来源标签一字不变,只会多派、不会少派;代价是改大多数 pm 模块会多派约 40 多个门禁族(pm 工具互相 import 成一个大环,这是实测的真实影响面)。回滚即还原本 PR。 - 先看:`scripts/pm/dispatch-gates.mjs` 的 `loadEdgeTargets`(读 import 边,含动态 import 的兜底)与 `coveringKey` 末尾的新分支;自测文件里 `The import-graph key (objectstack-ai#33848)` 一节和改过的两条旧用例。 - 两分钟验证:`node scripts/pm/dispatch-gates.mjs --commands scripts/pm/check-governed-queue-guard.mjs scripts/pm/check-governed-merges.mjs | grep fleet-write`,预期三行 `pnpm check:pm-fleet-write-{dispatch,execute,validate}`(修复前零行)。 - 需要你做的:无,席位落地(非受管面)。 ## What changes `dispatch-gates --commands` named a gate when a changed path was the gate's own script, a CI trigger, a job filter, a literal the gate spells, or a file it reads. It never named a gate because its script **imports** the changed module: `coveringKey`'s docblock refused that key (objectstack-ai#13126) on precision, because the shared heads under `scripts/` (`invoked-as.mjs` and four others) are imported by most families. The pm tools are the opposite shape, and the measured miss is the card's: on PR objectstack-ai#33804's first head the derivation named 35 gates, not `check:pm-fleet-write-execute`, whose script imports a changed function and whose self-test then went red in CI. A new key, consulted **last** in `coveringKey`, answers a changed path under `IMPORT_GRAPH_KEY_ROOT` (`scripts/pm/`): a family matches when the path is in the transitive load closure of its gate files. Read from the module's side that is the reverse import graph over `scripts/pm/**`, at any depth. The row prints the chain, e.g. `import graph scripts/pm/fleet-write/execute.mjs -> scripts/pm/check-governed-queue-guard.mjs`. Outside `scripts/pm/` the objectstack-ai#13126 refusal stands unchanged (a self-test row pins that). | Piece | What it does | |:--|:--| | `loadEdgeTargets(path, source)` | One file's first-party load edges: static `import … from`, `export … from` (a re-export loads its target), the side-effect form, a dynamic `import()` of a string literal or of `new URL(literal, import.meta.url)`. Comments are masked; a keyword inside a string or template literal is fixture text, not a load. Self-test bodies are **not** masked: a `--self-test` run loads them. | | Unreadable dynamic `import()` | The argument is a variable, a property or a computed URL. It is not dropped: every code-position module literal in that file becomes an edge, whether relative or spelled from the repo root under `scripts/` (toward deriving more). Both shapes are live: a loader seam (`load = (specifier) => import(specifier)`) with its relative specifiers in a constant (`ARM_READER_SOURCE`), and a root-spelled roster loaded in process (`fleet-write/dispatch.mjs`'s self-test imports each sender through `pathToFileURL(join(REPO_ROOT, sender))`; `check-dispatch-gates.mjs` loads its engine through `import(resolve(ROOT, TOOL))`). The root spelling also takes fixture rows and text reads written the same way (five modules `check-governed-merges.mjs` names as data); that over-derives, which is this key's direction. | | `importGraphReach(files, edgesOf)` | Breadth-first forward closure from a family's gate files, recording each module's first importer, so the printed chain is a shortest one. Walks self-test families and gate files too: the key claims what RUNNING the family loads, never what it watches, so neither population narrowing applies. | | `discoverFamilies` | Computes `entry.importReach` for every family, one scan per file per discovery. | | `derivationInputs` | Adds every reached module, since its edges decide what the key names. | Resolution is the existing first-party rule: relative specifiers only, inside `scripts/`, outside `node_modules`, the target must exist. A bare specifier is an installed package. Measured on this tree (b8685e5), and printed by a self-test row on every run rather than recorded in prose: the key reaches 28 pm modules over 1195 (family, module) pairs, and the most-reached module, `clause2-line.mjs`, names 53 families. The pm tools close into one large cycle (the governed register, the half-state patrol, the queue guard and the dispatch-gates engine load one another), so an edit to most pm modules names forty-odd families. That is the measured size of what such an edit can break. Time, measured on a quiet container, two cold runs each: a discovery took 16.6 s and 14.8 s before the key (base e71ecc1) and 17.2 s and 17.0 s with it (6f34ab1); a whole `--commands` run over one pm path took 36.0 s and 37.0 s before and 38.0 s and 35.7 s after. The review's 48.7 s was the same run on a loaded box. The stale "~14 s cold" in `derivationInputs`' docblock now carries these readings. ## Tests Full battery (`node scripts/pm/dispatch-gates.mjs --self-test`, both tiers) on b8685e5: **2530 cases pass** (fast 2215 + slow 315), lock `VERDICT command-exit 0`. Round 1: 2528 passed on 80bc14b and on e6452d3. New rows, all in the fast tier: - Fixture graph (in memory, so the shapes cannot rot with the tree): the reader takes the static import, the re-export, the side-effect form, a literal `import()` inside a self-test body and a `new URL` import; it refuses an import spelled in a template literal or a comment and a bare package; an unread `import()` widens to every module literal in the file, relative or root-spelled; CONTROL: the same two literals in a file with no unread `import()` are no edges. - ⭐ Transitive row: in the fixture, `b.mjs` reached only through `gate.mjs -> a.mjs -> b.mjs` names the family, and the row prints that chain. - Scope row: a module outside `scripts/pm/` reached by import is still answered by no key. - ⭐ Root-spelled roster row (live tree, review M1): `scripts/pm/issue-create.mjs`, which no file under `scripts/` imports statically and which the dispatcher's self-test loads by root path, derives `check:pm-fleet-write-dispatch` through the import graph. - Price row: prints the modules the key reaches, the (family, module) pairs and the most-reached module, asserting only that the key reaches anything. - ⭐ Replay row (live tree): PR objectstack-ai#33804's first file list places `check:pm-fleet-write-execute` as matched via `import graph scripts/pm/fleet-write/execute.mjs -> …`, rendered `pnpm check:pm-fleet-write-execute`; and `check:pm-fleet-write-validate` and `check:pm-fleet-write-dispatch` match too. Forced edits to existing rows (both are about the key order this PR extends): 1. **The objectstack-ai#13126 witness** (`the witness holds — bare-root-worklist --self-test imports THIS file, and no key names that family…`) asserted the refusal's one known missing lead. That module is under `scripts/pm/`, so the new key names it; the row now asserts the edge exists AND the key that names it is the import-graph key (`the witness is paid back — …`). The other five refusal pins (novel class, worst head, concentration, the deferred-pair pins) are unchanged and green. 2. **Read-key additivity** (`every read edge earns a key, and none is re-attributed …`) stripped `entry.reads` and compared against the keys left. The new key now sits after the read key, so with the reads stripped it answered those targets and the row reported 7 false re-attributions (`program text read by …` -> `import graph …`). The row now strips `entry.importReach` too, so it compares the read key against the keys consulted BEFORE it, which is its claim. <details><summary>Ablation: the new branch in coveringKey disabled on disk, exactly the four key rows red, restored (head e6452d3)</summary> Through `node scripts/ablation-replace.mjs` (anchor hits 1 -> 0 on disk, blob `7d65b7fe4962` -> `09197c9f6da0`), the fast tier under `os-verify-lock.sh`; restore: blob == HEAD (`7d65b7fe4962`) and `git diff HEAD` empty. ```text mutation: the import-graph branch's condition prefixed with `false &&` -> VERDICT command-exit 1, 4 of 2213 failed: the witness is paid back — bare-root-worklist --self-test imports THIS file, and the import-graph key names that family for a card editing it the transitive row: a module reached only through an importer of an importer names the family, and the row prints the chain from the gate file the replay row: PR objectstack-ai#33804's first file list derives check:pm-fleet-write-execute, through the import graph …and the validator and the dispatcher, the other two fleet-write families the card names (the edge-reader rows and the scope row stay green, as they must: they do not read the key) ``` </details> <details><summary>Ablation, round 2 (review M1): the root-spelled half of the fallback disabled on disk, exactly two rows red, restored (head b8685e5)</summary> Through `node scripts/ablation-replace.mjs` (anchor hits 1 -> 0, blob `8e00e6752a69` -> `fcd7324b7a64`), the fast tier under `os-verify-lock.sh`; restore: blob == HEAD (`8e00e6752a69`) and `git diff HEAD` empty. ```text mutation: a root-spelled literal in a file with an unreadable import() is skipped instead of admitted -> VERDICT command-exit 1, 2 of 2215 failed: an import() whose argument is not a literal widens toward MORE: every module literal in the file is an edge, relative or spelled from the repo root a sender the dispatcher loads by a root-spelled path derives check:pm-fleet-write-dispatch, through the import graph ``` </details> ## Acceptance notes - Additive by construction: the key is the last one `coveringKey` consults, so every (family, path) pair an earlier key answered keeps its key and label; the 2,520 rows that existed before stay green except the two forced edits above. - Price, stated rather than hidden: a card editing most `scripts/pm/` modules now derives about 62 commands where it derived about 30 (this PR's own card: 62). Every added row prints its import chain, so a reader can check why it is there. - Not covered by this key: the import closure of a script a gate only SPAWNS as a child (`node scripts/pm/x.mjs`) is not walked; the existing run and read keys answer the spawned file itself where they apply. carrier: objectstack-ai#34084. - The related evidence the delta names (`check:adr-anchors` reddened by a fixture string on PR objectstack-ai#33975) is a different mechanism: that family declares five hints (`docs/adr`, `scripts/adr-anchors`, its own script and two `CHANGELOG.md` files) and no whole-tree marker, while its scan reads the whole tree's text. Its population is under-declared; not fixed here. carrier: objectstack-ai#34086. - Serial: objectstack-ai#34002 (dotAll in `triggerPatternRegex`, same file) is held and not folded in. ## Verification Local subset on b8685e5 (round 2; main e71ecc1 merged in): `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 62 commands; 61 exit 0 and one exit 3 (each exit captured before any pipe). `--ran` with every line annotated `:: exit N`: **62 derived, 61 run, 1 NOT-MEASURED (derived from the recorded exit 3), 0 UNRUN**. `pnpm check:i18n-coverage` is derived only through the import graph (its self-test imports the engine): its self-test half passed, its scan half refused with exit 3 because the CLI build closure is not built here; declared to CI. No package touched, so no build closure and no package test is owed. <details><summary>The 62 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-issue-citations.mjs :: 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-skills-token-ratchet.mjs :: exit 0 node scripts/check-skills-token-ratchet.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/ci/scheduled-full-run-card.mjs --self-test :: exit 0 node scripts/ci/scheduled-full-run.mjs --self-test :: exit 0 node scripts/ci/snapshot-next.mjs --self-test :: exit 0 node scripts/pm/bare-root-worklist.mjs --self-test :: exit 0 node scripts/pm/board-snapshot.mjs --self-test :: exit 0 node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0 node scripts/pm/sweep-closed-cards.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:closing-target-claim :: exit 0 pnpm check:commit-card-trailers :: 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:i18n-coverage :: exit 3 pnpm check:issue-citations :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:parse-guard :: exit 0 pnpm check:partof-closing-keyword :: exit 0 pnpm check:pm-board-snapshot :: exit 0 pnpm check:pm-close-cards :: exit 0 pnpm check:pm-dispatch-gates :: exit 0 pnpm check:pm-expected-skips :: exit 0 pnpm check:pm-fleet-token :: exit 0 pnpm check:pm-fleet-write-dispatch :: exit 0 pnpm check:pm-fleet-write-execute :: exit 0 pnpm check:pm-fleet-write-validate :: exit 0 pnpm check:pm-governed-merges :: exit 0 pnpm check:pm-governed-prose :: exit 0 pnpm check:pm-half-states :: exit 0 pnpm check:pm-issue-create :: exit 0 pnpm check:pm-issue-transfer :: exit 0 pnpm check:pm-label-write :: exit 0 pnpm check:pm-post-stamped :: exit 0 pnpm check:pm-prior-rulings :: exit 0 pnpm check:pm-record-recognisers :: 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:single-claim-paths :: exit 0 pnpm check:watch-hint-literal :: exit 0 ``` </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmRtrFmEsp5pAjTBpMT)_ <!-- signed: domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Fixes #33620
Clause-②: no
Metadata-protocol: none
Signed: domain:skills#1 · os-project-manager · session_01FEkQ5mbkhYE1nRMP6v8ysa
维护者速读
check-governed-queue-guard.mjs的enumerateRows)和受管登记脚本(check-governed-merges.mjs的--branch、事后审计、workflow 拆分)读文件路径时一律加-z、按 NUL 切分。-z时,git 会把含中文等非 ASCII 字符、引号或换行的路径打印成带引号的转义串,它对不上任何受管前缀,队列守卫因此看不见这个受管文件,会把它当成普通文件放行。scripts/pm/**两个工具脚本及其自测,外加 fleet-write 执行器自测里的一个 git 假件(随新参数移位);不发布任何包;所有 ASCII 路径的判定字节不变。回滚即还原本 PR。scripts/pm/check-governed-queue-guard.mjs的enumerateRows;scripts/pm/check-governed-merges.mjs的deriveBranchPaths与commitChanges。node scripts/pm/check-governed-queue-guard.mjs --self-test,预期 530 条全过(含 3 条 pm(queue-guard): enumerateRows reads diff-tree without -z, so a governed path with a non-ASCII or control character is quoted and matches no governed prefix #33620 真 git 用例)。What changes
Every path listing that feeds a governed match now reads
-zand splits on NUL. Without-zgit C-quotes a path holding a non-ASCII byte, a quote or a control character ("skills/a/\346\226\207.md","skills/a/two\nlines.md"), and the quoted spelling starts with a quote mark, so it matches no governed prefix: the queue leg never saw that governed file.check-governed-queue-guard.mjsenumerateRows,pull_requestnet rowdiff-tree … --name-only base head, split on newline… --name-only -z …, split on NULcheck-governed-queue-guard.mjsenumerateRows,merge_groupper-commit rowdiff-tree … --name-only -m --first-parent sha, split on newline… -z …, split on NULcheck-governed-merges.mjsderiveBranchPaths(--branch)diff --name-only --no-renames, split on newline and trimmeddiff -z …, split on NUL, not trimmed per pathcheck-governed-merges.mjscommitChanges(the sweep's path list)diff-tree --numstat, one record per linediff-tree --numstat -z, oneadded TAB deleted TAB pathrecord per NULcheck-governed-merges.mjsreadWorkflowDifflistAt(the workflow split's base/head/inventory listing)ls-tree -r --name-only, split on newline and trimmedls-tree -r -z --name-only, split on NULSurface breach, named:
scripts/pm/fleet-write/execute.mjsis outside the claim's file surface. Its self-test drivesreadWorkflowDiffthrough anls-treefake that read the revision atargv[3], the directories fromargv.slice(5)and joined names with a newline; the new-zargv moved both one index, socheck:pm-fleet-write-executewent red (2 of 415, review record 6893545108, M1). The fake now readsargv[4]/argv.slice(6)and joins with NUL: test code only, the same three-line move as the two fakes in this PR's own files. The executor's productiongovernedReviewPlanreachesreadWorkflowDifftoo, so the relay's workflow reading takes-zwith this PR.The arm's own
catalogFilesOf(diff-tree --raw -z) and the carried-head read (diff -z --name-only) already used-z; the path walk now spells each path the way they do, so a catalog path with such a name has its status row instead of reading "no status was read".Not changed, on purpose: the two size reads (
diff --numstat -Min--branch,diff-tree -M --numstatin the sweep) only sum the two counts, which quoting never touches;pullCatalogReading'sls-tree sha -- pathparses the mode only. The--branchderivation line now printsgit diff -z --name-only --no-renames …, the command that ran.Tests
Self-test fakes moved with the argv (
-zin the recorded reads, NUL-joined answers, thels-treefakes' argv indices), and new real-git rows throughgitFreeEnv():check-governed-queue-guard.mjs --self-test: 526 → 530 cases, exit 0. On a real repo withskills/a/文档.mdandskills/a/twoNEWLINElines.md: a CONTROL row proves the plain read quotes both and matches nothing governed;merge_groupandpull_requestrows each read both paths raw, both governed, attributed to the PR;catalogFilesOfspells both paths the way the walk does.pnpm check:pm-fleet-write-execute: 415 / 415, exit 0 on f1a04f7. With the old fake restored on disk (argv[3], throughablation-replace) it reads exactly the review's red: 2 of 415,tier-s-workflow-pull-requests-no-oneandh-reading-workflow-pull-requests,fatal: not a tree object. Every other importer of the two files ran its self-test green on f1a04f7:check:pm-fleet-write-validate,check:pm-fleet-write-dispatch,check:pm-post-stamped,check:pm-record-recognisers,check-handover,fleet-write/ops,check-closing-target-claim,check-skills-token-ratchet.check-governed-merges.mjs --self-test: 741 → 745 assertions, exit 0. On a real repo with the same two names plus.github/workflows/café.ymledited: a CONTROL row (the plain list quotes all three, none governed);--branchandcommitChanges(run underwithoutGitEnv) read all three raw, all governed;readWorkflowDifffinds the non-ASCII workflow at both commits and classifies the edit instead of reading it "absent at both commits".scripts/git-env.mjsjoins the uninstalled-checkout fixture's copied module graph, since the file now imports it.Ablation: each
-zdropped on disk, each row red, each restored (head c5d1fdd)Every mutation through
node scripts/ablation-replace.mjs(anchor hits 1 → 0 on disk, blob changed; restore: blob == HEAD andgit diff HEADempty), with a shelltraprestoring both files fromHEAD.Without the held fake edits the
--branchandls-treeablations also go red, but earlier, on the fake pins, before the real-git rows run.Acceptance notes
timeout-minutesedit on it can read Tier S, as the same edit on an ASCII name does. Before, the queue did not see that workflow at all, and a--branch/--prreading put it at Tier H by a false reason ("absent at both commits").--branch, becausetryGittrims the whole output. No governed prefix starts with a space, so no governed match can change; noted, not changed (the helper is shared).scripts/pm/files without-zthat feed a tier decision, listed per the order, not fixed here:scripts/pm/dispatch-gates.mjschangedPathsFromGit(diff --name-only --no-renamestwice andls-files --others, each line trimmed) feeds--tier's path mandate and--commands; askills/**path git quotes misses the mandate glob. The other reads found (check-prior-rulings.mjs,check-harness-current.mjs,git-history.mjs,write-pace.mjs,release-rehearsal-clone.mjs) feed no governed or tier decision.Verification
dispatch-gates --tier: no path-derived mandate (the diff hits none of the 4 declared globs); default opus; 181 changed lines (+151 / -30), under the 3000 threshold.check-governed-merges.mjs --branchon f1a04f7: NOT governed, 0 of 3 paths hit the register, size 181 ≤ 3000, head repo NOT MEASURED from a branch.dispatch-gates --commands) on head f1a04f7, the three-file diff: 42 derived, 42 exit 0 (the new seven, among themcheck:pm-fleet-write-execute, come from thefleet-write/execute.mjspath; the round-1 two-file diff derived 35 and did not name it, which is how 35 / 35 sat beside a red head).dispatch-gates --ran: 42 accounted for, 42 run, 0 NOT-MEASURED, 0 UNRUN. No package is touched, so no build, package test or typecheck is owed;skip-changeset(scripts/pm/**publishes nothing).42 derived gates on f1a04f7, each with its exit code
Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses (CI runs it).main, one pull request.scripts/pm/**):skip-changeset; both declaration lines are above.packages/specnot touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5mbkhYE1nRMP6v8ysa