device-add: mint-code — Mint an enrollment code from Fleet → Add device #40

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

Parent

Feature spec: #13 (device-add).

What to build

The operator's entry point for growing the fleet. From the Fleet surface the operator chooses Add device (P2-S1) and both doorways — the CLI path and the app path — are offered from one place, each issuing the same generated enrollment code: short, human-typeable, single-use, expiring (7 days by default), revocable. The operator picks an intended-role hint (default helper, ADR 0055) that drives only the device-end spec-gate floor and VM-mode guest sizing — never a role assignment, which happens later at provisioning (ADR 0015).

The code screen (P2-S2) then shows the code, its expiry, a revoke affordance, and the one install command — a curl of the community's own gateway (https://<community-domain>/get) carrying the code, never a Matou-hosted URL (ADR 0054). For the app path the operator instead shares a download link or QR (P3-S1) pointing at Matou's release channel — the operator app is generic and the community only appears after the code is entered. The code screen is a live query: when the device calls in it updates itself without a reload, and leaving the page loses nothing.

Minting is the enroll seam's Operator face MintCode verb (intended role + TTL) over the code ledger the seam hides — the additive operator-face amendment from the device-add grill (2026-07-23).

Acceptance criteria

  • (story 1) Given the Fleet surface, When the operator chooses Add device, Then both the CLI path and the app path are offered and either one issues a generated enrollment code that is short, human-typeable, single-use, expiring, and revocable.
  • (story 2) Given Add device, When the operator mints without changing anything, Then the code carries intended role = helper and a 7-day expiry.
  • (story 2) Given a different hint (storage, gateway), When the code is minted, Then the hint selects only the device-end spec-gate floor and VM-mode guest sizing — the role is assigned later at provisioning, never here.
  • (story 4) Given P2-S2, When the operator reads the install command, Then it curls the community's own gateway (https://<community-domain>/get) with the code as its argument (ADR 0054) — no Matou-hosted URL.
  • (story 4) Given P2-S2 is open, When the device calls in, Then the page updates itself without a reload, and leaving the page loses nothing.
  • (story 7) Given P3-S1, When the operator shares the app, Then the link/QR points at Matou's release channel (ADR 0054) — the app is generic and the community appears only after the code is entered.

Blocked by

  • #26 — the code ledger + MintCode verb
  • #29 — Fleet/Add-device mount surface

Task manifest

task: device-add:mint-code
implements_flow: p2-device-add-cli
implements_edge: P2-S1→P2-S2, P3-S1→P3-S2 (mint/hand-off portion)
wireframe:
  - docs/ux/wireframes/p2-device-add-cli/p2-s1-fleet-add-device.html
  - docs/ux/wireframes/p2-device-add-cli/p2-s2-code-and-install-command.html
  - docs/ux/wireframes/p3-device-add-app/p3-s1-via-the-app.html
interface: "`enroll` seam Operator face — MintCode(intendedRole=helper, ttl=7d) → EnrollmentCode over the code ledger (ADR 0055 + seam amendment); P2-S2 code screen is a live query that updates without reload"
seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory code ledger/clock; VM-manager, mesh-admission, takeover-stager, artifact-serving fakes"
acceptance:
  - given: the Fleet surface
    when: the operator chooses Add device
    then: both paths are offered and either issues a short, human-typeable, single-use, expiring, revocable enrollment code
  - given: Add device with nothing changed
    when: the operator mints
    then: the code carries intended role = helper and a 7-day expiry
  - given: a different hint (storage, gateway)
    when: the code is minted
    then: the hint drives only the device-end spec-gate floor and VM-mode guest sizing, never a role assignment
  - given: P2-S2
    when: the operator reads the install command
    then: it curls the community's own gateway `/get` with the code, no Matou-hosted URL (ADR 0054)
  - given: P2-S2 is open
    when: the device calls in
    then: the page updates without a reload and leaving loses nothing
  - given: P3-S1
    when: the operator shares the app
    then: the link/QR points at Matou's release channel; the community appears only after the code is entered
depends_on: [bootstrap:enroll-seam, shell:ui-kit-mount-slot-contract]
out_of_scope:
  - "story 3, 23 code revocation + error taxonomy — code-lifecycle-and-errors'"
  - "the standing enrollment-codes ledger UI and the resting Fleet list — shell's"
  - "role and service assignment — provisioning's (P4-S1 onward)"
needs_human_decision: []
## Parent Feature spec: #13 (device-add). ## What to build The operator's entry point for growing the fleet. From the Fleet surface the operator chooses **Add device** (P2-S1) and both doorways — the CLI path and the app path — are offered from one place, each issuing the same generated **enrollment code**: short, human-typeable, single-use, expiring (7 days by default), revocable. The operator picks an intended-role hint (default **helper**, ADR 0055) that drives only the device-end spec-gate floor and VM-mode guest sizing — never a role assignment, which happens later at provisioning (ADR 0015). The **code screen** (P2-S2) then shows the code, its expiry, a revoke affordance, and the one **install command** — a curl of the community's own gateway (`https://<community-domain>/get`) carrying the code, never a Matou-hosted URL (ADR 0054). For the app path the operator instead shares a download link or QR (P3-S1) pointing at Matou's release channel — the operator app is generic and the community only appears after the code is entered. The code screen is a live query: when the device calls in it updates itself without a reload, and leaving the page loses nothing. Minting is the `enroll` seam's Operator face `MintCode` verb (intended role + TTL) over the code ledger the seam hides — the additive operator-face amendment from the device-add grill (2026-07-23). ## Acceptance criteria - [ ] (story 1) Given the Fleet surface, When the operator chooses Add device, Then both the CLI path and the app path are offered and either one issues a generated enrollment code that is short, human-typeable, single-use, expiring, and revocable. - [ ] (story 2) Given Add device, When the operator mints without changing anything, Then the code carries intended role = helper and a 7-day expiry. - [ ] (story 2) Given a different hint (storage, gateway), When the code is minted, Then the hint selects only the device-end spec-gate floor and VM-mode guest sizing — the role is assigned later at provisioning, never here. - [ ] (story 4) Given P2-S2, When the operator reads the install command, Then it curls the community's own gateway (`https://<community-domain>/get`) with the code as its argument (ADR 0054) — no Matou-hosted URL. - [ ] (story 4) Given P2-S2 is open, When the device calls in, Then the page updates itself without a reload, and leaving the page loses nothing. - [ ] (story 7) Given P3-S1, When the operator shares the app, Then the link/QR points at Matou's release channel (ADR 0054) — the app is generic and the community appears only after the code is entered. ## Blocked by - #26 — the code ledger + MintCode verb - #29 — Fleet/Add-device mount surface ## Task manifest ```yaml task: device-add:mint-code implements_flow: p2-device-add-cli implements_edge: P2-S1→P2-S2, P3-S1→P3-S2 (mint/hand-off portion) wireframe: - docs/ux/wireframes/p2-device-add-cli/p2-s1-fleet-add-device.html - docs/ux/wireframes/p2-device-add-cli/p2-s2-code-and-install-command.html - docs/ux/wireframes/p3-device-add-app/p3-s1-via-the-app.html interface: "`enroll` seam Operator face — MintCode(intendedRole=helper, ttl=7d) → EnrollmentCode over the code ledger (ADR 0055 + seam amendment); P2-S2 code screen is a live query that updates without reload" seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory code ledger/clock; VM-manager, mesh-admission, takeover-stager, artifact-serving fakes" acceptance: - given: the Fleet surface when: the operator chooses Add device then: both paths are offered and either issues a short, human-typeable, single-use, expiring, revocable enrollment code - given: Add device with nothing changed when: the operator mints then: the code carries intended role = helper and a 7-day expiry - given: a different hint (storage, gateway) when: the code is minted then: the hint drives only the device-end spec-gate floor and VM-mode guest sizing, never a role assignment - given: P2-S2 when: the operator reads the install command then: it curls the community's own gateway `/get` with the code, no Matou-hosted URL (ADR 0054) - given: P2-S2 is open when: the device calls in then: the page updates without a reload and leaving loses nothing - given: P3-S1 when: the operator shares the app then: the link/QR points at Matou's release channel; the community appears only after the code is entered depends_on: [bootstrap:enroll-seam, shell:ui-kit-mount-slot-contract] out_of_scope: - "story 3, 23 code revocation + error taxonomy — code-lifecycle-and-errors'" - "the standing enrollment-codes ledger UI and the resting Fleet list — shell's" - "role and service assignment — provisioning's (P4-S1 onward)" needs_human_decision: [] ```
Author
Owner

