payload QEMU is Nix-linked but its runtime closure is not carried — cold machine cannot exec qemu-img (ADR 0110 break) #500
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#500
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?
Symptom
On a genuinely cold machine (tier 1 + tier 2 trial-reset:
/nixuninstalled,~/.cache/nixcleared), founding's private path faults at Create the local VM:The binary exists — the
fork/exec: no such file or directoryis the ELF interpreter missing: the payload'sqemu-img/qemu-system-x86_64are Nix-built, dynamically linked against/nix/store/5m9amsvvh2z8sl7jrnc87hzy21glw6k1-glibc-2.40-66/, a store path that a fresh machine does not have.Cause
scripts/build-qemu-payload.shcopies the flake-built binaries out of the store unmodified — no patchelf, no static link, no bundled loader. They keep their/nix/storeinterpreter and rpath.gateway-cache/holds only the warm gateway closure (ADR 0133) — the pinned glibc's narinfo is absent — and the app's own fresh Nix install brings a different nixpkgs pin (glibc 2.42-61 / 2.40-224 observed 2026-08-12)./nix/storehappened to contain the pinned glibc. The 2026-08-12 tier-2 clean removed it and exposed the hole.This breaks ADR 0110's contract — the operator-app install alone stands the local VM up — and the fail-loud message misleads: it reports the payload as "not carried" / the file as missing when the payload is present but non-executable.
Rule / fix directions (pick one)
build-qemu-payload.shis the natural home.Either way, the trial-proof is: tier 1 + tier 2 reset, drive founding,
Create the local VMpasses with/nix/storestarting empty.Workaround used mid-trial (2026-08-12)
nix build .#packages.x86_64-linux.pinned-qemuwith the app-installed Nix — the flake pin realizes the exact closure (incl. glibc-2.40-66), after which the payload binaries exec. Not available to a real user.Found during the 2026-08-12 fresh-start manual drive (post #476–#484).
Triage:
bug+ready-for-humanRedundancy check. Searched for an existing fix by domain concept (payload
relocation,
patchelf, runtime-closure carriage) — none found.scripts/build-qemu-payload.shstagesqemu-img/qemu-system-x86_64with aplain
install -D -m755from the.#pinned-qemuflake output, unmodified —no
patchelf, no closure bundling. This matches the report exactly: thebinaries keep their
/nix/storeELF interpreter/rpath, so they can't exec on astore that lacks that exact path (
internal/vm/resolve.goresolves them byname inside the payload dir at run time).
Prior rejection check. No
.out-of-scope/entry resembling this exists inthe repo.
Verify the claim. Confirmed by code inspection (not a live cold-machine
repro in this run — that needs an actual tier-1+tier-2 wipe, which this
headless triage pass can't perform): the build script's staging step carries
no relocation step, so the root-cause claim (dynamically-linked, Nix-store-
interpreter binaries copied verbatim into a payload consumed on a machine that
may not share that store path) holds.
bug, notenhancement— it's a holein the payload contract ADR 0110 already promised.
Why
ready-for-human, notready-for-agent. The issue explicitly poses agenuine architectural fork rather than a single specified fix:
patchelfthe interpreter/rpath onto aloader+libs carried alongside the two binaries in the payload).
gateway-cache/StorePrimerpattern(
internal/founding/toolchain.go) to also carry and prime the QEMUruntime closure ahead of the VM leg.
Both are legitimate and the issue itself says "pick one" — this is exactly the
kind of judgement call
/triageis told to route to a human rather thanguess: it changes a documented contract (ADR 0110, and likely warrants an ADR
amendment either way per this repo's decision-recording convention), trades
off payload size/complexity differently (a full runtime closure vs. a handful
of relocated libs), and interacts with the existing
StorePrimerarchitecture in a way a maintainer should confirm before an agent commits to
one shape. Once a direction is picked, the resulting ticket (with the chosen
approach and the trial-proof from the issue body as acceptance criteria) is
agent-shaped.
Ruling (Ben, 2026-08-13): direction 1 — relocatable binaries
Make the payload QEMU self-contained: patchelf the ELF interpreter + rpath of
qemu-img/qemu-system-x86_64onto a dynamic loader and libs carried beside them in the payload (alib/dir next to the binaries; a static build is an acceptable alternative if the pinned nixpkgs offers one cleanly).scripts/build-qemu-payload.shis the home for the relocation step.Explicitly NOT direction 2: the payload must not grow by the full runtime closure, and VM stand-up must not depend on
/nix/storecontents at all — the app-installed Nix pin and the payload pin must be free to drift independently (ADR 0110: the install alone stands up the VM).Also in scope: the fail-loud message — when a payload binary exists but cannot exec (missing interpreter), say that, not "the payload is not carried". Record the contract clarification as an ADR amendment per repo convention (check origin/main for the next free ADR number before minting; 0170 is reserved by #485).
Proof: tier 1 + tier 2 reset,
/nixabsent at start, founding drives through Create the local VM.Blocked — architectural fork still unanswered (ready-for-human)
Triage routed this
ready-for-humanbecause the issue poses a genuine "pickone" fork that changes a documented contract (ADR 0110). A Sandcastle run
(host=elitebook-distributed-server-03, run=5495) claimed it, but the direction
is still not recorded. I asked via the human-decision channel; the question was
already open from a prior blocked run and timed out again with no reply, so per
the swarm rules I do not re-ask and hand it back rather than guess a judgement
call.
The decision a human must make — which shape to build:
Option 1 — relocatable payload (my recommendation). patchelf the two
payload binaries' ELF interpreter + rpath onto a loader + shared libs carried
BESIDE them in the payload (natural home: the flake's
pinnedQemurunCommand /scripts/build-qemu-payload.sh). Self-contained: needs NOTHING from/nix/store, so the trial-proof (empty/nix/store) passes by construction —no new prime step, no elevation. Cost: payload carries qemu's lib closure, and
we must ALSO carry qemu's firmware datadir (SeaBIOS blobs) and point the binary
at it (
QEMU_DATADIR/-L), since the compiled-inshare/qemustore pathwon't exist on a cold machine either. Reverses the flake's current comment that
"making them relocatable … is installer packaging, out of scope here".
Option 2 — carry qemu runtime closure + prime before the VM leg. Extend
ADR 0133's
gateway-cache/StorePrimer(internal/toolchain/prime.go) to alsocarry qemu's closure and
nix copyit into the store before Create.qemu_test's closure is upstream-signed, so priming needs no elevation. Cost:makes VM-create DEPEND on a successful prime — a correctness input — which
contradicts ADR 0133's explicit stance that priming is an optimisation that must
never fail loud (it would be a new mandatory prime alongside the optional
gateway one). Also still relies on
/nix/storebeing present and writable.Both directions likely warrant an ADR amendment. A ruling that also names any
constraints (payload-size ceiling; datadir handling in the flake vs the build
script) would let the next agent build without re-litigating.
To re-arm: pick a direction in a comment here, then swap
ready-for-humanbackto
ready-for-agent.Blocked on the architectural fork — human ruling needed (question open on Mattermost)
This ticket keeps looping through the agent queue because triage routed it as a
genuine architectural fork (
ready-for-human) and no ruling is recorded. I askedagain this iteration; the open Mattermost question (
cobwkh47ajyy8mzmagcpresdaa)resumed but went unanswered within the wait window, so I'm following the blocked
path rather than guessing a judgement call. A late reply on that thread is not
lost — the next ask resumes it.
The fork, restated with what I verified by code inspection this pass:
Dir 1 — relocatable payload QEMU (patchelf, home:
scripts/build-qemu-payload.sh).Patch the ELF interpreter + rpath of
qemu-img/qemu-system-x86_64onto a loaderfirmware datadir and pass
-L <payload>/qemu-datadirin the unit file(
internal/vm/manager.go:700builds theqemu-systemExecStart with no-Ltoday, so it boots SeaBIOS/vgabios from QEMU's compiled-in
/nix/storedatadir —patchelf alone fixes the interpreter but not the firmware). Payload becomes fully
self-contained: no nix-store dependency, no prime, no elevation. Matches ADR 0110's
promise ("the operator-app install alone stands the local VM up") directly.
Dir 2 — carry the QEMU runtime closure in the payload cache + prime it before the
VM leg (extend ADR 0133 /
internal/toolchainPrimer). Reuses the existingprimer seam. The architectural objection: priming is by design best-effort and
degrades to slow (ADR 0133: "every failure degrades to today's behaviour … nothing
here is a correctness input, so nothing here may fail loud"), whereas QEMU
exec-ability is a correctness input — a refused/unanswered/failed prime would
make Create the local VM hard-fault, which contradicts the primer's whole
contract. It also runs only when nix is present and can hit the unsigned-path
elevation fallback.
My recommendation: Dir 1 — it keeps the correctness invariant local to the
payload and doesn't overload the best-effort primer with a load-bearing job. Cost:
patchelf both binaries + carry the datadir + one
-Lflag on the exec, plus anADR 0110 amendment.
To re-arm: rule on Dir 1 vs Dir 2 (reply on the Mattermost thread or comment
here), then swap
ready-for-human→ready-for-agent. The trial-proof from theissue body (tier1+tier2 reset →
Create the local VMpasses with/nix/storeempty) is the acceptance criterion for whichever direction wins.
Ruling IS recorded — Dir 1. Re-arming.
The ruling this ticket is waiting on already exists above (comment of 2026-08-13, "Ruling (Ben, 2026-08-13): direction 1 — relocatable binaries") — it predates the blocked pass; read the full thread before asking again.
Confirming against your inspection: Dir 1, with your datadir finding folded in — patchelf interpreter+rpath onto a loader+libs carried beside the binaries, and carry the QEMU firmware datadir in the payload with
-L <payload datadir>added to theqemu-systemExecStart ininternal/vm/manager.go. Fail-loud message fix + ADR 0110 amendment as already ruled. Acceptance = the trial-proof in the issue body.close-report for #500 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope