provisioning: provision-assess-recommend — assess a device and recommend the services that fill gaps #41

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

Parent

Feature spec: #17 (provisioning).

What to build

The first two screens of the P4 setup journey, driven by the provision
orchestrator seam (ADR 0058) over the connection device-add already established.
When an operator opens setup on a connected — not set up device, the control
plane assesses what the machine offers — its resources (a VM-mode device counts
its allocated resources), its network and public reachability, and its uptime
pattern — against what the community needs right now, expressed as named HA and
backup gaps computed from live fleet state (P4-S1). It then recommends a role and
services that fill those gaps first: on the select screen (P4-S2) the recommended
services are pre-selected and each one names the gap it closes, while services the
device cannot run appear under Available, gated, with the reason stated in the
device's own numbers ("needs 8 GB — this device has 4", "needs a public
address"). The operator may accept the recommendation or adjust it freely — the
system advises, it never vetoes (ADR 0015) — and may assign the device a fleet
role, which re-filters the available services.

Two resting states must be first-class, never dead ends. When assess finds every
catalogue service out of reach for the device, P4-S1x is shown instead of P4-S2,
naming the device unusable in its own numbers and always offering a real next
step: the lowest-floor job it can still do (an extra backup copy, never the sole
copy of anything) or removal from the fleet. When the community already has no HA
or backup gaps left, P4-S2 replaces the recommended block with a plain "your
community has no gaps right now — nothing needs filling", still allowing the
operator to add any available service.

Notes: this slice builds the shared fleet-state reader both seams — and backups'
coverage map — read from (specs, reachability, uptime, roles, quorum membership,
dataset homes, coverage/HA gaps). Multi-arch is deferred (x86_64 only at v1). The
spec-gate floor's coupling to device-add (ADR 0064) is via the catalogue's
per-service minima — a single source, so the available-list and device-add's gate
cannot disagree; there is no build edge for it. Flow:
docs/ux/flows/p4-provisioning.mermaid.

Acceptance criteria

  • (story 1) Given a connected — not set up device, when the operator opens its setup, then P4-S1 shows what the device offers — resources (a VM-mode device counts its allocated resources), network and public reachability, and uptime pattern — and what the community needs, as named HA and backup gaps.
  • (story 1) Given the fleet's current state, when assess runs, then the gaps shown are the community's gaps now (e.g. "Files & documents live on one device only", "Chat has no backup yet"), computed from live fleet state, not a fixed list.
  • (story 2) Given the assessment, when P4-S2 loads, then the recommended services are pre-selected and each names the gap it closes ("closes the single-copy gap", "closes the no-backup gap").
  • (story 2) Given a service the device cannot run, when it appears under Available, then it is shown gated with the reason in the device's own numbers ("needs 8 GB — this device has 4", "needs a public address").
  • (story 3) Given assess finds every catalogue service out of reach for the device, when setup proceeds, then P4-S1x is shown instead of P4-S2, naming the device unusable in its own numbers with the reason each service is out of reach.
  • (story 3) Given P4-S1x, when the operator decides, then there is always a real next step: take the lowest-floor job the device can still do (an extra backup copy, never the sole copy of anything), or remove the device from the fleet.
  • (story 4) Given the community has no HA or backup gaps left, when P4-S2 loads, then the recommended block is replaced by a plain "your community has no gaps right now — nothing needs filling", and any available service can still be added.
  • (story 5) Given recommended and available services, when the operator adds or removes any selection, then the system never blocks the change (advice, never veto — ADR 0015); it only explains gated items.
  • (story 6) Given the role selector, when the operator picks a role, then the available services update to those the role and the device's specs/access permit.

Blocked by

  • #25 — reads fleet state via clan
  • #29 — mounts into shell's frame

Task manifest

task: provisioning:provision-assess-recommend
implements_flow: p4-provisioning
implements_edge: S1→S2, S1→S1x, S1x→S2, S1x→REM
wireframe:
  - docs/ux/wireframes/p4-provisioning/p4-s1-assess.html
  - docs/ux/wireframes/p4-provisioning/p4-s1x-assess-nothing-available.html
  - docs/ux/wireframes/p4-provisioning/p4-s2-select-role-and-services.html
