Skip to content

fix(pm): the queue guard and governed register read paths with -z, so a non-ASCII or newline path stays governed - #33804

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-fangcr
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-fangcr

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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 -z and splits on NUL. Without -z git 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.

File Read Was Now
check-governed-queue-guard.mjs enumerateRows, pull_request net row diff-tree … --name-only base head, split on newline … --name-only -z …, split on NUL
check-governed-queue-guard.mjs enumerateRows, merge_group per-commit row diff-tree … --name-only -m --first-parent sha, split on newline … -z …, split on NUL
check-governed-merges.mjs deriveBranchPaths (--branch) diff --name-only --no-renames, split on newline and trimmed diff -z …, split on NUL, not trimmed per path
check-governed-merges.mjs commitChanges (the sweep's path list) diff-tree --numstat, one record per line diff-tree --numstat -z, one added TAB deleted TAB path record per NUL
check-governed-merges.mjs readWorkflowDiff listAt (the workflow split's base/head/inventory listing) ls-tree -r --name-only, split on newline and trimmed ls-tree -r -z --name-only, split on NUL

Surface breach, named: scripts/pm/fleet-write/execute.mjs is outside the claim's file surface. Its self-test drives readWorkflowDiff through an ls-tree fake that read the revision at argv[3], the directories from argv.slice(5) and joined names with a newline; the new -z argv moved both one index, so check:pm-fleet-write-execute went red (2 of 415, review record 6893545108, M1). The fake now reads argv[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 production governedReviewPlan reaches readWorkflowDiff too, so the relay's workflow reading takes -z with 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 -M in --branch, diff-tree -M --numstat in the sweep) only sum the two counts, which quoting never touches; pullCatalogReading's ls-tree sha -- path parses the mode only. The --branch derivation line now prints git diff -z --name-only --no-renames …, the command that ran.

Tests

Self-test fakes moved with the argv (-z in the recorded reads, NUL-joined answers, the ls-tree fakes' argv indices), and new real-git rows through gitFreeEnv():

  • check-governed-queue-guard.mjs --self-test: 526 → 530 cases, exit 0. On a real repo with skills/a/文档.md and skills/a/two NEWLINE lines.md: a CONTROL row proves the plain read quotes both and matches nothing governed; merge_group and pull_request rows each read both paths raw, both governed, attributed to the PR; catalogFilesOf spells 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], through ablation-replace) it reads exactly the review's red: 2 of 415, tier-s-workflow-pull-requests-no-one and h-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é.yml edited: a CONTROL row (the plain list quotes all three, none governed); --branch and commitChanges (run under withoutGitEnv) read all three raw, all governed; readWorkflowDiff finds the non-ASCII workflow at both commits and classifies the edit instead of reading it "absent at both commits". scripts/git-env.mjs joins the uninstalled-checkout fixture's copied module graph, since the file now imports it.
Ablation: each -z dropped 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 and git diff HEAD empty), with a shell trap restoring both files from HEAD.

guard, merge_group read  -z dropped  -> exit 1, 2 of 530 failed:
  ⛔ #33620-merge_group-reads-a-non-ASCII-and-a-newline-path-raw-and-each-is-GOVERNED
  #33620-the-arm-status-read-spells-each-path-as-the-path-walk-does-so-every-path-has-its-row
guard, pull_request read -z dropped  -> exit 1, 2 of 530 failed:
  and-it-reads-the-net-diff-base-to-head-never-a-per-commit-first-parent-diff   (the argv pin)
  ⛔ #33620-pull_request-reads-the-same-two-paths-raw-and-each-is-GOVERNED
merges, --branch read -z dropped (fake keys held without -z too, so the run reaches the real-git rows) -> exit 1, 4 failed:
  ⛔ #33620 --branch-reads-a-non-ASCII-and-a-newline-path-raw-and-each-is-GOVERNED
  ⛔ #33620 the-workflow-split-lists-a-non-ASCII-workflow-at-BOTH-commits-and-classifies-the-edit
  plus two older real-git rows that read the NUL-split list
merges, commitChanges -z dropped     -> exit 1, 5 failed, among them:
  ⛔ #33620 the-sweep-commitChanges-reads-the-same-paths-raw-and-each-is-GOVERNED
