device-add: app-join-happy — Non-technical owner joins via the operator app #50

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

Parent

Feature spec: #13 (device-add).

What to build

The app doorway, for a device owner with no terminal, across Windows, Mac, and Linux. The owner enters the code on Join with a code (P3-S2) and sees what they're joining — the branded community, the role hint, the spec floor, the valid install modes for this OS, and the code's expiry (branding via the brandkit seam). The app's first real act is installing the same standing agent as a persistent OS service (ADR 0053); from there every join screen renders the agent's state over its local Unix socket, so closing the app never stops the join — the machine's membership never depends on the app staying open.

On This computer (P3-S3) a Windows or Mac owner is offered VM mode as the way their machine joins — no full install on these hosts — with consent stating the dedicated CPU/RAM/disk, sized by the role hint. A Linux owner reaches the install-mode screen (P3-S3L) where VM mode and full install are both offered, full install carrying the explicit wipe consent (ADR 0024). On VM-mode consent the agent creates and keeps a local NixOS VM on its bundled QEMU (KVM/WHPX/HVF acceleration), sized by the hint, registers it for autostart, and then pairs in one shot (ADR 0056) — the probe, consented mode, and SSH host key travelling together to Pending, the probe report exactly what the operator's pending card shows.

Notes: this join is consumed upstream by founding's manual stand-up paths (the S7b desktop-app hand-off). VM lifecycle rides the ADR 0056 VM-manager interface (native hypervisor stacks are a later swap behind it).

Acceptance criteria

  • (story 8) Given a valid code, When it is redeemed, Then the screen shows the branded community, the role hint, the spec floor, the valid install modes for this OS, and the code's expiry.
  • (story 9) Given the code redeemed, When the join proceeds, Then the agent is installed as a persistent OS service and every join screen renders the agent's state over its local socket — closing the app does not stop the join (ADR 0053).
  • (story 10) Given Windows or Mac, When the owner reaches This computer, Then VM mode is the offered mode (no full install on these hosts) and consent states the dedicated CPU/RAM/disk, sized by the role hint.
  • (story 12) Given Linux, When the owner reaches the install-mode screen, Then VM mode and full install are both offered, full install carrying the explicit wipe consent (ADR 0024).
  • (story 13) Given VM-mode consent, When the agent proceeds, Then it creates the guest on its bundled QEMU (KVM/WHPX/HVF), sized by the hint, registers it for autostart, and then pairs (ADR 0056).
  • (story 15) Given consent is given, When the agent pairs, Then the connection request advances to Pending and the probe report is exactly what the operator's pending card shows — one shared type, device screen and dashboard card cannot disagree.

Blocked by

  • #40 — a redeemable code
  • #25 — bringing the clan connection up
  • #27 — the branded community on P3-S2
  • #28 — the app-side surface the join screens render into

Task manifest

task: device-add:app-join-happy
implements_flow: p3-device-add-app
implements_edge: P3-S2→P3-S3, P3-S3→P3-S4, P3-S3→P3-S3L, P3-S3L→P3-S4
wireframe:
  - docs/ux/wireframes/p3-device-add-app/p3-s2-join-with-a-code.html
  - 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
interface: "app-side `join` — helper installs the agent first (ADR 0053), then renders agent state over the local Unix socket; `brandkit` seam for branded display; VM-manager interface create+autostart (ADR 0056); drives `enroll` seam Redeem → consent(mode) → Pair → Pending"
seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory ledger/clock; fake VM-manager, mesh-admission, brandkit, clan adapter; one thin local-socket round-trip against the real agent binary"
acceptance:
  - given: a valid code
    when: redeemed
    then: the screen shows the branded community, role hint, spec floor, valid install modes for this OS, and expiry
  - given: the code redeemed
    when: the join proceeds
    then: the agent is installed as a persistent service and screens render its state over the local socket; closing the app does not stop the join
  - given: Windows or Mac at This computer
    when: reached
    then: VM mode is offered (no full install) with consent stating dedicated CPU/RAM/disk sized by the hint
  - given: Linux at the install-mode screen
    when: reached
    then: VM mode and full install both offered, full install carrying explicit wipe consent (ADR 0024)
  - given: VM-mode consent
    when: the agent proceeds
    then: it creates the guest on bundled QEMU sized by the hint, registers autostart, then pairs (ADR 0056)
  - given: consent is given
    when: the agent pairs
    then: the request advances to Pending and the probe report is what the operator's pending card shows
depends_on: [mint-code, bootstrap:clan-seam, bootstrap:brandkit-seam, shell:app-side-shell]
out_of_scope:
  - "story 11, 16 virt self-loop + spec-gate rejection — spec-gate-and-virt's"
  - "story 14 full-install takeover-ready residue — full-install-takeover-ready's"
  - "story 17–20 approve/enroll/land — approve-enroll-land's"
