fleet: the DEVICE report-only heartbeat unit (item 2 device half, split from #1221) — mesh origin + resume-anchor identity + pin 4b #1356

Open
opened 2026-09-09 14:47:28 +00:00 by matou-build-agent · 0 comments

Split from #1221 (Ben's "one ticket, or split 1/2 from 3" allowance, DDR/ruling 2026-09-08). #1221's build-list item 2 GATEWAY half landed (the idss-agent-report unit on all four gateway renders, gatewayReportUnit, baking IDSS_NODE_ID = the founding gateway's ledger identity node-req-0001). This ticket carries the DEVICE half of item 2, plus pin 4b.

Why the device half is its own slice

The gateway reports to the control plane at loopback (http://127.0.0.1:8080) under a deterministic identity (node-req-0001). Neither holds for a device:

  1. Community origin over the MESH, not loopback. Ben's item 2 says a device's IDSS_COMMUNITY_ORIGIN is "the mesh address". renderMemberMesh (internal/clan/netbird.go) has only the netbird SetupKey + ManagementURL (https://mesh.<apex>:443) — that is the netbird management plane, NOT the IDSS community API. The gateway's IDSS API over wt0 is a dynamic address the fleet resolves post-reboot; there is no clean origin string at renderMemberMesh time.
  2. Identity is the device's OWN node-<requestID>, not baked. Ben: "identity from the pairing-minted enroll.json / device.key that survive the clan update." A member device HAS a resume anchor, so reportNodeID derives node-+requestID from it (agent/cmd/agent/main.go) — no IDSS_NODE_ID bake needed — but the report unit still needs a valid IDSS_COMMUNITY_ORIGIN.
  3. Two device shapes. The VM-mode / member-takeover device is NixOS-rendered (renderMemberMesh, which emits NO systemd unit today). The stock-Ubuntu device is a non-declarative /etc/systemd/system/idss-agent.service written by internal/install (ExecStart=<bin> join). Both need a report unit; they are different surfaces.

What to build

  • VM-mode / member device: renderMemberMesh (or a sibling module the member takeover bakes) declares idss-agent-report running the member's agent binary in the report-only shape, IDSS_COMMUNITY_ORIGIN = the gateway's IDSS API over the mesh (resolve the right address — likely the community front door https://<apex> or the gateway's wt0 address:8080), identity from the resume anchor. Mirror the gateway's path-unit-on-binary-arrival pattern where the binary is seeded, not switch-baked.
  • Stock-Ubuntu device: internal/install lays a second idss-agent-report.service alongside the join unit, reusing the join unit's baked IDSS_COMMUNITY_ORIGIN; identity from the resume anchor. Clean because both are already available there.
  • Pin 4b (live): a device whose power is pulled reads silent after StaleAfter (the #183 B·6 leg — never proven live). Needs a live device drive.

Depends on / reference

  • #1221 (gateway sender + the shared agent report loop, sampler, monitor identity join — all merged).
  • The gateway unit for the shape to mirror: internal/clan/vmguest.go gatewayReportUnit.
  • The path-unit-on-binary-arrival pattern: internal/clan/netbird.go meshSelfAdmitOneshot.

Found while landing #1221 item 2's gateway half.

Split from #1221 (Ben's "one ticket, or split 1/2 from 3" allowance, DDR/ruling 2026-09-08). #1221's build-list **item 2 GATEWAY half landed** (the `idss-agent-report` unit on all four gateway renders, `gatewayReportUnit`, baking `IDSS_NODE_ID` = the founding gateway's ledger identity `node-req-0001`). This ticket carries the **DEVICE half** of item 2, plus pin 4b. ## Why the device half is its own slice The gateway reports to the control plane at **loopback** (`http://127.0.0.1:8080`) under a **deterministic** identity (`node-req-0001`). Neither holds for a device: 1. **Community origin over the MESH, not loopback.** Ben's item 2 says a device's `IDSS_COMMUNITY_ORIGIN` is "the mesh address". `renderMemberMesh` (`internal/clan/netbird.go`) has only the netbird `SetupKey` + `ManagementURL` (`https://mesh.<apex>:443`) — that is the netbird *management* plane, NOT the IDSS community API. The gateway's IDSS API over `wt0` is a dynamic address the fleet resolves post-reboot; there is no clean origin string at `renderMemberMesh` time. 2. **Identity is the device's OWN `node-<requestID>`, not baked.** Ben: "identity from the pairing-minted `enroll.json` / `device.key` that survive the clan update." A member device HAS a resume anchor, so `reportNodeID` derives `node-`+requestID from it (agent/cmd/agent/main.go) — no `IDSS_NODE_ID` bake needed — but the report unit still needs a valid `IDSS_COMMUNITY_ORIGIN`. 3. **Two device shapes.** The VM-mode / member-takeover device is NixOS-rendered (`renderMemberMesh`, which emits NO systemd unit today). The stock-Ubuntu device is a **non-declarative** `/etc/systemd/system/idss-agent.service` written by `internal/install` (`ExecStart=<bin> join`). Both need a report unit; they are different surfaces. ## What to build - **VM-mode / member device:** `renderMemberMesh` (or a sibling module the member takeover bakes) declares `idss-agent-report` running the member's agent binary in the report-only shape, `IDSS_COMMUNITY_ORIGIN` = the gateway's IDSS API over the mesh (resolve the right address — likely the community front door `https://<apex>` or the gateway's `wt0` address:8080), identity from the resume anchor. Mirror the gateway's path-unit-on-binary-arrival pattern where the binary is seeded, not switch-baked. - **Stock-Ubuntu device:** `internal/install` lays a second `idss-agent-report.service` alongside the `join` unit, reusing the join unit's baked `IDSS_COMMUNITY_ORIGIN`; identity from the resume anchor. Clean because both are already available there. - **Pin 4b (live):** a device whose power is pulled reads `silent` after StaleAfter (the #183 B·6 leg — never proven live). Needs a live device drive. ## Depends on / reference - #1221 (gateway sender + the shared `agent report` loop, sampler, monitor identity join — all merged). - The gateway unit for the shape to mirror: `internal/clan/vmguest.go` `gatewayReportUnit`. - The path-unit-on-binary-arrival pattern: `internal/clan/netbird.go` `meshSelfAdmitOneshot`. Found while landing #1221 item 2's gateway half.
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.

Dependencies

No dependencies set.

Reference
Matou/idss#1356
No description provided.