Done in commit 4813eb0 (branch sandcastle/worker/20260725-101308-03a716).

The operator's Add-device entry point built over enroll's Operator face MintCode — the one minting path (ADR 0028/0055). DeviceAddSurface composes three screens in dashboard/src/components/device-add/, reading the seam through a narrow DeviceAddSource + FakeDeviceAddSource (in-memory code ledger + a controllable call-in signal). No Go change — MintCode's helper-default / 7-day-TTL / hint→spec-floor+VM-sizing / revocable semantics are the #26 enroll seam's, already tested there.

Acceptance:

  • story 1 — P2-S1 AddDeviceScreen offers both doorways (Via CLI + Via the app) from one place; each issues the same generated code (short, single-use, expiring, revocable).
  • story 2 — mint carries only the hint: no TTL (seam's 7-day default) and no role (provisioning's, ADR 0015), so "mint without changing anything" → helper + 7-day expiry; a gateway/storage hint travels as a hint alone.
  • story 4 — P2-S2 install command curls the community's OWN gateway /get with the code (ADR 0054), no Matou URL; the code screen is a live query — the call-in checkpoint flips without a reload and leaving loses nothing (the code stays durable in the ledger).
  • story 7 — P3-S1 ViaTheAppScreen download links + QR point at Matou's release channel (ADR 0054), never the community domain.

Evidence: dashboard/tests/unit/deviceAdd.test.ts (13 tests over FakeDeviceAddSource, one per acceptance clause). Full dashboard suite: 69 tests pass, vue-tsc + eslint clean. STATUS.md + docs/slices/device-add.yaml (mint-code status: done) updated in the same commit.

Out of scope (own slices): revocation lifecycle + error taxonomy (code-lifecycle-and-errors'), the standing enrollment-codes ledger UI (shell's #36), role/service assignment (provisioning's), and the device-end join orchestrator.

Done in commit `4813eb0` (branch `sandcastle/worker/20260725-101308-03a716`). The operator's Add-device entry point built over `enroll`'s Operator face `MintCode` — the one minting path (ADR 0028/0055). `DeviceAddSurface` composes three screens in `dashboard/src/components/device-add/`, reading the seam through a narrow `DeviceAddSource` + `FakeDeviceAddSource` (in-memory code ledger + a controllable call-in signal). No Go change — MintCode's helper-default / 7-day-TTL / hint→spec-floor+VM-sizing / revocable semantics are the #26 enroll seam's, already tested there. **Acceptance:** - **story 1** — P2-S1 `AddDeviceScreen` offers both doorways (Via CLI + Via the app) from one place; each issues the same generated code (short, single-use, expiring, revocable). - **story 2** — mint carries only the hint: no TTL (seam's 7-day default) and no role (provisioning's, ADR 0015), so "mint without changing anything" → helper + 7-day expiry; a gateway/storage hint travels as a hint alone. - **story 4** — P2-S2 install command curls the community's OWN gateway `/get` with the code (ADR 0054), no Matou URL; the code screen is a live query — the call-in checkpoint flips without a reload and leaving loses nothing (the code stays durable in the ledger). - **story 7** — P3-S1 `ViaTheAppScreen` download links + QR point at Matou's release channel (ADR 0054), never the community domain. **Evidence:** `dashboard/tests/unit/deviceAdd.test.ts` (13 tests over `FakeDeviceAddSource`, one per acceptance clause). Full dashboard suite: 69 tests pass, `vue-tsc` + eslint clean. STATUS.md + `docs/slices/device-add.yaml` (mint-code `status: done`) updated in the same commit. **Out of scope (own slices):** revocation lifecycle + error taxonomy (code-lifecycle-and-errors'), the standing enrollment-codes ledger UI (shell's #36), role/service assignment (provisioning's), and the device-end `join` orchestrator.
ben closed this issue 2026-07-25 10:28:39 +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#40
No description provided.