Repository navigation
Commit aec637b
test(pm): pin core.quotePath=true in the real-git quoted-path fixtures (#33962)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9PaNqu2SSrzw7UtdmjG9BE7)_
Fixes #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 #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
#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)
• ⛔ #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>1 parent b33365c commit aec637b
2 files changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8780 | 8780 | | |
8781 | 8781 | | |
8782 | 8782 | | |
8783 | | - | |
| 8783 | + | |
| 8784 | + | |
| 8785 | + | |
8784 | 8786 | | |
8785 | 8787 | | |
8786 | 8788 | | |
8787 | | - | |
| 8789 | + | |
8788 | 8790 | | |
8789 | 8791 | | |
8790 | 8792 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3700 | 3700 | | |
3701 | 3701 | | |
3702 | 3702 | | |
| 3703 | + | |
| 3704 | + | |
3703 | 3705 | | |
3704 | 3706 | | |
3705 | 3707 | | |
3706 | | - | |
| 3708 | + | |
3707 | 3709 | | |
3708 | 3710 | | |
3709 | 3711 | | |
| |||
0 commit comments