device-add: spec-gate-and-virt — Spec gate, virt remedy, and the x86_64-only floor #58

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

Parent

Feature spec: #13 (device-add).

What to build

The honest rejections that keep an owner from being stranded mid-deploy. When VM mode is chosen but virtualisation is unavailable, the check fails into a per-OS self-loop (P3-S3) that gives the fix — enable VT-x/AMD-V in firmware, or enable the Windows Hypervisor Platform feature on Windows — or the option to use another machine, and the code survives so the owner can retry.

When the probe fails the hint's spec gate, pairing is rejected with Need vs Got and a remedy; the connection request stays Redeemed (not a state, a typed error — there is no queryable rejection history) and the code survives. A Mac that fails the VM arithmetic gets copy stating plainly that a Mac has no full-install fallback and this Mac cannot contribute (ADR 0030). The hint's floor equals the floor of the cheapest service that role can actually run (ADR 0064) — read from the catalogue's per-service minima, never a second hand-maintained list — so any device that passes this gate can be given at least one real job by provisioning; where fleet state has moved on since pairing, provisioning's P4-S1x names why in the device's own numbers and always offers a next step.

Notes: per the slice-map ruling (2026-07-25), multi-arch fleet support is deferred — v1 admits x86_64 only, and an aarch64 device (e.g. an Apple Silicon VM-mode helper) is steered away here at the spec gate with honest copy, not silently rejected. Rejections hold on P2-S3 / P3-S3L as well as P3-S3.

Acceptance criteria

  • (story 11) Given VM mode is chosen and virtualisation is unavailable, When the check fails, Then the owner gets the per-OS remedy (enable VT-x/AMD-V in firmware; enable the Windows Hypervisor Platform feature on Windows) or the option to use another machine — and the code survives.
  • (story 16) Given the probe fails the hint's floor, When pairing is rejected, Then the owner sees Need vs Got and a remedy, the request stays Redeemed, and the code survives.
  • (story 16) Given a Mac that fails the VM arithmetic, When the gate fails, Then the copy says plainly a Mac has no full-install fallback and this Mac cannot contribute (ADR 0030).
  • (story 16) Given the hint's floor, When it is evaluated, Then it equals the floor of the cheapest service that role can actually run (ADR 0064, catalogue per-service minima) — a passing device can be given at least one real job; where fleet state has moved on, provisioning's P4-S1x names why in the device's numbers and offers a next step.
  • (slice-map ruling 2026-07-25) Given an aarch64 device, When it reaches the spec gate, Then it is steered away with honest copy (x86_64 only at v1; multi-arch deferred) — not silently rejected.

Blocked by

  • #49 — the CLI pairing path the gate holds on
  • #50 — the app pairing/virt path the gate holds on

Task manifest

task: device-add:spec-gate-and-virt
implements_flow: p3-device-add-app
implements_edge: P3-S3→P3-S3 (virt self-loop), spec-gate rejection holding on P2-S3 / P3-S3L
wireframe:
  - docs/ux/wireframes/p3-device-add-app/p3-s3-this-computer.html
  - docs/ux/wireframes/p3-device-add-app/p3-s3l-linux-install-mode.html
  - docs/ux/wireframes/p2-device-add-cli/p2-s3-install-mode-consent.html
interface: "spec-gate evaluation against the hint's floor (ADR 0030/0064, catalogue per-service minima) + virt-availability check with per-OS remedy self-loop + arch check (x86_64 only); rejections are typed errors that keep the request Redeemed"
seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory ledger/clock; fake VM-manager reports virt-unavailable / undersized; probe fed x86_64 and aarch64 facts"
acceptance:
  - given: VM mode chosen and virtualisation unavailable
    when: the check fails
    then: per-OS remedy or use-another-machine offered, and the code survives
  - given: the probe fails the hint's floor
    when: pairing is rejected
    then: Need vs Got + remedy shown, request stays Redeemed, code survives
  - given: a Mac that fails the VM arithmetic
    when: the gate fails
    then: copy states a Mac has no full-install fallback and cannot contribute (ADR 0030)
  - given: the hint's floor
    when: evaluated
    then: it equals the cheapest runnable service's floor (ADR 0064, catalogue minima)
  - given: an aarch64 device
    when: it reaches the spec gate
    then: steered away with honest copy (x86_64 only at v1) — not silently rejected
depends_on: [cli-join-happy, app-join-happy]
out_of_scope:
  - "story 14 full-install takeover-ready residue — full-install-takeover-ready's"
  - "provisioning's P4-S1x nothing-available screen — provisioning's"
  - "multi-arch v1 support (aarch64 admission, per-arch service builds/cache) — deferred, map-level"
