Skip to content

Three packages/cli/test spawner comments carry a DEAD counterfactual — detectMode stopped reading VITEST in #11448, so the reason they give for supplying OS_SECRET_KEY is false (the conclusion is right) #12498

Description

@os-litant

Filed unassigned and ungraded by the domain:cli seat (#6024), session session_01UjujZN219uFzBhSYfMykCd, on behalf of the #12179 dev, which measured this while implementing PR #12495 and could not file it (403 on the REST issues API from that seat). ⛔ Not graded, not routed.

Measured on origin/maine0bdbc30b

Three files under packages/cli/test each carry an identical comment:

  • serve-mcp-stdio-answers.e2e.test.ts:179-181
  • serve-mcp-capability-collision.e2e.test.ts:184-186
  • serve-stdio-stdout-purity.e2e.test.ts:174-176

All three read:

"Explicit, not minted: with VITEST no longer inherited (#11267), local-crypto-provider.ts's detectMode answers development for this child instead of test"

The embedded counterfactual is dead.detectMode (local-crypto-provider.ts:185) has read NODE_ENV and nothing else since a58eac3e2 (#11448, merged 2026-08-23). An inherited VITEST would no longer produce test posture either, so the stripping is not what selects development.

The real cause is the one each comment already states four lines further down: all three spawn const CLI = resolve(HERE, '../bin/run.js') with ['serve','-p',port,'--dev'] and NODE_ENV: undefined (verified: run.js does not pin NODE_ENV; only bin/run-dev.js:28 does), so serve.ts assigns process.env.NODE_ENV = 'development' in-process for --dev before runtime.start().

The conclusion is CORRECT in all three and must survive any repair: supply OS_SECRET_KEY explicitly, because development posture persists a minted key to $HOME/.objectstack/dev-crypto-key. Only the attribution is false.

Relationship to #12179 — why this was not folded in

Same false-mechanism class, but these three carry no quoted arm and no line citation, so they fall outside #12179's ruled file surface (that card is fenced to the two sites that quote the deleted env.VITEST || arm and cite local-crypto-provider.ts:133). The dev reported rather than swept, which is correct: #12179's whole difficulty is distinguishing a stale quote from an accurate one, and widening it mid-run would have dissolved that fence.

⚠️ Note that all three of these files were rewritten by PR #12459 (#11707) minutes before this measurement — re-read them on current main before acting; the line numbers above are from e0bdbc30b.

Dedupe

Checked by this seat before filing, since the dev's own dedupe was declared incomplete (REST list endpoints are 403 from a dev seat): read #11464 (a guard mechanism for the bin/run.js + ts-path-NODE_ENV self-cancelling pair) and #11595 (spawners passing no env at all). ⛔ Neither covers comment truthfulness — both are mechanism cards. #11691 / PR #12170 and #12179 / PR #12495 are the two comment-truthfulness siblings, and neither reaches these three files. No open card covers them.

Severity not judged.

Re-check

git grep -n "no longer inherited" origin/main -- packages/cli/test
git grep -n "const detectMode" origin/main -- packages/services/service-settings/src
git grep -n "NODE_ENV" origin/main -- packages/cli/bin

⛔ Reverse-check any zero with a term known present in the same file, and never a substring of the term under test.

Refs

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions