catalogue: install-to-a-chosen-device is harness-only — deviceFitFor / installService need a production implementation over the per-device provisioning door #1435

Closed
opened 2026-09-12 15:03:46 +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>.

Gap

The Services tab's Install picker (dashboard/src/components/catalogue/SelectDeviceDialog.vue, ~700 lines, from CatalogueSurface.vue) chooses WHICH device a service installs on, showing each device's fit (resources, headroom, what the install adds). It rides two OPTIONAL seam ops — AssessSource.deviceFitFor and installService (dashboard/src/lib/provision.ts:311, 328) — implemented only by dashboard/tests/fakes/provision.ts:323, 348 (whose DEFAULT_DEVICE_FIT invents the numbers). provisionClient.ts has neither, so live the dialog never opens: CatalogueSurface.vue:252, 292 fall back to routing into the setup journey.

The door already exists: POST /provision/devices/{device_id}/selection | impact | deploy (openapi ~:2372-2432) takes a device id — placement is client-chosen today. What is missing is the FIT read and the one-service install wrapper.

Governing: ADR 0015 (advice never veto), ADR 0060 (Review impact classifies destructiveness), DDR 0155 §3, DDR 0220/0225.

What to do

  • Go: GET /provision/devices/{id}/fit?service=<slug> returning DeviceFit (the assessment's headroom for that device, the service's floor, what the install adds) from the same assess code the setup journey uses — one rule, never a second estimate.
  • Go: POST /provision/devices/{id}/install = selection + impact + deploy for ONE service, returning the deploy handle the existing progress screen watches.
  • Dashboard: HttpProvisionClient.deviceFitFor / installService; the dialog then opens live. Keep the fallback route for a seam that lacks the ops (older gateway).
  • Tests: provisionLive.test.ts gains the fit read + a one-service install on a two-device fleet.

Acceptance criteria

  • Given two devices, when Install is pressed on a not-yet-running service, then the picker lists both with fit numbers from the seam and marks the one below the floor as unavailable (with what is missing named).
  • Given a chosen device, when Install is confirmed, then the deploy progress screen shows and the catalogue card reads running on that device afterwards.
## 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>`. ## Gap The Services tab's Install picker (`dashboard/src/components/catalogue/SelectDeviceDialog.vue`, ~700 lines, from `CatalogueSurface.vue`) chooses WHICH device a service installs on, showing each device's fit (resources, headroom, what the install adds). It rides two OPTIONAL seam ops — `AssessSource.deviceFitFor` and `installService` (`dashboard/src/lib/provision.ts:311, 328`) — implemented only by `dashboard/tests/fakes/provision.ts:323, 348` (whose `DEFAULT_DEVICE_FIT` invents the numbers). `provisionClient.ts` has neither, so live the dialog never opens: `CatalogueSurface.vue:252, 292` fall back to routing into the setup journey. The door already exists: `POST /provision/devices/{device_id}/selection | impact | deploy` (openapi ~:2372-2432) takes a device id — placement is client-chosen today. What is missing is the FIT read and the one-service install wrapper. Governing: ADR 0015 (advice never veto), ADR 0060 (Review impact classifies destructiveness), DDR 0155 §3, DDR 0220/0225. ## What to do - Go: `GET /provision/devices/{id}/fit?service=<slug>` returning `DeviceFit` (the assessment's headroom for that device, the service's floor, what the install adds) from the same assess code the setup journey uses — one rule, never a second estimate. - Go: `POST /provision/devices/{id}/install` = selection + impact + deploy for ONE service, returning the deploy handle the existing progress screen watches. - Dashboard: `HttpProvisionClient.deviceFitFor` / `installService`; the dialog then opens live. Keep the fallback route for a seam that lacks the ops (older gateway). - Tests: `provisionLive.test.ts` gains the fit read + a one-service install on a two-device fleet. ## Acceptance criteria - [ ] Given two devices, when Install is pressed on a not-yet-running service, then the picker lists both with fit numbers from the seam and marks the one below the floor as unavailable (with what is missing named). - [ ] Given a chosen device, when Install is confirmed, then the deploy progress screen shows and the catalogue card reads running on that device afterwards.

swarm-claim host=matou-dev-server-01 run=22588
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=22588 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1435 — status success

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

