an enrolled device vanishes from the operator's Fleet — the pending projection never returns Enrolled, so P2-S5 "Connected — not yet set up" can never render live #979
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.
Blocks
Reference
Matou/idss#979
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
20260829T085335Z(targetdevice, commite1a8cdcb) went red at theapproveleg (sigc1ac37bc5a0d), the 24th of 24 legs, after burning the full 300 s ceiling:artifacts/legs.json—approve,red, 300679 ms; every other leg green (artifacts/verdict.json: 23 green / 1 red).The device side succeeded.
artifacts/join-transcript.txtwalks the whole landing and ends✓ joined the community network/✓ community trust installed/✓ takeover staged/✓ this machine is enrolled;artifacts/join-exit.txtreadsexited 0 (approve red). Those ✓ lines are only printed afterEnrollreturns success —internal/join/cli.go:258-272(land: "It prints only after Enroll returns success, so every ✓ names a fact that provably happened (ADR 0100)"), which includesConfirmEnrolled.logs/device-journal.txt:1667showsnetbird.servicestarted at 09:14:08 andlogs/device-stall.txtshows the box holding mesh address100.74.5.74. The device really joined; the control plane really recordedStatusEnrolled.What the operator saw is in
artifacts/legs/approve-dash.png: the Fleet tab at 09:19 with no pending strip at all and a resting list holding onlygateway. The row did not sit at "approved — joining now", and no error state was raised — it simply left.The defect
The pending projection deliberately excludes
Enrolled:internal/controlapi/enroll.go:184-186—svc.ListPending(..., enroll.Query{Status: []enroll.Status{enroll.StatusPending, enroll.StatusApproved}}), with the comment atinternal/controlapi/enroll.go:177-181: "Enrolled devices leave the strip and join the resting Fleet list (story 26), so they are not read here."The dashboard holds the opposite contract:
dashboard/src/lib/pending.ts:27-31— "pendingandapprovedare the in-flight card states;enrolledis the landing;declined/expiredare terminal — those rows leave the pending list."dashboard/src/components/device-add/PendingDevicesSurface.vue:43-47rendersConnectedScreenforrow.phase === 'enrolled';dashboard/src/components/device-add/ConnectedScreen.vue:7is the only place in the tree that emitsdata-field="connected-device".dashboard/src/lib/api/enrollClient.ts:362mapsphase: w.request.status as RequestPhasestraight off the wire — soenrolledis a phase the transport can never deliver.dashboard/src/components/device-add/PendingDevicesSurface.vue:95-99filtersvisibleto pending|approved|enrolled, and the strip isv-if="visible.length"(line 9) — an empty read removes the strip entirely, exactly as the screenshot shows.The derived architecture view agrees with the dashboard, not with the projection:
docs/architecture/15-device-node-lifecycle.md:74— "Enrolled= P2-S5 / P3-S5" — anddocs/ux/flows/p2-device-add-cli.mermaid:18-19—S4 --"approves — device enrolled in the mesh"--> S5,S5 --"provision"--> P4S1. The P2-S5 wireframe (docs/ux/wireframes/p2-device-add-cli/p2-s5-connected.html:18) stands onadmin.example.nz/fleet.The divergence survived because the seam test drives a fake that CAN emit
enrolled:dashboard/tests/unit/pendingDevices.test.ts:126-135callssource.deviceEnrolled('req-0001')onFakePendingSourceand assertsconnected-devicerenders. Nothing tests the live projection against that phase —internal/controlapi/enroll_integration_test.go:262-268only asserts the honest story-20 split (approve lands onapproved, notenrolled).The story-26 alternative — the enrolled device joining the resting Fleet list instead — is not wired either, so the device currently vanishes from BOTH surfaces:
dashboard/src/lib/pending.ts:146enrolledFleetNode()has no caller anywhere indashboard/srcorapp/(dead except fordashboard/tests/unit/pendingDevices.test.ts:185-188);dashboard/src/components/shell/FleetSurface.vue:186loads the fleet composition once ononMountedwith no poll, so even a server-side admission would not appear without a reload.internal/enroll/ledger.go:544-556does fire theOnEnrolledadmission hook, but the operator's page never re-reads it.Suspected layer
The control-plane HTTP projection (
internal/controlapi), against the device-add dashboard contract. Not the mesh, not the agent, not the drive fixture:app/tests/e2e/fixtures/deviceAdd.ts:206-214is asking for exactly whatdocs/architecture/15-device-node-lifecycle.md:74promises.What plugging it needs
A ruling on where P2-S5 lives, then the wiring:
enroll.StatusEnrolledto the query atinternal/controlapi/enroll.go:185and correct the comment at lines 177-181, so the landed request renders as the P2-S5 Connected card on the strip.internal/enroll/ledger.go:621-648(ListPending) never prunes; enrolled requests live in the ledger forever. A bare status-list change means a standing community accumulates one permanent Connected card per device ever enrolled — the flow'sS5 --provision--> P4S1edge implies it should leave once the device is set up, but no rule exists for that today. Candidates: filter out enrolled requests whose node is already provisioned; bound by a recency window; or an explicit operator acknowledgement.internal/controlapi/enroll_integration_test.gothat confirms enrolled and asserts whatGET /api/v1/enroll/pendingreturns — the existing test only covers the approve step, which is why this shipped.enrolledFleetNode(dashboard/src/lib/pending.ts:146) into the fleet composition and giveFleetSurface.vuea live re-read, or the device stays invisible to the operator after it joins.Until one of those lands, the
approveleg re-fires straight into the same 300 s blind timeout on every drive, at the cost of standing the droplet up again.drive
20260829T085335Zred atapprove:expect(locator).toBeVisible() failed Locator: locator('[data-field="connected-device"]').or(locator('[data-status="pending-device-error"]')).first() Expected: visible Timeout: 300000ms Error: element(evidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260829T085335Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by agent under ADR 0174 — veto anytime
The ruling: option 1 (recommended). P2-S5 lives ON the pending strip. Added
enroll.StatusEnrolledto the pending projection query so a landed requestrenders as the "Connected — not yet set up" card, instead of leaving the strip
the instant it enrolls and vanishing from the operator's Fleet.
Why this is a two-way door I can rule. It is (a) revertible — a one-line
query change plus comment/spec/derived-client updates; (b) provable — a new
red-first integration test; (c) not on the one-way-door list. And it is the
ruling all four design contracts already agree on:
docs/ux/flows/p2-device-add-cli.mermaid:18S4 --approves — device enrolled in the mesh--> S5docs/architecture/15-device-node-lifecycle.md:74"Enrolled= P2-S5 / P3-S5"docs/ux/wireframes/p2-device-add-cli/p2-s5-connected.htmlstands on/fleetPendingDevicesSurface.vuerendersConnectedScreen(the onlydata-field="connected-device") forphase === 'enrolled'.The projection excluding
Enrolledwas the sole divergence, and it survivedbecause the seam test drives a fake (
FakePendingSource.deviceEnrolled) thatcan emit
enrolledwhile nothing tested the LIVE projection against that phase.What landed —
c7eef7e2internal/controlapi/enroll.go— query{Pending, Approved}→{Pending, Approved, Enrolled}; projection comment corrected (Enrolled = P2-S5 on the strip, not "leaves the strip").packages/openapi-spec/openapi.yaml—/enroll/pendingsummary +RequestView.statusdescription updated to name the P2-S5 enrolled card; typed client regenerated (dashboard/src/lib/api/generated.ts, ADR 0037). Theenrolledenum value was already present — no client type change.internal/controlapi/enroll_integration_test.go— new red-firstTestEnrollPending_EnrolledStaysOnStripAsConnectedCard: Approves over HTTP,ConfirmEnrolleds the device with itswt0addr, assertsGET /api/v1/enroll/pendingSTILL returns the request (status enrolled, probed hostname + mesh address intact). This closes the fake/production gap the ticket named.STATUS.md— lead updated.Proof
{Pending, Approved}the new test failedpending = [], want the landed request still on the strip— reproducing the exact "device vanishes" bug. WithEnrolledadded it is green.go test ./internal/enroll/... ./internal/controlapi/... ./internal/enrollwire/...→ all green.pendingDevices.test.ts(11) +pendingActsLive.test.ts(2). These already provephase === 'enrolled'→ConnectedScreen/connected-devicerenders; the two ends now meet at the wire contract.The 300 s blind
approveleg (drive20260829T085335Z, sigc1ac37bc5a0d) went red becauseconnected-devicenever rendered — the request had left the strip. With the projection now returning it, the dashboard mapsenrolled→ConnectedScreen→connected-device, so the leg has a live green to reach. I did NOT re-run the droplet drive from this session (host/harness one-shot); the fix is proven at the seam/integration level the ticket explicitly asked for.Spun out, not guessed — #982
The ticket's open question — when does the Connected card LEAVE — is a
design-tier decision with three candidates (prune-when-provisioned / recency
window / operator ack) and no chosen default, and it couples the enroll
projection to provisioning/fleet state. I deliberately did NOT guess it.
Filed as #982 (
needs-design+bug) with a proposed default ruling(candidate 1, prune-when-provisioned, which the
S5→P4S1flow edge implies),and it carries the sibling
FleetSurface.vuelive-re-read gap. Until #982lands, the #979 fix is net-correct (a just-joined device shows its true P2-S5
state) but a long-standing community will show stale Connected cards for
already-provisioned devices.
Closing #979: the stated defect — the projection never returns Enrolled, so
P2-S5 can never render live — is fixed and seam-proven.