device-add: approve-enroll-land — Approve, enrol, and land at Connected #60

Closed
opened 2026-07-25 04:56:56 +00:00 by ben · 1 comment
Owner

Parent

Feature spec: #13 (device-add).

What to build

The human gate the whole code discipline exists to reach, and the honest landing after it. The operator opens Fleet and sees a pending-device card (P2-S4 / P3-S4) showing the echoed probe and label, offering approve and decline; the pending list is a live query over connection requests, so devices appear and resolve without a refresh and terminal requests leave the list. On the device side the joining screen (P3-S4) long-polls honestly for days across reboots and network loss — nothing can reach the device inbound before mesh admission, so polling is the only forward mechanism.

On approval the weak code is spent forever and converted into strong device identity: the IdentityGrant carries the community-CA-signed NodeCert (binding device key, consented mode, and role-hint context), the community-signed SSH host cert, the ClanTrust material, and a single-use Netbird setup key. The dashboard shows the device as joined only when it truly is — only after the agent has joined the mesh, installed its certs, and brought the clan connection up does the request reach Enrolled (the Approved → Enrolled split). The device then lands at Connected — not yet set up (P2-S5 / P3-S5): no role or services assigned, the next action offered is provisioning's Assess (P4-S1), and it appears on the resting Fleet list with its probed identity.

From Enrolled the agent heartbeats on the fleet-reporting face (NodeCert mTLS over the mesh): agent version, uptime, clan-connection state, and VM health in VM mode — a missed heartbeat being the staleness signal monitoring surfaces. On the app path the owner rests at Device home (P3-S5 → shell) showing this device's state; provisioning happens from the operator's side, not theirs.

Acceptance criteria

  • (story 17) Given a Pending request, When the operator opens Fleet, Then the pending card shows the echoed probe and label and offers approve and decline.
  • (story 18) Given a Pending request, When approval hasn't happened yet, Then the agent long-polls across reboots and network loss and the screen reflects "waiting for approval" — polling is the only forward mechanism (nothing reaches the device inbound before mesh admission).
  • (story 19) Given the operator approves, When the grant is issued, Then the code is spent forever and the IdentityGrant carries the community-CA-signed NodeCert (device key, consented mode, role-hint context), the community-signed SSH host cert, the ClanTrust material, and a single-use Netbird setup key.
  • (story 20) Given approval, When the agent has joined the mesh, installed its certs, and brought the clan connection up, Then and only then the request reaches Enrolled and the device shows Connected (Approved → Enrolled split).
  • (story 25) Given pending requests exist, When the operator views Fleet, Then the list reflects current request states and terminal requests leave the pending list.
  • (story 26) Given Enrolled, When the operator views the device, Then its state is Connected — not yet set up, no role or services are assigned, and the next action offered is provisioning's Assess (P4-S1).
  • (story 26) Given Enrolled, When the device lands, Then it appears on the resting Fleet list (shell's surface) with its probed identity.
  • (story 27) Given Enrolled, When the agent runs, Then it reports on the fleet-reporting face (NodeCert mTLS over the mesh): agent version, uptime, clan-connection state, and VM health in VM mode — a missed heartbeat is the staleness signal (monitoring's to surface).
  • (story 28) Given Joined, When the owner exits the join flow, Then they land on Device home showing this device's state; provisioning happens from the operator's side, not theirs.

Blocked by

  • #49 — the CLI path reaching Pending
  • #50 — the app path reaching Pending

Task manifest

task: device-add:approve-enroll-land
implements_flow: p2-device-add-cli
implements_edge: P2-S4→P2-S5, P3-S4→P3-S5, P3-S5→HD
wireframe:
  - docs/ux/wireframes/p2-device-add-cli/p2-s4-pending-device.html
  - docs/ux/wireframes/p2-device-add-cli/p2-s5-connected.html
  - docs/ux/wireframes/p3-device-add-app/p3-s4-joining.html
  - docs/ux/wireframes/p3-device-add-app/p3-s5-joined.html
interface: "`enroll` seam Operator face Approve → IdentityGrant issuance (NodeCert + SSH host cert + ClanTrust + Netbird setup key); Approved→Enrolled split gated on mesh-join/cert-install/clan-up; List as a live pending query; fleet-reporting heartbeat face (NodeCert mTLS)"
seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory ledger/clock; fake mesh admission and clan adapter; assert IdentityGrant contents, the Enrolled gate, and long-poll across simulated reboots"
acceptance:
  - given: a Pending request
    when: the operator opens Fleet
    then: the pending card shows the echoed probe and label and offers approve and decline
  - given: a Pending request not yet approved
    when: the agent waits
    then: it long-polls across reboots/network loss; the screen shows "waiting for approval"
  - given: the operator approves
    when: the grant is issued
    then: the code is spent forever and the IdentityGrant carries the NodeCert, SSH host cert, ClanTrust, and single-use Netbird setup key
  - given: approval
    when: the agent has joined the mesh, installed certs, and brought clan up
    then: only then the request reaches Enrolled and the device shows Connected
  - given: pending requests exist
    when: the operator views Fleet
    then: the live list reflects current states; terminal requests leave it
  - given: Enrolled
    when: the operator views the device
    then: Connected — not yet set up, no role/services, next action = Assess (P4-S1); it appears on the resting Fleet list with its probed identity
  - given: Enrolled
    when: the agent runs
    then: it heartbeats agent version, uptime, clan-connection state, and VM health (VM mode) on the fleet-reporting face
  - given: Joined
    when: the owner exits the join flow
    then: they land on Device home showing this device's state
depends_on: [cli-join-happy, app-join-happy]
out_of_scope:
  - "story 21–22, 24 decline + crash-resume — decline-and-resume's"
  - "steady-state health, alerting, staleness surfacing — monitoring's (from Connected on)"
  - "role/service assignment and first deploy — provisioning's (P4-S1 on)"
needs_human_decision: []
## Parent Feature spec: #13 (device-add). ## What to build The human gate the whole code discipline exists to reach, and the honest landing after it. The operator opens Fleet and sees a **pending-device card** (P2-S4 / P3-S4) showing the echoed probe and label, offering approve and decline; the pending list is a **live query** over connection requests, so devices appear and resolve without a refresh and terminal requests leave the list. On the device side the joining screen (P3-S4) **long-polls honestly for days** across reboots and network loss — nothing can reach the device inbound before mesh admission, so polling is the only forward mechanism. On **approval** the weak code is spent forever and converted into strong device identity: the **IdentityGrant** carries the community-CA-signed **NodeCert** (binding device key, consented mode, and role-hint context), the community-signed SSH host cert, the ClanTrust material, and a single-use Netbird setup key. The dashboard shows the device as joined only when it truly is — only after the agent has joined the mesh, installed its certs, and brought the clan connection up does the request reach **Enrolled** (the Approved → Enrolled split). The device then lands at **Connected — not yet set up** (P2-S5 / P3-S5): no role or services assigned, the next action offered is provisioning's Assess (P4-S1), and it appears on the resting Fleet list with its probed identity. From Enrolled the agent **heartbeats** on the fleet-reporting face (NodeCert mTLS over the mesh): agent version, uptime, clan-connection state, and VM health in VM mode — a missed heartbeat being the staleness signal monitoring surfaces. On the app path the owner rests at **Device home** (P3-S5 → shell) showing this device's state; provisioning happens from the operator's side, not theirs. ## Acceptance criteria - [ ] (story 17) Given a Pending request, When the operator opens Fleet, Then the pending card shows the echoed probe and label and offers approve and decline. - [ ] (story 18) Given a Pending request, When approval hasn't happened yet, Then the agent long-polls across reboots and network loss and the screen reflects "waiting for approval" — polling is the only forward mechanism (nothing reaches the device inbound before mesh admission). - [ ] (story 19) Given the operator approves, When the grant is issued, Then the code is spent forever and the IdentityGrant carries the community-CA-signed NodeCert (device key, consented mode, role-hint context), the community-signed SSH host cert, the ClanTrust material, and a single-use Netbird setup key. - [ ] (story 20) Given approval, When the agent has joined the mesh, installed its certs, and brought the clan connection up, Then and only then the request reaches Enrolled and the device shows Connected (Approved → Enrolled split). - [ ] (story 25) Given pending requests exist, When the operator views Fleet, Then the list reflects current request states and terminal requests leave the pending list. - [ ] (story 26) Given Enrolled, When the operator views the device, Then its state is Connected — not yet set up, no role or services are assigned, and the next action offered is provisioning's Assess (P4-S1). - [ ] (story 26) Given Enrolled, When the device lands, Then it appears on the resting Fleet list (shell's surface) with its probed identity. - [ ] (story 27) Given Enrolled, When the agent runs, Then it reports on the fleet-reporting face (NodeCert mTLS over the mesh): agent version, uptime, clan-connection state, and VM health in VM mode — a missed heartbeat is the staleness signal (monitoring's to surface). - [ ] (story 28) Given Joined, When the owner exits the join flow, Then they land on Device home showing this device's state; provisioning happens from the operator's side, not theirs. ## Blocked by - #49 — the CLI path reaching Pending - #50 — the app path reaching Pending ## Task manifest ```yaml task: device-add:approve-enroll-land implements_flow: p2-device-add-cli implements_edge: P2-S4→P2-S5, P3-S4→P3-S5, P3-S5→HD wireframe: - docs/ux/wireframes/p2-device-add-cli/p2-s4-pending-device.html - docs/ux/wireframes/p2-device-add-cli/p2-s5-connected.html - docs/ux/wireframes/p3-device-add-app/p3-s4-joining.html - docs/ux/wireframes/p3-device-add-app/p3-s5-joined.html interface: "`enroll` seam Operator face Approve → IdentityGrant issuance (NodeCert + SSH host cert + ClanTrust + Netbird setup key); Approved→Enrolled split gated on mesh-join/cert-install/clan-up; List as a live pending query; fleet-reporting heartbeat face (NodeCert mTLS)" seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory ledger/clock; fake mesh admission and clan adapter; assert IdentityGrant contents, the Enrolled gate, and long-poll across simulated reboots" acceptance: - given: a Pending request when: the operator opens Fleet then: the pending card shows the echoed probe and label and offers approve and decline - given: a Pending request not yet approved when: the agent waits then: it long-polls across reboots/network loss; the screen shows "waiting for approval" - given: the operator approves when: the grant is issued then: the code is spent forever and the IdentityGrant carries the NodeCert, SSH host cert, ClanTrust, and single-use Netbird setup key - given: approval when: the agent has joined the mesh, installed certs, and brought clan up then: only then the request reaches Enrolled and the device shows Connected - given: pending requests exist when: the operator views Fleet then: the live list reflects current states; terminal requests leave it - given: Enrolled when: the operator views the device then: Connected — not yet set up, no role/services, next action = Assess (P4-S1); it appears on the resting Fleet list with its probed identity - given: Enrolled when: the agent runs then: it heartbeats agent version, uptime, clan-connection state, and VM health (VM mode) on the fleet-reporting face - given: Joined when: the owner exits the join flow then: they land on Device home showing this device's state depends_on: [cli-join-happy, app-join-happy] out_of_scope: - "story 21–22, 24 decline + crash-resume — decline-and-resume's" - "steady-state health, alerting, staleness surfacing — monitoring's (from Connected on)" - "role/service assignment and first deploy — provisioning's (P4-S1 on)" needs_human_decision: [] ```
Author
Owner

Done in commit f6824d7 (sandcastle: device-add:approve-enroll-land #60).

At the ADR 0057 seam (internal/join/land_test.go, real enroll ledger + clock, fake mesh admission + clan adapter):

  • Story 19 — enroll.Approve now spends the code forever at grant-mint (consumed, unrevocable — moved from ConfirmEnrolled, since approval is the weak→strong conversion). Grant contents asserted: community-CA NodeCert (device key, consented mode, role-hint, 90-day validity), community-signed SSH host cert, ClanTrust, single-use Netbird setup key; re-approve re-delivers verbatim.
  • Story 20 — internal/join/land.go adds the Enroll continuation: mesh join → cert install → clan up → only then ConfirmEnrolled, order asserted; a failing clan connection holds the gate (request stays Approved, never shown joined early) and retries clean.
  • Story 18 — long-poll across simulated reboots and network loss: a fresh orchestrator over the same durable key + ledger resumes the days-long Pending wait.
  • Stories 25/17 — the pending list is a query over request states; the card material is the echoed enroll.ProbeReport + consented mode; terminal requests leave the list.
  • Story 27 — Heartbeat on the fleet-reporting face from Enrolled: agent version, uptime, clan state, VM health in VM mode only; latest-wins.

Screens (rule 2b) — all four wireframes ship as components:

  • P2-S4 dashboard/src/components/device-add/PendingDeviceCard.vue + PendingDevicesSurface.vue over lib/pending.ts — a live query composed above the resting Fleet list (FleetSurface optional pending prop); rows appear/resolve/leave without a reload; approve renders joining, never joined early.
  • P2-S5 ConnectedScreen.vue — connected — not set up, one action set-up-this-device → provisioning Assess (P4-S1); enrolledFleetNode maps the landing onto the resting-list row with its probed identity (story 26).
  • P3-S4 app/src/components/device-add/JoiningScreen.vue — checklist to the wireframe (VM step for VM mode only, "you can close this — we’ll keep waiting"), held honestly through approved.
  • P3-S5 JoinedScreen.vue — ● Approved pill, "helping run" line, Done → Device home (story 28) via JoinProgressSurface.

Verified: full Go suite + go vet green (7 new seam tests); dashboard 235/235 and app 98/98 vitest, vue-tsc both, eslint clean. Also fixed #40’s time-of-day-flaky expiry test. STATUS.md updated in the same commit.

Done in commit `f6824d7` (`sandcastle: device-add:approve-enroll-land #60`). **At the ADR 0057 seam** (`internal/join/land_test.go`, real enroll ledger + clock, fake mesh admission + clan adapter): - **Story 19** — `enroll.Approve` now spends the code forever *at grant-mint* (consumed, unrevocable — moved from ConfirmEnrolled, since approval is the weak→strong conversion). Grant contents asserted: community-CA NodeCert (device key, consented mode, role-hint, 90-day validity), community-signed SSH host cert, ClanTrust, single-use Netbird setup key; re-approve re-delivers verbatim. - **Story 20** — `internal/join/land.go` adds the Enroll continuation: mesh join → cert install → clan up → only then ConfirmEnrolled, order asserted; a failing clan connection holds the gate (request stays Approved, never shown joined early) and retries clean. - **Story 18** — long-poll across simulated reboots and network loss: a fresh orchestrator over the same durable key + ledger resumes the days-long Pending wait. - **Stories 25/17** — the pending list is a query over request states; the card material is the echoed `enroll.ProbeReport` + consented mode; terminal requests leave the list. - **Story 27** — `Heartbeat` on the fleet-reporting face from Enrolled: agent version, uptime, clan state, VM health in VM mode only; latest-wins. **Screens (rule 2b)** — all four wireframes ship as components: - P2-S4 `dashboard/src/components/device-add/PendingDeviceCard.vue` + `PendingDevicesSurface.vue` over `lib/pending.ts` — a live query composed above the resting Fleet list (`FleetSurface` optional `pending` prop); rows appear/resolve/leave without a reload; approve renders **joining**, never joined early. - P2-S5 `ConnectedScreen.vue` — connected — not set up, one action `set-up-this-device` → provisioning Assess (P4-S1); `enrolledFleetNode` maps the landing onto the resting-list row with its probed identity (story 26). - P3-S4 `app/src/components/device-add/JoiningScreen.vue` — checklist to the wireframe (VM step for VM mode only, "you can close this — we’ll keep waiting"), held honestly through approved. - P3-S5 `JoinedScreen.vue` — ● Approved pill, "helping run" line, Done → Device home (story 28) via `JoinProgressSurface`. **Verified:** full Go suite + `go vet` green (7 new seam tests); dashboard 235/235 and app 98/98 vitest, `vue-tsc` both, eslint clean. Also fixed #40’s time-of-day-flaky expiry test. STATUS.md updated in the same commit.
ben closed this issue 2026-07-25 15:50:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#60
No description provided.