interface: "`provision` orchestrator seam — assess(device) reads the shared fleet-state reader (specs, reachability, uptime, roles, quorum, dataset homes, coverage/HA gaps) and the catalogue's per-service minima; returns recommended + gated-available sets, the nothing-available verdict, or the no-gaps resting state"
seam: "`provision` orchestrator seam tests (control plane, Go) — fake fleet-state reader (gaps computed from injected fleet state), fake clan adapter, real brandkit; drives assess/recommend, both empty states, and the gated-reason strings"
acceptance:
  - given: a `connected — not set up` device
    when: the operator opens its setup
    then: P4-S1 shows the device's resources (allocated, for VM mode), network and public reachability, and uptime pattern, and the community's needs as named HA and backup gaps computed from live fleet state
  - given: the assessment
    when: P4-S2 loads
    then: recommended services are pre-selected each naming the gap it closes, and services the device cannot run appear gated with the reason in the device's own numbers
  - given: assess finds every catalogue service out of reach
    when: setup proceeds
    then: P4-S1x is shown instead of P4-S2, naming the device unusable in its own numbers, always offering the lowest-floor job (never the sole copy) or removal
  - given: the community has no HA or backup gaps left
    when: P4-S2 loads
    then: the recommended block becomes a plain no-gaps message and any available service can still be added
  - given: recommended and available services
    when: the operator adds, removes, or picks a role
    then: the change is never blocked (advice, never veto — ADR 0015); gated items are explained and available services re-filter to the role
depends_on: [bootstrap:clan-seam, shell:ui-kit-mount-slot-contract]
out_of_scope:
  - "story 7–9 review impact and the destructive confirm — provision-review-impact's"
  - "catalogue growth: v1 ships a fixed catalogue (ticket #8)"
  - "device-add's spec gate itself — this slice consumes the shared catalogue minima (ADR 0064), it does not implement the pairing-time gate"
