






















@@ -19,9 +19,11 @@ or validating a change without wasting hours.
1919Prove the touched surface first. Do not reflexively run the whole suite.
202021211. Inspect the diff and classify the touched surface:
22-- source: `pnpm changed:lanes --json`, then `pnpm check:changed`
23-- tests only: `pnpm test:changed`
24-- one failing file: `pnpm test <path-or-filter> -- --reporter=verbose`
22+- normal source checkout, source change: `pnpm changed:lanes --json`, then `pnpm check:changed`
23+- normal source checkout, tests only: `pnpm test:changed`
24+- normal source checkout, one failing file: `pnpm test <path-or-filter> -- --reporter=verbose`
25+- Codex worktree or linked/sparse checkout, one/few explicit files: `node scripts/run-vitest.mjs <path-or-filter>`
26+- Codex worktree or linked/sparse checkout, changed gates or anything broad: `node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox ... --shell -- "pnpm check:changed"`
2527- workflow-only: `git diff --check`, workflow syntax/lint (`actionlint` when available)
2628- docs-only: `pnpm docs:list`, docs formatter/lint only if docs tooling changed or requested
27292. Reproduce narrowly before fixing.
@@ -36,6 +38,12 @@ Prove the touched surface first. Do not reflexively run the whole suite.
3638- Prefer GitHub Actions for release/Docker proof when the workflow already has the prepared image and secrets.
3739- Use `scripts/committer "<msg>" <paths...>` when committing; stage only your files.
3840- If deps are missing, run `pnpm install`, retry once, then report the first actionable error.
41+- In a Codex worktree or linked/sparse checkout, do not run direct local
42+`pnpm test*`, `pnpm check*`, `pnpm crabbox:run`, or `scripts/committer` until
43+ you have verified pnpm will not reconcile or reinstall dependencies. Use
44+`node scripts/run-vitest.mjs` for tiny local proof, `node
45+ scripts/crabbox-wrapper.mjs` for Testbox, and `git commit --no-verify` only
46+ after the relevant remote or node-wrapper proof is already clean.
3947- For Blacksmith Testbox proof, use Crabbox first. `pnpm crabbox:run -- --provider
4048blacksmith-testbox --timing-json -- <command...>` warms, claims, syncs, runs,
4149 reports, and cleans up one-shot boxes. Reuse only an id/slug created in this
@@ -55,6 +63,14 @@ OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test <path-or-filter>
55635664Use targeted file paths whenever possible. Avoid raw `vitest`; use the repo
5765`pnpm test` wrapper so project routing, workers, and setup stay correct.
66+When the checkout is a Codex worktree, prefer the direct node harness instead:
67+68+```bash
69+node scripts/run-vitest.mjs <path-or-filter>
70+```
71+72+That keeps the test scoped without giving pnpm a chance to run dependency
73+status checks or install reconciliation in a linked worktree.
58745975## Command Semantics
6076此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。