agent: device-transport — the agent enrolls against a remote control plane over HTTP #207

Closed
opened 2026-07-30 23:20:19 +00:00 by ben · 1 comment
Owner

Parent

Device-add spec #13; consumes #192's real device-side adapters. Gap audit 2026-07-30 (post #191–#195 sweep of the composition roots and both app shells). Filed per the #191–#195 precedent: a close-out blocker of #183 found while preparing the run, confirmed by Ben.

What's true today

  • There is no network between a device and the control plane. Every agent subcommand (join, enroll, install) builds its own in-process enroll ledger and enrolls against itself — a second machine cannot enroll, period. The control-plane side of the seam is proven real (#175); the device-side adapters are real (#192); the wire between them does not exist.
  • The one real device→gateway call that exists — the install command's fetch of /get — has no server: nothing serves that route.
  • The device key handed to the join is a 32-zero-byte placeholder.

What to build

  1. The device face over HTTP: redeem/call-in with the enrollment code, the probed-spec hand-up, pairing, and the approval poll — the agent's ControlPlane port becomes a real HTTP client of the gateway; the in-process ledger remains a test double only.
  2. The install doorway served: the gateway answers the install command's fetch with the real per-arch payload.
  3. A real device key: generated and persisted device-side; zeros never leave the machine.

Acceptance criteria

  • Given a running gateway with a minted code, When the install command runs on a second machine and VM mode is consented, Then the device calls in over HTTP with honestly probed specs and appears on the gateway's pending projection
  • Given an approve on the gateway, When the device's poll sees it, Then the join completes and the device lands enrolled — over the wire, no in-process ledger in the path
  • Given the gateway's install route, When the install command fetches, Then the real payload serves
  • Given no reachable gateway, Then the agent fails loud (ADR 0100)

Task manifest

task: agent:device-transport
implements_seam: "the enroll seam device face (specs #11/#13) over HTTP + ADR 0100; consumes #192"
interface: "the install command + agent join against a remote gateway"
seam: "an integration test: real control plane process + agent client — call-in→pending→approve→enrolled over the wire"
acceptance:
  - given: a gateway + a minted code; when: the install command runs on another machine; then: the device enrolls over HTTP end-to-end
depends_on: [control-plane:compose-enroll]
out_of_scope: [heartbeats (the next slice), the full-install takeover physical proof (#183 B·2 / spike Q2.2 — the code path keeps failing loud only where genuinely unbuilt)]
needs_human_decision: []

Blocked by

Blocks

#183 — leg B·2 (both joins are wire-driven) and Phase A's call-in.

## Parent Device-add spec #13; consumes #192's real device-side adapters. Gap audit 2026-07-30 (post #191–#195 sweep of the composition roots and both app shells). Filed per the #191–#195 precedent: a close-out blocker of #183 found while preparing the run, confirmed by Ben. ## What's true today - **There is no network between a device and the control plane.** Every agent subcommand (join, enroll, install) builds its own in-process enroll ledger and enrolls against itself — a second machine cannot enroll, period. The control-plane side of the seam is proven real (#175); the device-side adapters are real (#192); the wire between them does not exist. - The one real device→gateway call that exists — the install command's fetch of `/get` — has no server: nothing serves that route. - The device key handed to the join is a 32-zero-byte placeholder. ## What to build 1. **The device face over HTTP**: redeem/call-in with the enrollment code, the probed-spec hand-up, pairing, and the approval poll — the agent's ControlPlane port becomes a real HTTP client of the gateway; the in-process ledger remains a test double only. 2. **The install doorway served**: the gateway answers the install command's fetch with the real per-arch payload. 3. **A real device key**: generated and persisted device-side; zeros never leave the machine. ## Acceptance criteria - [ ] Given a running gateway with a minted code, When the install command runs on a second machine and VM mode is consented, Then the device calls in over HTTP with honestly probed specs and appears on the gateway's pending projection - [ ] Given an approve on the gateway, When the device's poll sees it, Then the join completes and the device lands enrolled — over the wire, no in-process ledger in the path - [ ] Given the gateway's install route, When the install command fetches, Then the real payload serves - [ ] Given no reachable gateway, Then the agent fails loud (ADR 0100) ## Task manifest ```yaml task: agent:device-transport implements_seam: "the enroll seam device face (specs #11/#13) over HTTP + ADR 0100; consumes #192" interface: "the install command + agent join against a remote gateway" seam: "an integration test: real control plane process + agent client — call-in→pending→approve→enrolled over the wire" acceptance: - given: a gateway + a minted code; when: the install command runs on another machine; then: the device enrolls over HTTP end-to-end depends_on: [control-plane:compose-enroll] out_of_scope: [heartbeats (the next slice), the full-install takeover physical proof (#183 B·2 / spike Q2.2 — the code path keeps failing loud only where genuinely unbuilt)] needs_human_decision: [] ``` ## Blocked by - #200 ## Blocks #183 — leg B·2 (both joins are wire-driven) and Phase A's call-in.
Author
Owner

Landed as 9db23c5 on main.

The device↔control-plane wire now exists — a device on another machine enrolls over HTTP; every agent subcommand no longer builds its own in-process ledger and enrolls against itself.

  • internal/enrollwire carries both ends of the enroll device face (ADR 0037): RegisterDevice mounts redeem/pair/poll/confirm over the real *enroll.Ledger, and Client is the agents real enroll.ControlPlane HTTP client. The seams typed error taxonomy (code errors + spec-gate/virt/arch, with detail) is encoded and reconstructed across the wire, so joins Redeem outcomes and Pair rejection screens are identical local-or-remote. A transport fault (no reachable gateway) fails loud (ADR 0100).
  • The install doorway served: controlapi.WithInstallDoorway serves /get with the fleets pinned per-arch agent from the gateways own seeded cache (install.CacheSource, OURCLOUD_AGENT_CACHE, ADR 0054/0051); an unseeded cache fails loud (ADR 0100).
  • A real device key (internal/devicekey, ed25519, persisted 0600): retires the 32-zero placeholder — the private half never leaves the machine.
  • Production wiring: the agent enrolls against a REMOTE gateway (enrollTransportFor over OURCLOUD_COMMUNITY_ORIGIN, fail-loud without it); the in-process ledger is a -tags dev test double only. The whole control-plane composition wires the real ledger + cache; resting fails loud on both.

Acceptance (seam: internal/enrollwire/device_transport_integration_test.go):

  • AC1 — install command on another machine, VM mode consented → device calls in over HTTP with honestly probed specs and appears on the gateways pending projection.
  • AC2 — operator approves → the devices poll sees it, the join completes, ConfirmEnrolled lands enrolled over the wire (verified against the control planes own ledger; no in-process ledger in the agents path).
  • AC3 — the gateways /get install route serves the real payload (driven by the real install command via install.Gateway).
  • AC4 — no reachable gateway → the agent fails loud (ADR 0100).

Error-taxonomy round-trip additionally covered in taxonomy_test.go. Reviewed compile/lint-clean (no Go toolchain in the sandbox, #198). Unblocks #183 leg B·2 and Phase As call-in.

Next slice: the device heartbeat (fleet-reporting) transport — unbuiltFleet fails loud until it lands.

Landed as `9db23c5` on `main`. **The device↔control-plane wire now exists** — a device on another machine enrolls over HTTP; every agent subcommand no longer builds its own in-process ledger and enrolls against itself. - **`internal/enrollwire`** carries both ends of the enroll device face (ADR 0037): `RegisterDevice` mounts redeem/pair/poll/confirm over the real `*enroll.Ledger`, and `Client` is the agents real `enroll.ControlPlane` HTTP client. The seams typed error taxonomy (code errors + spec-gate/virt/arch, with detail) is encoded and reconstructed across the wire, so joins Redeem outcomes and Pair rejection screens are identical local-or-remote. A transport fault (no reachable gateway) fails loud (ADR 0100). - **The install doorway served**: `controlapi.WithInstallDoorway` serves `/get` with the fleets pinned per-arch agent from the gateways own seeded cache (`install.CacheSource`, `OURCLOUD_AGENT_CACHE`, ADR 0054/0051); an unseeded cache fails loud (ADR 0100). - **A real device key** (`internal/devicekey`, ed25519, persisted 0600): retires the 32-zero placeholder — the private half never leaves the machine. - **Production wiring**: the agent enrolls against a REMOTE gateway (`enrollTransportFor` over `OURCLOUD_COMMUNITY_ORIGIN`, fail-loud without it); the in-process ledger is a `-tags dev` test double only. The whole control-plane composition wires the real ledger + cache; resting fails loud on both. **Acceptance (seam: `internal/enrollwire/device_transport_integration_test.go`):** - [x] AC1 — install command on another machine, VM mode consented → device calls in over HTTP with honestly probed specs and appears on the gateways pending projection. - [x] AC2 — operator approves → the devices poll sees it, the join completes, ConfirmEnrolled lands enrolled over the wire (verified against the control planes own ledger; no in-process ledger in the agents path). - [x] AC3 — the gateways `/get` install route serves the real payload (driven by the real install command via `install.Gateway`). - [x] AC4 — no reachable gateway → the agent fails loud (ADR 0100). Error-taxonomy round-trip additionally covered in `taxonomy_test.go`. Reviewed compile/lint-clean (no Go toolchain in the sandbox, #198). Unblocks #183 leg B·2 and Phase As call-in. **Next slice**: the device heartbeat (fleet-reporting) transport — `unbuiltFleet` fails loud until it lands.
ben closed this issue 2026-07-31 05:09:27 +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#207
No description provided.