enroll: the mint wire drops the device's name, kind and location — MintCodeRequest and the handler carry only role and TTL #1431

Closed
opened 2026-09-12 15:03:32 +00:00 by ben · 2 comments
Owner

Parent

Control-panel UI pass (Ben, 2026-09-10 → 09-12, commit 078cd5b3 on founding-ui-two-colour-rail-ceremony, merged to main 2026-09-12). Filed from the end-of-pass review (#1399 sweep): every place the shipped UI shows or implies something the product does not do yet. Browser harness: cd dashboard && pnpm harness → http://localhost:5198/panel.html?scenario=steady&tab=<tab>.

Symptom

The Add device dialog captures name, kind and location (dashboard/src/components/device-add/AddDeviceScreen.vue:47-58, DeviceAddSurface.vue:159), deviceAdd.ts:58-68 carries them and dashboard/src/lib/api/enrollClient.ts:135 snakeizes them onto the wire — but:

  • openapi MintCodeRequest is {intended_role, ttl_days} only (packages/openapi-spec/openapi.yaml ~:7398-7408);
  • the handler struct and the call drop them (internal/controlapi/enroll.go:163-166, 210-221).

#1396 (closed, 878acba6) landed enroll.MintRequest.Name/Kind/Location, the ledger, fleetstate.Device.Location and FleetNode.location (openapi ~:6838) — the READ path is whole and painted (DeviceCard.vue:33, FleetDiagram.vue:74). Only the rent path writes a location (controlapi/enroll_rent.go:190-201). So every device added by code shows no location and a generated name.

Governing: ADR 0237 (device location), DDR 0202.

What to do

  • openapi: add name, kind (enum of the four form factors) and location to MintCodeRequest (optional, so old callers keep working); regenerate dashboard/src/lib/api/generated.ts.
  • controlapi/enroll.go: read the three fields into enroll.MintRequest and pass them through to the ledger — the same three assignments the rent path makes.
  • Go test: a mint with name/kind/location → the fleet read returns them on the node. Dashboard: enrollLive.test.ts gains the round trip (mint with a location → getFleet shows it).

Acceptance criteria

  • Given a mint from the dialog with name "Marae mini PC", kind mini-pc, location "Marae office", when the device joins, then the Fleet card and diagram show exactly those three.
  • Given a mint with none of the three, then the wire still validates and the device gets the current defaults.
## Parent Control-panel UI pass (Ben, 2026-09-10 → 09-12, commit `078cd5b3` on `founding-ui-two-colour-rail-ceremony`, merged to main 2026-09-12). Filed from the end-of-pass review (#1399 sweep): every place the shipped UI shows or implies something the product does not do yet. Browser harness: `cd dashboard && pnpm harness` → `http://localhost:5198/panel.html?scenario=steady&tab=<tab>`. ## Symptom The Add device dialog captures **name, kind and location** (`dashboard/src/components/device-add/AddDeviceScreen.vue:47-58`, `DeviceAddSurface.vue:159`), `deviceAdd.ts:58-68` carries them and `dashboard/src/lib/api/enrollClient.ts:135` snakeizes them onto the wire — but: - openapi `MintCodeRequest` is `{intended_role, ttl_days}` only (`packages/openapi-spec/openapi.yaml` ~:7398-7408); - the handler struct and the call drop them (`internal/controlapi/enroll.go:163-166, 210-221`). #1396 (closed, `878acba6`) landed `enroll.MintRequest.Name/Kind/Location`, the ledger, `fleetstate.Device.Location` and `FleetNode.location` (openapi ~:6838) — the READ path is whole and painted (`DeviceCard.vue:33`, `FleetDiagram.vue:74`). Only the rent path writes a location (`controlapi/enroll_rent.go:190-201`). So every device added by code shows no location and a generated name. Governing: ADR 0237 (device location), DDR 0202. ## What to do - openapi: add `name`, `kind` (enum of the four form factors) and `location` to `MintCodeRequest` (optional, so old callers keep working); regenerate `dashboard/src/lib/api/generated.ts`. - `controlapi/enroll.go`: read the three fields into `enroll.MintRequest` and pass them through to the ledger — the same three assignments the rent path makes. - Go test: a mint with name/kind/location → the fleet read returns them on the node. Dashboard: `enrollLive.test.ts` gains the round trip (mint with a location → `getFleet` shows it). ## Acceptance criteria - [ ] Given a mint from the dialog with name "Marae mini PC", kind mini-pc, location "Marae office", when the device joins, then the Fleet card and diagram show exactly those three. - [ ] Given a mint with none of the three, then the wire still validates and the device gets the current defaults.

swarm-claim host=bens-mac-04 run=22593
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=22593 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1431 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1431,
  "status": "success",
  "commits": [
    "fd855f53"
  ],
  "changed_files": [
    "STATUS.md",
    "dashboard/src/lib/api/generated.ts",
    "dashboard/tests/unit/enrollLive.test.ts",
    "internal/controlapi/enroll.go",
    "internal/controlapi/enroll_integration_test.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/controlapi/ ./internal/enroll/...",
      "exit_code": 0
    },
    {
      "command": "CI=true node_modules/.bin/vitest run tests/unit/enrollLive.test.ts",
      "exit_code": 0
    },
    {
      "command": "node_modules/.bin/vue-tsc --noEmit -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a mint from the dialog with name \"Marae mini PC\", kind mini-pc, location \"Marae office\", when the device joins, then the Fleet card and diagram show exactly those three": "Handler passes all three into enroll.MintRequest (internal/controlapi/enroll.go); the seam already projects them ledger→redeem→fleetstate→FleetNode.location (#1396). TestEnrollHandler_MintCarriesNameKindLocationOverRealLedger asserts the minted code + ledger read carry name/kind/location; enrollLive.test.ts asserts the dialog mint snakeizes all three onto the wire.",
    "Given a mint with none of the three, then the wire still validates and the device gets the current defaults": "openapi MintCodeRequest fields are optional; TestEnrollHandler_MintCarriesNameKindLocationOverRealLedger's bare-mint case asserts an active code with no fabricated name/kind/location (ADR 0100)."
  },
  "summary": "The mint wire (openapi MintCodeRequest + controlapi handler) now carries the Add-device dialog's name, kind and location through to the ledger, so a code-added device inherits them like the rent path already did.",
  "blockers": []
}
**close-report** for #1431 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1431, "status": "success", "commits": [ "fd855f53" ], "changed_files": [ "STATUS.md", "dashboard/src/lib/api/generated.ts", "dashboard/tests/unit/enrollLive.test.ts", "internal/controlapi/enroll.go", "internal/controlapi/enroll_integration_test.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/controlapi/ ./internal/enroll/...", "exit_code": 0 }, { "command": "CI=true node_modules/.bin/vitest run tests/unit/enrollLive.test.ts", "exit_code": 0 }, { "command": "node_modules/.bin/vue-tsc --noEmit -p tsconfig.json", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 } ], "criteria": { "Given a mint from the dialog with name \"Marae mini PC\", kind mini-pc, location \"Marae office\", when the device joins, then the Fleet card and diagram show exactly those three": "Handler passes all three into enroll.MintRequest (internal/controlapi/enroll.go); the seam already projects them ledger→redeem→fleetstate→FleetNode.location (#1396). TestEnrollHandler_MintCarriesNameKindLocationOverRealLedger asserts the minted code + ledger read carry name/kind/location; enrollLive.test.ts asserts the dialog mint snakeizes all three onto the wire.", "Given a mint with none of the three, then the wire still validates and the device gets the current defaults": "openapi MintCodeRequest fields are optional; TestEnrollHandler_MintCarriesNameKindLocationOverRealLedger's bare-mint case asserts an active code with no fabricated name/kind/location (ADR 0100)." }, "summary": "The mint wire (openapi MintCodeRequest + controlapi handler) now carries the Add-device dialog's name, kind and location through to the ledger, so a code-added device inherits them like the rent path already did.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1431
No description provided.