create: the #1178 SSH-key confirm gate spends the transient-blip budget, giving DO ten seconds to settle a key write it already accepted #1472
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#1472
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
20260914T160005Z(targetrented) red at legcreateafter 13.2s —rent-fails-clean,claimandwizard-rentall green (artifacts/legs.json,artifacts/verdict.jsonat commitc1a25535). Build it was refused IN PLACE on the Confirm screen (founding-error, never reachingstandup-rented), so the drive trippedreviewAndCreate's refusal race atapp/tests/e2e/fixtures/wizard.ts:322rather than sitting out the 8-minute landing ceiling (app/tests/e2e/fixtures/rentedPrefix.ts:371). Fault line, fromreport/data/…-error-context.mdand the page snapshot:No droplet was created (no
state/clan-config,logs/qemu.logempty, guest logs-- No entries --) — the gate fired before the create POST, which is the gate working as designed. What it got wrong is how long it waited.The defect: a borrowed budget
confirmSSHKeyVisible(broker/internal/broker/provider_do.go:460) gates the deliberately un-retried droplet create on DO's read path resolving the just-registered key — correct — but it rodedoRetry, whose budget istransientRetries = 3(broker/internal/broker/provider_do.go:53-72). That constant's own doc says it is small and fixed "because a persistent refusal has no 'still booting' ceiling and must surface fast, not spin on a bad token" — a blip budget for 5xx/429.A read-after-write 404 is the opposite class: it is EXPECTED for a while and the only cure is to read again. That is why the same #672/#677 lag gets
PollTries(120 × 5s = 10 min) onpollActive(broker/internal/broker/provider_do.go:466-505). So the gate whose comment claims to "give the write that window" (provider_do.go:445-462) actually gave it2 × PollInterval= ten seconds.logs/broker-journal.txtis that window, exactly: three GETs on/v2/account/keys/0e:d9:…:d5at 16:18:57, 16:19:02, 16:19:07 — all 404,budget=3— then the loud refusal. The existing green test sits flush against the same ceiling:TestDO_CreateWaitsForKeyVisibility(broker/internal/broker/provider_do_test.go:970-983) lags two 404s and resolves on read 3, i.e. the last attempt in budget.Why it is the window and not the key
Two alternatives ruled out from the evidence, not assumed:
dologs EVERY non-2xx at Info with method+path (broker/internal/broker/provider_do.go:545), and the harvest is an unfilteredjournalctl -u ourcloud-broker.service -n 2000 --since <drive-start>(scripts/lib/rehearsal-droplet.sh:762-777). There is noPOST /v2/account/keysrefusal line in the window, so the key write returned 2xx and DO then 404ed its own read of it.sshKeyFingerprint(broker/internal/broker/provider_do.go:712-729) reproducesssh-keygen -E md5 -lfbyte-for-byte — verified here on a fresh ed25519 and a fresh RSA key — which is the value DO's ownssh_key.fingerprintfield carries. So the identifier the gate polls is the right one; it is simply read too few times.Suspected layer
Broker provider boundary —
broker/internal/broker/provider_do.go, the DO retry policy (#753) and the #1178 confirm gate (introduced0fc29770). Not the app, not the journey fixtures, not the wizard: all three prior legs are green and the fault line is the broker's own.Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)
Two-way door, mechanical repair, not a design decision.
What changed:
doRetrynow delegates to a newdoRetryBudget— the same loop, sameretryablepredicate, same one-Warn-per-retry log, with the attempt count named by the caller. Every existing idempotent call site keepstransientRetries = 3, unchanged. The single call whose 404 is a read-after-write WAIT rather than a blip —confirmSSHKeyVisible's account-key GET — now spends a newkeySettleTries = 24(~115s at the shared 5sPollInterval).Why mechanical, not a design decision: nothing the product means to do changes. The gate's decision rule is identical (resolve the key, or refuse and never fire the create); the refusal string is byte-identical; no message at a trust moment, no route shape, no secrets shape, no default a community sees, no security posture moves. The #1178 contract — the create consumes only a fingerprint DO has already resolved — is exactly preserved, and the create's no-retry fence (ADR 0047/#682) is untouched: it still fires at most once, only later. This is the code doing what its own comment already said it did.
Revertible how: one commit, one file of product code, 45 non-test lines, no schema/dependency/infra-state change and nothing outside this checkout.
git revert ef7d6208restorestransientRetrieson the gate; the two new tests are the only thing that would then go red, which is the correct signal.Proven by which test: two new tests in
broker/internal/broker/provider_do_test.go, both watched RED on the pre-fix gate first —TestDO_KeyConfirmOutlastsTheTransientBlipBudget(a key lagging past the blip budget still lands the droplet, create fires exactly once and only after visibility; pre-fix it failed with the drive's own refusal line) andTestDO_KeyConfirmSettleWindowIsBounded(a key DO never resolves spends exactlykeySettleTriesreads and no more, then fails loud — pre-fix:reads = 3, want 24). The second is the can-fire half: a wider window is still a bounded window, so ADR 0100's fail-loud is not weakened into a spin.Bounded against the harness: ~115s of settle window is a small fraction of the leg's 8-minute ceiling (
app/tests/e2e/fixtures/rentedPrefix.ts:371), leaving room for the create pluspollActive's boot poll. No assertion, leg or test was edited, skipped or deleted; no.sandcastle/rehearsal-*or.forgejo/workflows/file was touched. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.drive
20260914T160005Zred atcreate(sig b052db2832cd) — self-fixed on the fast lane, commit3f494328c2a10dea91aa9f4ef64baebe4454aa90; checks: Targeted (red-first):cd broker && go test ./internal/broker -run TestDO_KeyConfirm— FAIL on the pre-fix gate (TestDO_KeyConfirmOutlastsTheTransientBlipBudget: refused with the drive's own "cannot resolve it yet" line;TestDO_KeyConfirmSettleWindowIsBounded: "key confirm reads = 3, want exactly the settle budget 24"), thenok git.matou.nz/Matou/idss/broker/internal/broker 0.011swith the fix. Package:go test ./internal/broker→ ok (0.078s, all pre-existing tests green, none modified). Module:go test ./...in broker/ → ok.go vet ./internal/broker→ clean (exit 0);gofmt -l broker/internal/broker/→ clean. Thecreateleg itself needs the live broker plus a paid droplet, so it was not re-driven here.. evidence:/home/dev/swarm/Matou/idss/test-results/drive-rented/20260914T160005Zon matou-workstation.close-report for #1472 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope