founding selfhosted relay carrier: the helper/app end of the ADR 0043 enroll relay — enrollwire-over-SSH-socket + app-side pairing observation (unblocks consent/pair) #582
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
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#582
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?
Split from #581 (per its own direction: "If the relay carrier turns out to be genuinely large, split the agent-side founding-mode fix … from the relay … sequenced tickets"). #581 shipped the agent-side tooth (
agent/cmd/agent/wiring_prod.go— noOURCLOUD_COMMUNITY_ORIGINis now the FOUNDING shape, wiring the device-end control-plane transport as an enrollwire client over a local Unix relay socketOURCLOUD_ENROLL_RELAY_SOCKET(default/run/ourcloud/enroll-relay.sock), not a hard error). This ticket builds the helper/app end so theconsent/pairlegs of the phase-3--target selfhosteddrive (journey.selfhosted.spec.ts) go green.What #581 established (the device end of the carrier)
agent join(the serviceExecStart) andagent enroll <code>(the terminal doorway,bootstrap/cmd/bootstrap/installscript.go's finalexec) now construct in founding mode instead of failing loud atenrollTransportFor. Their control-plane calls (Redeem/Pair/Poll) dial the relay socket; enrollwire wire is unchanged (ADR 0043 carrier-agnostic client).Redeem/Pairfail loud (connection refused). So the drive still reds — now at the dial, not at construction.What this ticket must build (checked what exists first, per #581)
app/helper/cmd/helper/wiring_prod.gonewEnrollLedger) is used in-process only (founding.WithEnroll); there is no HTTP/enrollwire face over it.enrollwire.RegisterDevice(mux, svc, log)exists (internal/enrollwire/server.go:26) — wrap the in-helper ledger'senroll.ControlPlanewith it. Note:newEnrollLedgerreturnsfounding.EnrollFace(mint + device face); confirm it satisfies / can exposeenroll.ControlPlane.BeginStandupbranch (internal/founding/manualpath.go) mints the code and rests at S7b — it does NOT drive out (unlike own-VPS/ADR 0152). Nothing today opens an SSH channel from the helper to the selfhosted box, and the wizard's captured S4b access (internal/founding/access.go) is not threaded into a carrier. Build: helper reachesroot@<IP>over SSH and remote-forwards the box's/run/ourcloud/enroll-relay.sockonto the helper's enrollwire device server (device end dials local → SSH → helper ledger).pair) asserts[data-status="spec-gate-pass"]app-side. The own-VPS path drives+observes pairing in-process; selfhosted must observe the device's redeem/pair landing in the in-helper ledger and render S9. No such flow exists for selfhosted yet.Two design decisions this needs a human ruling on (why
ready-for-human)A. ADR 0152 reconciliation. ADR 0152 superseded ADR 0043's own-VPS relay and explicitly rejected building the relay ("option B") in favour of the app driving out. #581's direction is that selfhosted is a genuinely different path (the operator's own home machine — a paste-a-one-liner install, not an app-driven nixos-anywhere disk takeover), so the relay is the right carrier here and ADR 0152 does not cover it. Confirm that reading and record it (an ADR/DDR), OR rule that selfhosted also drives out.
B. installScript vs the leg contract.
bootstrap/cmd/bootstrap/installscript.goends withexec "$bin" enroll "$code"(consent in the box's own terminal, ADR 0024 — Task 1's contract). But the phase-3 spec runs leg 5 (agent-install) non-interactively viasshDroplet(ip, installCommand)expecting exit 0 +systemctl is-active, and leg 6 (consent) interactively re-runningourcloud-agent enroll <code>over a PTY. The trailingexec enrollruns a non-interactive enroll at leg 5 that cannot consent (no TTY → EOF), so leg 5 cannot exit 0 as written. Rule how these reconcile: e.g. the served script installs+starts only (drops theexec enroll) and consent is leg 6 alone; or the leg contract changes.bootstrap/is a normal (non-protected) path;installscript.gois Ben-deployed by hand to get.idss.nz (plan Task 2), so a change here also needs a re-stage.Evidence + full trace: #581's thread and
test-results/drive-selfhosted/20260815T062245Z/.advances #523
Ruled by agent under ADR 0174 — veto anytime: this ticket is the confirmed root cause of #591 (rehearsal drive
20260819T163919Z, red atagent-install), diagnosed interactively rather than left unparsed.Diagnosis (proof): the raw log #591 carries —
enroll did not reach Pending … enrollwire: POST http://enroll-relay/api/vN/enroll/redeem … di[al …]— isagent enroll's Redeem call dying on the local Unix relay socket (agent/cmd/agent/wiring_prod.go'senrollTransportFor, empty-origin/founding branch, dialing/run/ourcloud/enroll-relay.sock).bootstrap/cmd/bootstrap/installscript.go's install one-liner endsexec "$bin" enroll "$code", so this fires inside leg 5 (agent-install) itself, before leg 6 (consent) ever runs. Confirmed by reading the code, not by re-driving:internal/enrollwire's device server (RegisterDevice) is never mounted anywhere inapp/helper(grep -rn ListenAndServe app/helper— zero hits), and no SSH remote-forward exists from a selfhosted box back to the helper — exactly the two gaps this ticket's "What this ticket must build" section already names. Nothing new to add to the diagnosis; #591 is the same signature (f719667ae384= sha1(rehearsal-183|agent-install)) recurring because this ticket didn't carry therehearsal-183label or arehearsal-sigmarker, so the automated reporter's dedup (match_sig, filters onlabels=rehearsal-183+ a body substring) could never find it and filed fresh each time.Fixed the dedup gap (a plain two-way-door label/body edit, revertible by re-editing): added the
rehearsal-183+prioritylabels and appended<!-- rehearsal-sig: f719667ae384 -->to this issue's body — the next red drive atagent-installwill append evidence here instead of filing a new ticket. Wired#523(the phase-3 standing drive) as nativelydepends_onthis issue, so the drive stays honestly blocked now that #591 (which was the only live blocker) is closing as a duplicate.Did NOT touch the two open design questions (A/B above) or write any of the carrier code — that's this ticket's actual scope, a
ready-for-session-sized (or larger) build, out of bounds for a session dispatched to work #591 alone (ADR 0174 rule "work only this ticket"). Leftready-for-humanas-is: those two decisions are the genuine residue.Fresh evidence this drive added:
test-results/…/20260819T163919Z/on matou-workstation (legs.json, droplet-journal.txt, trace).Ben ruled both design decisions (2026-08-19, live session):
A — ADR 0152 reconciliation: the relay IS the carrier for self-hosted. #581's reading confirmed: self-hosted (paste-a-one-liner install on the operator's own machine) is a genuinely different path from own-VPS's app-driven takeover, so ADR 0152's rejection of the relay does not cover it. Record this as a new ADR scoped to self-hosted founding enrolment (0152 stands unamended for own-VPS). Next free ADR number: 0180 — 0179 is taken on origin/main (check before minting; there is also an unlanded local 0179 draft on Ben's machine that will be renumbered).
B — the served install script installs + starts only. Drop the trailing
exec "$bin" enroll "$code"frombootstrap/cmd/bootstrap/installscript.go: leg 5 (agent-install, non-interactive ssh) must exit 0 on install+service-active; consent remains leg 6 alone, interactive over a PTY (ADR 0024 intact). After this lands, get.idss.nz needs a re-stage — comment here when the artifact is ready and a human/session re-stages it on the mail droplet (ssh dev@100.98.48.68) before the next drive can green leg 5.Armed ready-for-agent; priority stays. The standing drive #523 is armed and blocked on this ticket — it re-fires on close.
swarm-claim host=matou-dev-server-01 run=7734
(automated multi-host claim — lowest live claim id works this ticket)
Shipped the ruled + cleanly-separable slice in
f7ed1fe(onorigin/main), mirroring how #581 shipped the device end and split the rest here:Decision A → ADR 0181 — the relay IS the carrier for self-hosted founding enrolment (ADR 0152's own-VPS drive-out stands unamended). Architecture diagrams 08/09 corrected (they had self-hosted vs own-VPS carriers backwards) per ADR 0042.
Decision B →
installscript.goinstalls + starts only — dropped the trailingexec "$bin" enroll "$code"so leg 5 (agent-install, non-interactive over SSH) exits 0 on service-active; consent is leg 6 alone (interactive PTY, ADR 0024).main_test.gonow guards the foreground-enroll regression #591 kept re-filing.⚠️ get.idss.nz needs a re-stage before a drive can green leg 5: the served one-liner changed. A human/session re-stages
bootstrap/cmd/bootstrap/installscript.go's artifact on the mail droplet (ssh dev@100.98.48.68), as Ben's decision-B comment noted.Build item 1 (helper end of the carrier) —
persistedEnrollnow satisfiesenroll.ControlPlane(addedPoll);enrolldevice.goservesenrollwire.RegisterDeviceover the same in-helper ledger the orchestrator holds (shared face, no #575 split-brain) on a Unix socket gated byOURCLOUD_ENROLL_RELAY_SERVE_SOCKET, wired intohelper found.enrolldevice_test.godrives Redeem end-to-end over the socket and proves it persists to the ledger's own document.Split out → #594 (build items 2 + 3): the SSH remote-forward carrier binding the box's
/run/ourcloud/enroll-relay.sockonto this helper socket, and app-side S9 pairing observation for self-hosted. #594 carries the one open design question this closer did not touch — self-hosted box SSH-address provenance (drive supplies it viaOC_E2E_DROPLET_IP; product-flow provenance is a later slice), which is two-way-door-shaped and rulable under ADR 0174 by the agent that picks it up.Consent (leg 6) / pair (leg 7) stay red until #594 + the re-stage land — this close is the helper-end slice + both rulings, not the whole drive.
close-report for #582 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope