Repository navigation
Commit 385ea1c
fix(pm): the regeneration carry lists a renamed path by both sides, not its destination alone (#34049)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi91bnws1UqmPVLyN8RpkkrJg)_
Fixes #33578
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:已留档的合同复审记录被「纯再生成/纯文案」跳转带到新 head
时,判定用的路径清单改为不做改名合并(`--no-renames`),改名同时列出源路径和目的路径。
- 为什么改:原来改名只列目的路径,把受审文件挪进文档目录(如 `skills/a/rules/security.md` →
`content/docs/security.md`)只会看到文档路径,旧记录会被错误地延续到新 head。
- 风险与回滚:只动 `scripts/pm/` 内部工具与其自测,不发布任何包;回滚即还原本 PR 的提交。
- 先看:`scripts/pm/record-recognisers.mjs` 的 `CARRY_DIFF_ARGV` 与
`unexplainedPathsBetween`;同文件新增的真 git
自测行;`check-governed-queue-guard.mjs` 假 git 一行。
- 两分钟验证:`node scripts/pm/record-recognisers.mjs --self-test`,预期 401 例全过。
- 需要你做的:无,席位落地。
## What changes
- `scripts/pm/record-recognisers.mjs` (carry region):
`unexplainedPathsBetween` lists a hop's paths, and the pull request's
own delta at each head, through one module-private argv,
`CARRY_DIFF_ARGV = ['diff', '-z', '--name-only', '--no-renames']`. Both
reads go through the one `names` helper, so the flag is spelled once. A
rename now reads as a delete plus an add, so the source path is judged
by the prose arm, the `merge=os-regen` attribute and the own-delta arm
like any other path.
- Same file, self-test: the regen battery's fake git answers only that
exact argv (any other spelling answers no paths), the two existing
argument pins now spell `--no-renames`, and two cases are added (battery
floor 22 → 24):
- an argument pin: every `diff` the carry sent is `diff -z --name-only
--no-renames A B`;
- a REAL-git row in a temp repository: `skills/a/rules/security.md`
moved to `content/docs/security.md`; a plain rename-detecting diff lists
only the destination (the blind spot, measured in the same row), and
`unexplainedPathsBetween` lists `skills/a/rules/security.md`. The row
runs with `GIT_*` stripped (`gitFreeEnv`), `GIT_CONFIG_NOSYSTEM=1`,
`GIT_CONFIG_GLOBAL=/dev/null`, and `-c` identity, `commit.gpgsign=false`
and `diff.renames=true`, so it reads the same on any machine.
- `scripts/pm/check-governed-queue-guard.mjs` (claim amendment
6897818459, one line): the regen battery's fake git took the revs
positionally (`[, , , a, b]`), so the new argv read `--no-renames` as
rev A and four guard cases went red. It now takes the two revs from the
tail of argv. **Forced test edit.**
- `scripts/pm/check-governed-merges.mjs` (claim amendment 6897818459,
card comment 6887759291): the older real-git self-test fixtures (the
real prober, the derive, size, oversized-sweep, rename-size and banner
fixtures, and the argv-root `init`/`remote add`) now pass `env:
gitFreeEnv()`; the three backdated-commit spawns spread `gitFreeEnv()`
under their `GIT_*_DATE` keys. All of them already passed `-c
commit.gpgsign=false`; the argv-root `init`/`remote add` make no commit.
**Forced test edit** (hygiene, no behaviour change).
## Why
A carried contract-review record re-runs `unexplainedPathsBetween` on
the committed trees of each `Regen-provenance:` hop. With git's default
rename detection, `git diff --name-only` lists a rename by its
destination alone. A hop that moved a reviewed file onto a prose face
listed only the prose path, the prose arm explained it, and the record
carried to a head where a reviewed file had left its face. The own-delta
read had the same blind spot. The queue guard's own row enumeration and
its low-risk carry check already pass `--no-renames`; this brings the
carry reader in line.
## Tests
<details><summary>record-recognisers self-test (head 6c6a5c9, after
merging main)</summary>
`node scripts/pm/record-recognisers.mjs --self-test` → exit 0, `✓
record-recognisers self-test: 401 cases pass` (the two new cases on top
of main e71ecc1's set; 402 on the pre-merge head 80fb531, whose base
was c3c0c30).
</details>
<details><summary>Ablation: drop the no-renames flag (heads 80fb531 and
6c6a5c9)</summary>
`node scripts/ablation-replace.mjs --file
scripts/pm/record-recognisers.mjs --anchor "Object.freeze(['diff', '-z',
'--name-only', '--no-renames'])" --replacement "Object.freeze(['diff',
'-z', '--name-only'])" -- node scripts/pm/record-recognisers.mjs
--self-test`
- 80fb531: `ok mutation landed: anchor 1 -> 0, blob d15231d ->
9da9b7818a7d`, exit 1, `4 of 402 case(s) failed`.
- 6c6a5c9 (after the merge): `ok mutation landed: anchor 1 -> 0, blob
03ae346 -> 4352da5184ff`, exit 1, `4 of 401 case(s) failed`.
- Both times the four reds are: the real-git row
(`{"destinationOnly":["content/docs/security.md"],"unexplained":[]}`),
the new argument pin, and the two existing argv pins.
- Restore: `git diff HEAD` empty and the file's hash equals its HEAD
blob.
</details>
<details><summary>Queue guard self-test</summary>
`node scripts/pm/check-governed-queue-guard.mjs --self-test`: with the
carry change alone (head 0f2341b) exit 1, 4 of 534 failed (the regen
battery's slipped-in, names-the-path, hand-resolved and prose-and-code
cases). With the tail-reading fake: exit 0.
</details>
<details><summary>check-governed-merges self-test under a hook-shaped
environment</summary>
- `node scripts/pm/check-governed-merges.mjs --self-test` → exit 0.
- `GIT_INDEX_FILE=SCRATCH/probe.index node
scripts/pm/check-governed-merges.mjs --self-test` → exit 0, no index
file written.
- Control, the base file under the same environment → exit 1, 4 failures
(the oversized-sweep and banner fixtures could not commit, and the
INCOMPLETE-banner battery fell below its floor), and the outside index
file was written.
</details>
## Acceptance notes
- The `check-governed-merges` self-test also spawns its own CLI
(`spawnSync(process.execPath, [scriptPath, …])`) with
`process.env`-based environments, and that child runs real git in the
fixture roots. Those spawns were left as they are: the amendment scopes
this PR to the fixtures' own git calls. carrier: #34066.
- Merged `origin/main` (e71ecc1) as a merge commit: the one conflict
was the adjacent `SELF_TEST_BATTERIES` rows, resolved keeping both
floors (this PR's regen battery 24, main's template battery 32). The
delta against main is unchanged, +67 / -17 over the three files.
- On the first gate round, `check:pm-dispatch-gates` went red because
the header export list grew by one line and moved the `self-test-reads`
marker off the line its census pins (`record-recognisers.mjs:77`). The
argv is now module-private and the header is unchanged; the marker is
back on line 77.
## Verification
Local gate round on head `6c6a5c9e` (the merge of main, after the last
commit): `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 36 commands from the three
`scripts/pm/` paths; all 36 ran, all exit 0. `--ran` reconciliation: `36
derived famil(ies) accounted for — 36 run, 0 NOT-MEASURED`.
`check:pm-dispatch-gates` fast tier: `2205 cases pass; 9 slow section(s)
deferred`. The same 36 were green on the pre-merge head `80fb5317`.
Every family CI runs is read from this PR's check-runs, not re-run here.
<details><summary>The 36 commands and their exit codes (head
6c6a5c9)</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-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-dispatch-gates :: exit 0
pnpm check:pm-governed-merges :: 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:watch-hint-literal :: exit 0
```
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (CI)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
(`scripts/pm/**` only: `skip-changeset`)
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
<!-- signed: domain:skills#1 · os-steve ·
session_01ADHkmQk5t2iVNRP4bBd2qx -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5af956f commit 385ea1c
3 files changed
Lines changed: 67 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7698 | 7698 | | |
7699 | 7699 | | |
7700 | 7700 | | |
| 7701 | + | |
7701 | 7702 | | |
7702 | 7703 | | |
7703 | 7704 | | |
| |||
7710 | 7711 | | |
7711 | 7712 | | |
7712 | 7713 | | |
7713 | | - | |
| 7714 | + | |
7714 | 7715 | | |
7715 | 7716 | | |
7716 | 7717 | | |
| |||
8980 | 8981 | | |
8981 | 8982 | | |
8982 | 8983 | | |
8983 | | - | |
| 8984 | + | |
8984 | 8985 | | |
8985 | 8986 | | |
8986 | 8987 | | |
| |||
9254 | 9255 | | |
9255 | 9256 | | |
9256 | 9257 | | |
9257 | | - | |
| 9258 | + | |
9258 | 9259 | | |
9259 | 9260 | | |
9260 | 9261 | | |
| |||
9435 | 9436 | | |
9436 | 9437 | | |
9437 | 9438 | | |
9438 | | - | |
| 9439 | + | |
9439 | 9440 | | |
9440 | 9441 | | |
9441 | 9442 | | |
9442 | 9443 | | |
9443 | 9444 | | |
9444 | 9445 | | |
9445 | | - | |
| 9446 | + | |
9446 | 9447 | | |
9447 | 9448 | | |
9448 | 9449 | | |
| |||
9525 | 9526 | | |
9526 | 9527 | | |
9527 | 9528 | | |
9528 | | - | |
| 9529 | + | |
9529 | 9530 | | |
9530 | 9531 | | |
9531 | 9532 | | |
| |||
9702 | 9703 | | |
9703 | 9704 | | |
9704 | 9705 | | |
| 9706 | + | |
9705 | 9707 | | |
9706 | 9708 | | |
9707 | 9709 | | |
| |||
9713 | 9715 | | |
9714 | 9716 | | |
9715 | 9717 | | |
9716 | | - | |
| 9718 | + | |
9717 | 9719 | | |
9718 | 9720 | | |
9719 | 9721 | | |
| |||
9863 | 9865 | | |
9864 | 9866 | | |
9865 | 9867 | | |
9866 | | - | |
9867 | | - | |
| 9868 | + | |
| 9869 | + | |
9868 | 9870 | | |
9869 | 9871 | | |
9870 | 9872 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5777 | 5777 | | |
5778 | 5778 | | |
5779 | 5779 | | |
5780 | | - | |
| 5780 | + | |
5781 | 5781 | | |
5782 | 5782 | | |
5783 | 5783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
438 | 441 | | |
439 | 442 | | |
440 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
441 | 448 | | |
442 | 449 | | |
443 | 450 | | |
| |||
462 | 469 | | |
463 | 470 | | |
464 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
465 | 479 | | |
466 | 480 | | |
467 | | - | |
| 481 | + | |
468 | 482 | | |
469 | 483 | | |
470 | 484 | | |
| |||
2457 | 2471 | | |
2458 | 2472 | | |
2459 | 2473 | | |
2460 | | - | |
| 2474 | + | |
2461 | 2475 | | |
2462 | 2476 | | |
2463 | 2477 | | |
| |||
2840 | 2854 | | |
2841 | 2855 | | |
2842 | 2856 | | |
2843 | | - | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
2844 | 2860 | | |
2845 | 2861 | | |
2846 | 2862 | | |
| |||
2867 | 2883 | | |
2868 | 2884 | | |
2869 | 2885 | | |
2870 | | - | |
| 2886 | + | |
2871 | 2887 | | |
2872 | 2888 | | |
2873 | 2889 | | |
| |||
2883 | 2899 | | |
2884 | 2900 | | |
2885 | 2901 | | |
2886 | | - | |
| 2902 | + | |
2887 | 2903 | | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
2888 | 2936 | | |
2889 | 2937 | | |
2890 | 2938 | | |
| |||
0 commit comments