provisioning P4-S2: For this device lists only what a non-gateway device can take — the front door and the Gateway role never offered on a second device (DDR 0293) #2022

Closed
opened 2026-09-30 05:23:49 +00:00 by ben · 2 comments
Owner

What

Build DDR 0293 (docs/adr/0293-design-for-this-device-lists-only-what-this-device-can-take.md, Ben's ruling 2026-09-30). Contract: wireframe docs/ux/wireframes/p4-provisioning/p4-s2-select-role-and-services.html frame 1 as amended in the same commit.

On P4-S2 For this device for a device that is not the community's gateway:

  1. List only what the device can take now. Leave off every service that ForRole gates today by device fit (deviceReason), by role (!runsAs), as withheld (s.Withheld), or as not yet deployable (provisionCannotDeploy). Keep only the dependency-gated rows (depReason, #413/#1173); ticking the dependency on the same screen clears them. Recommended is unchanged.
  2. Never offer the front door (front-door, the gateway role's service) as a card or a recommendation, and never offer the Gateway role. Assess returns Helper only for a non-gateway device, and the selector renders one role as a fixed line (the gateway node's screen already does this).
  3. Empty state. When Available is empty, render one line: "Nothing else fits this device — see Browse catalogue for what it would need" (data-field="nothing-else-fits"), with the Browse catalogue tab link. P4-S1x (nothing at all) is unchanged.
  4. Pointer line. The "you decide; the system won't veto" line becomes "Only what this device can take is listed here — Browse catalogue shows everything else and what it would need." (data-field="browse-pointer", link data-action="tab-browse-catalogue").
  5. Server-side refusal. The selection/deploy routes refuse front-door, or role gateway, for a device whose fleet role is not gateway, and refuse any service ForRole would not list. The refusal is typed and happens before any config commit; #2018 showed that a bad attach breaks the whole community's eval.

Unchanged: the gateway node's own P4-S2 (DDR 0146 headroom rows) and Browse catalogue (P4-S2b), which keeps every service with its reason.

Where

  • internal/provision/assess.go: Assess (roles), ForRole non-gateway branch (drop un-takeable rows; rewrite the "never vetoes" doc comment to point at Browse catalogue), and the deploy/selection guard.
  • dashboard/src/components/provisioning/SelectRoleServicesScreen.vue: fixed role line when one role, empty-state line, pointer line.
  • Tests: internal/provision/assess_test.go (a helper device's Available holds no gated-by-fit/role/withheld/undeployable row and never front-door; roles = Helper only; dependency-gated row still listed; the gateway branch unchanged), the route refusal, and the dashboard unit test for the three copy states. Move any existing assertion of a grey reason row on a helper's For this device tab to Browse catalogue.

Why

Ben set up his laptop's VM guest (Helper, 1 core / ~950 MB / 10 GB) on Whakatōhea Demo. Nearly the whole catalogue came up grey, the Public gateway card included, and the role selector offered Gateway.

#2018 (member-device deploy), #2017, #2005.

## What Build **DDR 0293** (`docs/adr/0293-design-for-this-device-lists-only-what-this-device-can-take.md`, Ben's ruling 2026-09-30). Contract: wireframe `docs/ux/wireframes/p4-provisioning/p4-s2-select-role-and-services.html` frame 1 as amended in the same commit. On P4-S2 **For this device** for a device that is **not the community's gateway**: 1. **List only what the device can take now.** Leave off every service that `ForRole` gates today by device fit (`deviceReason`), by role (`!runsAs`), as withheld (`s.Withheld`), or as not yet deployable (`provisionCannotDeploy`). Keep only the dependency-gated rows (`depReason`, #413/#1173); ticking the dependency on the same screen clears them. Recommended is unchanged. 2. **Never offer the front door** (`front-door`, the gateway role's service) as a card or a recommendation, and never offer the *Gateway* role. `Assess` returns Helper only for a non-gateway device, and the selector renders one role as a fixed line (the gateway node's screen already does this). 3. **Empty state.** When Available is empty, render one line: *"Nothing else fits this device — see Browse catalogue for what it would need"* (`data-field="nothing-else-fits"`), with the Browse catalogue tab link. P4-S1x (nothing at all) is unchanged. 4. **Pointer line.** The "you decide; the system won't veto" line becomes *"Only what this device can take is listed here — Browse catalogue shows everything else and what it would need."* (`data-field="browse-pointer"`, link `data-action="tab-browse-catalogue"`). 5. **Server-side refusal.** The selection/deploy routes refuse `front-door`, or role `gateway`, for a device whose fleet role is not gateway, and refuse any service `ForRole` would not list. The refusal is typed and happens before any config commit; #2018 showed that a bad attach breaks the whole community's eval. **Unchanged:** the gateway node's own P4-S2 (DDR 0146 headroom rows) and Browse catalogue (P4-S2b), which keeps every service with its reason. ## Where - `internal/provision/assess.go`: `Assess` (roles), `ForRole` non-gateway branch (drop un-takeable rows; rewrite the "never vetoes" doc comment to point at Browse catalogue), and the deploy/selection guard. - `dashboard/src/components/provisioning/SelectRoleServicesScreen.vue`: fixed role line when one role, empty-state line, pointer line. - Tests: `internal/provision/assess_test.go` (a helper device's Available holds no gated-by-fit/role/withheld/undeployable row and never `front-door`; roles = Helper only; dependency-gated row still listed; the gateway branch unchanged), the route refusal, and the dashboard unit test for the three copy states. Move any existing assertion of a grey reason row on a helper's For this device tab to Browse catalogue. ## Why Ben set up his laptop's VM guest (Helper, 1 core / ~950 MB / 10 GB) on Whakatōhea Demo. Nearly the whole catalogue came up grey, the *Public gateway* card included, and the role selector offered *Gateway*. ## Related #2018 (member-device deploy), #2017, #2005.

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

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

close-report for #2022 — status success

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

envelope
{
  "issue": 2022,
  "status": "success",
  "commits": [
    "b2816bac7ef31d2bcd6ca81960a00ce087bb6fb8"
  ],
  "changed_files": [
    "STATUS.md",
    "dashboard/src/components/provisioning/SelectRoleServicesScreen.vue",
    "dashboard/src/components/provisioning/SetupSurface.vue",
    "dashboard/tests/unit/provisionForThisDevice.test.ts",
    "internal/provision/assess.go",
    "internal/provision/assess_test.go",
    "internal/provision/change.go",
    "internal/provision/deploy.go",
    "internal/provision/deploy_ddr0293_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/provision/... ./internal/controlapi/...",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/provision/...",
      "exit_code": 0
    },
    {
      "command": "npx vitest run (dashboard, 167 files)",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc -p tsconfig.json --noEmit (dashboard)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "List only what the device can take now (drop fit/role/withheld/undeployable; keep dep-gated)": "internal/provision/assess.go ForRole non-gateway branch drops deviceReason/!runsAs/withheld/provisionCannotDeploy rows, keeps depReason rows; TestAssess_ForThisDeviceListsOnlyWhatThisDeviceCanTake + TestForRole_DocsEditingWaitsForFilesUntilItIsPlaced",
    "Never offer the front door or the Gateway role; Assess returns Helper only for a non-gateway device; selector renders one role as a fixed line": "assess.go rolesFor (one role) + ForRole refuses gateway role for non-gateway device (ErrRoleNotOnThisDevice); SelectRoleServicesScreen.vue data-field=fixed-role when roles.length<=1; TestForRole_NonGatewayDeviceIsNeverOfferedTheGatewayRole, provisionForThisDevice.test.ts",
    "Empty state one line data-field=nothing-else-fits with Browse catalogue link": "SelectRoleServicesScreen.vue nothing-else-fits callout; provisionForThisDevice.test.ts 'reads one Browse-catalogue line when nothing else fits'",
    "Pointer line data-field=browse-pointer, link data-action=tab-browse-catalogue": "SelectRoleServicesScreen.vue browse-pointer callout + emit browse-catalogue forwarded via SetupSurface; provisionForThisDevice.test.ts 'points at Browse catalogue'",
    "Server-side refusal: typed, before any config commit, for front-door/gateway-role/un-takeable service": "internal/provision/deploy.go Deploy calls refuseUntakeable before StepCommitConfig; assess.go refuseUntakeable returns ErrRoleNotOnThisDevice / ErrServiceNotTakeable; deploy_ddr0293_test.go (three refusals assert len(rec.calls)==0)",
    "Unchanged: gateway node's P4-S2 (DDR 0146) and Browse catalogue (P4-S2b)": "gatewaySelection untouched; internal/controlapi catalogue seam untouched; go test ./internal/controlapi/... green; TestForRole_GatewayNodeGatesByHeadroomNotRole still green",
    "Move grey-reason assertions off a helper's For-this-device tab": "assess_test.go TestAssess_ForThisDeviceListsOnlyWhatThisDeviceCanTake / TestAssess_NoGapsRestingStateStillOffersEveryAvailableService / TestAssess_S1xIntoS2 now assert ABSENCE on For this device (Browse catalogue keeps the reason via internal/controlapi, unchanged)"
  },
  "summary": "P4-S2 For this device now lists only what a non-gateway device can take, never the front door or the Gateway role, backed by a typed pre-commit deploy refusal and the three-state screen copy.",
  "blockers": []
}
**close-report** for #2022 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 2022, "status": "success", "commits": [ "b2816bac7ef31d2bcd6ca81960a00ce087bb6fb8" ], "changed_files": [ "STATUS.md", "dashboard/src/components/provisioning/SelectRoleServicesScreen.vue", "dashboard/src/components/provisioning/SetupSurface.vue", "dashboard/tests/unit/provisionForThisDevice.test.ts", "internal/provision/assess.go", "internal/provision/assess_test.go", "internal/provision/change.go", "internal/provision/deploy.go", "internal/provision/deploy_ddr0293_test.go" ], "tests": [ { "command": "go test ./internal/provision/... ./internal/controlapi/...", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/provision/...", "exit_code": 0 }, { "command": "npx vitest run (dashboard, 167 files)", "exit_code": 0 }, { "command": "npx vue-tsc -p tsconfig.json --noEmit (dashboard)", "exit_code": 0 } ], "criteria": { "List only what the device can take now (drop fit/role/withheld/undeployable; keep dep-gated)": "internal/provision/assess.go ForRole non-gateway branch drops deviceReason/!runsAs/withheld/provisionCannotDeploy rows, keeps depReason rows; TestAssess_ForThisDeviceListsOnlyWhatThisDeviceCanTake + TestForRole_DocsEditingWaitsForFilesUntilItIsPlaced", "Never offer the front door or the Gateway role; Assess returns Helper only for a non-gateway device; selector renders one role as a fixed line": "assess.go rolesFor (one role) + ForRole refuses gateway role for non-gateway device (ErrRoleNotOnThisDevice); SelectRoleServicesScreen.vue data-field=fixed-role when roles.length<=1; TestForRole_NonGatewayDeviceIsNeverOfferedTheGatewayRole, provisionForThisDevice.test.ts", "Empty state one line data-field=nothing-else-fits with Browse catalogue link": "SelectRoleServicesScreen.vue nothing-else-fits callout; provisionForThisDevice.test.ts 'reads one Browse-catalogue line when nothing else fits'", "Pointer line data-field=browse-pointer, link data-action=tab-browse-catalogue": "SelectRoleServicesScreen.vue browse-pointer callout + emit browse-catalogue forwarded via SetupSurface; provisionForThisDevice.test.ts 'points at Browse catalogue'", "Server-side refusal: typed, before any config commit, for front-door/gateway-role/un-takeable service": "internal/provision/deploy.go Deploy calls refuseUntakeable before StepCommitConfig; assess.go refuseUntakeable returns ErrRoleNotOnThisDevice / ErrServiceNotTakeable; deploy_ddr0293_test.go (three refusals assert len(rec.calls)==0)", "Unchanged: gateway node's P4-S2 (DDR 0146) and Browse catalogue (P4-S2b)": "gatewaySelection untouched; internal/controlapi catalogue seam untouched; go test ./internal/controlapi/... green; TestForRole_GatewayNodeGatesByHeadroomNotRole still green", "Move grey-reason assertions off a helper's For-this-device tab": "assess_test.go TestAssess_ForThisDeviceListsOnlyWhatThisDeviceCanTake / TestAssess_NoGapsRestingStateStillOffersEveryAvailableService / TestAssess_S1xIntoS2 now assert ABSENCE on For this device (Browse catalogue keeps the reason via internal/controlapi, unchanged)" }, "summary": "P4-S2 For this device now lists only what a non-gateway device can take, never the front door or the Gateway role, backed by a typed pre-commit deploy refusal and the three-state screen copy.", "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#2022
No description provided.