needs_human_decision: []
## Parent Feature spec: #13 (device-add). ## What to build The honest rejections that keep an owner from being stranded mid-deploy. When VM mode is chosen but **virtualisation is unavailable**, the check fails into a per-OS self-loop (P3-S3) that gives the fix — enable VT-x/AMD-V in firmware, or enable the Windows Hypervisor Platform feature on Windows — or the option to use another machine, and the **code survives** so the owner can retry. When the probe fails the hint's **spec gate**, pairing is rejected with **Need vs Got and a remedy**; the connection request stays **Redeemed** (not a state, a typed error — there is no queryable rejection history) and the code survives. A Mac that fails the VM arithmetic gets copy stating plainly that a Mac has no full-install fallback and this Mac cannot contribute (ADR 0030). The hint's floor equals the floor of the **cheapest service that role can actually run** (ADR 0064) — read from the catalogue's per-service minima, never a second hand-maintained list — so any device that passes this gate can be given at least one real job by provisioning; where fleet state has moved on since pairing, provisioning's P4-S1x names why in the device's own numbers and always offers a next step. Notes: per the slice-map ruling (2026-07-25), multi-arch fleet support is **deferred** — v1 admits **x86_64 only**, and an **aarch64** device (e.g. an Apple Silicon VM-mode helper) is steered away here at the spec gate with honest copy, not silently rejected. Rejections hold on P2-S3 / P3-S3L as well as P3-S3. ## Acceptance criteria - [ ] (story 11) Given VM mode is chosen and virtualisation is unavailable, When the check fails, Then the owner gets the per-OS remedy (enable VT-x/AMD-V in firmware; enable the Windows Hypervisor Platform feature on Windows) or the option to use another machine — and the code survives. - [ ] (story 16) Given the probe fails the hint's floor, When pairing is rejected, Then the owner sees Need vs Got and a remedy, the request stays Redeemed, and the code survives. - [ ] (story 16) Given a Mac that fails the VM arithmetic, When the gate fails, Then the copy says plainly a Mac has no full-install fallback and this Mac cannot contribute (ADR 0030). - [ ] (story 16) Given the hint's floor, When it is evaluated, Then it equals the floor of the cheapest service that role can actually run (ADR 0064, catalogue per-service minima) — a passing device can be given at least one real job; where fleet state has moved on, provisioning's P4-S1x names why in the device's numbers and offers a next step. - [ ] (slice-map ruling 2026-07-25) Given an aarch64 device, When it reaches the spec gate, Then it is steered away with honest copy (x86_64 only at v1; multi-arch deferred) — not silently rejected. ## Blocked by - #49 — the CLI pairing path the gate holds on - #50 — the app pairing/virt path the gate holds on ## Task manifest ```yaml task: device-add:spec-gate-and-virt implements_flow: p3-device-add-app implements_edge: P3-S3→P3-S3 (virt self-loop), spec-gate rejection holding on P2-S3 / P3-S3L wireframe: - docs/ux/wireframes/p3-device-add-app/p3-s3-this-computer.html - docs/ux/wireframes/p3-device-add-app/p3-s3l-linux-install-mode.html - docs/ux/wireframes/p2-device-add-cli/p2-s3-install-mode-consent.html interface: "spec-gate evaluation against the hint's floor (ADR 0030/0064, catalogue per-service minima) + virt-availability check with per-OS remedy self-loop + arch check (x86_64 only); rejections are typed errors that keep the request Redeemed" seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory ledger/clock; fake VM-manager reports virt-unavailable / undersized; probe fed x86_64 and aarch64 facts" acceptance: - given: VM mode chosen and virtualisation unavailable when: the check fails then: per-OS remedy or use-another-machine offered, and the code survives - given: the probe fails the hint's floor when: pairing is rejected then: Need vs Got + remedy shown, request stays Redeemed, code survives - given: a Mac that fails the VM arithmetic when: the gate fails then: copy states a Mac has no full-install fallback and cannot contribute (ADR 0030) - given: the hint's floor when: evaluated then: it equals the cheapest runnable service's floor (ADR 0064, catalogue minima) - given: an aarch64 device when: it reaches the spec gate then: steered away with honest copy (x86_64 only at v1) — not silently rejected depends_on: [cli-join-happy, app-join-happy] out_of_scope: - "story 14 full-install takeover-ready residue — full-install-takeover-ready's" - "provisioning's P4-S1x nothing-available screen — provisioning's" - "multi-arch v1 support (aarch64 admission, per-arch service builds/cache) — deferred, map-level" needs_human_decision: [] ```
Author
Owner

Done — commit sandcastle: device-add:spec-gate-and-virt #58.

What shipped

  • Catalogue-pinned floor (ADR 0064): new internal/catalogue package — the v1 fixed catalogue with per-service minima. FloorFor(role) is the floor of the cheapest service the role can actually run; enroll is wired via catalogue.SpecFloors() (never a second hand-maintained list), and a package test pins the invariant that the chosen floor fits under every runnable candidate, so a passing device can always be given at least one real job. The gateway role's one service is the front door, so its floor IS ADR 0030's declared 2 threads · 4 GB · 40 GB.
  • Spec gate (story 16): VM mode is evaluated against ADR 0030's per-OS VM-host arithmetic over the guest floor (+2 threads; +4 GB Linux / +8 GB Windows / +12 GB macOS). Rejection = typed SpecGateError with Need vs Got and a remedy; the request STAYS Redeemed (a typed error, no rejection history) and the code survives. A machine that fits the plain floor but not the VM is steered to full install by the math; a Mac that fails the arithmetic gets the plain copy: no full-install fallback, this Mac cannot contribute (ADR 0030).
  • Virt self-loop (story 11): new typed enroll.VirtError with the per-OS remedy — enable VT-x/AMD-V in firmware; on Windows also the Windows Hypervisor Platform feature — or use another machine. The code survives; the seam test enables virt and retries the SAME code to Pending.
  • x86_64-only steer-away (slice-map ruling 2026-07-25): new typed enroll.ArchError — an aarch64 device is steered away with honest copy (x86_64 only at v1, multi-arch deferred), never silently rejected; code survives.
  • Rejections hold on the consent screens: new join.Rejection (internal/join/gate.go) with Need vs Got in the device's own numbers. P2-S3 terminal holds — honest ✕, remedy, "Your code is still good — nothing was spent.", menu re-offered in the same session (arch alone ends the session, typed ErrRejected). The socket's OpConsent carries Rejection as a screen outcome, never an Error. The app ships ThisComputerScreen.vue (P3-S3: virt/threads/memory/disk checks flipped by the held rejection; arch steer-away replaces the set-up action) and LinuxInstallModeScreen.vue (P3-S3L: both consent cards, typed ERASE arming full install), built to the wireframes' element contract over app/src/lib/consent.ts.

Evidence: internal/join/gate_test.go (9 seam tests at the ADR 0057 seam — real enroll ledger + clock, probe fed x86_64 and aarch64 facts), internal/catalogue/catalogue_test.go (4 tests), app/tests/unit/consentGate.test.ts (10 Vue tests). Full Go suite + vet, app vitest 114/114, vue-tsc and eslint all green. STATUS.md updated in the same commit.

Done — commit `sandcastle: device-add:spec-gate-and-virt #58`. **What shipped** - **Catalogue-pinned floor (ADR 0064):** new `internal/catalogue` package — the v1 fixed catalogue with per-service minima. `FloorFor(role)` is the floor of the cheapest service the role can actually run; `enroll` is wired via `catalogue.SpecFloors()` (never a second hand-maintained list), and a package test pins the invariant that the chosen floor fits under every runnable candidate, so a passing device can always be given at least one real job. The gateway role's one service is the front door, so its floor IS ADR 0030's declared 2 threads · 4 GB · 40 GB. - **Spec gate (story 16):** VM mode is evaluated against ADR 0030's per-OS VM-host arithmetic over the guest floor (+2 threads; +4 GB Linux / +8 GB Windows / +12 GB macOS). Rejection = typed `SpecGateError` with Need vs Got and a remedy; the request STAYS Redeemed (a typed error, no rejection history) and the code survives. A machine that fits the plain floor but not the VM is steered to full install by the math; a Mac that fails the arithmetic gets the plain copy: no full-install fallback, this Mac cannot contribute (ADR 0030). - **Virt self-loop (story 11):** new typed `enroll.VirtError` with the per-OS remedy — enable VT-x/AMD-V in firmware; on Windows also the Windows Hypervisor Platform feature — or use another machine. The code survives; the seam test enables virt and retries the SAME code to Pending. - **x86_64-only steer-away (slice-map ruling 2026-07-25):** new typed `enroll.ArchError` — an aarch64 device is steered away with honest copy (x86_64 only at v1, multi-arch deferred), never silently rejected; code survives. - **Rejections hold on the consent screens:** new `join.Rejection` (`internal/join/gate.go`) with Need vs Got in the device's own numbers. P2-S3 terminal holds — honest ✕, remedy, "Your code is still good — nothing was spent.", menu re-offered in the same session (arch alone ends the session, typed `ErrRejected`). The socket's OpConsent carries `Rejection` as a screen outcome, never an Error. The app ships `ThisComputerScreen.vue` (P3-S3: virt/threads/memory/disk checks flipped by the held rejection; arch steer-away replaces the set-up action) and `LinuxInstallModeScreen.vue` (P3-S3L: both consent cards, typed ERASE arming full install), built to the wireframes' element contract over `app/src/lib/consent.ts`. **Evidence:** `internal/join/gate_test.go` (9 seam tests at the ADR 0057 seam — real enroll ledger + clock, probe fed x86_64 and aarch64 facts), `internal/catalogue/catalogue_test.go` (4 tests), `app/tests/unit/consentGate.test.ts` (10 Vue tests). Full Go suite + vet, app vitest 114/114, vue-tsc and eslint all green. STATUS.md updated in the same commit.
ben closed this issue 2026-07-25 16:45:11 +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#58
No description provided.