rent-fails-clean can't reach its fault path: nothing ever mints the rent ssh_pubkey (own-vps/operator_ed25519.pub) #665
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.
Reference
Matou/idss#665
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
The
rent-fails-cleanhonesty leg (tests/e2e/journey.rented.spec.ts, helpers4aRentExpectFailin the wizard fixtures) expects the S4a rent card to show a retriable[data-status="rent-error"]naming the broker's injectedprovisionstage. Instead it shows a real broker validation error:Run:
test-results/drive-rented/20260822T125436Z, signaturedcd9de7c3e06.state/founding-state.jsonconfirms the draft never left S4 (draft.step == "access"), consistent with the request being rejected before any provisioning happened.Root cause
The app's rent POST always carries an empty
ssh_pubkey, so the broker's own input-validation 400s the request before the rehearsal fault-injection path is ever reached:internal/brokerclient/client.go:101—body := map[string]string{"host": host, "ssh_pubkey": req.PubKey}puts whateverreq.PubKeyis (including"") on the wire.app/src/components/founding/FoundingAccess.vue:288— the Vue rent call deliberately sendsprops.client.rentServer({}); the pubkey is meant to be filled in server-side.internal/founding/access.go:351-360(Orchestrator.RentServer) is the only place that fills it in when the request arrives empty:readErris swallowed by design ("best-effort"), so a missing file just leavesPubKey"".app/helper/cmd/helper/wiring_prod.go:140-142wiresrentPubKeyPath()tostateBaseDir()/own-vps/operator_ed25519.pub. Nothing in the codebase ever writes this file. There's noEnsure-style mint call for it anywhere (checkedinternal/sshkey,internal/founding/{ownvpspath,privatepath}.go, everyed25519.GenerateKeycall site). So on every fresh state dir — rehearsal or real —os.ReadFilefails,PubKeystays"", and every rent call (success or fault-injected) hits the broker's hard requirement:broker/internal/broker/http.go:190-193:if strings.TrimSpace(in.SSHPubKey) == "" { writeErr(w, log, http.StatusBadRequest, "ssh_pubkey is required"); return }— this runs beforeauthorizeGatewayand beforerentals.Rent(...), i.e. before therehearsal-rentfailclaim-name fault injection the leg is trying to exercise.The
wiring_prod.go:138comment ("a missing file leaves the rent's PubKey empty — the broker's while-alpha default stands in") describes broker behaviour that does not exist; the broker has no such default.Compounding design conflict (why this isn't a mechanical fix)
ADR 0189 ruling 4 (
docs/adr/0189-...md:24-32) says the rent should reuse "ADR 0152's keypair — not a new one minted per rent," implying an app-held operator SSH identity. But ADR 0152/0154 ("own-VPS founds by the app driving out", shape A) rule the opposite: the own-VPS carrier uses the operator's ambient SSH agent/key, explicitly "no identity" (internal/fleetwire/carrier.go:30-31: "Identity is deliberately absent: shape A uses the operator's ambient key/agent (ADR 0152)"), andinternal/founding/rentedpath.goreuses that same ambient-only carrier for the rented path too. So even ifrentPubKeyPath()'s file existed, nothing wires its private half into the carrier's SSH connection — the rent-pubkey file and the carrier's actual connect identity are two disconnected concepts today.What plugging it needs
Two things, and the second is a design call, not a patch:
Ensure-style mint/persist forown-vps/operator_ed25519.pub(+ private half), analogous tointernal/sshkey.Ensure, run once before/atRentServersoreq.PubKeyis non-empty on a fresh state dir.Connect(a deliberate exception to shape A, since a freshly-provisioned rented box has no pre-existing ambient trust to reuse), or ADR 0189's text needs correcting to describe what's actually buildable. This determines whether the fix touchesinternal/fleetwire/carrier.go'sCarrierConfig/Connectas well as the keygen.Suspected layer:
internal/founding(RentServer / rentedpath.go) +app/helper/cmd/helper/wiring_prod.go(key minting) +internal/fleetwire/carrier.go(connect identity) + a DDR amendment to ADR 0189 or 0152/0154.Git history: both halves of this landed the same session —
8585a954added the broker's hardssh_pubkey is required400, and516c5054("sandcastle: #649") addedrentPubKeyPath()/WithRentPubKeywith the (incorrect) while-alpha-default assumption, ~1h16m later, without adding a generator for the file it reads.No self-fix attempted: this needs a new persisted credential (security-sensitive) and a ruling between two conflicting ADRs — outside mechanical-fix bounds.
drive
20260822T125436Zred atrent-fails-clean:expect(locator).toContainText(expected) failed Locator: locator('[data-status="rent-error"]') Expected pattern: /provision/i Received string: "brokerclient: /v1/gateways/rent: 400 Bad Request: ssh_pubevidence:
test-results/…/20260822T125436Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)Ruled by agent under ADR 0174 — veto anytime
Both open questions here are two-way doors, not one-way ones:
ssh_pubkey; this makes that existing requirement actually satisfiable). Revertible by commit/config; provable by unit test (internal/sshkey.Ensure's existing mint/persist/reload tests, plus newfounding-level tests provingRentServermints on a blankPubKeyand fails loud on a mint error).Ruling: ADR 0189 ruling 4's intent (one keypair, minted once, reused across every rent) stands; its origin was wrong — ADR 0152/0154 (own-VPS shape A) is ambient-key-only by design, so there was never an app-held keypair there to reuse. Wrote
docs/adr/0191-design-rent-operator-key-is-minted-not-reused-from-0152.md: mint a NEW app-held rent-operator keypair (the same mint-once-and-reload primitive ADR 0126 already uses for guest-trust), and wire its private half explicitly into the RENTED carrier's connect identity — a scoped exception to shape A, since a freshly broker-provisioned box has no ambient trust to reuse. Own-VPS is untouched.What proves it:
internal/foundinggains aRentPubKeyport (mirrorsGuestTrust) and a secondWithRentedCarrierport besideWithOwnVPSCarrier(two separate wired instances of the same interface).fleetwire.CarrierConfiggains anIdentityfield. New seam tests:TestRentServer_FillsBlankPubKeyFromRentPubKeySeam,TestRentServer_CallerSuppliedPubKeyIsNeverOverridden,TestRentServer_RentPubKeyMintFailureFailsLoud(internal/founding/access_test.go),TestOwnVPSCarrier_ConnectDialsExplicitIdentityWhenConfigured(internal/fleetwire/carrier_test.go).go build/vet/test ./...(main +-tags dev) andbroker's own module all green;gofmtclean. Landed at528ffaea.Not re-proved by a fresh live drive this session:
journey.rented.spec.tsneeds a real broker + DigitalOcean and this session-runner class cannot itself fire the standing rehearsal (#577/ADR 0184 lock) — the nextrented-target drive'srent-fails-cleanleg is the live proof, per the #635/#636/#641/#642/#644/#662 precedent this repo already uses for closing on unit-test strength alone.Close report
Landed:
528ffaeaonmain— "mint the rent-operator SSH keypair; RentServer fails loud on a mint error, and the rented carrier connects over it (DDR 0191)".What changed:
docs/adr/0191-design-rent-operator-key-is-minted-not-reused-from-0152.md(new DDR, ruling posted above)internal/founding/access.go— newRentPubKeyport;RentServermints/reads a blankPubKeythrough it and fails loud on a mint error instead of silently sending""to the brokerinternal/founding/orchestrator.go,internal/founding/rentedpath.go— newrentedCarrierfield +WithRentedCarrieroption; the rented journey'sConnectnow dials over its own carrier instance, never the shared own-VPS oneinternal/fleetwire/carrier.go—CarrierConfiggainsIdentity;Connect/RotateHostKeydial-i <identity>when set,""= ambient (own-VPS unchanged)app/helper/cmd/helper/wiring_prod.go— mints/reuses the keypair atrent-operator/(new state-dir home, notown-vps/) viasshkey.Ensure; wires the rented carrier'sIdentityat the private-key pathapp/helper/cmd/helper/wiring_dev.go,wiring_test.go— demo build + boot-seam exhaustiveness test updated for the newrented-carrierportinternal/founding/testing/fakes.go— newFakeRentPubKeyinternal/founding/access_test.go(3 new),internal/fleetwire/carrier_test.go(1 new),internal/founding/rentedpath_test.go(wiredWithRentedCarrier)STATUS.mdupdated same-commitProof:
go build ./...,go build -tags dev ./...,go vet ./...,go test ./...all green (main module +broker's own module);gofmt -lclean. New tests reproduce the exact bug (a blankRentRequest.PubKeyused to silently stay"") and prove the fix, plus proveCarrierConfig.Identityreaches the real ssh argv.Not proved by a fresh live drive —
journey.rented.spec.tsneeds a real broker + DigitalOcean droplet and this session-runner class cannot fire the standing rehearsal itself (#577/ADR 0184 lock). The next cron-triggeredrented-target drive'srent-fails-cleanleg is the live proof, per the established #635/#636/#641/#642/#644/#662 precedent for closing on seam-test strength when a live re-drive isn't reachable from a session.Closing per that precedent.