needs_human_decision: []
## Parent Feature spec: #17 (provisioning). ## What to build The first two screens of the P4 setup journey, driven by the `provision` orchestrator seam (ADR 0058) over the connection device-add already established. When an operator opens setup on a `connected — not set up` device, the control plane assesses what the machine offers — its resources (a VM-mode device counts its *allocated* resources), its network and public reachability, and its uptime pattern — against what the community needs *right now*, expressed as named HA and backup gaps computed from live fleet state (P4-S1). It then recommends a role and services that fill those gaps first: on the select screen (P4-S2) the recommended services are pre-selected and each one names the gap it closes, while services the device cannot run appear under Available, gated, with the reason stated in the device's own numbers ("needs 8 GB — this device has 4", "needs a public address"). The operator may accept the recommendation or adjust it freely — the system advises, it never vetoes (ADR 0015) — and may assign the device a fleet role, which re-filters the available services. Two resting states must be first-class, never dead ends. When assess finds *every* catalogue service out of reach for the device, P4-S1x is shown instead of P4-S2, naming the device unusable in its own numbers and always offering a real next step: the lowest-floor job it can still do (an extra backup copy, never the sole copy of anything) or removal from the fleet. When the community already has no HA or backup gaps left, P4-S2 replaces the recommended block with a plain "your community has no gaps right now — nothing needs filling", still allowing the operator to add any available service. Notes: this slice builds the shared fleet-state reader both seams — and backups' coverage map — read from (specs, reachability, uptime, roles, quorum membership, dataset homes, coverage/HA gaps). Multi-arch is deferred (x86_64 only at v1). The spec-gate floor's coupling to device-add (ADR 0064) is via the catalogue's per-service minima — a single source, so the available-list and device-add's gate cannot disagree; there is no build edge for it. Flow: `docs/ux/flows/p4-provisioning.mermaid`. ## Acceptance criteria - [ ] (story 1) Given a `connected — not set up` device, when the operator opens its setup, then P4-S1 shows what the device offers — resources (a VM-mode device counts its *allocated* resources), network and public reachability, and uptime pattern — and what the community needs, as named HA and backup gaps. - [ ] (story 1) Given the fleet's current state, when assess runs, then the gaps shown are the community's gaps *now* (e.g. "Files & documents live on one device only", "Chat has no backup yet"), computed from live fleet state, not a fixed list. - [ ] (story 2) Given the assessment, when P4-S2 loads, then the recommended services are pre-selected and each names the gap it closes ("closes the single-copy gap", "closes the no-backup gap"). - [ ] (story 2) Given a service the device cannot run, when it appears under Available, then it is shown gated with the reason in the device's own numbers ("needs 8 GB — this device has 4", "needs a public address"). - [ ] (story 3) Given assess finds every catalogue service out of reach for the device, when setup proceeds, then P4-S1x is shown instead of P4-S2, naming the device unusable in its own numbers with the reason each service is out of reach. - [ ] (story 3) Given P4-S1x, when the operator decides, then there is always a real next step: take the lowest-floor job the device can still do (an extra backup copy, never the sole copy of anything), or remove the device from the fleet. - [ ] (story 4) Given the community has no HA or backup gaps left, when P4-S2 loads, then the recommended block is replaced by a plain "your community has no gaps right now — nothing needs filling", and any available service can still be added. - [ ] (story 5) Given recommended and available services, when the operator adds or removes any selection, then the system never blocks the change (advice, never veto — ADR 0015); it only explains gated items. - [ ] (story 6) Given the role selector, when the operator picks a role, then the available services update to those the role and the device's specs/access permit. ## Blocked by - #25 — reads fleet state via clan - #29 — mounts into shell's frame ## Task manifest ```yaml task: provisioning:provision-assess-recommend implements_flow: p4-provisioning implements_edge: S1→S2, S1→S1x, S1x→S2, S1x→REM wireframe: - docs/ux/wireframes/p4-provisioning/p4-s1-assess.html - docs/ux/wireframes/p4-provisioning/p4-s1x-assess-nothing-available.html - docs/ux/wireframes/p4-provisioning/p4-s2-select-role-and-services.html interface: "`provision` orchestrator seam — assess(device) reads the shared fleet-state reader (specs, reachability, uptime, roles, quorum, dataset homes, coverage/HA gaps) and the catalogue's per-service minima; returns recommended + gated-available sets, the nothing-available verdict, or the no-gaps resting state" seam: "`provision` orchestrator seam tests (control plane, Go) — fake fleet-state reader (gaps computed from injected fleet state), fake clan adapter, real brandkit; drives assess/recommend, both empty states, and the gated-reason strings" acceptance: - given: a `connected — not set up` device when: the operator opens its setup then: P4-S1 shows the device's resources (allocated, for VM mode), network and public reachability, and uptime pattern, and the community's needs as named HA and backup gaps computed from live fleet state - given: the assessment when: P4-S2 loads then: recommended services are pre-selected each naming the gap it closes, and services the device cannot run appear gated with the reason in the device's own numbers - given: assess finds every catalogue service out of reach when: setup proceeds then: P4-S1x is shown instead of P4-S2, naming the device unusable in its own numbers, always offering the lowest-floor job (never the sole copy) or removal - given: the community has no HA or backup gaps left when: P4-S2 loads then: the recommended block becomes a plain no-gaps message and any available service can still be added - given: recommended and available services when: the operator adds, removes, or picks a role then: the change is never blocked (advice, never veto — ADR 0015); gated items are explained and available services re-filter to the role depends_on: [bootstrap:clan-seam, shell:ui-kit-mount-slot-contract] out_of_scope: - "story 7–9 review impact and the destructive confirm — provision-review-impact's" - "catalogue growth: v1 ships a fixed catalogue (ticket #8)" - "device-add's spec gate itself — this slice consumes the shared catalogue minima (ADR 0064), it does not implement the pairing-time gate" needs_human_decision: [] ```
Author
Owner

