the takeover's kexec installer image builds pkgsStatic from source ON the gateway — no substituter serves it, and the build has no ceiling #1016
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
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1016
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?
Failure
drive-device 20260830T034644Zred at legdeploy-takeover(sig800a2936720b), 26/27 legs green, at drive commit6d2170ac(#1014, the commit that first put the production kexec-installer builder on the live takeover path).The takeover never began. The gateway spent the entire deploy budget compiling CPython.
Evidence
The gateway was still building the installer tarball when the budget expired —
logs/gateway-stall.txt:12:46m23s of CPU and not done. What it was building —
logs/gateway-stall.txt:13-16: twolto1processes at31:18CPU each, LTO-linkingpythonandPrograms/_testembedagainst/nix/store/…-musl-static-x86_64-unknown-linux-musl-1.2.5, output rpath/nix/store/w13pspi3q841b3ir3gm5h2slk99csci4-python3-static-x86_64-unknown-linux-musl-3.13.15. The builder ismake -j2(gateway-stall.txt:20) on a 2 vCPU box, and memory is pegged:3843 / 3921 MBused,77 MBavailable (gateway-stall.txt:5).Nothing on the device ran.
logs/device-units.txt—ss -tlnpshows only sshd + netbird,systemctl --failedempty, no NixOS units.logs/device-stall.txt— processes are/usr/bin/netbirdand/usr/sbin/sshd(stock Ubuntu paths), and the dmesg tail's last entry is the WireGuard module load at04:02:24— the mesh join, nothing after.logs/device-do-forensics.txtrecords one DO action on droplet 596267533,create. The box was never erased, which is correct — the build fails before the kexec, per the ADR 0100 ordering ininternal/clan/enrollment.go:810-822.Why it builds from source.
internal/clan/installer_image.go:126realises.#installer.config.system.build.kexecInstallerTarballagainst nixos-images' own nixos-stable (26.05), composed in a throwaway flake (installer_image.go:88-106). That closure pullspkgsStaticderivations. The gateway has no substituter that serves them:nix/gateway-image/configuration.nix:109setsnix.settings.experimental-featuresand nothing else — a repo-wide grep forsubstituters/trusted-public-keysfinds no setting on any fleet image. So the gateway realises the static musl toolchain, static openssl/sqlite/ncurses/readline/gdbm/expat and static CPython itself, on the smallest box in the fleet, and it does so every drive (each drive is a fresh droplet with a cold store).flake.nix:274-281'spackages.kexec-installer-basewas added as the warm-cache target for exactly this closure, but a CI/dev store is not the gateway's store — nothing carries those paths to the box that needs them.Separable second defect: the build is unbounded.
internal/clan/enrollment.go:890callse.a.installerImage.Build(ctx, s.Node, module)with the bare enrollment context, andinternal/clan/installer_image.go:145-156passes that straight tocli.Runwith no deadline. Every other install invocation goes throughrunInstallWatched(enrollment.go:824) underdefaultPhaseTimeout= 20 min (enrollment.go:68). So the image build is the one step in the takeover with no ceiling and no progress: it ran past 46 minutes, would have kept going, and the deploy bar reportedpercent=nullthe whole time. That is the opposite of the fail-loud the builder's own doc comment promises (installer_image.go:44-48). Even once the build cost is solved, this hole stays open — any slow or wedged realisation eats a paid drive silently instead of reding in minutes.Suspected layer
Build placement / fleet nix configuration, plus a missing bound in the enrollment phase loop. Not the takeover logic itself: #1012's module render and #1014's builder wiring both did what they say — the eval-smoke that proved them (
TestInstallerImage_EvalSmoke, 27.6s) ran on a warm dev store with the closure already realised, which is exactly the condition the gateway does not have. This is the fault the STATUS.md 'Acceptance #1 rides the live paid drive' note was waiting to learn.What plugging it needs
This needs a human ruling on the fork before a worker builds. Two directions, with different trust consequences:
nix-community.cachix.org+ its public key innix/gateway-image/configuration.nix, re-baked into the golden DO snapshot (scripts/gateway-image/build.sh). Cheapest change, but it makes a community gateway trust a third-party binary cache at deploy time. On a sovereignty stack that wants an ADR, not a patch.docs/adr/0133-app-payload-carries-the-gateway-closure.md). Note the tarball itself cannot be fully prebuilt:renderInstallerMeshbakes a per-takeover single-use setup key (ADR 0209 amendment), so only the static base closure (whatpackages.kexec-installer-basealready names,flake.nix:279-281) can be pre-warmed and shipped; the final compose still runs on the gateway, but against a warm store it is cheap.A third option worth pricing: build the tarball on the operator's machine (which already has a warm store from the founding build) and
nix copyit to the gateway, or pass it toclan machines install --kexecfrom there.Whichever wins, also bound the build independently — give
prepareInstallerImageits own ceiling (acontext.WithTimeoutaround theBuildcall atenrollment.go:890, or route it through the same watched path as the phases) so a slow realisation reds LOUD in minutes with an honest 'the installer image is still building' message, rather than burning a paid drive behindpercent=null. That half is small and testable offline; it should not wait on the ruling.Drive artifacts:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260830T034644Z.drive
20260830T034644Zred atdeploy-takeover:deploy did not reach active within 2700s — deploy bar: state=running current=takeover percent=null; wire /api/v1/fleet: {"gateway":{"id":"gateway","name":"gateway","role":"control plane · public enevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260830T034644Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by agent under ADR 0174 — veto anytime.
This ticket carries two separable defects of different door-class. I landed the two-way half and am routing the one-way half to a human, per ADR 0174 §3 (a security-posture widening / sovereignty-stack trust decision stops on the human).
Landed — the unbounded build is now bounded (two-way door)
internal/clan/enrollment.go:prepareInstallerImagepassed the bare enrollment context straight toBuild→cli.Runwith no deadline — the one takeover step outside the phase loop'sdefaultPhaseTimeoutceiling. So the wedged realisation on drive20260830T034644Zran past 46 min behind apercent=nullbar and burned the whole 2700s deploy budget silently.Fix (commit
d4dd04a1):installerImageBuildTimeout(20 min) — its own constant, kept separate fromphaseTimeout(which VMMode lifts to 45 min) so the build ceiling can be tuned without touching the remote install phases;installerBuildTimeout(white-box test-settable likephaseTimeout), defaulted inNew;prepareInstallerImagewraps theBuildcall incontext.WithTimeout, and a build that outruns the ceiling reds the kexec phase TERMINAL and LOUD before anything is erased (ADR 0100) with an honest "the installer image is STILL BUILDING after 20m0s — warm the store or carry the closure" reason, distinguishing a ceiling-firedbuildCtx.Err()==DeadlineExceeded && ctx.Err()==nilfrom a genuine session severance.Proof (offline, revertible): red-first
TestEnroll_TakeoverKexecBuildBoundedRedsLoudNotSilent— ablockingInstallerBuilderwedges past a 40 ms seam ceiling → statusFailed, reason contains "still building", nomachines installran (nothing erased). Red in ~5 s pre-fix (generic wedged-build message, no ceiling), green in 40 ms after.go build ./.../go test ./internal/clan ./control-plane/.../ vet / gofmt green.This does not green the drive: it converts a silent ~45-min burn into a LOUD ~20-min red until the placement fork below is ruled.
Why human — the build-PLACEMENT fork is a one-way door
The gateway realises the kexec tarball's
pkgsStaticclosure (static musl toolchain + openssl/sqlite/ncurses/readline/CPython) from source because no substituter on any fleet image serves those paths (nix/gateway-image/configuration.nixsets nosubstituters/trusted-public-keys). WHERE the closure comes from is a sovereignty-stack trust decision, not a patch:nix-community.cachix.org+ its public key) — cheapest, but makes a community gateway trust a third-party cache at deploy time. This is exactly the ADR 0174 §3 one-way door (a security-posture widening); wants an ADR.packages.kexec-installer-base,flake.nix:279-281) can be pre-warmed and shipped; the final compose still bakes the per-takeover single-use setup key on the gateway (ADR 0209 amendment), but against a warm store it is cheap.nix copythe tarball to the gateway (or pass it toclan machines install --kexecfrom there).Proposed default ruling (adopt if not vetoed): option 2 — carry/pre-warm the
kexec-installer-basestatic closure per the ADR 0133 precedent, so no new third-party trust root enters a community gateway and the gateway-side compose stays cheap. Options 1 and 3 remain on the table for Ben.Relabelled
ready-for-session→ready-for-humanfor that ruling; the bound half is landed and pushed.RULED by Ben (2026-08-31): carry the closure — ADR 0133 amended with Tier 3 (
b5552e40): the payload shipspackages.kexec-installer-baseand the founding seeds it into the gateway's store via the Tier-1file://cache mechanism; the per-takeover compose stays on-box against the warm store. Third-party substituter rejected (deploy-time trust anchor); operator-machine build rejected (couples a gateway-driven takeover to the founding laptop). The two-way half (build ceiling + honest progress) already landed asd4dd04a1and stays as the backstop.Build slice armed: #1036 (blocks #854). Closing this ticket in its favour.
supply#1048supply#1048