needs_human_decision: []
## Parent Feature spec: #13 (device-add). ## What to build The app doorway, for a device owner with no terminal, across Windows, Mac, and Linux. The owner enters the code on **Join with a code** (P3-S2) and sees what they're joining — the branded community, the role hint, the spec floor, the valid install modes for this OS, and the code's expiry (branding via the `brandkit` seam). The app's **first real act** is installing the same standing agent as a persistent OS service (ADR 0053); from there every join screen renders the agent's state over its **local Unix socket**, so closing the app never stops the join — the machine's membership never depends on the app staying open. On **This computer** (P3-S3) a Windows or Mac owner is offered VM mode as the way their machine joins — no full install on these hosts — with consent stating the dedicated CPU/RAM/disk, sized by the role hint. A Linux owner reaches the **install-mode screen** (P3-S3L) where VM mode and full install are both offered, full install carrying the explicit wipe consent (ADR 0024). On VM-mode consent the agent creates and keeps a local NixOS VM on its bundled QEMU (KVM/WHPX/HVF acceleration), sized by the hint, registers it for autostart, and then **pairs in one shot** (ADR 0056) — the probe, consented mode, and SSH host key travelling together to Pending, the probe report exactly what the operator's pending card shows. Notes: this join is consumed upstream by founding's manual stand-up paths (the S7b desktop-app hand-off). VM lifecycle rides the ADR 0056 VM-manager interface (native hypervisor stacks are a later swap behind it). ## Acceptance criteria - [ ] (story 8) Given a valid code, When it is redeemed, Then the screen shows the branded community, the role hint, the spec floor, the valid install modes for this OS, and the code's expiry. - [ ] (story 9) Given the code redeemed, When the join proceeds, Then the agent is installed as a persistent OS service and every join screen renders the agent's state over its local socket — closing the app does not stop the join (ADR 0053). - [ ] (story 10) Given Windows or Mac, When the owner reaches This computer, Then VM mode is the offered mode (no full install on these hosts) and consent states the dedicated CPU/RAM/disk, sized by the role hint. - [ ] (story 12) Given Linux, When the owner reaches the install-mode screen, Then VM mode and full install are both offered, full install carrying the explicit wipe consent (ADR 0024). - [ ] (story 13) Given VM-mode consent, When the agent proceeds, Then it creates the guest on its bundled QEMU (KVM/WHPX/HVF), sized by the hint, registers it for autostart, and then pairs (ADR 0056). - [ ] (story 15) Given consent is given, When the agent pairs, Then the connection request advances to Pending and the probe report is exactly what the operator's pending card shows — one shared type, device screen and dashboard card cannot disagree. ## Blocked by - #40 — a redeemable code - #25 — bringing the clan connection up - #27 — the branded community on P3-S2 - #28 — the app-side surface the join screens render into ## Task manifest ```yaml task: device-add:app-join-happy implements_flow: p3-device-add-app implements_edge: P3-S2→P3-S3, P3-S3→P3-S4, P3-S3→P3-S3L, P3-S3L→P3-S4 wireframe: - docs/ux/wireframes/p3-device-add-app/p3-s2-join-with-a-code.html - 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 interface: "app-side `join` — helper installs the agent first (ADR 0053), then renders agent state over the local Unix socket; `brandkit` seam for branded display; VM-manager interface create+autostart (ADR 0056); drives `enroll` seam Redeem → consent(mode) → Pair → Pending" seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory ledger/clock; fake VM-manager, mesh-admission, brandkit, clan adapter; one thin local-socket round-trip against the real agent binary" acceptance: - given: a valid code when: redeemed then: the screen shows the branded community, role hint, spec floor, valid install modes for this OS, and expiry - given: the code redeemed when: the join proceeds then: the agent is installed as a persistent service and screens render its state over the local socket; closing the app does not stop the join - given: Windows or Mac at This computer when: reached then: VM mode is offered (no full install) with consent stating dedicated CPU/RAM/disk sized by the hint - given: Linux at the install-mode screen when: reached then: VM mode and full install both offered, full install carrying explicit wipe consent (ADR 0024) - given: VM-mode consent when: the agent proceeds then: it creates the guest on bundled QEMU sized by the hint, registers autostart, then pairs (ADR 0056) - given: consent is given when: the agent pairs then: the request advances to Pending and the probe report is what the operator's pending card shows depends_on: [mint-code, bootstrap:clan-seam, bootstrap:brandkit-seam, shell:app-side-shell] out_of_scope: - "story 11, 16 virt self-loop + spec-gate rejection — spec-gate-and-virt's" - "story 14 full-install takeover-ready residue — full-install-takeover-ready's" - "story 17–20 approve/enroll/land — approve-enroll-land's" needs_human_decision: [] ```
Author
Owner

Done — the app doorway's happy path (P3-S2 → P3-S4), the join orchestrator's app-path side, ADRs 0053/0056/0057/0024/0055. Commit 69bebf9.

What shipped (internal/join/app.go + socket.go, extending #48's device-end join package):

  • story 8 — Prospect(resp) brands a valid RedeemResponse into the P3-S2 view: the branded community (via a Brander port over the brandkit seam), the role hint, the role's spec floor, the install modes valid for this host OS each with device-end consent copy, and the code's expiry.
  • story 9 — the local Unix socket is the app's UI contract (socket.go, Serve/ServeListener over NDJSON): the standing agent serves the join, the app renders its state over the socket, and closing the app (dropping the connection) never stops the join — a reopened app re-reads the same Pending state. The real agent binary gains a join subcommand serving the socket (skeleton wiring over an in-process ledger + fakes, mirroring the helper's clan subcommand).
  • story 10 — Windows/Mac offer VM mode only (no full install), consent stating the dedicated CPU/RAM/disk sized by the role hint.
  • story 12 — Linux offers VM + full install, full install carrying the explicit first-deploy wipe consent (ADR 0024).
  • story 13 — VM-mode consent creates + autostarts the guest on the VM manager (VMManager.Create, ADR 0056) sized by the hint, then pairs (an ordering test proves create is a precondition of pairing).
  • story 15 — probe, consented mode and SSH host key travel in one Pair; the Pending view's Probe is exactly the operator's pending card (one shared enroll.RequestView.Probe type).

The OS→modes split is the control plane's (enroll ledger InstallModes(os)); the orchestrator renders what enroll returns and decides no OS policy of its own. VM sizing = the role's spec floor (a single source, so consent numbers and the spec gate cannot disagree).

Evidence: 8 new join seam tests (ADR 0057) over the real enroll ledger + clock with faked VM-manager/brandkit/host-prober, in internal/join/app_test.go + socket_test.go (incl. the local-socket round-trip). go build/vet/gofmt clean; full suite + go test -race ./internal/join green.

Out of scope (own slices): virt self-loop + spec-gate rejection (spec-gate-and-virt), full-install takeover-ready residue (full-install-takeover-ready), approve/enroll/land (approve-enroll-land).

Done — the app doorway's happy path (P3-S2 → P3-S4), the `join` orchestrator's app-path side, ADRs 0053/0056/0057/0024/0055. Commit `69bebf9`. **What shipped** (`internal/join/app.go` + `socket.go`, extending #48's device-end `join` package): - **story 8** — `Prospect(resp)` brands a valid RedeemResponse into the P3-S2 view: the branded community (via a `Brander` port over the brandkit seam), the role hint, the role's spec floor, the install modes valid for this host OS each with device-end consent copy, and the code's expiry. - **story 9** — the local Unix socket is the app's UI contract (`socket.go`, `Serve`/`ServeListener` over NDJSON): the standing agent serves the join, the app renders its state over the socket, and closing the app (dropping the connection) never stops the join — a reopened app re-reads the same Pending state. The real `agent` binary gains a `join` subcommand serving the socket (skeleton wiring over an in-process ledger + fakes, mirroring the helper's `clan` subcommand). - **story 10** — Windows/Mac offer VM mode only (no full install), consent stating the dedicated CPU/RAM/disk sized by the role hint. - **story 12** — Linux offers VM + full install, full install carrying the explicit first-deploy wipe consent (ADR 0024). - **story 13** — VM-mode consent creates + autostarts the guest on the VM manager (`VMManager.Create`, ADR 0056) sized by the hint, **then** pairs (an ordering test proves create is a precondition of pairing). - **story 15** — probe, consented mode and SSH host key travel in one `Pair`; the Pending view's `Probe` is exactly the operator's pending card (one shared `enroll.RequestView.Probe` type). The OS→modes split is the control plane's (`enroll` ledger `InstallModes(os)`); the orchestrator renders what enroll returns and decides no OS policy of its own. VM sizing = the role's spec floor (a single source, so consent numbers and the spec gate cannot disagree). **Evidence:** 8 new `join` seam tests (ADR 0057) over the real `enroll` ledger + clock with faked VM-manager/brandkit/host-prober, in `internal/join/app_test.go` + `socket_test.go` (incl. the local-socket round-trip). `go build`/`vet`/`gofmt` clean; full suite + `go test -race ./internal/join` green. **Out of scope** (own slices): virt self-loop + spec-gate rejection (spec-gate-and-virt), full-install takeover-ready residue (full-install-takeover-ready), approve/enroll/land (approve-enroll-land).
ben closed this issue 2026-07-25 12:58:10 +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#50
No description provided.