Done in commit f1fd88a on main (sandcastle: provisioning:provision-assess-recommend #41).

What was built

  • internal/fleetstate — the shared fleet-state reader the manifest notes this slice builds: specs (a VM-mode device counts its allocated resources), reachability, uptime pattern, roles/quorum membership, dataset homes and verified coverage, with the community's HA and backup gaps computed from live state at read time (ComputeGaps: one live home = single-copy gap, zero verified copies = no-backup gap). The Fake runs the same rule over injected state — the seam test moves the fleet and watches the gaps move (story 1's "computed from live fleet state, not a fixed list").
  • internal/provision — the ADR 0058 orchestrator (control plane only), assess/recommend face: Assess(device) returns what the device offers, the named gaps, the routing verdict, and the S2 selection; ForRole re-filters for the role selector (story 6). Recommended rows are pre-selected and each names the gap it closes; gated rows carry the reason in the device's own numbers ("needs 8 GB — this device has 4", "needs a public address — this device has none", "needs a device that stays on — this one comes and goes").
  • Catalogue: grew access facts only (NeedsPublic/AlwaysOn) plus LowestFloorJob(); floors untouched, so ADR 0064's single source still holds and the available-list and device-add's spec gate cannot disagree (no build edge, as the manifest notes).
  • Both resting states, never dead ends: P4-S1x lists every service with its reason and always offers the extra-backup-copy job (never the sole copy of anything; absent only when even it cannot fit — removal remains) or removal; taking the offer lands on S2 with the job ticked (S1x→S2). No-gaps replaces the recommended block with the calm "your community has no gaps right now" and everything stays addable (story 4).
  • Advice, never veto (ADR 0015, story 5): every row stays toggleable — gated items are explained, never blocked; the UI computes nothing.
  • Screens shipped per the wireframe contract: AssessScreen (P4-S1), AssessNothingAvailableScreen (P4-S1x), SelectRoleServicesScreen (P4-S2), composed by SetupSurface under the Fleet mount (DF → P4-S1), backed by dashboard/src/lib/provision.ts mirroring the seam's JSON shapes. Review impact (S2→S3) and removal (S1x→REM) emit onward to provision-review-impact's slice per out_of_scope.

Evidence: 11 Go seam tests in internal/provision/assess_test.go (fake fleet-state reader, fake clan adapter, real brandkit — the manifest's harness) and 14 Vue tests in dashboard/tests/unit/provisionSetup.test.ts. Full Go suite + vet, all TS suites, vue-tsc builds and eslint green. STATUS.md updated in the same commit.

Done in commit f1fd88a on main (`sandcastle: provisioning:provision-assess-recommend #41`). **What was built** - **`internal/fleetstate`** — the shared fleet-state reader the manifest notes this slice builds: specs (a VM-mode device counts its *allocated* resources), reachability, uptime pattern, roles/quorum membership, dataset homes and verified coverage, with the community's HA and backup gaps computed from live state at read time (`ComputeGaps`: one live home = single-copy gap, zero verified copies = no-backup gap). The `Fake` runs the same rule over injected state — the seam test moves the fleet and watches the gaps move (story 1's "computed from live fleet state, not a fixed list"). - **`internal/provision`** — the ADR 0058 orchestrator (control plane only), assess/recommend face: `Assess(device)` returns what the device offers, the named gaps, the routing verdict, and the S2 selection; `ForRole` re-filters for the role selector (story 6). Recommended rows are pre-selected and each names the gap it closes; gated rows carry the reason in the device's own numbers ("needs 8 GB — this device has 4", "needs a public address — this device has none", "needs a device that stays on — this one comes and goes"). - **Catalogue**: grew access facts only (`NeedsPublic`/`AlwaysOn`) plus `LowestFloorJob()`; floors untouched, so ADR 0064's single source still holds and the available-list and device-add's spec gate cannot disagree (no build edge, as the manifest notes). - **Both resting states, never dead ends**: P4-S1x lists every service with its reason and always offers the extra-backup-copy job (never the sole copy of anything; absent only when even it cannot fit — removal remains) or removal; taking the offer lands on S2 with the job ticked (S1x→S2). No-gaps replaces the recommended block with the calm "your community has no gaps right now" and everything stays addable (story 4). - **Advice, never veto** (ADR 0015, story 5): every row stays toggleable — gated items are explained, never blocked; the UI computes nothing. - **Screens shipped** per the wireframe contract: `AssessScreen` (P4-S1), `AssessNothingAvailableScreen` (P4-S1x), `SelectRoleServicesScreen` (P4-S2), composed by `SetupSurface` under the Fleet mount (DF → P4-S1), backed by `dashboard/src/lib/provision.ts` mirroring the seam's JSON shapes. Review impact (S2→S3) and removal (S1x→REM) emit onward to provision-review-impact's slice per out_of_scope. **Evidence**: 11 Go seam tests in `internal/provision/assess_test.go` (fake fleet-state reader, fake clan adapter, real brandkit — the manifest's harness) and 14 Vue tests in `dashboard/tests/unit/provisionSetup.test.ts`. Full Go suite + vet, all TS suites, vue-tsc builds and eslint green. STATUS.md updated in the same commit.
ben closed this issue 2026-07-25 17:08:35 +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#41
No description provided.