founding self-hosted relay carrier (part 2): SSH remote-forward binding the box's enroll socket to the helper device server + app-side S9 pairing observation #594

Closed
opened 2026-08-19 18:46:07 +00:00 by ben · 3 comments
Owner

Split from #582 (per its own "What this ticket must build" section: build item 1 — the helper-side enrollwire device server — shipped in f7ed1fe; build items 2 and 3 remain and are a genuinely separate, larger, live-verified slice). #582 also landed the two ruled design decisions: ADR 0181 (decision A — the relay IS the carrier for self-hosted founding enrolment; ADR 0152's own-VPS drive-out stands unamended) and decision B (installscript.go installs + starts only, no foreground exec enroll).

What #582 established (the carrier's helper end)

  • persistedEnroll now satisfies enroll.ControlPlane (added Poll), and app/helper/cmd/helper/enrolldevice.go (serveEnrollDevice / startEnrollRelayServer) mounts enrollwire.RegisterDevice over the same in-helper ledger the founding orchestrator holds (newFoundingOrchestrator returns the shared face — no #575 split-brain), served on a Unix socket gated by OURCLOUD_ENROLL_RELAY_SERVE_SOCKET and wired into helper found.
  • The device end (the agent dialing /run/ourcloud/enroll-relay.sock) is #581, already shipped. So both socket ends exist; nothing yet binds them across the wire, and the app never observes the box's pairing.

What this ticket must build (items 2 + 3 of #582)

  1. The SSH remote-forward carrier itself. The self-hosted BeginStandup branch (internal/founding/manualpath.go) mints the code and rests at S7b — it does NOT drive out. Build the leg that reaches root@<IP> over SSH and remote-forwards the box's /run/ourcloud/enroll-relay.sock onto the helper's enrollwire device server (set OURCLOUD_ENROLL_RELAY_SERVE_SOCKET and forward the box socket onto it). Reuse the fleetwire SSH machinery the own-VPS carrier already uses (fleetwire.NewOwnVPSCarrier, NewSSHForwarder).
  2. App-side pairing observation for self-hosted. Leg 7 (pair) asserts [data-status="spec-gate-pass"] app-side. Own-VPS drives+observes pairing in-process; self-hosted must observe the box's redeem/pair landing in the in-helper ledger (which the device server now writes to) and render S9. No such flow exists for self-hosted yet.

Open design question this must first settle (why it is not a trivial build)

Self-hosted box SSH-address + credentials provenance. The self-hosted path is "a machine at your place" — ConfirmSelfHosted (internal/founding/access.go) captures no IP, and the phase-3 drive only supplies the box IP via OC_E2E_DROPLET_IP (an env the launch fixture forwards into the helper, like OURCLOUD_E2E_OPEN_SINK). So the carrier can read the box address from a drive-only env knob to make the drive green without a UX change (product-flow provenance — where a real operator's box address/SSH trust comes from — is a later slice, honestly noted). Confirm that reading, or rule differently, before building. This is two-way-door-shaped (env-gated, revertible, provable by the drive) so it should be rulable under ADR 0174 by the agent that picks this up.

Evidence + full trace: #582's thread; ADR 0181; test-results/drive-selfhosted/.

advances #523

Split from **#582** (per its own "What this ticket must build" section: build item 1 — the helper-side enrollwire device server — shipped in `f7ed1fe`; build items 2 and 3 remain and are a genuinely separate, larger, live-verified slice). #582 also landed the two ruled design decisions: **ADR 0181** (decision A — the relay IS the carrier for self-hosted founding enrolment; ADR 0152's own-VPS drive-out stands unamended) and **decision B** (`installscript.go` installs + starts only, no foreground `exec enroll`). ## What #582 established (the carrier's helper end) - `persistedEnroll` now satisfies `enroll.ControlPlane` (added `Poll`), and `app/helper/cmd/helper/enrolldevice.go` (`serveEnrollDevice` / `startEnrollRelayServer`) mounts `enrollwire.RegisterDevice` over the **same** in-helper ledger the founding orchestrator holds (`newFoundingOrchestrator` returns the shared face — no #575 split-brain), served on a Unix socket **gated by `OURCLOUD_ENROLL_RELAY_SERVE_SOCKET`** and wired into `helper found`. - The device end (the agent dialing `/run/ourcloud/enroll-relay.sock`) is #581, already shipped. So both socket ends exist; nothing yet *binds* them across the wire, and the app never observes the box's pairing. ## What this ticket must build (items 2 + 3 of #582) 1. **The SSH remote-forward carrier itself.** The self-hosted `BeginStandup` branch (`internal/founding/manualpath.go`) mints the code and rests at S7b — it does NOT drive out. Build the leg that reaches `root@<IP>` over SSH and **remote-forwards** the box's `/run/ourcloud/enroll-relay.sock` onto the helper's enrollwire device server (set `OURCLOUD_ENROLL_RELAY_SERVE_SOCKET` and forward the box socket onto it). Reuse the fleetwire SSH machinery the own-VPS carrier already uses (`fleetwire.NewOwnVPSCarrier`, `NewSSHForwarder`). 2. **App-side pairing observation for self-hosted.** Leg 7 (`pair`) asserts `[data-status="spec-gate-pass"]` app-side. Own-VPS drives+observes pairing in-process; self-hosted must observe the box's redeem/pair landing in the in-helper ledger (which the device server now writes to) and render S9. No such flow exists for self-hosted yet. ## Open design question this must first settle (why it is not a trivial build) **Self-hosted box SSH-address + credentials provenance.** The self-hosted path is "a machine at your place" — `ConfirmSelfHosted` (`internal/founding/access.go`) captures **no IP**, and the phase-3 drive only supplies the box IP via `OC_E2E_DROPLET_IP` (an env the launch fixture forwards into the helper, like `OURCLOUD_E2E_OPEN_SINK`). So the carrier can read the box address from a drive-only env knob to make the drive green **without** a UX change (product-flow provenance — where a real operator's box address/SSH trust comes from — is a later slice, honestly noted). Confirm that reading, or rule differently, before building. This is two-way-door-shaped (env-gated, revertible, provable by the drive) so it should be rulable under ADR 0174 by the agent that picks this up. Evidence + full trace: #582's thread; ADR 0181; `test-results/drive-selfhosted/`. advances #523
Author
Owner

Ruled by agent under ADR 0174 — veto anytime.

Decision (the open design question in the ticket): the self-hosted founding
relay carrier reads the box's SSH address from the drive-only env knob
OC_E2E_DROPLET_IP — the same env the phase-1 droplet journey already reads
(scripts/lib/rehearsal-droplet.sh exports it; journey.selfhosted.spec.ts
consumes it). ConfirmSelfHosted/AccessSelfHosted (internal/founding/access.go)
captures no operator IP, so the carrier reads the box address from this knob to
make the self-hosted drive green without any UX change. The helper serves the
enrollwire device face on OURCLOUD_ENROLL_RELAY_SERVE_SOCKET (#582, set by the
drive fixture); the carrier's ssh -N -R <box-relay-socket>:<serve-socket>
remote-forward binds the box's /run/ourcloud/enroll-relay.sock onto it.

Why it is a two-way door: env-gated (the whole reading is behind
OC_E2E_DROPLET_IP — unset on every non-drive path, so nothing widens for a real
operator), revertible by a later commit, and not on the ADR 0174 one-way-door list
(no personal credential, no security-posture widening, no member-facing trust
accept, no data destruction, no spend). It mirrors the exact provenance shape the
own-VPS carrier's OURCLOUD_E2E_OPEN_SINK and the phase-1 droplet IP already use.

What proves it: the drive-selfhosted phase-3 rehearsal drive — legs 6
(consent: the box's connection request sent lands in the in-helper ledger over
the forwarded socket) and 7 (pair: the app renders [data-status="spec-gate-pass"]).

Honestly noted: where a real operator's box SSH address + host-key trust come
from (a UX capture on AccessSelfHosted) is a later product-flow slice — this
ruling does not build that, it only reads the drive knob so the transport + app-side
observation can be built and proven now.

**Ruled by agent under ADR 0174 — veto anytime.** **Decision (the open design question in the ticket):** the self-hosted founding relay carrier reads the box's SSH address from the drive-only env knob **`OC_E2E_DROPLET_IP`** — the same env the phase-1 droplet journey already reads (`scripts/lib/rehearsal-droplet.sh` exports it; `journey.selfhosted.spec.ts` consumes it). `ConfirmSelfHosted`/`AccessSelfHosted` (`internal/founding/access.go`) captures **no operator IP**, so the carrier reads the box address from this knob to make the self-hosted drive green **without any UX change**. The helper serves the enrollwire device face on `OURCLOUD_ENROLL_RELAY_SERVE_SOCKET` (#582, set by the drive fixture); the carrier's `ssh -N -R <box-relay-socket>:<serve-socket>` remote-forward binds the box's `/run/ourcloud/enroll-relay.sock` onto it. **Why it is a two-way door:** env-gated (the whole reading is behind `OC_E2E_DROPLET_IP` — unset on every non-drive path, so nothing widens for a real operator), revertible by a later commit, and not on the ADR 0174 one-way-door list (no personal credential, no security-posture widening, no member-facing trust accept, no data destruction, no spend). It mirrors the exact provenance shape the own-VPS carrier's `OURCLOUD_E2E_OPEN_SINK` and the phase-1 droplet IP already use. **What proves it:** the `drive-selfhosted` phase-3 rehearsal drive — legs 6 (`consent`: the box's `connection request sent` lands in the in-helper ledger over the forwarded socket) and 7 (`pair`: the app renders `[data-status="spec-gate-pass"]`). **Honestly noted:** where a *real* operator's box SSH address + host-key trust come from (a UX capture on `AccessSelfHosted`) is a later product-flow slice — this ruling does not build that, it only reads the drive knob so the transport + app-side observation can be built and proven now.

swarm-claim host=matou-dev-server-01 run=7775
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=7775 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

close-report for #594 — status success

✅ close-report gates passed — every claim verified against main; closing.

envelope
{
  "issue": 594,
  "status": "success",
  "commits": [
    "89902f96688691f17f1fcc6e610e2e9cd25f8088"
  ],
  "changed_files": [
    "STATUS.md",
    "app/helper/cmd/helper/enrollpersist.go",
    "app/helper/cmd/helper/main.go",
    "app/helper/cmd/helper/wiring_prod.go",
    "app/helper/cmd/helper/wiring_test.go",
    "app/src/components/founding/FoundingStandup.vue",
    "app/src/lib/founding.ts",
    "app/tests/e2e/fixtures/launch.ts",
    "internal/enroll/enroll.go",
    "internal/enroll/ledger.go",
    "internal/fleetwire/relay.go",
    "internal/fleetwire/relay_test.go",
    "internal/founding/manualpath.go",
    "internal/founding/orchestrator.go",
    "internal/founding/relaycarrier.go",
    "internal/founding/selfhostedcarrier.go",
    "internal/founding/selfhostedcarrier_test.go",
    "internal/founding/standup.go",
    "internal/founding/stdio.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/founding/ ./internal/fleetwire/ ./internal/enroll/ ./app/helper/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/founding/... ./internal/fleetwire/... ./internal/enroll/... ./app/helper/...",
      "exit_code": 0
    },
    {
      "command": "app: node_modules/.bin/vue-tsc -p tsconfig.json",
      "exit_code": 0
    },
    {
      "command": "app: vitest run (incl. boot.test.ts under nix go)",
      "exit_code": 0
    },
    {
      "command": "eslint app/src/lib/founding.ts app/src/components/founding/FoundingStandup.vue app/tests/e2e/fixtures/launch.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Item 1 — SSH remote-forward carrier reaches root@<IP> and remote-forwards the box's /run/ourcloud/enroll-relay.sock onto the helper's enrollwire device server (OURCLOUD_ENROLL_RELAY_SERVE_SOCKET), reusing fleetwire SSH machinery": "internal/fleetwire/relay.go (RelayForwarder: supervised `ssh -N -R <box-socket>:<helper-socket>` over RemoteTarget accept-new+pinned+ambient posture, ExitOnForwardFailure+StreamLocalBindUnlink); founding.RelayCarrier seam (internal/founding/relaycarrier.go); BeginStandup opens it (internal/founding/manualpath.go); wired in wiring_prod.go with HelperSocket=relayServeSocket(). Proven by internal/fleetwire/relay_test.go (argv + supervisor retry/stop) and internal/founding/selfhostedcarrier_test.go (BeginStandup opens the forward to the box address once).",
    "Item 2 — app-side pairing observation for self-hosted observes the box's redeem/pair landing in the in-helper ledger and renders S9 ([data-status=spec-gate-pass])": "Orchestrator.ObservePairing (internal/founding/selfhostedcarrier.go) finds the box's now-Pending gateway request via EnrollFace.List and runs the shared applyPaired approve-and-advance tail (refactored out of pair, internal/founding/standup.go) -> StandupReachability with the SpecCard, which FoundingSpecGate.vue renders as data-status=spec-gate-pass. Polled by FoundingStandup.vue's observe-pairing poll + founding.ts observePairing(). Proven by internal/founding/selfhostedcarrier_test.go (box redeem/pair straight to the shared ledger, then ObservePairing advances to the card + takeover facts, idempotent).",
    "Open design question — self-hosted box SSH-address provenance": "Ruled by agent under ADR 0174 (posted to issue #594): read from the drive-only OC_E2E_DROPLET_IP env (selfHostedBoxAddressEnv in wiring_prod.go, WithSelfHostedBoxAddress in founding); unset off-drive so no UX change; a real operator's box-address/SSH-trust capture is a later product-flow slice."
  },
  "summary": "Built the self-hosted founding relay carrier's SSH remote-forward transport and the app-side S9 pairing observation (items 2+3 of #582), ruling box-address provenance under ADR 0174.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #594 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 594, "status": "success", "commits": [ "89902f96688691f17f1fcc6e610e2e9cd25f8088" ], "changed_files": [ "STATUS.md", "app/helper/cmd/helper/enrollpersist.go", "app/helper/cmd/helper/main.go", "app/helper/cmd/helper/wiring_prod.go", "app/helper/cmd/helper/wiring_test.go", "app/src/components/founding/FoundingStandup.vue", "app/src/lib/founding.ts", "app/tests/e2e/fixtures/launch.ts", "internal/enroll/enroll.go", "internal/enroll/ledger.go", "internal/fleetwire/relay.go", "internal/fleetwire/relay_test.go", "internal/founding/manualpath.go", "internal/founding/orchestrator.go", "internal/founding/relaycarrier.go", "internal/founding/selfhostedcarrier.go", "internal/founding/selfhostedcarrier_test.go", "internal/founding/standup.go", "internal/founding/stdio.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/founding/ ./internal/fleetwire/ ./internal/enroll/ ./app/helper/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/founding/... ./internal/fleetwire/... ./internal/enroll/... ./app/helper/...", "exit_code": 0 }, { "command": "app: node_modules/.bin/vue-tsc -p tsconfig.json", "exit_code": 0 }, { "command": "app: vitest run (incl. boot.test.ts under nix go)", "exit_code": 0 }, { "command": "eslint app/src/lib/founding.ts app/src/components/founding/FoundingStandup.vue app/tests/e2e/fixtures/launch.ts", "exit_code": 0 } ], "criteria": { "Item 1 — SSH remote-forward carrier reaches root@<IP> and remote-forwards the box's /run/ourcloud/enroll-relay.sock onto the helper's enrollwire device server (OURCLOUD_ENROLL_RELAY_SERVE_SOCKET), reusing fleetwire SSH machinery": "internal/fleetwire/relay.go (RelayForwarder: supervised `ssh -N -R <box-socket>:<helper-socket>` over RemoteTarget accept-new+pinned+ambient posture, ExitOnForwardFailure+StreamLocalBindUnlink); founding.RelayCarrier seam (internal/founding/relaycarrier.go); BeginStandup opens it (internal/founding/manualpath.go); wired in wiring_prod.go with HelperSocket=relayServeSocket(). Proven by internal/fleetwire/relay_test.go (argv + supervisor retry/stop) and internal/founding/selfhostedcarrier_test.go (BeginStandup opens the forward to the box address once).", "Item 2 — app-side pairing observation for self-hosted observes the box's redeem/pair landing in the in-helper ledger and renders S9 ([data-status=spec-gate-pass])": "Orchestrator.ObservePairing (internal/founding/selfhostedcarrier.go) finds the box's now-Pending gateway request via EnrollFace.List and runs the shared applyPaired approve-and-advance tail (refactored out of pair, internal/founding/standup.go) -> StandupReachability with the SpecCard, which FoundingSpecGate.vue renders as data-status=spec-gate-pass. Polled by FoundingStandup.vue's observe-pairing poll + founding.ts observePairing(). Proven by internal/founding/selfhostedcarrier_test.go (box redeem/pair straight to the shared ledger, then ObservePairing advances to the card + takeover facts, idempotent).", "Open design question — self-hosted box SSH-address provenance": "Ruled by agent under ADR 0174 (posted to issue #594): read from the drive-only OC_E2E_DROPLET_IP env (selfHostedBoxAddressEnv in wiring_prod.go, WithSelfHostedBoxAddress in founding); unset off-drive so no UX change; a real operator's box-address/SSH-trust capture is a later product-flow slice." }, "summary": "Built the self-hosted founding relay carrier's SSH remote-forward transport and the app-side S9 pairing observation (items 2+3 of #582), ruling box-address provenance under ADR 0174.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
ben closed this issue 2026-08-19 19:27:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#594
No description provided.