Uh oh!
There was an error while loading. Please reload this page.
docs(cli): past-tense the deleted detectMode VITEST arm in two serve e2e headers - #12495
Merged
Merged
Conversation
…e2e headers Two `packages/cli/test` headers quoted `detectMode`'s `env.VITEST ||` arm in the PRESENT tense and cited `local-crypto-provider.ts:133`. That arm was deleted by a58eac3 (2026-08-23) and the live `detectMode` sits at `local-crypto-provider.ts:185`, reading `NODE_ENV` and nothing else. The conclusion each header draws survives; the mechanism it predicts does not: - `serve-process-child-env.e2e.test.ts` implied the strip still moves crypto posture. Children spawned through `helpers/serve-process.ts` run `bin/run-dev.js`, which pins `NODE_ENV = 'development'` before argv is parsed, and `NODE_ENV` sits outside `childEnv()`'s strip family — their posture is `development` with or without a leaked `VITEST`, so the `test` -> `development` flip the old wording predicted cannot happen. - `serve-node-env-production-default.e2e.test.ts` tied its explicit `OS_SECRET_KEY` to `childEnv()` stripping `VITEST`. The unset-`NODE_ENV` leg selects production posture from `NODE_ENV` alone; production refuses without a stable key whether or not a `VITEST` leaks in. Both restatements quote the removed line in the PAST TENSE and say so, which is the discriminator this class needs: `local-crypto-provider.ts` and four other sites quote the same string CORRECTLY, as retired code, and a string-level sweep would corrupt them. Comment prose only, no behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjujZN219uFzBhSYfMykCd
Contributor
📓 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): |
This was referenced Aug 26, 2026
os-litant
marked this pull request as ready for review
August 26, 2026 06:18
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#12179
Two
packages/cli/testheaders quoteddetectMode's deletedenv.VITEST ||arm in the present tense and citedlocal-crypto-provider.ts:133, a line it no longer lives on. Comment prose only — no behaviour change, nothing published,skip-changeset.The discriminator, stated before the fix ran
The same string lives at 9 occurrences across 7 files, and 7 of those 9 are correct. A grep-and-replace over the string would corrupt every one of them. The difference is tense, never text: an accurate quote of RETIRED code narrates the removal in the past tense; a stale quote presents deleted code as what the function reads TODAY.
Census re-run unnarrowed on
origin/main@e0bdbc30b—git grep -n -I -F "env.VITEST ||", every hit classified by framing rather than by filename:packages/services/service-settings/src/local-crypto-provider.ts:148packages/services/service-settings/src/crypto-posture-deployment-signal.test.ts:17detectModeread:"scripts/check-runner-env-posture.mjs:16scripts/check-runner-env-posture.mjs:255,:266.github/workflows/lint.yml:1729local-crypto-provider.tsselected its crypto posture with …".changeset/crypto-posture-deployment-signal.md:10detectModereadenv.VITESTas a vote for'test'posture:"packages/cli/test/serve-process-child-env.e2e.test.ts:40-41local-crypto-provider.ts:133reads it"packages/cli/test/serve-node-env-production-default.e2e.test.ts:247-248local-crypto-provider.ts:133reads"Second census, over line-number citations (
git grep -n -I -E "local-crypto-provider(\.ts)?:[0-9]+"): exactly three.packages/cli/test/helpers/serve-process.ts:81cites:185and is accurate — verified against the tree, not copied:const detectMode = (env: EnvMap): CryptoMode =>sits atlocal-crypto-provider.ts:185one0bdbc30b. The other two cited:133. After this changegit grep "local-crypto-provider.ts:133"matches nothing repo-wide.helpers/serve-process.tswas the template, not a target — it was already repaired, and neither it norlocal-crypto-provider.tsis touched by this branch.The mechanism restated, not deleted
Each header's conclusion survives — stripping
VITESTstays correct, now as defence-in-depth over a classpnpm check:runner-env-postureholds shut in product source. The mechanism is what was false, and it is a wrong mechanism in a header rather than cosmetic drift: it predicts a crypto-posture flip that cannot happen, and that prediction has already been carried into a dispatch's scoping (#11596).serve-process-child-env.e2e.test.ts— children spawned throughhelpers/serve-process.tsrunbin/run-dev.js, which pinsprocess.env.NODE_ENV = 'development'at line 28, beforerun()parses argv;NODE_ENVis deliberately outsidechildEnv()'s strip family. Their posture isdevelopmentwith or without a leakedVITEST, so thetest→developmentflip the old wording predicted is unreachable.serve-node-env-production-default.e2e.test.ts— this file spawns its ownconst CLI = resolve(HERE, '../bin/run.js')(the built entrypoint, which does not pinNODE_ENV), so its unset-NODE_ENVleg really is a production boot. What was false is the attribution: the explicitOS_SECRET_KEYno longer follows fromchildEnv()stripping anything.NODE_ENValone selects production posture, and production refuses without a stable key whether or not aVITESTleaks in.Both restatements say PAST TENSE out loud, so the next census reads them as the sixth and seventh correct sites rather than re-flagging them.
⛔ Untouched on purpose: the
randomPort()docblock atserve-node-env-production-default.e2e.test.ts:200-202(that paragraph belongs to #12441, serialized behind this card in the same file), and the precedingOS_AUTH_SECRET/ production-boot paragraph at:238-244, which is accurate for this file.Reported, not folded — a related site the census surfaced
Three files carry the same false mechanism without quoting the arm and without a line citation, so they are outside this card's declared file surface and are not touched here:
packages/cli/test/serve-mcp-stdio-answers.e2e.test.ts:179-181packages/cli/test/serve-mcp-capability-collision.e2e.test.ts:184-186packages/cli/test/serve-stdio-stdout-purity.e2e.test.ts:174-176All three read: "with
VITESTno longer inherited (#11267),local-crypto-provider.ts's detectMode answersdevelopmentfor this child instead oftest". The counterfactual is dead:detectModeno longer readsVITEST, so an inherited one would not producetesteither. The real cause is the one each comment states four lines further down —serve.tsassignsprocess.env.NODE_ENV = 'development'in-process for--dev. Measured: all three spawnbin/run.jswith--devandNODE_ENV: undefined.Verification
Gate union re-run after the final commit, at
4051ed659, each verdict read from the gate's own printed line (exit codes captured before any pipe):pnpm check:nul-bytes→check-nul-bytes: OK (scanned 6899 text file(s) … no raw ASCII control bytes)pnpm check:cli-test-child-env→✓ check:cli-test-child-env: 35 spawner source(s) among 95 under packages/cli/test/**; no new bulk process.env copy reaches a spawned child … 2 deliberate site(s) still pinnedpnpm check:runner-env-posture→✓ check-runner-env-posture: 1974 product source file(s), no test-runner variable read.pnpm check:cross-package-test-inputs→OK: 18 package(s) read outside themselves, all declaredpnpm check:test-source-alias→check-test-source-alias OK — 72 packages with tests scannedpnpm check:type-check-coverage→check-type-check-coverage: OK — 65/78 workspace packages type-checkednode scripts/check-comment-mask-adoption.mjs→OK check:comment-mask-adoption — 23 private comment-stripper(s) … all 23 recordedpnpm lint(eslint . --no-inline-config, whole repo, not narrowed) → exit 0, no findingspnpm --filter @objectstack/cli exec vitest run --maxWorkers=2on both edited files, afterpnpm --filter '@objectstack/cli^...' buildandpnpm --filter @objectstack/cli build→Test Files 2 passed (2) · Tests 9 passed (9)— real boots, 18.16sGate set derived with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(2 paths vs merge basee0bdbc30b), not recalled.pnpm --filter @objectstack/cli typecheckexits 0, butpackages/cli/tsconfig.jsondeclares"include": ["src"], so neither edited file is in that program —tsc --noEmit --listFileslists 1275 files and 0 of them underpackages/cli/test/. That is a ledgered standing condition (check:type-check-coverage: "19 package(s) still hide their own tests from tsc"), not a regression, and it is why the two files were executed under vitest above: that run is the only local evidence they still compile. The rest of@objectstack/cli's suite and the full check farm are left to CI.Generated by Claude Code