remove-device: the standing agent's #1219 revocation guard polls the founding relay socket, not the community gateway — a device install never carries IDSS_COMMUNITY_ORIGIN into the agent unit #1220
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1220
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The failure
remove-devicered on drive20260904T174618Z(commitb0b0ba65, the #1219 pull mirror). Legs 1–13 green; the fleet-side offboard landed (assertFleetGatewayOnlypassed), but the host kept its guest — unit stillis-active active,/var/lib/idss/vm/guest.qcow2still on disk at 18:12 (3.2 GB, mtime 18:12 — the guest was still writing). The leg's 180 s poll (app/tests/e2e/journey.device.spec.ts:1163-1183) ran to its deadline and threw the last probe's residue.The drive's check is right and the product is wrong: the teardown never ran.
The evidence
The guard #1219 added is wired and ticking — it simply cannot reach the gateway. From the FIRST tick after the landing to the end of the run (quoting normalised):
logs/device-journal.txt:488through:1937— 35 identical failures exactly 30 s apart (17:55:46 → 18:12:46), and nothing else. So:/var/lib/idss/resume.json, 67 bytes, mtime 17:55 (logs/device-journal.txt:2009):saveEnrolledAnchorran;GuardEnrolledOnce(internal/join/resume.go:182) is called each tick fromguardOnce(agent/cmd/agent/main.go:384-403);o.cfg.ControlPlane.Pollnever answers, so the guard returns an error before it can ever see theClosure{Revoked}the offboard wrote.http://enroll-relayis the FOUNDING-shape base.agent/cmd/agent/wiring_prod.go:148-157:The standing service is running with an EMPTY
IDSS_COMMUNITY_ORIGIN, so it dials the app's SSH relay-carrier socket (ADR 0043/0181) — which does not exist on a device box that joined a real remote gateway (rehearsal-e.idss.nz/ 170.64.139.203, perfounding-state.log; the device box is 170.64.191.183).dialRelayretries the ENOENT for its 30 s budget (wiring_prod.go:204-229), butPoll's own ctx is 15 s (wait=0+pollSlack,internal/enrollwire/client.go:21,71-80) — hencecontext deadline exceededevery 15 s, forever.The defect
The origin never reaches the standing unit.
internal/controlapi/installscript.go:70-72sets it as a per-command assignment —IDSS_COMMUNITY_ORIGIN=<apex> idss-agent install "$1". It lives in that one process's environment only.internal/install/install.go:304-315—Service.unitFile()renders the standing unit as[Service]/ExecStart=<bin> join/Restart=always, with noEnvironment=line, andService(install.go:109-134) holds no origin to render one from. Nothing else in the tree writes that unit.idss-agent joinunder systemd (runJoin,agent/cmd/agent/main.go:287-336) resolves its transport with no origin and silently takes the founding branch.This is a latent misconfiguration #1219 lit up. Before it, the standing service's control-plane transport was only exercised by the stranded-join resume (
ResumeStrandedOnce) — never reached on a healthy drive, becauseEnrollcleared the anchor at landing. #1219 madeEnrollKEEP the anchor (internal/join/land.go:151-162) and made the standing service poll every tick, putting the founding-shape fallback on the critical path of the removal contract.That the join itself was green confirms the split: the foreground
idss-agent enrollcarries the origin on its own command line (app/tests/e2e/journey.device.spec.ts:667) and reaches the gateway fine. Two processes, two transports; only the standing one is misconfigured.Suspected layer
Agent install wiring —
internal/installplusagent/cmd/agent/wiring_prod.go. Not the harness: the leg's probe, poll and 180 s deadline are all correct, and the fleet side of the offboard did its part.Why I refused — REFUSAL RULE 3 (product-behaviour surface)
The fix must change what a device install lays down on a community member's machine — the systemd unit written to
/etc/systemd/system/idss-agent.serviceon every joining host. That is what a deploy does, so it is a ruling, not a heal.It is also not a single obvious line. Two shapes, with different durability:
(a) Carry the origin into the unit. Thread the origin into
install.Serviceand renderEnvironment=IDSS_COMMUNITY_ORIGIN=<apex>inunitFile();runInstallalready holds it (main.go:580). Smallest change — but it bakes the community apex into a unit file, so an apex change needs the unit rewritten.(b) Persist the origin as device state under
/var/lib/idssbesidedevice.key, and haveenrollTransportForprefer env → persisted → founding. Survives a unit rewrite; costs a state file and a precedence rule.And a third question that genuinely needs a ruling, which is why this is not confident:
What transport does the guard use on a FOUNDING-shape host? A gateway box enrolled through the app's in-helper ledger over the
ssh -Rrelay carrier has no origin by construction — the documented shape (ADR 0043/0152,wiring_prod.go:135-143), not a bug. Post-#1219 its standing agent also holds anenrolled: trueanchor and will pollhttp://enroll-relayon every 30 s tick for the life of the box, logging an ERROR each time, because the carrier only exists while the app's S7b screen is open. On that shape ADR 0223's amended ruling 5 (docs/adr/0223-vm-guest-joins-the-mesh.md:248-256, gone within one guard tick) has no delivery either. Whoever takes this should rule whether the guard is device-shape-only, or whether a founding host learns an origin once its own gateway is live.Worth ruling alongside:
enrollTransportFor's empty-origin fallback is silent. Under ADR 0100, an agent holding an enrolled anchor with no origin arguably should refuse loudly rather than dial a relay socket that cannot be there — that would have surfaced this at install time instead of 35 identical ERROR lines and a paid red drive.For the record
Rule 1 is clean — the assertion is correct and must stand exactly as written. Rule 2 is comfortable — shape (a) is about 3 files and well under 100 lines. Rule 3 is the one that fires.
drive
20260904T174618Zred atremove-device:the guest is not gone from the host after the LOSES removal (the pull mirror of the decline teardown, #1219): the unit is still loaded (is-active active); /var/lib/idss/vm/guest.qcow2 is still on diskevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260904T174618Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedAlready fixed on main —
26db459e(and diagnosed the same way, from the live droplet's agent journal before the reap).install.ServicegainedOrigin, threaded from the one-liner's env throughNewService(run, origin), andunitFile()now rendersEnvironment=IDSS_COMMUNITY_ORIGIN=<origin>into the standing unit — the standing service then constructs the direct gateway transport (enrollTransportFor's add-device fork), so the guard's poll reacheshttps://<apex>/api/v1/enroll/requests/<id>and sees theClosure{Revoked}. The founding shape (empty origin) renders no line — the app's SSH relay IS its transport and rightly dies with the founding session — and the agent's guard tick no-ops there (the founding node is the gateway; there is no fleet removal to guard against, only 30 s error spam forever). Pin:TestInstallService_BakesTheOriginIntoTheStandingUnit. Also landed54f9cb88: the device harvest now carries the host agent's journal (device-agent-journal) so this class of red is in the run dir, not only on a droplet racing the reaper. Note: this latently broke a #953 resume on every add-device install too — the guard was just the first standing-transport consumer a drive exercised. Closing — the re-fire's fresh install lays the env-carrying unit and remove-device is the live proof. — session under ADR 0174 (veto anytime)Second session-runner note (run 3379756, host matou-dev-server-01) — no action taken; ticket already correctly closed. My runner claimed this at 18:30:09Z, ~15 min after the fix landed and seconds before ben closed it at 18:33:01Z (a race on the shared ready-for-session queue). I independently verified the landed fix before standing down:
26db459eis onorigin/main;install.gothreadsService.OriginviaNewService(run, origin)andunitFile()rendersEnvironment=IDSS_COMMUNITY_ORIGIN=<origin>;wiring_prod.installConfigpasses the real origin;main.goguardOnceno-ops on the founding shape (empty origin).go test ./internal/install/ ./internal/join/ ./agent/...all green, incl. the pinTestInstallService_BakesTheOriginIntoTheStandingUnit;gofmt -lempty,go vetclean.guardOnceno-op), and the collector gap the fix commit flagged is closed by54f9cb88(device harvest now carries the host agent journal). The ADR-0100 "loud empty-origin refusal" idea is moot on the add-device shape now that the unit always carries the origin, and would be wrong on the founding shape where the relay IS the correct transport — no follow-up filed.Closing the ticket already unblocks the confirming re-drive (
rehearsal-report.sh: the red drive re-fires when its last blocker closes). Nothing further for a session to do. Verified by agent under ADR 0174 — veto anytime.