Self-hosted founding renders no gateway — thread GatewayFacts (incl. claim secret) at the pair/deploy join point so a production self-hosted gateway boots the heartbeat ARMED (#519 follow-up) #535

Closed
opened 2026-08-14 17:14:26 +00:00 by ben · 1 comment
Owner

Symptom / gap

Phase-3 rehearsal Task 5 (#519) mirrored #505's claim-secret carriage onto the
SELF-HOSTED full-install gateway render and locked it with two CI-runnable
parity teeth. But tracing the code confirmed (as #519's earlier blocked note
did) that the self-hosted founding path never renders the gateway
founding-side at all
— so a PRODUCTION self-hosted gateway does not yet carry
the claim secret, and its address heartbeat would rest.

  • own-VPS (#505): installOwnVPS (internal/founding/ownvpspath.go) builds the
    full GatewayFacts (apex + PublicGatewayFacts + ClaimSecret + the
    claim-secret Answer) and calls o.clan.Enroll(FullInstall, Gateway: ...),
    which composes control-plane.nix via writeNodeConfig + AttachGateway.
  • private VM (#354): seedCommunityFlake (internal/founding/privatepath.go)
    does the same with Install: VMMode.
  • self-hosted (internal/founding/manualpath.go → Orchestrator.Pair →
    RunReachability → RunDeploy): the device runs the install command and
    pairs via o.enroll.Pair (the in-process enroll ledger, NOT o.clan.Enroll);
    RunDeploy applies o.clan.Config().Head(). Nothing assembles
    GatewayFacts or composes a machines/<node>/ gateway dir for this path
    —
    the draft's apex/claim-secret are consumed only for broker name-wiring
    (wireName → broker.PointSubdomain).

renderControlPlaneSurface already carries the claim secret + apex when the
facts set them (#505); the missing piece is the founding-side wiring that
builds those facts for the self-hosted path.

Proposed fix (proposed default ruling under ADR 0174)

Option A (from #519's blocked note): give the self-hosted founding path its
own gateway-compose leg — a self-hosted analogue of installOwnVPS at the
pair/deploy join point that assembles GatewayFacts (apex from the draft
address, IP from the S10 reachability probe, ports, root keys from the pairing
probe, ClaimSecret gated on AddressSubdomain) and composes the gateway
machine dir (AttachGateway) in the operator's config repo BEFORE RunDeploy
applies Config().Head(). Reuse claimSecretAnswers (ownvpspath.go) for the
in-memory secret feed. This mirrors #505's landed thread exactly, one path over.

The #519 parity teeth (TestEnroll_FullInstallGatewayCarriesClaimSecret,
TestSelfHostedGatewayAssembly_CarriesFullBaseline) already guard the assembly
this wiring must produce, so the change is test-provable.

Blocks

Phase-3 rehearsal Task 7 (heartbeat-repoint leg) needs a PRODUCTION
self-hosted gateway that boots the heartbeat ARMED, so the self-hosted drive
cannot green until this lands. Found while working #519 (phase-3 spec
docs/superpowers/specs/2026-08-14-183-phase-3-home-gateway-rehearsal-design.md,
section c).

## Symptom / gap Phase-3 rehearsal Task 5 (#519) mirrored #505's claim-secret carriage onto the SELF-HOSTED full-install gateway *render* and locked it with two CI-runnable parity teeth. But tracing the code confirmed (as #519's earlier blocked note did) that **the self-hosted founding path never renders the gateway founding-side at all** — so a PRODUCTION self-hosted gateway does not yet carry the claim secret, and its address heartbeat would rest. - own-VPS (#505): `installOwnVPS` (`internal/founding/ownvpspath.go`) builds the full `GatewayFacts` (apex + `PublicGatewayFacts` + `ClaimSecret` + the claim-secret `Answer`) and calls `o.clan.Enroll(FullInstall, Gateway: ...)`, which composes `control-plane.nix` via `writeNodeConfig` + `AttachGateway`. - private VM (#354): `seedCommunityFlake` (`internal/founding/privatepath.go`) does the same with `Install: VMMode`. - **self-hosted** (`internal/founding/manualpath.go` → `Orchestrator.Pair` → `RunReachability` → `RunDeploy`): the device runs the install command and pairs via `o.enroll.Pair` (the in-process enroll ledger, NOT `o.clan.Enroll`); `RunDeploy` applies `o.clan.Config().Head()`. **Nothing assembles `GatewayFacts` or composes a `machines/<node>/` gateway dir for this path** — the draft's apex/claim-secret are consumed only for broker name-wiring (`wireName` → `broker.PointSubdomain`). `renderControlPlaneSurface` already carries the claim secret + apex when the facts set them (#505); the missing piece is the founding-side *wiring* that builds those facts for the self-hosted path. ## Proposed fix (proposed default ruling under ADR 0174) **Option A** (from #519's blocked note): give the self-hosted founding path its own gateway-compose leg — a self-hosted analogue of `installOwnVPS` at the pair/deploy join point that assembles `GatewayFacts` (apex from the draft address, IP from the S10 reachability probe, ports, root keys from the pairing probe, `ClaimSecret` gated on `AddressSubdomain`) and composes the gateway machine dir (`AttachGateway`) in the operator's config repo BEFORE `RunDeploy` applies `Config().Head()`. Reuse `claimSecretAnswers` (`ownvpspath.go`) for the in-memory secret feed. This mirrors #505's landed thread exactly, one path over. The #519 parity teeth (`TestEnroll_FullInstallGatewayCarriesClaimSecret`, `TestSelfHostedGatewayAssembly_CarriesFullBaseline`) already guard the assembly this wiring must produce, so the change is test-provable. ## Blocks Phase-3 rehearsal Task 7 (`heartbeat-repoint` leg) needs a PRODUCTION self-hosted gateway that boots the heartbeat ARMED, so the self-hosted drive cannot green until this lands. Found while working #519 (phase-3 spec `docs/superpowers/specs/2026-08-14-183-phase-3-home-gateway-rehearsal-design.md`, section c).
Author
Owner

close-report for #535 — status success

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

envelope
{
  "issue": 535,
  "status": "success",
  "commits": [
    "b7c8497e2459a92d5e9ec0d1215044481a48aa91"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/enroll/enroll.go",
    "internal/founding/deploy.go",
    "internal/founding/ownvpspath.go",
    "internal/founding/selfhostedpath.go",
    "internal/founding/selfhostedpath_internal_test.go",
    "internal/founding/selfhostedpath_test.go",
    "internal/founding/standup.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/founding/ -run 'SelfHosted|PublicGatewayFacts|EnrollNetwork'",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/clan/ -run 'TestSelfHostedGatewayAssembly_CarriesFullBaseline|TestEnroll_FullInstallGatewayCarriesClaimSecret'",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Option A (ADR 0174 ruling): a self-hosted gateway-compose leg assembles GatewayFacts at the pair/deploy join BEFORE RunDeploy applies Config().Head()": "internal/founding/selfhostedpath.go composeSelfHostedGateway + internal/founding/deploy.go runDeploy calls it before o.clan.Config().Head(); TestSelfHosted_DeployComposesGatewayWithClaimSecretApexAndBaseline",
    "apex from the draft address": "publicGatewayFacts sets CommunityApex/Public.Apex from ownVPSApex(d); test asserts req.Gateway.CommunityApex == rehearsal-home.idss.nz",
    "IP from the S10 reachability probe": "Public.GatewayIP = st.GatewayIP (set at Pair from probe net facts, proven public by RunReachability); test asserts req.Gateway.Public.GatewayIP == 198.51.100.7",
    "ports + root keys from the pairing probe": "publicGatewayFacts bakes the fixed public* kanidm/gate literals; Standup.Takeover captures Network + RootAuthorizedKeys off the pair via new enroll.PairRequest.RootAuthorizedKeys; test asserts req.AuthorizedKeys == the box root key and req.Network non-zero",
    "ClaimSecret gated on AddressSubdomain": "claim := d.Address.Kind == AddressSubdomain; TestSelfHosted_DeployComposes... asserts ClaimSecret true + 1 claim answer for subdomain, TestSelfHosted_OwnDomainComposesWithoutClaimSecret asserts false + 0 answers",
    "composes the gateway machine dir (AttachGateway) via clan.Enroll, reusing claimSecretAnswers": "composeSelfHostedGateway drives o.clan.Enroll (its configure stage = writeNodeConfig + AttachGateway) with answers = claimSecretAnswers(d, claim) + smtp; #519 teeth (TestSelfHostedGatewayAssembly_CarriesFullBaseline) guard the assembly",
    "test-provable against the #519 parity teeth": "the two #519 teeth still pass (re-run recorded in tests[]); new founding tests prove the founding-side facts wiring the teeth's assembly consumes"
  },
  "summary": "The device-driven self-hosted full-install founding now composes its gateway machine dir with the S5 claim secret + apex + baseline at the pair/deploy join, so a production self-hosted gateway boots the heartbeat ARMED (#505's thread, second path).",
  "blockers": []
}
**close-report** for #535 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 535, "status": "success", "commits": [ "b7c8497e2459a92d5e9ec0d1215044481a48aa91" ], "changed_files": [ "STATUS.md", "internal/enroll/enroll.go", "internal/founding/deploy.go", "internal/founding/ownvpspath.go", "internal/founding/selfhostedpath.go", "internal/founding/selfhostedpath_internal_test.go", "internal/founding/selfhostedpath_test.go", "internal/founding/standup.go" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/founding/ -run 'SelfHosted|PublicGatewayFacts|EnrollNetwork'", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/clan/ -run 'TestSelfHostedGatewayAssembly_CarriesFullBaseline|TestEnroll_FullInstallGatewayCarriesClaimSecret'", "exit_code": 0 } ], "criteria": { "Option A (ADR 0174 ruling): a self-hosted gateway-compose leg assembles GatewayFacts at the pair/deploy join BEFORE RunDeploy applies Config().Head()": "internal/founding/selfhostedpath.go composeSelfHostedGateway + internal/founding/deploy.go runDeploy calls it before o.clan.Config().Head(); TestSelfHosted_DeployComposesGatewayWithClaimSecretApexAndBaseline", "apex from the draft address": "publicGatewayFacts sets CommunityApex/Public.Apex from ownVPSApex(d); test asserts req.Gateway.CommunityApex == rehearsal-home.idss.nz", "IP from the S10 reachability probe": "Public.GatewayIP = st.GatewayIP (set at Pair from probe net facts, proven public by RunReachability); test asserts req.Gateway.Public.GatewayIP == 198.51.100.7", "ports + root keys from the pairing probe": "publicGatewayFacts bakes the fixed public* kanidm/gate literals; Standup.Takeover captures Network + RootAuthorizedKeys off the pair via new enroll.PairRequest.RootAuthorizedKeys; test asserts req.AuthorizedKeys == the box root key and req.Network non-zero", "ClaimSecret gated on AddressSubdomain": "claim := d.Address.Kind == AddressSubdomain; TestSelfHosted_DeployComposes... asserts ClaimSecret true + 1 claim answer for subdomain, TestSelfHosted_OwnDomainComposesWithoutClaimSecret asserts false + 0 answers", "composes the gateway machine dir (AttachGateway) via clan.Enroll, reusing claimSecretAnswers": "composeSelfHostedGateway drives o.clan.Enroll (its configure stage = writeNodeConfig + AttachGateway) with answers = claimSecretAnswers(d, claim) + smtp; #519 teeth (TestSelfHostedGatewayAssembly_CarriesFullBaseline) guard the assembly", "test-provable against the #519 parity teeth": "the two #519 teeth still pass (re-run recorded in tests[]); new founding tests prove the founding-side facts wiring the teeth's assembly consumes" }, "summary": "The device-driven self-hosted full-install founding now composes its gateway machine dir with the S5 claim secret + apex + baseline at the pair/deploy join, so a production self-hosted gateway boots the heartbeat ARMED (#505's thread, second path).", "blockers": [] } ``` </details>
ben closed this issue 2026-08-14 17:42:51 +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.

Dependencies

No dependencies set.

Reference
Matou/idss#535
No description provided.