merges, workflow ls-tree -z dropped (fake argv indices held in step) -> exit 1, exactly 1 failed:
  ⛔ #33620 the-workflow-split-lists-a-non-ASCII-workflow-at-BOTH-commits-and-classifies-the-edit

Without the held fake edits the --branch and ls-tree ablations also go red, but earlier, on the fake pins, before the real-git rows run.

Acceptance notes

  • Every ASCII path reads byte-identically. For a name git quotes, a governed path that read UNGOVERNED now reads governed (the card's defect). Two H-to-S directions follow from reading such a workflow name correctly; both are accepted deviations, recorded here per review record 6893545108:
    1. A modified workflow whose name git quotes is classified like any other workflow edit, so a pure timeout-minutes edit 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 / --pr reading put it at Tier H by a false reason ("absent at both commits").
    2. A workflow on the merge base whose name git quotes now joins the split's "already in use" inventory (actions and job names), so another workflow's edit that adopts an action used only there can read Tier S where it read H. Before, the quoted listing dropped that file from the inventory.
  • A path whose first character is a space still loses it in --branch, because tryGit trims the whole output. No governed prefix starts with a space, so no governed match can change; noted, not changed (the helper is shared).
  • Path reads in OTHER scripts/pm/ files without -z that feed a tier decision, listed per the order, not fixed here: scripts/pm/dispatch-gates.mjs changedPathsFromGit (diff --name-only --no-renames twice and ls-files --others, each line trimmed) feeds --tier's path mandate and --commands; a skills/** 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 --branch on f1a04f7: NOT governed, 0 of 3 paths hit the register, size 181 ≤ 3000, head repo NOT MEASURED from a branch.
  • Derived gates (dispatch-gates --commands) on head f1a04f7, the three-file diff: 42 derived, 42 exit 0 (the new seven, among them check:pm-fleet-write-execute, come from the fleet-write/execute.mjs path; 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
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-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/pm/bare-root-worklist.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.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: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-close-cards :: exit 0
pnpm check:pm-dispatch-gates :: 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-issue-transfer :: exit 0
pnpm check:pm-record-recognisers :: exit 0
pnpm check:pm-write-pace :: 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

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes (CI runs it).
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. Publishes nothing (scripts/pm/**): skip-changeset; both declaration lines are above.
  • 6. packages/spec not touched.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the maintainer's Chinese quick read).
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5mbkhYE1nRMP6v8ysa

…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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c5d1fddde28602e282dbf7680bbdb5b7dec79c9f
Local-runs: probe — one check-governed-merges.mjs --test scripts/pm/fleet-write/execute.mjs path-predicate call, run to say whether the must-fix's fix file is governed; it was not needed (the register rows answer it by reading) and nothing in this record rests on its output. Nothing built, no self-test or gate re-run, no checkout.
Scope: none (reviewFace hits: ungoverned); judged as the contract files: scripts/pm/check-governed-queue-guard.mjs, scripts/pm/check-governed-merges.mjs + none (the diff holds those two files only)

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 b76df9a6980 (one commit; main is one commit ahead, #33725, which touches neither file); the check-runs on the head. Read, not reviewed: scripts/pm/fleet-write/execute.mjs, scripts/pm/dispatch-gates.mjs, scripts/git-env.mjs, .github/workflows/lint.yml at the head.

Check-runs on the head when this record was written: Lint · repo & tooling gates FAILURE (see M1). Still running: Lint · PM dispatch-gates, Type Check · workspace, Type Check · consumer gates, Test Core (1/8). Green: Governed Surface Queue Guard, Lint · scoped · tooling self-tests, Lint · ESLint, Lint · docs & code guards, Lint · scoped · slot lookup & corpus, Type Check · source gates, Check Changeset, Check PR Size, PR-body guards, Test Core (2/8), Plan Test Core shards, Test UI, Dogfood Regression Gate.

① Derived judgments

  • Queue guard enumerateRows, both legs (pull_request net row, merge_group per-commit row): diff-tree ... --name-only -z, split on NUL, empty fields dropped. Right. --name-only -z has no status field and --no-renames is kept, so there is no two-path record to mis-split.
  • check-governed-merges.mjs deriveBranchPaths: diff -z --name-only --no-renames, split on NUL. Right. tryGit still trims the whole output; a NUL is not whitespace, so only leading whitespace of the first path can be lost, and that can only turn an ungoverned name into a governed one, never the reverse.
  • commitChanges: diff-tree --numstat -z --no-renames, one added TAB deleted TAB path record per NUL, the path group widened to cross a newline. Right: --no-renames rules out the three-field rename form of --numstat -z, and a binary row (- TAB -) still matches.
  • readWorkflowDiff listAt: ls-tree -r -z --name-only, split on NUL, no per-name trim. Right.
  • Every path read in the two files that feeds a governed or tier decision was found. Greps of the head for diff-tree, diff, ls-tree, ls-files, log, show, status, --name-only, --name-status, --numstat, --raw, --porcelain leave, outside the self-tests: the three already -z reads (catalogFilesOf --raw -z, the carried-head diff -z --name-only, armReadsNotMeasured ls-tree -z); two SIZE reads that sum counts only; pullCatalogReading ls-tree SHA -- PATH, which parses the mode only; and log reads that carry no path. No reader compares a quoted path string any more.
  • Accept-set moves, each judged:
    • A governed path git quotes: UNGOVERNED before, governed now, in the queue leg, --branch and the sweep. Right, the card's defect.
    • A workflow whose name git quotes, in the queue leg and --branch: not seen before, now governed and classified (S or H by content). Stricter. Right.
    • The same workflow under --pr and the fleet-write executor (paths from the API, raw): Tier H before by "absent at both commits", now classified, so a timeout-only edit reads Tier S. This is one H to S move; judged in ③, correct reading.
    • The inventory ("already in use" at the merge base) now includes workflows whose names git quotes; before they were dropped by the prefix filter. An action only such a workflow uses now vouches for another workflow's uses:, a second narrow H to S direction the PR body does not name. Correct under the ruling's words ("a uses: no workflow uses at the base"); see N1.
    • Every ASCII path reads the same bytes on all five reads.
  • Public surface: none. No package, no schema, no exported signature changed; renderDerivation prints git diff -z --name-only --no-renames, the command that ran.

② Semver level

skip-changeset is right: scripts/pm/** publishes nothing, no package is touched. Clause-②: no and Metadata-protocol: none on the PR body match the claim comment 6893186109 and the diff.

③ Boundary flags

  • Developer flag, the quoted-name workflow reading Tier S: NOT a fail-open. The workflows split (ruling record 6722205630, header section "The workflows row's split") makes a file H by PATH (the six pinned files, all ASCII, unchanged) or H by DIFF (C2 triggers), and S otherwise. The file name's encoding is no trigger. The earlier Tier H under --pr was a failed measurement with a false reason, and in the queue leg the same file was not governed at all, which is the larger hole this PR closes. Taken literally, the dispatch sentence "nothing that reads Tier H today may read Tier S" is breached on this one reading; the seat should accept it as a named deviation (the PR body's Acceptance notes state it), not treat it as a regression.
  • open_questions: empty in the report. Nothing to answer.
  • Out-of-file, dispatch-gates.mjs changedPathsFromGit: confirmed at the head (diff --name-only --no-renames twice and ls-files --others, no -z, each line trimmed). A skills/** path git quotes misses the --tier path mandate, so a dev can be dispatched below the mandated tier. The landing gates (queue guard, --pr) now catch the path, so this is a weaker-than-rule dispatch gate, not a landing hole. It needs its own card (tooling, p2 by the same reasoning as this card); the report lists it "noted, not filed", so the card is owed by the seat.
  • Out-of-file, the tryGit leading-space note: agreed, no governed match can be lost. No card needed.
  • New, for the seat: dispatch-gates --commands derived 35 gates on this diff and did not derive pnpm check:pm-fleet-write-execute, although scripts/pm/fleet-write/execute.mjs imports readWorkflowDiff from a changed file and its self-test fakes that function's git argv. The report's "35 derived, 35 exit 0" is true and the head is still red (M1). The derivation gap deserves a card of its own.

④ Design judgment

  • M1, must-fix. The head turns Lint · repo & tooling gates red. Step Fleet-write executor self-test (pnpm check:pm-fleet-write-execute) fails 2 of 415 cases: tier-s-workflow-pull-requests-no-one and h-reading-workflow-pull-requests, both with git could not read the workflow files (fatal: not a tree object: --name-only). Cause: the ls-tree fake in scripts/pm/fleet-write/execute.mjs (head lines 2993 to 2997) reads the revision at argv[3], the directories from argv.slice(5), and joins names with a newline; readWorkflowDiff now sends -z at index 2 and splits on NUL. The diff moved the same fake in both of its own files (index 3 to 4, 5 to 6, NUL join) and missed this third copy. Production fleet-write is not broken: workflowReadingFor hands real git to readWorkflowDiff. The fix is the same three-line move in that fake; the file is outside the claim's file surface (ungoverned, no register row), so the dev names the breach in the report. A delta review of the fix is owed.
  • The four production reads agree with the card's item 1, sentence by sentence, and with the jsdoc the diff adds to enumerateRows, commitChanges and readWorkflowDiff.
  • Card item 2 holds: real-git rows through gitFreeEnv() with a CJK name and a newline name under skills/, each with a CONTROL row proving the plain read quotes it, on both guard legs, --branch, the sweep and the workflow split. The PR body's ablation table was not re-run (read-only).
  • Tried to break it: a name that is not valid UTF-8 decodes with replacement characters under encoding: 'utf8'; the ASCII governed prefix still matches, and a later show SHA:PATH fails into an unmeasured reading, Tier H. Fails closed. A path holding a TAB is kept whole by the greedy last group of the numstat pattern. A rename is two paths on every list read (--no-renames kept everywhere a path is listed).
  • N1, nit. The PR body's Acceptance notes say a tier "can move one way only" plus the one workflow reading; the inventory widening in ① is a second reading that can move H to S and is not named. Prose face only.
  • N2, nit. The CONTROL rows rely on git's default core.quotePath; gitFreeEnv() strips GIT_* variables but not a user or system gitconfig, so a machine with core.quotePath=false reads the CJK and café names raw and the CONTROL rows go red. It fails red, never falsely green. A -c core.quotePath=true on the control read would pin it; follow-up or accepted deviation.

Implemented-by: claude/project-thread-fangcr
Reviewed-by: session_01FEkQ5pjSPT7ui2EUcunaVb

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH

Contract-review-claim: session_016WV4cy7hQ5MvQ83ByNZ8ZH · head f1a04f7 · 2026-11-15T11:39:47Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH

Contract review

Served-tier: TIER_DEFAULT
Head-sha: f1a04f78345a9d346efda8a325f57fd03d1c3ab8
Local-runs: probe — the delta's one claim is a self-test going from red to green, so it was re-run in a detached worktree of the head: node scripts/pm/fleet-write/execute.mjs --self-test (the body of pnpm check:pm-fleet-write-execute) on the head, the same run with the old fake restored on disk and then restored from the head, and check-governed-queue-guard.mjs --self-test. check-governed-merges.mjs --self-test was started and exited 3, prerequisite not met (the worktree has no node_modules): NOT MEASURED here, read from CI instead.

Delta review of the fix for the one graded finding of (record ID: 6893545108), from head c5d1fddd to head f1a04f78. That record's reviewer seat stood down; the hand-off line 6893741738 names review#1 and this head. Claim: 6893761491.

Read: card #33620 body and its 3 comments; PR #33804 body, file list (3 files) and its comments; the prior record; git diff c5d1fddd f1a04f78 (one commit, one file, +5 / -4, scripts/pm/fleet-write/execute.mjs); readWorkflowDiff listAt and the two sibling fakes in check-governed-merges.mjs at the head; the check-runs on the head. The other two files are byte-identical to the head the prior record reviewed, so its judgments on them stand and are not repeated.

① Derived judgments

M1 (must-fix): closed

  • The fix is the move the prior record asked for and nothing else: the ls-tree fake in the executor self-test reads the revision at argv[4], the directories from argv.slice(6), and joins names with NUL. That matches the argv listAt sends at the head, ls-tree -r -z --name-only REV -- DIRS, and the NUL split that reads the answer; it is the same shape as the fake in check-governed-merges.mjs (line 6122).
  • Measured on the head: the executor self-test passes 415 of 415, exit 0. Ablation: with the c5d1fddd copy of the file restored on disk it is red again, exit 1, 2 of 415, exactly tier-s-workflow-pull-requests-no-one and h-reading-workflow-pull-requests, the two cases the prior record named; restored from the head, the worktree reads clean. check-governed-queue-guard.mjs --self-test: 530 cases, exit 0.
  • No other stale copy: a grep of scripts/ for ls-tree fakes and for importers of readWorkflowDiff, enumerateRows, commitChanges and deriveBranchPaths finds the three PR files only. The remaining ls-tree users (check-prior-rulings.mjs, ci/snapshot-next.mjs, check-adr-0087-registration.mjs, release-pending-publish.mjs) do not reach the changed readers.
  • Production is untouched by the delta: all nine changed lines sit inside selfTest(). No accept-set move.
  • Card 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, item by item, at this head: every path read that feeds a governed match in the queue guard and in check-governed-merges.mjs reads -z and splits on NUL (judged in the prior record, files unchanged since); the real-git rows with a non-ASCII and a newline name are in both self-tests.

No must-fix, no should-fix.

② Semver level

Unchanged: skip-changeset is right, scripts/pm/** publishes nothing. Clause-②: no and Metadata-protocol: none on the PR body match the three-file diff.

③ Boundary flags

  • Surface breach, named: scripts/pm/fleet-write/execute.mjs is outside the claim's file surface. The PR body names it under "Surface breach, named", with the reason (the stale fake, the prior record's M1) and its bound (test code only). check-governed-merges.mjs --test on the three paths reads 0 of 3 governed, so the breach adds no governed path and no approver. Accepted as a named deviation.
  • The two H-to-S readings are both named in the PR body's Acceptance notes as accepted deviations, citing the prior record: (1) a modified workflow whose name git quotes is now classified like any other workflow edit; (2) such a workflow on the merge base now joins the "already in use" inventory. The prior record judged both correct under the workflows split of ruling record 6722205630; nothing in the delta changes that reading. This closes that record's N1 (prose face).
  • N2 of the prior record (nit) stands as written: the CONTROL rows rely on git's default core.quotePath; it reads red, never falsely green, on a machine that sets it false. Accepted deviation or a follow-up card, the seat's choice; no effect on correctness or the contract.
  • Still owed by the seat, from the prior record and not part of this PR: a card for dispatch-gates.mjs changedPathsFromGit (no -z), and one for the --commands derivation that did not name check:pm-fleet-write-execute for a diff that changed a function the executor self-test fakes. The PR body now reports 42 derived gates on the three-file diff, that gate among them.
  • Check-runs on the head when this record was written: Lint · repo & tooling gates green (its step Fleet-write executor self-test, red on the prior head, passed). Green: Auto Label, Check PR Size, Dogfood Regression Gate, Governed Surface Queue Guard, Lint & Repo Gates, Lint · CI, release & engine gates, Lint · ESLint, Lint · PM dispatch-gates, Lint · docs & code guards, Lint · repo & tooling gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Lint · scoped · tooling self-tests, PR-body guards (claim · duplicate · Part-of · single-writer path), Plan Test Core shards, Test Core (2/8), Test UI, Type Check · consumer gates, Type Check · debt ledger, Type Check · source gates, Type Check · workspace, TypeScript Type Check, filter. Not finished: Test Core (1/8) (in_progress). None red.
  • Draft PR; a human or the seat still moves it to ready. This record does not.

Implemented-by: claude/project-thread-fangcr
Reviewed-by: session_016WV4cy7hQ5MvQ83ByNZ8ZH

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.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH

Contract-review-claim: session_016WV4cy7hQ5MvQ83ByNZ8ZH · head 3b083cc · 2026-11-15T12:27:30Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-elon-musk · session_016WV4cy7hQ5MvQ83ByNZ8ZH

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 3b083ccc1efe2edebba90341b357540a6dbc362b
Local-runs: none

Merge-only delta review, from head f1a04f78 (the PASS of (record ID: 6893808803)) to head 3b083ccc. The hand-off line 6894282303 names review#1 and this head. Claim: 6894310144.

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

  • The head is a merge, not a rebase: its parents are f1a04f78345a9d346efda8a325f57fd03d1c3ab8 (the reviewed head) and 568f214a6cbeb1ef7e9213d41a68ec19acd8e41c (origin/main), subject "Merge origin/main into claude/project-thread-fangcr".
  • Clean and faithful: git merge-tree --write-tree f1a04f78 568f214a exits 0 with no conflict and writes tree 94db0dae37f1e16f761475c2370353a7d50223df, which is exactly the head's tree. The merge commit carries no hand edit.
  • The PR's own diff is unchanged: git patch-id --stable of merge-base b76df9a6..f1a04f78 and of merge-base 568f214a..3b083ccc are both 883be090edf26227c8118eea25db8ab95cdbc41d. Same three files: scripts/pm/check-governed-merges.mjs, scripts/pm/check-governed-queue-guard.mjs, scripts/pm/fleet-write/execute.mjs.
  • No interaction with main: none of the 18 main commits in b76df9a6..568f214a touches the three PR files. The only main change under scripts/ is scripts/engine-double-contract.pinned.json, and nothing under .github/ moved; none of the local modules the three files import changed.
  • The prior record's judgments therefore carry to this head unchanged, its open items included, standing as written there.

No must-fix, no should-fix.

② Semver level

Unchanged: skip-changeset, scripts/pm/** publishes nothing. The merge brings in no change to the PR's own files.

③ Boundary flags

  • The named surface breach (scripts/pm/fleet-write/execute.mjs, test code only) and the two accepted H-to-S readings stand as the prior record judged them; the merge moves none of the three files.
  • The two follow-up cards the prior record listed as owed by the seat are still owed; not part of this PR.
  • Check-runs on the head when this record was written: none red. Green: Auto Label, Check PR Size, Dogfood Regression Gate, Governed Surface Queue Guard, Lint · scoped · query-options erasure, PR-body guards (claim · duplicate · Part-of · single-writer path), Plan Test Core shards, Test UI, Type Check · debt ledger, Type Check · workspace, filter. Not finished: Lint · CI, release & engine gates, Lint · ESLint, Lint · PM dispatch-gates, Lint · docs & code guards, Lint · repo & tooling gates, Lint · scoped · slot lookup & corpus, Lint · scoped · tooling self-tests, Test Core (1/8), Test Core (2/8), Type Check · consumer gates, Type Check · source gates. The landing check of all-green is the dispatch seat's to read before queueing.
  • Draft PR; a human or the seat still moves it to ready. This record does not.

Implemented-by: claude/project-thread-fangcr
Reviewed-by: session_016WV4cy7hQ5MvQ83ByNZ8ZH

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.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

席位核对

Verdict: ACCEPT, seat lands (ungoverned, scripts/pm/)** · head 3b083ccc1efe2edebba90341b357540a6dbc362b · card #33620 · report 6893465272 · at-tier contract review 6893545108 (FAIL on M1 on c5d1fddd) and delta 6893808803 by review#1 (PASS on f1a04f78, nits only) and merge-only delta 6894320798 by review#1 (PASS on this head, after a clean merge of main for the K rule; handoff 6894282303 under the maintainer's routing for this account's seats).

  • Shape: draft → main, Fixes #33620. scripts/pm/check-governed-queue-guard.mjs, scripts/pm/check-governed-merges.mjs (path reads), scripts/pm/fleet-write/execute.mjs (the ls-tree fake; surface breach named in the body). skip-changeset. Clause-②: no; Metadata-protocol: none. Not governed.
  • Contract: every governed path read in the two files uses -z and splits on NUL; real-git rows with a non-ASCII path and a newline path prove each is governed.
  • M1 closed: the executor self-test's ls-tree fake follows the new argv; check:pm-fleet-write-execute 415 of 415, red again on ablation.
  • Accepted deviations: a quoted-name workflow is now classified by the workflow split and joins the merge-base inventory (the correct reading under ruling 6722205630, where before it went unseen). Nit N2 (CONTROL rows rely on git's default core.quotePath; fails red, never green) on card review follow-ups of PR #33804 #33846 (defects outside the PR: pm(dispatch-gates): changedPathsFromGit reads paths without -z, so a non-ASCII governed path is missed at dispatch #33847, pm(dispatch-gates): --commands does not derive the self-test of a script that imports a changed scripts/pm module #33848).
  • Gates: 42 derived, all exit 0 (developer). Check-runs on the head: 44 total, 25 success, 19 skipped, 0 other.
  • Pre-landing check: ① same-head PASS 6894320798. ② check-runs as above. ③ K = 4 on the merge base; no commit on main since touches the PR's files; mergeable_state clean.
  • Landing: pr_ready + automerge_enable in the same relay round.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 15, 2026 12:47
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit da4a485 Nov 15, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-fangcr branch November 15, 2026 13:05
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
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>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…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>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…/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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

1 participant