Repository navigation
test(cli): tmpdir fixtures that run pnpm reach no registry (dev-no-watch pin, doctor readers, init leg) - #24455
Conversation
dev-no-watch.pin: the fixtures carry the repository's packageManager pin, read from the root manifest at run time, so Corepack resolves the version CI's store already holds instead of pnpm@latest. package-owned-command-readers: os doctor's pnpm -v answers from a stub on PATH, asserted reached. create-refuses-invalid-project-name.e2e: the init leg passes --no-install; its subject is the name, not a dependency install. Claude-Session: https://claude.ai/code/session_01SYEJqDL3NXxrJRBVqaMu9T Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
席位核对 — REWORK (patch round 1: the open question answered B)
Accepted as it stands:
Your open question: B. Pin the fixtures to the version
Owed in this round:
Findings: the Generated by Claude Code |
…oot file The fixtures' packageManager is pnpm@VERSION, where VERSION is what pnpm --version answers in packages/cli: the root pin through Corepack's walk. No root manifest read, so no new cross-package input; the blind spot (a pin-only bump does not re-run this file) is stated in the file. Claude-Session: https://claude.ai/code/session_01SYEJqDL3NXxrJRBVqaMu9T Co-authored-by: Claude <noreply@anthropic.com>
席位核对 — ACCEPT (patch round 1)
Generated by Claude Code |
Fixes #24419
Clause-②: no
Basis for the Clause-② line: every changed file is under
packages/cli/test/**, the CLI's test harness.@objectstack/clipublishesdist,README.mdandCHANGELOG.md(itsfiles[]). Measured on head8994da181, afterpnpm turbo run build --filter='@objectstack/cli...': the identifiers this PR adds (derivePackageManagerPin,packageManagerPin,PACKAGE_ROOT,STUB_PNPM_VERSION,writeStubPnpm,stubBinDir,fixtureRoot) occur in 0 of those files. The positive controldevWatchActive, which comes fromsrc/, occurs in 2. Nothing published moves, so this PR carries theskip-changesetlabel and no changeset.The pin's shape: derived from pnpm (option B, the seat's decision)
The first head (
bd0651500) read thepackageManagerpin from the rootpackage.json. That read leavespackages/cli, socheck:cross-package-test-inputswent red, and declaring it needed three files outside the claim's file surface. The work stopped there, and the seat chose option B (PR thread, patch round 1).The pin is now derived.
dev-no-watch.pin.test.tsrunspnpm --versionwithcwd=packages/cliand writespnpm@VERSIONinto the fixtures. That answer is the root pin, reached through Corepack's own walk. No root file is read and no new turbo input is declared.check:cross-package-test-inputsexits 0 on8994da181, andturbo.json,scripts/cross-package-test-inputs.mjsandscripts/check-cross-package-test-inputs.mjsare untouched (git diff db1f1fd20 HEADis empty for all three).Why B:
package.jsonan input of@objectstack/cli#test. Every PR that edits it would then add cli's PR-tier suite to Test Core. Measured: a root-package.json-only edit givesturbo ls --affected0 packages today (the control, apackages/types/package.jsonedit, gives 69 including cli). Onorigin/main, 42 of the last 300 commits (since 2026-10-16) touched the rootpackage.jsonand nopackages/,examples/orapps/path.What B leaves, stated in the file's own comment: the pin is an undeclared input, so a pin-only bump does not re-run this file. This suite's other
pnpm -vandpnpm packcallers have the same blind spot, so B adds no new class of it. The fixture spec carries no integrity hash, and the derivation costs one extra spawn.Option A's patch was measured and not taken. On
bd0651500, three edits turned the gate green withcheck-ci-filter-parityalso green, and were then restored (blob equal to HEAD,git diff HEADempty for all three):turbo.json:"$TURBO_ROOT$/package.json"in the@objectstack/cli#testinputs;scripts/cross-package-test-inputs.mjs:'package.json'in the cli globs;scripts/check-cross-package-test-inputs.mjs:'package.json'in the pinnedTURBO_ROOT_FILE_INPUTSroster.The premise, measured on
db1f1fd20before any changeCI's runner shape was rebuilt locally as
.github/actions/setup-pnpmleaves it: Corepack shims first onPATH, and a privateCOREPACK_HOMEholding exactly the pinnedpnpm@10.31.0(materialised withcorepack installin the repo root, with nolastKnownGood.json). The registry was made unreachable:COREPACK_NPM_REGISTRYandnpm_config_registrypoint at a local server that answers HTTP 429 to every request and logs each one. A loggingpnpmshim in front of Corepack's records every pnpm call's cwd and argv.tmpdir()directory,pnpm --versionsentGET /pnpm/latestand exited 1 withServer answered with HTTP 429 when performing the request to …/pnpm/latest. That is CI's signature on PR fix(plugin-auth): a migrate-and-exit boot (OS_MIGRATE_AND_EXIT=1) never provisions the dev admin, whatever NODE_ENV says #24415. The same directory with apackage.jsoncarrying the root pin:10.31.0, 0 requests.dev-no-watch.pin.test.ts, unchanged: the same two tests CI failed went red. "and the failure is pnpm refusing the PACKAGE…" failed withAssertionError: os dev ended with code 1. "the fixture starts its own dev script when asked — the control" failed withexpected 1 to be +0. Both outputs carry the 429 line. The--no-watchspawn never runs pnpm, because the refusal comes first. "os dev --watch=falseexits 1 instead of 0" stayed GREEN under the 429, because Corepack's failure exits 1 too. Only its sibling assertion on pnpm's own sentence tells the two apart.The shape, and why
The fixtures carry the repository's own pin as
pnpm@VERSION, where VERSION is whatpnpm --versionanswers inpackages/cli(see the section above). Nothing is copied by hand. It is the one version CI's Corepack store already holds, so it resolves with no network call.package.jsoncarries the pin.workspace/package.jsoncarries it too, because it is the nearest manifest.project/holds no manifest. Measured with pnpm 10.31.0: apackage.jsoninside the project directory changes pnpm's answer fromNo projects found in "…"(the sentence this file pins) toNo projects matched the filters in "…". With the pin one level up, the answer is unchanged.COREPACK_DEFAULT_TO_LATEST=0does not remove the network reach in CI's shape. It swapslatestfor Corepack's own bundled default, which the store does not hold. Measured:GET /pnpm/10.13.1, 429, exit 1.COREPACK_ENABLE_NETWORK=0would only turn the fetch into a refusal.--no-watchrefusal against a fixture whosedevscript runs.The family census
Method: the CLI paths that run pnpm were enumerated from every child-process call site in
packages/cli/src. There are three:os devmonorepo mode (pnpm … dev),os doctor(pnpm -v), andos init(PM install). Tests that spawn pnpm directly, or drive one of those three paths, were enumerated bygit grepover the command literals. Each candidate was then run in the CI shape above, with the registry refused.test/dev-no-watch.pin.test.tsos dev→pnpm --filter false … dev,pnpm devtmpdir()GET /pnpm/latest, 2 tests redpnpm --versioninpackages/clitest/package-owned-command-readers.test.tsos doctor→pnpm -v(2 children)tmpdir()GET /pnpm/latest, tests GREEN (doctor turns a failed probe into a row)pnpmonPATHanswers-vand refuses anything else. A newitper shape asserts the stub was reachedtest/create-refuses-invalid-project-name.e2e.test.ts(nightly tier)os init NAME(no--no-install) →pnpm installtmpdir()scaffold (no pin, on purpose)GET /pnpm/latest, 1 test red. With a working registry it installs the scaffold's dependencies from npm--no-install. The leg's subject is thatinitaccepts the nametest/init.test.tstest/init-created-files-summary.e2e.test.tspnpmleadsPATHtmpdir()test/published-subpath-console.pin.test.tspnpm packpackages/clitmpdir()is only--pack-destination)test/published-subpath-hook-body.pin.test.tspnpm packpackages/clisrc/commands/doctor-*.test.ts(10 files, in-processDoctor.run)pnpm -vpackages/cli(they spyprocess.cwd(), which a child never reads)test/create-objectstack-stack-reach.test.ts(found by the whole-tier run below; the grep missed it)pnpm --versionpackages/cli/node_modules/.create-objectstack-reach-*bd0651500)Other
os devspawns refuse before pnpm (--no-watch) or boot one environment (--artifact, a config in cwd). Otheros initspawns refuse before the install, pass--no-install, or stubnpm.exit-signal.pin.test.tsmockschild_process.Whole PR tier, after the fix, in the CI shape with the registry refused (head
bd0651500):--project unit: 311 files, 4610 tests passed, 0 registry requests. The only pnpm calls were the twopnpm packruns and 87 ×pnpm -v, all inpackages/cli.--project integration: 160 files, 159 passed + 1 skipped (a pre-existing skip in a file this PR does not touch), 1375 tests passed + 9 skipped, 0 registry requests. pnpm was called by dev-no-watch's two spawns (pinned) and bycreate-objectstack-stack-reach.test.ts'spnpm --versioninpackages/cli/node_modules/…, where the root pin is in reach. That file is the table's last row.Patch round 1 (
8994da181) changes onlydev-no-watch.pin.test.ts. That file was re-proved on the new head (see Proof); the whole-tier readings above were taken onbd0651500.The nightly tier was not run whole. Its pnpm-reaching candidates are the two
.e2erows above, each measured.Proof: the converted tests with the registry refused
8994da181:dev-no-watch.pin+package-owned-command-readers16/16 passed, 0 registry requests. The derivation'spnpm --versionran inpackages/cli. The pnpm calls in/tmp/os-dev-no-watch-*/projectand…/workspaceresolved to10.31.0from the store.bd0651500, files unchanged since:create-refuses-invalid-project-name.e2e+init-created-files-summary.e2e(OS_TEST_TIERS=nightly) 10/10 passed, 0 registry requests.v1/pnpm/10.31.0, with nolastKnownGood.json.8994da181:dev-no-watch.pin8/8, 0 requests.Ablation (
scripts/ablation-replace.mjs, wrap mode, fix committed first, head8994da181)packageManager: packageManagerPin(2 hits,--expect 2), replaced withpackageManager: undefined. On disk: anchor 2 → 0, replacement 0 → 2, blob0881d577b041→1df76c152cb3.GET /pnpm/latest.0881d577b041equals HEAD,git diff HEADempty,git status --porcelainempty.bd0651500's read-the-manifest shape gave the same red: 2 failed, 2 requests, restore proven.Tiers
The tiers are unchanged.
vitest-tiers.ts'stierSignalsgives the same answer for each changed file before (db1f1fd20), onbd0651500and on8994da181. Fordev-no-watch.pinandcreate-refuses-…e2e: integration (childProcess, entryBasename, tsxBin). Forpackage-owned-command-readers: integration (childProcess, helperCliOrTsx). The e2e file keeps its nightly name.test/vitest-tiers-partition.test.tspassed (22/22 on8994da181).Gates (local, head
8994da181)node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 52 derived commands, each run with its exit code captured before any pipe. All 52 exited 0,pnpm check:cross-package-test-inputsincluded.pnpm check:dual-build-cjs-loadsfirst answered 3, PREREQUISITE NOT MET: the fresh worktree had nodist/for packages outside cli's closure, so that run measured nothing. A later gate in the battery (check:type-check-debt) built them, and the re-run exited 0.origin/main, and the derivation flagged two gate files changed there. The same derivation on a tree atorigin/main725a5b131, with this diff applied, gives the identical 52 commands.pnpm check:cli-test-child-envexited 0.--ranreconciliation: 52 derived, 52 run, 0 NOT-MEASURED (a derived zero: all 52 recorded an exit code), 0 UNRUN.eslint --no-inline-configover the 3 changed files: exit 0, 0 errors, 0 warnings, none ignored.pnpm --filter @objectstack/cli typecheck: exit 0.tsc -p tsconfig.test.json --listFileslists all 3 changed files. Its 28 errors are exactly the ledgeredtest-typecheck-debt.jsonset, none in these files.8994da181, read before this reply: 33 success, 7 skipped, 0 failures. All five required contexts are green (Lint & Repo Gates,TypeScript Type Check,Test Core,Build Core,Governed Surface Queue Guard).Acceptance notes
os doctor's pnpm row misreports a Corepack fetch failure as✗ pnpm Not found → Install pnpm: npm install -g pnpm@10.28.1, and prints Corepack's stack trace above the report. Measured in atmpdir()with no pin under Corepack, with the registry answering 429. Filed as os doctor: apnpm -vthat fails for any reason (Corepack unable to fetch its pinned or latest pnpm) is reported "✗ pnpm Not found" with "Install pnpm: npm install -g pnpm@10.28.1", though pnpm is installed #24464, not fixed here (packages/cli/src/**is held off).process.cwd()spy does not reachdoctor'spnpm -vchild, which runs in the real cwd. That is harmless here (the pin is in reach) and is noted only.Generated by Claude Code