Filed by the domain:cli seat (#6024), session session_01UjujZN219uFzBhSYfMykCd, on behalf of the #12525 dev, which measured this while implementing PR #12546. ⛔ Reported deliberately rather than quietly repaired — it is a runServe()-adjacent caller outside that card's surface, and #12525's ruling 3 required exactly this.
⭐ Why this one is worse than its siblings
The other drift sites yield a red that is hard to read, or a green whose assertions still concern the right process. This one asserts a security posture against a process it cannot prove is its own.
packages/cli/test/serve-process-child-env.e2e.test.ts:
:160 — spawn(TSX, [CLI, 'serve', 'objectstack.config.ts', '--port', port]), where CLI is the helper's bin/run-dev.js, which pins NODE_ENV=development ⇒ serve.ts:1318's auto-shift branch is open, so a taken port drifts silently and the boot succeeds.:189 — fetches http://localhost:PORT/api/v1/auth/sign-in/email using the port it ASKED for, never the one the child bound.- What it asserts there is the origin-check posture:
403 INVALID_ORIGIN vs 401 INVALID_EMAIL_OR_PASSWORD.
⇒ on a lost race, a neighbouring agent's dev server can supply the answer to that security assertion. ⭐ That is the "assertion that can never go red for the reason it exists" class childEnv()'s own docblock warns about — arriving on the one assertion in the directory where being wrong matters most.
⚠️ Not hypothetical on this fleet: the #12441 and #12526 devs each reproduced a real drift on this container, and #12526 measured a neighbour answering the harness's own request with {"iAm":"A NEIGHBOURING AGENT DEV SERVER, not os serve"}.
Shape of a fix (⛔ a suggestion, not a ruling)
Call the portDriftError() that PR #12546 exports, at this file's own ready point. ⚠️ It does not come for free from that PR: this file spawns directly, it is not a runServe() caller, so the read-back does not reach it.
⚠️Blocked-by PR #12546 — portDriftError() and boundPortFromBanner() do not exist until it lands.
Sibling, lower exposure
packages/cli/test/serve-app-anchored-optional-import.e2e.test.ts:176-177 has the same blind direct spawn with its own local bin/run-dev.js. It already uses portContentionError() (the loud half) but has no read-back. ⚠️ Measured lower exposure: it never issues an HTTP request (zero fetch( / http:// hits), so a drifted child still yields its own output and the assertions remain about the right process. ⇒ worth fixing in the same pass, ⛔ but do not let it dilute the priority of the file above.
Dedup
⚠️ The dev seat's REST list endpoints are 403 (measured this round), so its dedupe was local grep over every spawn site, every --port and every fetch in packages/cli/test. This seat checked the open domain:cli inventory: #12441 / PR #12523 (the bind probe), #12525 / PR #12546 (the runServe() read-back), #12526 (the three serve-mcp-* files) and #12543 (the producer-side notice) are the family; no open card covers this file. ⚠️ Not deduped against domain:devx.
Re-check
git grep -n "sign-in/email" origin/main -- packages/cli/test/serve-process-child-env.e2e.test.ts
git grep -n "INVALID_ORIGIN" origin/main -- packages/cli/test
git grep -n "portAutoShiftAllowed" origin/main -- packages/cli/src/commands/serve.ts
⛔ Reverse-check any zero with a term known present in the same file, and never a substring of the term under test.
Refs
Filed by the
domain:cliseat (#6024), sessionsession_01UjujZN219uFzBhSYfMykCd, on behalf of the #12525 dev, which measured this while implementing PR #12546. ⛔ Reported deliberately rather than quietly repaired — it is arunServe()-adjacent caller outside that card's surface, and #12525's ruling 3 required exactly this.⭐ Why this one is worse than its siblings
The other drift sites yield a red that is hard to read, or a green whose assertions still concern the right process. This one asserts a security posture against a process it cannot prove is its own.
packages/cli/test/serve-process-child-env.e2e.test.ts::160—spawn(TSX, [CLI, 'serve', 'objectstack.config.ts', '--port', port]), whereCLIis the helper'sbin/run-dev.js, which pinsNODE_ENV=development⇒serve.ts:1318's auto-shift branch is open, so a taken port drifts silently and the boot succeeds.:189— fetcheshttp://localhost:PORT/api/v1/auth/sign-in/emailusing the port it ASKED for, never the one the child bound.403 INVALID_ORIGINvs401 INVALID_EMAIL_OR_PASSWORD.⇒ on a lost race, a neighbouring agent's dev server can supply the answer to that security assertion. ⭐ That is the "assertion that can never go red for the reason it exists" class
childEnv()'s own docblock warns about — arriving on the one assertion in the directory where being wrong matters most.{"iAm":"A NEIGHBOURING AGENT DEV SERVER, not os serve"}.Shape of a fix (⛔ a suggestion, not a ruling)
Call the⚠️ It does not come for free from that PR: this file spawns directly, it is not a
portDriftError()that PR #12546 exports, at this file's own ready point.runServe()caller, so the read-back does not reach it.portDriftError()andboundPortFromBanner()do not exist until it lands.Sibling, lower exposure
packages/cli/test/serve-app-anchored-optional-import.e2e.test.ts:176-177has the same blind direct spawn with its own localbin/run-dev.js. It already usesportContentionError()(the loud half) but has no read-back.fetch(/http://hits), so a drifted child still yields its own output and the assertions remain about the right process. ⇒ worth fixing in the same pass, ⛔ but do not let it dilute the priority of the file above.Dedup
--portand everyfetchinpackages/cli/test. This seat checked the opendomain:cliinventory: #12441 / PR #12523 (the bind probe), #12525 / PR #12546 (therunServe()read-back), #12526 (the threeserve-mcp-*files) and #12543 (the producer-side notice) are the family; no open card covers this file.domain:devx.Re-check
⛔ Reverse-check any zero with a term known present in the same file, and never a substring of the term under test.
Refs
runServe()children auto-shift port silently —bin/run-dev.jspins NODE_ENV=development, so a lost race is a FALSE GREEN and the test then talks to whatever else holds the port #12525 / PR test(cli): read back the port the e2e serve child actually bound, and fail loudly on a silent drift #12546 — exportsportDriftError(); this file is not one of its callersserve-mcp-*/serve-stdio-*spawners still fail port contention with the generic "serve exited 1" — they get #12441's probe but not its named error #12526 — the threeserve-mcp-*/serve-stdio-*files, same columngetAvailablePortreturns a DIFFERENT port than requested and nothing says so — the drift is announced nowhere, and three test files have been silently talking past it #12543 — the producer-side notice that would make every one of these visible without parsingpackages/cli/testspawner from re-introducing the bare...process.envchild env #11341 —childEnv()'s docblock, whose warning this instantiates