DESIGN: the ~60-minute gateway-image rebuild is the snapshot CONTRACT, not a staleness-key bug — bake the agent at drive time, or make the build cheap? (#1096/#1100 measured ineffective) #1102
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.
Dependencies
No dependencies set.
Reference
Matou/idss#1102
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?
Two fixes have now landed against the rebuild cost (#1096 pin axis, #1100 checksum axis) and neither reduces the rebuild rate, because the premise both share is false. Measured, not reasoned — see #1100's closing comment for the five-for-five distinct
agent-x86_64.sha256digests, including a pure render/comment change (#1095,0b5cbad5→9d414e84).Why:
internal/is linked into the agent and the Nix module text lives as Go string literals inside it, so a "render-only" edit genuinely produces a different binary. No staleness key — version tag, content checksum, or anything else — can call those two agents equal, because they are not equal. The gate is now honest and correct; the snapshot really is stale by its own definition.So the cost is the contract: the gateway image bakes one specific agent build, which chains image freshness to the whole product's commit rate. On a busy
internal/night that is a ~60-minute tax per drive — measured 49/62/58/60 min, 3.8 h of the 6.5 h window 19:30→02:00 for three drives (#1096's evidence).The two directions (a ruling is wanted; both are above the two-way-door line)
A — stop baking the agent into the image. The snapshot carries only OS/store warmth; the drive places the current agent on the gateway after boot (it already copies closures). Rebuilds then key on the base image, which moves rarely. The #656 ghost-red risk it was built to prevent ("a drive testing a stale agent") moves to "did the drive place the agent", which is checkable in-run and arguably a stronger guarantee than a baked pin, since it cannot silently drift.
B — keep baking it, make the build cheap. The 60 min is dominated by a full NixOS build plus the installer-base bake on a freshly created droplet. Tonight every bake reported an identical marker and an identical
1355 store paths— the same work, from cold, four times. A warm/persistent build host, or using the previous snapshot as the build base instead of stock Ubuntu, would attack the real cost directly and is independent of any staleness question.They are not exclusive: B is worth doing regardless, and A removes most of the firings.
What should be measured before building either
nix buildfrom cold, the installer-base bake, or droplet create/snapshot/destroy? (gateway-image-rebuild.logper phase; nothing has timed the phases yet.)Not blocking
#854 continues to drive; this is wall-clock and DO spend. Filed
needs-designfor Ben's ruling under ADR 0174 rather than letting a worker pick an architecture. Context: #1096 and #1100 are closed and should stay landed — their probe machinery, honest verdicts and corrected~60 minstring are the right foundation for A.Ben ruled B (2026-09-01, in session). Recording the mechanism that decides it, so A is not re-proposed.
A is not viable — the baked agent is under test at boot
nix/gateway-image/configuration.nix:111-130: the image lays the pinned binary at/usr/local/bin/idss-agentand the unit'sExecStartis/usr/local/bin/idss-agent join, running at boot. The drive'sclaim/connect/point-rowlegs test exactly that boot-time join.So the baked agent is not vestigial — that was this ticket's open "what should be measured" question, and it is now answered without needing a measurement: it is the thing under test at the moment it runs. "Place the agent after boot" cannot work, because the join has already happened. A would have the drive exercise a stale agent on precisely the legs #656 exists to protect — the served-bits-vs-main trap (#912), one layer down.
B's lever is larger than this ticket estimated
scripts/gateway-image/build.sh:97:Every rebuild creates a droplet from stock Ubuntu and has nixos-anywhere install NixOS from scratch. That is the whole ~60 minutes — a cold NixOS install + closure build + installer-base bake — repeated four times tonight, each producing a near-identical image differing in one fetchurl'd binary.
The fix: build from the PREVIOUS golden snapshot instead of stock Ubuntu. The base is then already NixOS with a warm store, and a rebuild becomes "swap one binary, rebuild the system generation" — minutes, not an hour. The build already scrubs identity at the end, so re-basing leaks nothing.
The one real risk is generational cruft/drift — a store that only ever accumulates. Mitigate by rebasing from stock on a schedule (weekly) or on a flake bump, and by keeping the existing image-contract proof (
idss-agent.serviceactive on the fresh box, ADR 0100), which fails loud if a generation goes bad.Consequence worth stating: at ~minutes per rebuild, the frequency question this arc started with (#1096, #1100) stops mattering. Their honest verdicts and probe machinery are exactly the right thing to keep driving a cheap rebuild — they should stay landed, and no third staleness key should be attempted.
Acceptance
swarm-claim host=matou-dev-server-01 run=15670
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1102 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope