agent: real-composition — device-end join adapters (QEMU/mesh/clan) + the install command #192

Closed
opened 2026-07-30 19:53:56 +00:00 by ben · 3 comments
Owner

Parent

Engine-adapters close-out #183 (spec #161). Filed 2026-07-30; re-scoped 2026-07-30 per triage's analysis — Ben confirmed in a driven session: the full-install takeover criterion (old AC2) moves out — it needs physical hardware no swarm substrate can reach and is exactly #183's B·2 leg, where the takeover proof always lived (spike Q2.2). What remains is fully agent-doable.

What's true today

  • The agent code lives at agent/cmd/agent, but its production wiring fails loud on the join seam — no real QEMU/mesh/clan device-side adapters (ADR 0100). Only join.VMManager's interface + fake exist; the real ADR 0056 QEMU single-VM manager is unbuilt.
  • Founding's private path (internal/founding/privatepath.go) never wires a VM manager — its host probe is a hardcoded stand-in — so the local-VM stand-up (P1 VAR) has no code path. Ownership ruling per ADR 0043/0056: the VM manager is the agent's — the private path has the helper install the standing agent locally and drive its VM manager.
  • Per the glossary there is deliberately no kept CLI tool: the "CLI path" is the one-shot install command — installs the agent, takes the enrollment code, leaves nothing operator-driveable behind.
  • The control-plane side of enrolment is proven real (#175).

What to build

  1. The real QEMU single-VM manager (ADR 0056) behind join.VMManager, agent-bundled.
  2. The agent's real join seam — wiring_prod.go constructs the real device-side adapters: the VM manager for VM-mode joins, the mesh join (devices are mesh peers — members never are), and the device-side clan enrolment against the control plane (enroll seam, MintCode/RevokeCode contract).
  3. The install command — the real one-shot doorway (P2-S2 / P1-S7a/S7b): installs the agent on a stock Linux OS, takes the enrollment code, drives install-mode consent, probes specs for the gate, pairs, leaves nothing behind.
  4. Founding's private-path VM standup — the private path (P1 VAR) drives the locally-installed agent's VM manager to stand up the gateway VM, replacing the hardcoded probe stand-in.

Acceptance criteria

  • Given a stock Linux machine and a minted enrollment code, When the owner runs the install command and consents to VM mode, Then the agent stands up the guest via the real VM manager, pairs, and the device reaches pending — approve with honestly probed specs
  • Given founding's private path on a KVM-capable Linux machine, When the operator creates a private community, Then the locally-installed agent stands up the local NixOS gateway VM and it calls in and pairs (P1 VAR)
  • Given the production agent with an unwired sub-adapter, When it starts, Then it fails loud with the honest ADR 0100 message — never a fake

Task manifest

task: agent:real-composition
implements_seam: "enroll seam (specs #11/#13) + ADR 0056 (single VM manager, agent-bundled) + ADR 0043 (private path installs the standing agent locally) + ADR 0100"
interface: "the install command on a stock Linux device; the agent's join seam; founding's private-path standup"
seam: "agent/cmd/agent wiring + a real VM-mode enrolment driven against a real control plane"
acceptance:
  - given: a stock Linux machine + an enrollment code; when: the install command runs and VM mode is consented; then: the guest stands up real and the device reaches approval with no fakes in the path
depends_on: []
out_of_scope: [full-install takeover on physical hardware (that proof is #183 B·2 — spike Q2.2; the takeover *code path* stays behind the same seam and keeps failing loud only where genuinely unbuilt), a standing operator CLI (deliberately deferred — glossary), macOS/Windows device ends, app packaging (#191)]
needs_human_decision: []

Blocks

#183 — leg B·2 (VM-mode joins incl. the laptop backup-target device) and Phase A's local-VM call-in (leg A·1).

## Parent Engine-adapters close-out #183 (spec #161). Filed 2026-07-30; **re-scoped 2026-07-30 per triage's analysis — Ben confirmed in a driven session**: the full-install takeover criterion (old AC2) moves out — it needs physical hardware no swarm substrate can reach and is exactly #183's B·2 leg, where the takeover proof always lived (spike Q2.2). What remains is fully agent-doable. ## What's true today - The agent code lives at `agent/cmd/agent`, but its production wiring fails loud on the join seam — no real QEMU/mesh/clan device-side adapters (ADR 0100). Only `join.VMManager`'s interface + fake exist; the real ADR 0056 QEMU single-VM manager is unbuilt. - Founding's private path (`internal/founding/privatepath.go`) never wires a VM manager — its host probe is a hardcoded stand-in — so the local-VM stand-up (P1 VAR) has no code path. Ownership ruling per ADR 0043/0056: **the VM manager is the agent's** — the private path has the helper install the standing agent locally and drive its VM manager. - Per the glossary there is deliberately **no kept CLI tool**: the "CLI path" is the one-shot **install command** — installs the agent, takes the enrollment code, leaves nothing operator-driveable behind. - The control-plane side of enrolment is proven real (#175). ## What to build 1. **The real QEMU single-VM manager** (ADR 0056) behind `join.VMManager`, agent-bundled. 2. **The agent's real join seam** — `wiring_prod.go` constructs the real device-side adapters: the VM manager for VM-mode joins, the mesh join (devices are mesh peers — members never are), and the device-side clan enrolment against the control plane (enroll seam, MintCode/RevokeCode contract). 3. **The install command** — the real one-shot doorway (P2-S2 / P1-S7a/S7b): installs the agent on a stock Linux OS, takes the enrollment code, drives install-mode consent, probes specs for the gate, pairs, leaves nothing behind. 4. **Founding's private-path VM standup** — the private path (P1 VAR) drives the locally-installed agent's VM manager to stand up the gateway VM, replacing the hardcoded probe stand-in. ## Acceptance criteria - [ ] Given a stock Linux machine and a minted enrollment code, When the owner runs the install command and consents to VM mode, Then the agent stands up the guest via the real VM manager, pairs, and the device reaches *pending — approve* with honestly probed specs - [ ] Given founding's private path on a KVM-capable Linux machine, When the operator creates a private community, Then the locally-installed agent stands up the local NixOS gateway VM and it calls in and pairs (P1 VAR) - [ ] Given the production agent with an unwired sub-adapter, When it starts, Then it fails loud with the honest ADR 0100 message — never a fake ## Task manifest ```yaml task: agent:real-composition implements_seam: "enroll seam (specs #11/#13) + ADR 0056 (single VM manager, agent-bundled) + ADR 0043 (private path installs the standing agent locally) + ADR 0100" interface: "the install command on a stock Linux device; the agent's join seam; founding's private-path standup" seam: "agent/cmd/agent wiring + a real VM-mode enrolment driven against a real control plane" acceptance: - given: a stock Linux machine + an enrollment code; when: the install command runs and VM mode is consented; then: the guest stands up real and the device reaches approval with no fakes in the path depends_on: [] out_of_scope: [full-install takeover on physical hardware (that proof is #183 B·2 — spike Q2.2; the takeover *code path* stays behind the same seam and keeps failing loud only where genuinely unbuilt), a standing operator CLI (deliberately deferred — glossary), macOS/Windows device ends, app packaging (#191)] needs_human_decision: [] ``` ## Blocks #183 — leg B·2 (VM-mode joins incl. the laptop backup-target device) and Phase A's local-VM call-in (leg A·1).
Author
Owner

This was generated by AI during triage.

Triage verification: confirmed against the codebase — agent/cmd/agent/wiring_prod.go fails loud on the join seam exactly as described, with no real QEMU/mesh/clan adapters wired. Referenced ADRs 0056/0100 exist and are accepted; the agent-control-plane and clan seam contracts are status: confirmed. No missing-design gate triggered, no prior .out-of-scope/ rejection found, nothing pre-existing that makes this redundant.

Why ready-for-human and not ready-for-agent: this is a judgment call, not a missing-design or spec gap — the task manifest's own needs_human_decision is empty, and I don't think that's wrong for most of the ticket. The blocker is narrower: the two acceptance criteria have different reach.

  • AC1 (VM-mode join: agent stands up the guest, pairs, reaches pending — approve with honest specs) is buildable and testable by an AFK agent — the QEMU single-VM manager (ADR 0056) is agent-bundled software, and the control-plane side of enrolment is already proven real (#175).
  • AC2 (full install on takeover-ready hardware: overwrite the host to NixOS, --phases resumable) is the exact leg STATUS.md already calls out as substrate-limited — the #175 smoke on the golden clan-lab could not exercise it because "VMs had no outbound for the kexec fetch," and the real-hardware proof was explicitly deferred to spike Q2.2, re-proven at #183 (itself ready-for-human for the same reason). Cloud lab droplets (the clan-lab skill) can't stand in for a physical machine with real BIOS/UEFI and a MAC-matched NIC to take over — there's no substrate an agent can reach that satisfies this criterion.

Since this ticket bundles both criteria into one deliverable and can't be called done without AC2, routing the whole thing to ready-for-human matches the precedent already set at #183 rather than have an agent either stall on AC2 or claim done without it. Whoever picks this up in a driven session can still delegate the AC1 adapter-wiring work to an agent and reserve only the AC2 hardware leg for themselves — that split is the maintainer's call, not something to bake into the label.

Leaving needs_human_decision in the manifest empty as-authored since the call here is about this ticket's scope, not a missing spec detail.

> *This was generated by AI during triage.* **Triage verification:** confirmed against the codebase — `agent/cmd/agent/wiring_prod.go` fails loud on the join seam exactly as described, with no real QEMU/mesh/clan adapters wired. Referenced ADRs 0056/0100 exist and are accepted; the `agent-control-plane` and `clan` seam contracts are `status: confirmed`. No missing-design gate triggered, no prior `.out-of-scope/` rejection found, nothing pre-existing that makes this redundant. **Why `ready-for-human` and not `ready-for-agent`:** this is a judgment call, not a missing-design or spec gap — the task manifest's own `needs_human_decision` is empty, and I don't think that's wrong for most of the ticket. The blocker is narrower: the two acceptance criteria have different reach. - AC1 (VM-mode join: agent stands up the guest, pairs, reaches *pending — approve* with honest specs) is buildable and testable by an AFK agent — the QEMU single-VM manager (ADR 0056) is agent-bundled software, and the control-plane side of enrolment is already proven real (#175). - AC2 (full install on takeover-ready hardware: overwrite the host to NixOS, `--phases` resumable) is the exact leg STATUS.md already calls out as **substrate-limited** — the #175 smoke on the golden clan-lab could not exercise it because "VMs had no outbound for the kexec fetch," and the real-hardware proof was explicitly deferred to spike Q2.2, re-proven at #183 (itself `ready-for-human` for the same reason). Cloud lab droplets (the `clan-lab` skill) can't stand in for a physical machine with real BIOS/UEFI and a MAC-matched NIC to take over — there's no substrate an agent can reach that satisfies this criterion. Since this ticket bundles both criteria into one deliverable and can't be called done without AC2, routing the whole thing to `ready-for-human` matches the precedent already set at #183 rather than have an agent either stall on AC2 or claim done without it. Whoever picks this up in a driven session can still delegate the AC1 adapter-wiring work to an agent and reserve only the AC2 hardware leg for themselves — that split is the maintainer's call, not something to bake into the label. Leaving `needs_human_decision` in the manifest empty as-authored since the call here is about *this ticket's scope*, not a missing spec detail.
Author
Owner

Ben confirmed the split (driven session 2026-07-30): the full-install takeover criterion moves out to #183 B·2 (physical hardware, spike Q2.2 — where that proof always lived). This ticket narrows to the agent-doable remainder: the real QEMU single-VM manager (ADR 0056), the agent's real join seam, the install command, and founding's private-path VM standup through the locally-installed agent (ADR 0043). Body re-scoped, re-armed ready-for-agent.

**Ben confirmed the split** (driven session 2026-07-30): the full-install takeover criterion moves out to #183 B·2 (physical hardware, spike Q2.2 — where that proof always lived). This ticket narrows to the agent-doable remainder: the real QEMU single-VM manager (ADR 0056), the agent's real join seam, the install command, and founding's private-path VM standup through the locally-installed agent (ADR 0043). Body re-scoped, re-armed `ready-for-agent`.
Author
Owner

Landed in e3c2f0f on main (STATUS.md updated same commit).

What shipped real (ADR 0056/0100 — no fake in the shipped path):

  • internal/vm.Manager — the production join.VMManager, the agent-bundled QEMU single-VM manager: sized qcow2 guest backed by the per-arch NixOS base image → systemd unit running qemu-system with KVM accel + virtio → enable --now autostart (guest + membership survive reboots, ADR 0053) → Exists off the durable disk, Health off the supervising unit → idempotent teardown. Logic injected behind a System seam; contract-tested (internal/vm/manager_test.go).
  • internal/hostprobe.Prober — the production join.Prober: honest arch/OS/cores/mem/disk//dev/kvm-virt read, never a fabricated spec.
  • internal/install — the install command's real ports: HTTP /get Gateway at the fleet's pinned release (never upstream, ADR 0054) + a systemd ServiceInstaller/SelfRemover (the doorway's only residue, ADR 0028/0053).
  • agent/cmd/agent/wiring_prod.go — constructs the real VM/probe/self + install ports, so the pending path (Redeem → consent → Pair → Pending) stands a VM-mode guest up for real. agent install is the runnable one-shot doorway.
  • founding private path — drives the locally-installed agent's VM manager (LocalVM.Create before the clan enrolment, which VM-mode only updates an already-existing guest) and the real HostProbe; the hardcoded privateVMHostProbe stand-in is gone (P1 VAR, ADR 0043).

Acceptance:

  • AC1 — the agent-doable pending path is real: agent install/agent enroll drive the real vm.Manager.Create + real hostprobe to reach pending — approve with honestly-probed specs, no fake in the path. The real-hardware KVM stand-up is the driver-gated scripts/smoke-vm.sh + control-plane/cmd/smoke-vm (no swarm substrate carries /dev/kvm).
  • AC2 — founding's private path now stands the local NixOS gateway guest up via the agent's VM manager + real host probe (seam-tested). The real-KVM end-to-end is the driver's, same substrate limit.
  • AC3 — an unwired sub-adapter fails loud with the honest ADR 0100 message the moment a surface reaches it (TestProductionUnbuiltPortsFailLoud), never a fake; the agent still boots and reaches approval.

Remaining (driver's / their own slices, per the #193/#194 split precedent): the real device-side mesh (Netbird) and clan adapters (post-approval, need real mesh/control-plane infra); the real-KVM/real-mesh AC1/AC2 end-to-end on hardware; and wiring the real vm.Manager/hostprobe.Prober into the helper's wiring_prod.go (#191, the compose ticket — the helper still fails loud on founding until then).

Verification: both build tags + the Go suite + golangci-lint clean.

Landed in `e3c2f0f` on `main` (STATUS.md updated same commit). **What shipped real (ADR 0056/0100 — no fake in the shipped path):** - **`internal/vm.Manager`** — the production `join.VMManager`, the agent-bundled QEMU single-VM manager: sized qcow2 guest backed by the per-arch NixOS base image → systemd unit running `qemu-system` with KVM accel + virtio → `enable --now` autostart (guest + membership survive reboots, ADR 0053) → `Exists` off the durable disk, `Health` off the supervising unit → idempotent teardown. Logic injected behind a `System` seam; contract-tested (`internal/vm/manager_test.go`). - **`internal/hostprobe.Prober`** — the production `join.Prober`: honest arch/OS/cores/mem/disk/`/dev/kvm`-virt read, never a fabricated spec. - **`internal/install`** — the install command's real ports: HTTP `/get` `Gateway` at the fleet's pinned release (never upstream, ADR 0054) + a systemd `ServiceInstaller`/`SelfRemover` (the doorway's only residue, ADR 0028/0053). - **`agent/cmd/agent/wiring_prod.go`** — constructs the real VM/probe/self + install ports, so the pending path (Redeem → consent → Pair → Pending) stands a VM-mode guest up for real. `agent install` is the runnable one-shot doorway. - **founding private path** — drives the locally-installed agent's VM manager (`LocalVM.Create` before the clan enrolment, which VM-mode only `update`s an already-existing guest) and the real `HostProbe`; the hardcoded `privateVMHostProbe` stand-in is gone (P1 VAR, ADR 0043). **Acceptance:** - **AC1** — the agent-doable pending path is real: `agent install`/`agent enroll` drive the real `vm.Manager.Create` + real `hostprobe` to reach *pending — approve* with honestly-probed specs, no fake in the path. The real-hardware KVM stand-up is the driver-gated `scripts/smoke-vm.sh` + `control-plane/cmd/smoke-vm` (no swarm substrate carries `/dev/kvm`). - **AC2** — founding's private path now stands the local NixOS gateway guest up via the agent's VM manager + real host probe (seam-tested). The real-KVM end-to-end is the driver's, same substrate limit. - **AC3** — an unwired sub-adapter fails loud with the honest ADR 0100 message the moment a surface reaches it (`TestProductionUnbuiltPortsFailLoud`), never a fake; the agent still boots and reaches approval. **Remaining (driver's / their own slices, per the #193/#194 split precedent):** the real device-side **mesh (Netbird)** and **clan** adapters (post-approval, need real mesh/control-plane infra); the real-KVM/real-mesh AC1/AC2 end-to-end on hardware; and wiring the real `vm.Manager`/`hostprobe.Prober` into the **helper's** `wiring_prod.go` (**#191**, the compose ticket — the helper still fails loud on founding until then). Verification: both build tags + the Go suite + `golangci-lint` clean.
ben closed this issue 2026-07-30 21:47:22 +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#192
No description provided.