fleetstate + enroll + controlapi: a device KNOWS its kind, roles, location and the services it runs — the fleet row carries what the Overview card draws #1396
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
Reference
Matou/idss#1396
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 Overview's device cards (
dashboard/src/components/shell/DeviceCards.vue) draw five facts the control plane does not keep: kind (server | mini-pc | desktop | laptop), roles (one or more ofgateway | server | flaky | backup | storage, outlined tags), location (free text — "Marae office", "Ana's place"), per-service memory (GB, from monitoring) and the services placed on the device (label + health chip). Today the dashboard fakes them (dashboard/src/lib/fleet.tsFleetNode.kind?/roles?/location?/services?, interimdeviceRoles()fallback from the gateway flag + INTERMITTENT tag) and the enrol form already SENDS name/kind/location on the mint (MintCodeRequest.name/kind/location,POST /api/v1/enroll/codes), which the seam ignores.internal/enrollMintRequest(+CodeView) carriesname,kind,location; the code remembers them and the device that redeems it inherits them at approve (the fleet row's name is the operator's, else the agent's hostname as now).internal/fleetstateDevicekeepsKind,Location,Roles(derived: gateway flag →gateway; provisioning's placements →server/storage/backup; monitoring's intermittent verdict →flaky— roles are FACTS from the stores, never a free-text field), and the services placed on it with monitoring's chip and memory reading (nil when monitoring has none — never 0).internal/controlapi/fleet.goFleetNodeexposeskind,location,roles,services[] {service,label,mem_mb|null,chip}onGET /api/v1/fleet; the generated dashboard client (dashboard/src/lib/api/generated.ts) andfleetClient.tsmap them;deviceRoles()'s fallback goes.Acceptance criteria
{"name":"rimu","kind":"mini-pc","location":"Marae office"}, when that code's device is approved, thenGET /api/v1/fleetlists a node named rimu withkind: mini-pc,location: Marae office.kind/locationare absent (never a fabricated default).rolescontainsgateway; given a node with a Nextcloud placement, thenserver; given monitoring's intermittent verdict, thenflaky.serviceslists both with monitoring's chip andmem_mb(or null), and the Overview card's rows match the Fleet tab's for that node.DeviceCardsrenders from the real shape with no fallback.Why agent
Two-way door: additive fields on two stores and one read; provable by seam tests + the harness.
GET /enroll/places,GET /enroll/server-offer,POST /enroll/rent(the broker rents, the box enrols itself with a code minted for it)journey.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 closeGET /enroll/places,GET /enroll/server-offer,POST /enroll/rent(the broker rents, the box enrols itself with a code minted for it) #1397journey.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.
Ruling: land the two stores + one read this ticket's "why agent" names (enroll + fleetstate + controlapi/fleet
GET /api/v1/fleet+ the OpenAPI contract). Defer the Overview device-card renderer half to thefounding-ui-two-colour-rail-ceremonybranch merge.Why this split (the two-way door): the renderer this ticket cites is not in
main—dashboard/src/components/shell/DeviceCards.vue, itsdeviceRoles()fallback, and thefleet.tskind/roles/location/servicesview fields all ride the unmergedfounding-ui-two-colour-rail-ceremonybranch (the ticket itself says "the dashboard half is BUILT on the branch … unmerged at filing"). Additionally, per-service memory/health do not exist ininternal/monitor: memory is per-NODE only, and per-(device,service) health lives unexported inprovFaults/the alert set. This is the SAME split #1393 and #1375 landed and Ben accepted: Go/contract halves land now, the renderer half rides its own branch. Additive, reversible, provable by seam tests — not on the one-way-door list.What landed:
MintRequest/CodeView/codeRecord/RequestViewcarryname/kind/location; the minted code remembers them, the redeeming device inherits them onto its request, they ride verbatim to Enrolled and round-trip the JSON store.Device.Kind/Device.Location(off the enrolled request) andDevice.Rolesderived byDeriveRoles(gateway flag→gateway, a service placement→server,backup-copy→backup, monitoring's intermittent uptime→flaky) — never a free-text field; the operator's minted name overrides the placement name, else the placement/hostname stands as now.FleetNodeexposeskind/location/roles/services[] {service,label,mem_mb,chip}onGET /api/v1/fleet.roles/servicesserialise[]never null; per-servicemem_mb/chiprest null because monitoring holds no per-service reading yet (honest, ADR 0100). Label comes from the catalogue.openapi.yamlgrowsFleetNode.kind/location/roles/services+ aFleetNodeServiceschema;generated.tsregenerated (check:clientgreen);fleetClient.tsmaps them via the genericcamelize(no change needed).Proof: seam tests
TestEnroll_DeviceFacts_RoundTrip/…_AbsentByDefault,TestProjection_DeviceFacts,TestDeriveRoles,TestFleetHandler_CarriesDeviceFacts; dashboard vitest (1455) +vue-tscgreen; gofmt/vet clean.Acceptance status: clauses 1–3 and the enroll/fleetstate round-trip of clause 5 are met at the seam; clause 4's "Overview card's rows match the Fleet tab's" and clause 5's "
DeviceCardsrenders from the real shape with no fallback" reconcile at thefounding-ui-two-colour-rail-ceremonymerge (the render doesn't exist onmain). Per-servicemem_mb/chipawait a monitoring per-service slice. Kind/location editing from device detail is P9 (out of scope, item 4).close-report for #1396 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
MintCodeRequestand the handler carry only role and TTL #1431