enroll + broker: RENT A DEVICE from the control panel — GET /enroll/places, GET /enroll/server-offer, POST /enroll/rent (the broker rents, the box enrols itself with a code minted for it) #1397
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
Depends on
Reference
Matou/idss#1397
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?
Parent
Control-panel UI pass, Ben 2026-09-10/11 (branch
founding-ui-two-colour-rail-ceremony, unmerged at filing). Device-add spec #13 (ADRs 0053–0057, DDR 0109); founding Access step P1-S4/S4a (ADR 0189 / DDR 0190). The dashboard half is BUILT on the branch:dashboard/src/components/device-add/{PlaceScreen,RentServerScreen,RentedScreen}.vue,DeviceAddSurface.vue(stages place → rent → rented | form),shell/DeviceAddDialog.vue, seamdashboard/src/lib/deviceAdd.ts(DevicePlaceOption,ServerOffer,RentServerRequest,RentedServer; OPTIONALplaceOptions/serverOffer/rentServeronDeviceAddSource), fakedashboard/tests/fakes/deviceAdd.ts, browser harnesscd dashboard && pnpm harness→http://localhost:5198/panel.html?scenario=steady.What to build
The dialog's rented path has no live half. enroll's Operator face gains the founding Access step's three verbs, device-shaped:
GET /api/v1/enroll/places→ the place list (founding'sAccessOptions()minusprivate, worded for a device joining a standing fleet — the wording indashboard/tests/fakes/deviceAdd.tsplaceOptions()is the contract: rented · recommended, own-vps, self-hosted).GET /api/v1/enroll/server-offer→ the broker's offer (internal/founding/access.goBroker.Offer— the SAME broker client, moved or shared so founding and enroll read one offer):preset,provider,region,regions[],presets[] {slug,label,specs,mem_mb,price}(the sizes/prices half lands in #1393 — this ticket is BLOCKED by it).POST /api/v1/enroll/rent{name?, region?, preset?}→{name, ip, preset, region}. The op: mint a code server-side (intended roleserver— a rented box hosts services — carryingname,kind: server,location: <region label>, see #1396), thenBroker.Rentthe droplet from the generic gateway image with cloud-init user-data that runs the agent's enrol with that code against the community's domain (the equivalent ofcurl -sSf https://<domain>/get | sh -s -- <code>, ADR 0054) — so the box CALLS IN by itself. Fail loud, nothing recorded, on any broker fault (ADR 0047: no half-rented device; the minted code is revoked on failure).broker/internal/broker/broker.go) needs nothing new if #1393's offer/rent already take a preset + region and accept user-data; if the rent endpoint has no user-data hook, add one (cloud_initfield on the rent request, passed toprovider_do.go's droplet-create).docs/GOTCHAS.mdentry if the generic image needs a first-boot agent unit to read the code from user-data (ADR 0160).Acceptance criteria
GET /api/v1/enroll/places, when called by an operator, then three places in the order rented (recommended), own-vps, self-hosted;privatenever appears.GET /api/v1/enroll/server-offer, when the broker is reachable, then the offer'spresets[]andregions[]are the broker's own (no list invented in Go); when unreachable, then a fail-loud 502 with the broker's stage + message.POST /api/v1/enroll/rent {"name":"kōwhai","region":"sgp1","preset":"s-4vcpu-8gb"}, when the broker provisions, then the response carries the droplet's IP, the picked size's specs and "Singapore", and the enroll ledger shows one active code minted for it with intended role server.GET /api/v1/fleetlists kōwhai withkind: server,location: Singapore.Blocked by
#1393 (offer sizes + prices; the rent honours the pick) and #1396 (the mint carries name/kind/location).
Why agent
Additive ops over existing seams (enroll ledger, founding's broker client, the broker's rent) — two-way door, provable by seam tests with a fake broker; the live half is proven by #1400.
placeOptions/serverOffer/rentServerto the new enroll ops so the real panel opens the dialog on the place screenjourney.rented-device.spec.tson the standing rented community: Overview → Add a device → place → rent → the box calls in → the device card → remove → reap; GREEN is the only closeplaceOptions/serverOffer/rentServerto the new enroll ops so the real panel opens the dialog on the place screen #1398journey.rented-device.spec.tson the standing rented community: Overview → Add a device → place → rent → the box calls in → the device card → remove → reap; GREEN is the only close #1400swarm-claim host=matou-dev-server-01 run=21978
(automated multi-host claim — lowest live claim id works this ticket)
Ruled by agent under ADR 0174 — veto anytime.
Two rulings on this ticket, both two-way doors:
Auto-approve (ticket point 4, already recorded). A device the operator rented from their own panel is auto-approved at call-in — the rent IS the approval, so it never sits on the pending list. Implemented as a
MintRequest/codeAutoApproveflag that makesPairapprove the instant the request reaches Pending (Redeemed → Pending → Approved in one call), best-effort with fail-loud parity (an unready CA/mesh leaves it Pending for the operator). A later Decline/Abandon still tears it down. Recorded in DDR 0237 decision 8 (amends decision 4) as the ticket instructed ("Record it in the DDR #1395 writes"). Provable byTestEnroll_AutoApprove_*+TestEnrollRent_RentMintsAutoApprovedThenBoxCallsInApproved.Scope split — the Go + broker-primitive halves this iteration; the live half is #1400. The ticket designates #1400 the live proof and acceptance #6 stipulates all clauses are proven by seam tests with a fake broker. So this lands: the three enroll endpoints +
WithEnrollDeviceRent(proven byTestEnrollRent_*against a fakeEnrollDeviceBroker), the enroll auto-approve, and the broker's additiveCreateRequest.UserData→ DOuser_dataprimitive (TestDO_CreatePassesCloudInitUserData). Not wired into productionmain.go: thebrokerclientdevice-rent adapter, a broker device-rent HTTP route + rented-device lease semantics, the openapi contract for the three routes, and the generic image's first-boot user-data unit (GOTCHAS #222) — all #1400's live half, mirroring how #1393/#1396 split their live halves. The dashboard consumer rides the unmergedfounding-ui-two-colour-rail-ceremonybranch, so there is no live consumer to strand.Why two-way: additive, reversible seam + a single additive broker field; the seam behaviour is proven at the unit tier; #1400 proves it live. Landed in
a575406b.close-report for #1397 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
placeOptions/serverOffer/rentServerto the new enroll ops so the real panel opens the dialog on the place screen #1398placeOptions/serverOffer/rentServerto the new enroll ops so the real panel opens the dialog on the place screen #1398journey.rented-device.spec.tson the standing rented community: Overview → Add a device → place → rent → the box calls in → the device card → remove → reap; GREEN is the only close #1400