envelope
{
  "issue": 1435,
  "status": "success",
  "commits": [
    "3ed15ee8"
  ],
  "changed_files": [
    "STATUS.md",
    "dashboard/src/lib/api/generated.ts",
    "dashboard/src/lib/api/provisionClient.ts",
    "dashboard/tests/unit/provisionLive.test.ts",
    "internal/controlapi/provision.go",
    "internal/controlapi/provision_integration_test.go",
    "internal/provision/fit.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/controlapi/... ./internal/provision/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go build ./...",
      "exit_code": 0
    },
    {
      "command": "CI=true npx vitest run tests/unit/provisionLive.test.ts (dashboard)",
      "exit_code": 0
    },
    {
      "command": "CI=true npx vitest run tests/ (dashboard, full suite)",
      "exit_code": 0
    },
    {
      "command": "CI=true npx vue-tsc -p tsconfig.json --noEmit (dashboard)",
      "exit_code": 0
    },
    {
      "command": "CI=true npx eslint src/lib/api/provisionClient.ts tests/unit/provisionLive.test.ts",
      "exit_code": 0
    },
    {
      "command": "node scripts/generate-client.mjs --check (openapi-spec)",
      "exit_code": 0
    },
    {
      "command": "CI=true npx vitest run (openapi-spec)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given two devices, when Install is pressed on a not-yet-running service, then the picker lists both with fit numbers from the seam and marks the one below the floor as unavailable (with what is missing named)": "HttpProvisionClient.deviceFitFor (dashboard/src/lib/api/provisionClient.ts) reads the one /fleet aggregate for the rows and joins the seam's per-device fit (GET /provision/devices/{id}/fit/{service}) onto each; provisionLive.test.ts 'lists every device with the seam fit numbers and marks the one below the floor unavailable (AC1)' proves both devices listed with fit numbers, the below-floor one fits=false with reason 'needs 8 GB — this device has 4'; Go TestProvisionHandler_DeviceFitReadsTheSameAssessRule proves the verdict is the same assess gate (meetings fits rimu, below-floor on totara with the reason named).",
    "Given a chosen device, when Install is confirmed, then the deploy progress screen shows and the catalogue card reads running on that device afterwards": "HttpProvisionClient.installService POSTs POST /provision/devices/{id}/install then polls the same device-scoped deploy snapshot, projecting each DeployRun frame to InstallProgress (running words + done with the service url); provisionLive.test.ts 'installs one service on a chosen device and watches it to running with its door (AC2)' asserts a running frame maps to running, the settled install is done on that device (percent 100, words contain 'Totara') with url https://meetings.example.nz; Go TestProvisionHandler_InstallServicePlacesOneServiceLive proves the install settles active with the placed service's door, added beside the existing files service (the card then reads running on that device via the existing catalogue re-read)."
  },
  "summary": "Built the production control-plane door (fit read + one-service install) behind the catalogue's SELECT DEVICE picker, so HttpProvisionClient implements deviceFitFor/installService and the dialog opens live instead of falling back to the setup journey.",
  "blockers": []
}
**close-report** for #1435 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1435, "status": "success", "commits": [ "3ed15ee8" ], "changed_files": [ "STATUS.md", "dashboard/src/lib/api/generated.ts", "dashboard/src/lib/api/provisionClient.ts", "dashboard/tests/unit/provisionLive.test.ts", "internal/controlapi/provision.go", "internal/controlapi/provision_integration_test.go", "internal/provision/fit.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/controlapi/... ./internal/provision/...", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go build ./...", "exit_code": 0 }, { "command": "CI=true npx vitest run tests/unit/provisionLive.test.ts (dashboard)", "exit_code": 0 }, { "command": "CI=true npx vitest run tests/ (dashboard, full suite)", "exit_code": 0 }, { "command": "CI=true npx vue-tsc -p tsconfig.json --noEmit (dashboard)", "exit_code": 0 }, { "command": "CI=true npx eslint src/lib/api/provisionClient.ts tests/unit/provisionLive.test.ts", "exit_code": 0 }, { "command": "node scripts/generate-client.mjs --check (openapi-spec)", "exit_code": 0 }, { "command": "CI=true npx vitest run (openapi-spec)", "exit_code": 0 } ], "criteria": { "Given two devices, when Install is pressed on a not-yet-running service, then the picker lists both with fit numbers from the seam and marks the one below the floor as unavailable (with what is missing named)": "HttpProvisionClient.deviceFitFor (dashboard/src/lib/api/provisionClient.ts) reads the one /fleet aggregate for the rows and joins the seam's per-device fit (GET /provision/devices/{id}/fit/{service}) onto each; provisionLive.test.ts 'lists every device with the seam fit numbers and marks the one below the floor unavailable (AC1)' proves both devices listed with fit numbers, the below-floor one fits=false with reason 'needs 8 GB — this device has 4'; Go TestProvisionHandler_DeviceFitReadsTheSameAssessRule proves the verdict is the same assess gate (meetings fits rimu, below-floor on totara with the reason named).", "Given a chosen device, when Install is confirmed, then the deploy progress screen shows and the catalogue card reads running on that device afterwards": "HttpProvisionClient.installService POSTs POST /provision/devices/{id}/install then polls the same device-scoped deploy snapshot, projecting each DeployRun frame to InstallProgress (running words + done with the service url); provisionLive.test.ts 'installs one service on a chosen device and watches it to running with its door (AC2)' asserts a running frame maps to running, the settled install is done on that device (percent 100, words contain 'Totara') with url https://meetings.example.nz; Go TestProvisionHandler_InstallServicePlacesOneServiceLive proves the install settles active with the placed service's door, added beside the existing files service (the card then reads running on that device via the existing catalogue re-read)." }, "summary": "Built the production control-plane door (fit read + one-service install) behind the catalogue's SELECT DEVICE picker, so HttpProvisionClient implements deviceFitFor/installService and the dialog opens live instead of falling back to the setup journey.", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1435
No description provided.