founding: private-path stand-up fails — the helper is spawned with an empty environment #255
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#255
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened
During the #183 Phase A rehearsal (unpackaged production build, launched via the sanctioned dev script that exports the single-artifact overrides — guest image + QEMU paths), founding a private community and clicking Create landed on a fail-loud callout:
The guest base image was in place on disk and the launch environment pointed at it, but the helper resolved an empty image path.
What I expected
The private-path stand-up creates the local VM: the helper resolves the bundled QEMU + guest base image from the carried payload (packaged) or from the dev single-artifact environment overrides (unpackaged, ADR 0110 resolution order), and Create proceeds through create VM → pair → deploy access role.
Steps to reproduce
("").Additional context
Root cause (diagnosed during the rehearsal): the production renderer build bakes the process environment away — the bundle compiles the environment object to an empty literal, so the helper bridge spawns every helper with only the two variables it sets explicitly (state dir, payload dir). Everything else the shell was launched with is lost: the ADR 0110 dev overrides, and even
PATH/HOME. Consequences beyond this rehearsal: even a packaged install would spawn helpers withoutPATH, so the stand-up'ssystemctl/qemu-imginvocations would fail too. The fix should make the spawned helper inherit the app's real runtime environment (and a guard test should pin that the production bundle preserves it — the same shape as the #233 file:// boot guard).Found in the #183 Phase A rehearsal; blocks the private-path leg of the rehearsal.
Done in
b26ff4c(on origin/main).Root cause confirmed as diagnosed: the production renderer build (Vite) statically compiles a bare
process.envto an empty object literal{}(verified in the built bundle:var s5={}; ... {...s5}). SostdioBridge'sspawn(..., { env: { ...process.env } })handed every spawned helper an env carrying only the two vars it sets explicitly (OURCLOUD_STATE_DIR,OURCLOUD_PAYLOAD_DIR) — the ADR 0110 dev single-artifact overrides, and evenPATH/HOME, were all lost. The boot seam test runs in Node (realprocess.env), so it structurally could not catch this.Fix:
app/src/lib/stdioBridge.tsnow reads the live environment off thenode:processbuiltin ({ ...nodeProcess.env }) instead of the bareprocess.envglobal. The #233 electron-builtins plugin bridges the builtin to the node-integrated renderer's runtimerequire, so it resolves to the real environment at spawn time and the bundle keeps it. Verified: the shipped bundle now spreads{...require("node:process").env}before layeringOURCLOUD_STATE_DIR/OURCLOUD_PAYLOAD_DIRon top.Guard (the #233 file:// boot-guard shape):
app/tests/unit/rendererBuild.test.tsbuilds the shipped renderer and asserts the helper spawn env is spread offrequire("node:process").env, never an empty literal — so the class of defect (and even a plainPATH-less packaged spawn) cannot regress.This unblocks the private-path leg of the #183 Phase A rehearsal. (
boot.test.tsneedsgoon PATH — an unrelated sandbox env limitation; all other app tests pass.)stablepromote cannot work — it dropsidss-idp, reports success on a 409 while the production-signed feed never publishes, and nothing can servestable(fix + provepublish.sh promotebefore the production key is minted) #1971