supply: the two best-effort seeds each take the FULL seed bound and spend the whole 600s leg between them #1402
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#1402
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?
The failure
Drive
20260911T215059Z(--target droplet, commita575406b) red at thesupplyleg:artifacts/legs.json— 7 green legs,supplyred at 600794ms. Thrown fromapp/tests/e2e/journey.droplet.spec.ts:235(waitForLeg's budget death) against the ceiling atapp/tests/e2e/journey.droplet.spec.ts:135(['supply', 10 * 60_000]).The evidence
Nothing was broken on the box.
logs/droplet-stall.txt: load average0.00, disk 5% used, and a live sftp session still receiving —bytes_received:265904750 busy:182168ms, i.e. ~1.46 MB/s andlastrcv:51ms at the moment of death. The leg was not stalled; it was still copying.supply's LOUD correctness steps all passed, fast.
logs/droplet-journal.txt(the/var/lib/idsslisting after the===marker):device.key,agent-cache/RELEASEandagent-cache/x86_64/idss-agent(11 MB) all landed 22:03 — supply started ~22:02:02 (startedAt 21:52:21 + the 581s of green legs), so ~62s of loud steps, exactly the figureinternal/fleetwire/supply.go:101budgets for.The two optimisation seeds ate the remaining ~540s:
/var/lib/idss/installer-base-cache.staging— narinfo files stamped 22:03→22:07, nar.xz 22:07→22:08, and the dir is still.staging(nevermv'd toinstaller-base-cache). The installer-base seed ran to its own 300s bound and returned (internal/fleetwire/supply.go:476on the red commit)./var/lib/idss/agent-cache/x86_64/vm-guest.tar.staging— 263,470,080 bytes, mtime 22:12, still growing. The vm-guest seed started at ~22:08 and opened a fresh 300s (internal/fleetwire/supply.go:369on the red commit) with only ~240s of leg left.No WARN from either seed appears anywhere: the leg died while the scp still blocked, so
seedGuestPayload's degrade-and-return never got to fire — the exact shape its own comment (internal/fleetwire/supply.go:363-378) says the bound exists to prevent.The suspected layer — confirmed
internal/fleetwire/supply.go, the best-effort seed family's budget arithmetic.defaultSeedTimeout(internal/fleetwire/supply.go:93-106) is sized in its own words as "half the 600s supply ceiling, leaving ample headroom for supply's ~62s of loud correctness steps even when the seed runs to its bound". That is headroom arithmetic over the leg, and it holds only while the whole best-effort family fits inside ONE bound. #1049 wrote it for the installer-base seed alone. #1191 addedseedGuestPayloadas a second consumer of the same constant, run serially right after, and each derived its owncontext.WithTimeout(ctx, s.seedTimeout). Worst case became 2×300s = the entire leg — spent on two copies that are contractually forbidden to fail it (ADR 0133 "every failure degrades to today's behaviour"; ADR 0100 puts the loud check at the device's own guest Create, not here).The droplet path hits that worst case on every drive: the FullInstall takeover wipes the box (
internal/founding/ownvpspath.go:441-443), so neither seed's short-circuit —nix path-info <marker>for installer-base, thevm-guest.tar.sha256content key for the bundle — can hit, and both copies run in full.The fix
One shared envelope.
Supply.seedopens theseedTimeoutcontext ONCE and passes it to both seeds; neither mints its own. Each still degrades to today's behaviour on its own, and a seed that finds the envelope already spent WARNs and returns instead of opening a copy the leg cannot pay for. No message, assertion, short-circuit or step list changed — only which context the remote calls run under. GOTCHAS #224 records the hazard.Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)
Two-way door, mechanical, not a design decision.
Why it is a repair, not a decision. The intended envelope is already written down in the code:
defaultSeedTimeoutis documented as HALF the supply leg's 600s ceiling precisely so the loud correctness steps still fit. That arithmetic was authored for one seed; #1191 added a second consumer of the same constant without re-doing it. Sharing the deadline makes the code do what the constant already says it means. It changes nothing a community sees and nothing a deploy does: both seeds are, by their own contract (ADR 0133 tier 3, ADR 0100), optimisations that are allowed to lose — a lost installer-base seed means the takeover builds the base from source (backstopped by the #1016 ceiling); a lost vm-guest seed means a VM-mode device join fails LOUD at guest Create, which is the designed consume-time check either way. No route, secret, default, trust-moment message or security posture is touched. The only behaviour that changes is how much of the founding leg the optimisations are permitted to spend — and 600s-of-600s was never a decision anyone made, it was two halves added together.Revertible how.
git revert 16aa06cbrestores each seed's owncontext.WithTimeout(ctx, s.seedTimeout)— the change is three call-site/signature edits plus comments, no schema, no state, no persisted artefact, nothing on the box or in infra. A re-drive after a revert behaves exactly asa575406bdid.Proven by which test.
TestSupplySeed_BestEffortSeedsShareOneDeadline(internal/fleetwire/supply_test.go) runs one payload carrying BOTH best-effort slots with both short-circuits missing, and asserts the installer-base scp and the vm-guest scp ran under the identical ctx deadline. It is proven by the deadline the copies carry, not by wall-clock, so the rail cannot silently drift back in under a fast fake runner: on the red commit it fails deterministically (vm-guest's deadline 49–125µs later, across-count=5); with the fix it passes-count=20. All 40 pre-existing supply tests — including the two per-seed deadline railsTestSupplySeed_InstallerBaseCopyBoundedBySeedDeadlineandTestSupplySeed_VMGuestCopyBoundedBySeedDeadline— are unchanged and still pass, so the per-seed degrade contract each one pins is intact.What I did NOT do. I did not widen the
supplyceiling injourney.droplet.spec.ts. That would have been the cheap green: it would let two optimisations bill the leg 600s on every paid drive and would paper over arithmetic that breaks again the next time a seed joins the family. The product's own sizing says supply fits in 600s; the honest repair is to make the seeds fit in it. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.drive
20260911T215059Zred atsupply(sig 404124947736) — self-fixed on the fast lane, commit74f92a9dcbecb5d469998b5c446dcabc7d6eee0a; checks: targeted (red-first):GOWORK=… go test ./internal/fleetwire/ -run TestSupplySeed_BestEffortSeedsShareOneDeadline -count=5→ FAIL ×5 on the unfixed supply.go ("the best-effort seeds ran under SEPARATE envelopes — vm-guest's deadline is 125.104µs / 49.447µs / 63.943µs / 62.666µs / 64.135µs after installer-base's"); with the fix → ok, and-count=20→ ok 0.009s (no flake). package:go test ./internal/fleetwire/→ ok 0.482s (all 40 supply tests, including the two pre-existing per-seed deadline rails, unchanged and passing);go vet ./internal/fleetwire/→ clean;gofmt -lon both changed .go files → clean. whole tree:go build ./...→ clean;go test ./...→ every package ok, zero failures. commit shape: 3 files, 147 insertions / 41 deletions, of which 115/41 are non-test (internal/fleetwire/supply.go 63/41, docs/GOTCHAS.md 11/0 — supply_test.go is +73/-0 and a test file); one commit 16aa06cb, not pushed, working tree clean. rails self-check: all 41 removed lines are in supply.go and are comment-prose or the twoseedCtx, cancel := context.WithTimeout(ctx, s.seedTimeout)/defer cancel()pairs plus the two function signatures and the two call sites; ZERO removed lines in supply_test.go or GOTCHAS.md; none of the 41 match expect(/assert/require./t.Fatal/t.Error/toBe/toEqual/func Test/it(/test(/describe(/.skip/t.Skip; zero added .skip/.only/t.Skip; 3 files and 115 non-test changed lines, under the cap; no.sandcastle/rehearsal-*or.forgejo/workflows/path touched.. evidence:/home/swarm/session-runner/idss/test-results/drive-droplet/20260911T215059Zon matou-workstation.close-report for #1402 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope