device-add: cli-join-happy — Install command joins a stock Linux machine to Pending #49

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

Parent

Feature spec: #13 (device-add).

What to build

The CLI doorway, end to end, on a stock Linux machine. The device owner copy-pastes the one install command carrying the code; it fetches the agent from the community's own gateway at the fleet's pinned release (never upstream — S13 Q9), installs it as a persistent OS service, and starts the join with the embedded code. The command is a doorway, not a kept tool — nothing standing is left for an operator to drive (ADR 0028).

In the terminal (P2-S3) the owner meets the install-mode choice and consent — the consent that deliberately lives with the person at the machine (ADR 0024). Full install states plainly that the machine will be wiped at first deploy and requires explicit consent; VM mode states what it dedicates and keeps. Once consent is given, the agent pairs in one shot: the probe, the consented mode, and the machine's SSH host key travel together, the connection request advances to Pending, and the probe report the agent sends is exactly what the operator's pending card will show — device screen and dashboard card share one type and cannot disagree.

This is the join orchestrator's CLI entry (Go, in the agent, ADRs 0053/0057) driving the enroll seam through Redeem → consent → Pair → Pending, bringing the clan connection up via the clan seam.

Acceptance criteria

  • (story 5) Given a stock Linux machine, When the owner runs the install command with the code, Then the agent is fetched from the gateway at the fleet's pinned release (never upstream), installed as a persistent service, and the join starts with the embedded code — nothing standing is left for an operator to drive.
  • (story 6) Given the agent is installed and the code redeemed, When the owner is asked for an install mode, Then full install states plainly the machine will be wiped at first deploy and requires explicit consent, and VM mode states what it dedicates and keeps (ADR 0024).
  • (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 — device screen and dashboard card share one type and cannot disagree.

Blocked by

  • #40 — a redeemable code
  • #25 — bringing the clan connection up

Task manifest

task: device-add:cli-join-happy
implements_flow: p2-device-add-cli
implements_edge: P2-S2→P2-S3, P2-S3→P2-S4
wireframe: docs/ux/wireframes/p2-device-add-cli/p2-s3-install-mode-consent.html
interface: "`join` orchestrator CLI entry (ADRs 0053/0057) — install command from gateway `/get` at pinned release installs agent-as-service; drives `enroll` seam Redeem → consent(mode) → Pair → Pending; clan connection via `clan` seam"
seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory ledger/clock; fake clan adapter, VM-manager, mesh-admission, artifact serving"
acceptance:
  - given: a stock Linux machine
    when: the owner runs the install command with the code
    then: the agent is fetched at the fleet's pinned release, installed as a persistent service, and the join starts with the embedded code — nothing operator-driveable left behind
  - given: the agent installed and the code redeemed
    when: the owner is asked for an install mode
    then: full install states the first-deploy wipe and requires explicit consent; VM mode states what it dedicates and keeps (ADR 0024)
  - 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 — one shared type
depends_on: [mint-code, bootstrap:clan-seam]
out_of_scope:
  - "story 16 spec-gate rejection + virt self-loop — 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"
  - "the app path (P3) — app-join-happy's"
needs_human_decision: []
## Parent Feature spec: #13 (device-add). ## What to build The CLI doorway, end to end, on a stock Linux machine. The device owner copy-pastes the one install command carrying the code; it fetches the agent from the community's own gateway at the fleet's **pinned release** (never upstream — S13 Q9), installs it as a **persistent OS service**, and starts the join with the embedded code. The command is a doorway, not a kept tool — nothing standing is left for an operator to drive (ADR 0028). In the terminal (P2-S3) the owner meets the **install-mode choice and consent** — the consent that deliberately lives with the person at the machine (ADR 0024). Full install states plainly that the machine will be wiped at first deploy and requires explicit consent; VM mode states what it dedicates and keeps. Once consent is given, the agent **pairs in one shot**: the probe, the consented mode, and the machine's SSH host key travel together, the connection request advances to **Pending**, and the probe report the agent sends is exactly what the operator's pending card will show — device screen and dashboard card share one type and cannot disagree. This is the `join` orchestrator's CLI entry (Go, in the agent, ADRs 0053/0057) driving the `enroll` seam through Redeem → consent → Pair → Pending, bringing the clan connection up via the `clan` seam. ## Acceptance criteria - [ ] (story 5) Given a stock Linux machine, When the owner runs the install command with the code, Then the agent is fetched from the gateway at the fleet's pinned release (never upstream), installed as a persistent service, and the join starts with the embedded code — nothing standing is left for an operator to drive. - [ ] (story 6) Given the agent is installed and the code redeemed, When the owner is asked for an install mode, Then full install states plainly the machine will be wiped at first deploy and requires explicit consent, and VM mode states what it dedicates and keeps (ADR 0024). - [ ] (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 — device screen and dashboard card share one type and cannot disagree. ## Blocked by - #40 — a redeemable code - #25 — bringing the clan connection up ## Task manifest ```yaml task: device-add:cli-join-happy implements_flow: p2-device-add-cli implements_edge: P2-S2→P2-S3, P2-S3→P2-S4 wireframe: docs/ux/wireframes/p2-device-add-cli/p2-s3-install-mode-consent.html interface: "`join` orchestrator CLI entry (ADRs 0053/0057) — install command from gateway `/get` at pinned release installs agent-as-service; drives `enroll` seam Redeem → consent(mode) → Pair → Pending; clan connection via `clan` seam" seam: "`join`-orchestrator seam tests (ADR 0057) — real `enroll` control-plane face + in-memory ledger/clock; fake clan adapter, VM-manager, mesh-admission, artifact serving" acceptance: - given: a stock Linux machine when: the owner runs the install command with the code then: the agent is fetched at the fleet's pinned release, installed as a persistent service, and the join starts with the embedded code — nothing operator-driveable left behind - given: the agent installed and the code redeemed when: the owner is asked for an install mode then: full install states the first-deploy wipe and requires explicit consent; VM mode states what it dedicates and keeps (ADR 0024) - 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 — one shared type depends_on: [mint-code, bootstrap:clan-seam] out_of_scope: - "story 16 spec-gate rejection + virt self-loop — 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" - "the app path (P3) — app-join-happy's" needs_human_decision: [] ```
Author
Owner

Done in commit ead53ec (sandcastle: device-add:cli-join-happy #49).

What shipped — the P2 CLI doorway end to end, at the ADR 0057 seam (real enroll ledger + clock; artifact serving, service install, VM manager, prober faked below):

  • Story 5 — internal/join/cli.go: ArtifactSource (the gateway /get face, ADR 0054 — the doorway's ONLY source) + ServiceInstaller; InstallAgent/RunInstallCommand fetch the agent at the fleet's pinned release (never upstream — the seam test wires an upstream stand-in and asserts zero fetches), install it as a persistent OS service, and start the join with the embedded code. Residue: exactly one agent service, nothing operator-driveable left (ADR 0028).
  • Story 6 — RunTerminal is P2-S3 built to the wireframe's copy: menu full [1] / VM [2] with the trade lines; full install states the first-deploy wipe plainly (Erases EVERYTHING… The takeover runs at first deploy) and requires typed WIPE consent — anything else pairs nothing, changes nothing, and the code survives (ADR 0024); VM mode states what it dedicates (Dedicate to the community: CPUs [2] Memory [4 GB] Disk [40 GB], role-floor-sized) and what it keeps (keep this OS), creating + autostarting the guest before pairing (ADR 0056).
  • Story 15 — consent pairs in one shot (probe + consented mode + SSH host key) to Pending; the Pending view's Probe is asserted identical to the operator's pending card via the ledger's Operator face — one shared enroll.ProbeReport, they cannot disagree.

Evidence: 6 new seam tests in internal/join/cli_test.go (green incl. -race; full Go suite green, gofmt/vet clean). The real agent binary gains agent enroll [CODE] rendering the same terminal contract (skeleton in-process wiring mirroring agent join); both consent paths exercised against the built binary.

Notes: no clan verbs run in this slice — the clan connection coming up post-approval is approve-enroll-land's (stories 17–20, out of scope here); the real /get HTTP round-trip stays with the non-gating lab smoke per the spec's testing decisions. STATUS.md updated in the same commit.

Done in commit `ead53ec` (`sandcastle: device-add:cli-join-happy #49`). **What shipped** — the P2 CLI doorway end to end, at the ADR 0057 seam (real `enroll` ledger + clock; artifact serving, service install, VM manager, prober faked below): - **Story 5** — `internal/join/cli.go`: `ArtifactSource` (the gateway `/get` face, ADR 0054 — the doorway's ONLY source) + `ServiceInstaller`; `InstallAgent`/`RunInstallCommand` fetch the agent at the fleet's **pinned release** (never upstream — the seam test wires an upstream stand-in and asserts zero fetches), install it as a persistent OS service, and start the join with the embedded code. Residue: exactly one agent service, nothing operator-driveable left (ADR 0028). - **Story 6** — `RunTerminal` is P2-S3 built to the wireframe's copy: menu full [1] / VM [2] with the trade lines; full install states the first-deploy wipe plainly (`Erases EVERYTHING… The takeover runs at first deploy`) and requires typed `WIPE` consent — anything else pairs nothing, changes nothing, and the code survives (ADR 0024); VM mode states what it dedicates (`Dedicate to the community: CPUs [2] Memory [4 GB] Disk [40 GB]`, role-floor-sized) and what it keeps (`keep this OS`), creating + autostarting the guest before pairing (ADR 0056). - **Story 15** — consent pairs in one shot (probe + consented mode + SSH host key) to **Pending**; the Pending view's Probe is asserted identical to the operator's pending card via the ledger's Operator face — one shared `enroll.ProbeReport`, they cannot disagree. **Evidence**: 6 new seam tests in `internal/join/cli_test.go` (green incl. `-race`; full Go suite green, gofmt/vet clean). The real agent binary gains `agent enroll [CODE]` rendering the same terminal contract (skeleton in-process wiring mirroring `agent join`); both consent paths exercised against the built binary. **Notes**: no clan verbs run in this slice — the clan connection coming up post-approval is approve-enroll-land's (stories 17–20, out of scope here); the real `/get` HTTP round-trip stays with the non-gating lab smoke per the spec's testing decisions. STATUS.md updated in the same commit.
ben closed this issue 2026-07-25 15:28:57 +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#49
No description provided.