A standing community never receives a front-door posture change: the release lane and rerender-gateway leave front-door.nix as founded, so every pre-ADR-0271 community loses its control panel on its next release (apex boots the Portal, admin.<apex> 404s) #1845

Closed
opened 2026-09-24 18:35:33 +00:00 by ben · 3 comments
Owner

Symptom

A community founded before ADR 0271 (the apex switch, 976ef465) that takes ANY later release loses its control panel. Found 2026-09-24 while hand-updating whakatohea-demo (founded from ff4a5263 on 09-23) to the testing release 2c5fe0fa (seq 2835):

  • the box's machines/gateway/front-door.nix is the ADR 0247 render: @apex host <apex> → gate → control plane (the panel), no admin.<apex> route (https://admin.whakatohea-demo.idss.nz/ → Caddy 404, content-length 0);
  • the 2c5fe0fa dashboard bundle is host-aware (dashboard/src/lib/portalRouting.ts, APEX_SURFACE = 'portal'): the bare apex boots the Portal, only admin.<apex> boots the operator SPA;
  • so once the new bits land, the apex shows the Portal behind the gate and the panel is unreachable — admin.<apex> is never served.

Cause

Nothing re-renders front-door.nix on a standing community:

  • the release lane (internal/update/land.go + ADR 0259 self-swap) lands control-plane / control-panel / agent / idss-idp and restarts — it never touches the front door;
  • rerender-gateway --switch (#1821) re-renders the gateway surface + keri/idp/anysync modules only; front-door/acme-dns/files/code/mail were left as the "named follow-up" because the sidecar lacks their post-founding route inputs;
  • AttachFrontDoor is called only from internal/provision/deploy.go on a service deploy/remove.

The same class as #1821 (GOTCHAS #179), now on the front door — and this one bites the PRODUCT lane, not just re-supply: every pre-0271 community on the testing channel will auto-apply a post-0271 patch in its window and come up panel-less.

Proof the render is reproducible from what the box already holds

Rendering the demo's front door through the real AttachFrontDoor with the live set the orchestrator assembles (frontDoorLiveSet + fleetFrontDoorServices: apex, IDIP + Keri + Mesh from the sidecar facts, files → 127.0.0.1:8084 with FilesExemptPaths + FilesEditorCallbackPaths, docs-editing → DocsEditingServeFacts().LoopbackTarget()) at ff4a5263 reproduces the box's file byte-for-byte; the same inputs at 2c5fe0fa render the ADR 0271 front door (admin route + Portal apex + the 308 list). So the running control plane has every input it needs — the fleet store knows the deployed services and their placement.

Proposed fix (two-way door, ADR 0174)

  • The control plane re-attaches the front door from the LIVE fleet set whenever the render on disk differs from what its own code renders — at composition (startup after a self-swap) and as the last step of the release lane's land — through the existing AttachFrontDoor(frontDoorLiveSet(gateway, fleetFrontDoorServices(...))), then the same in-place switch rerender-gateway --switch drives. Unchanged render → single-writer no-op.
  • rerender-gateway grows the same reconcile (it has IDSS_CONFIG_REPO; the fleet store lives under the state dir) so the standing re-supply carries it too.
  • Test: a fake fleet with files + docs-editing under the ADR 0247 render on disk; bump the posture; reconcile; assert front-door.nix equals the current render and a second reconcile is a no-op.

Meanwhile (hand recipe, whakatohea-demo)

Land the four signed 2c5fe0fa artifacts the standing-re-supply way, commit the freshly rendered front-door.nix into /srv/idss/config BEFORE rerender-gateway --switch (one switch carries both), and advance update.json current/high_water to 2c5fe0fa/2835 with active cleared (Poll never prunes parked entries below the floor — an Approve on one would walk the box backwards).

Related: #1821, #1816, ADR 0271 / DDR 0270, ADR 0259, ADR 0208 ruling 3a, internal/clan/frontdoor_attach.go, internal/provision/deploy.go.

## Symptom A community founded before ADR 0271 (the apex switch, `976ef465`) that takes ANY later release loses its control panel. Found 2026-09-24 while hand-updating `whakatohea-demo` (founded from `ff4a5263` on 09-23) to the `testing` release `2c5fe0fa` (seq 2835): - the box's `machines/gateway/front-door.nix` is the ADR 0247 render: `@apex host <apex>` → gate → control plane (the panel), **no `admin.<apex>` route** (`https://admin.whakatohea-demo.idss.nz/` → Caddy 404, content-length 0); - the `2c5fe0fa` dashboard bundle is host-aware (`dashboard/src/lib/portalRouting.ts`, `APEX_SURFACE = 'portal'`): the bare apex boots the **Portal**, only `admin.<apex>` boots the operator SPA; - so once the new bits land, the apex shows the Portal behind the gate and the panel is unreachable — `admin.<apex>` is never served. ## Cause Nothing re-renders `front-door.nix` on a standing community: - the release lane (`internal/update/land.go` + ADR 0259 self-swap) lands control-plane / control-panel / agent / idss-idp and restarts — it never touches the front door; - `rerender-gateway --switch` (#1821) re-renders the gateway surface + keri/idp/anysync modules only; front-door/acme-dns/files/code/mail were left as the "named follow-up" because the sidecar lacks their post-founding route inputs; - `AttachFrontDoor` is called only from `internal/provision/deploy.go` on a service deploy/remove. The same class as #1821 (GOTCHAS #179), now on the front door — and this one bites the PRODUCT lane, not just re-supply: every pre-0271 community on the `testing` channel will auto-apply a post-0271 patch in its window and come up panel-less. ## Proof the render is reproducible from what the box already holds Rendering the demo's front door through the real `AttachFrontDoor` with the live set the orchestrator assembles (`frontDoorLiveSet` + `fleetFrontDoorServices`: apex, IDIP + Keri + Mesh from the sidecar facts, files → `127.0.0.1:8084` with `FilesExemptPaths` + `FilesEditorCallbackPaths`, docs-editing → `DocsEditingServeFacts().LoopbackTarget()`) at `ff4a5263` reproduces the box's file **byte-for-byte**; the same inputs at `2c5fe0fa` render the ADR 0271 front door (admin route + Portal apex + the 308 list). So the running control plane has every input it needs — the fleet store knows the deployed services and their placement. ## Proposed fix (two-way door, ADR 0174) - The control plane re-attaches the front door from the LIVE fleet set whenever the render on disk differs from what its own code renders — at composition (startup after a self-swap) and as the last step of the release lane's land — through the existing `AttachFrontDoor(frontDoorLiveSet(gateway, fleetFrontDoorServices(...)))`, then the same in-place switch `rerender-gateway --switch` drives. Unchanged render → single-writer no-op. - `rerender-gateway` grows the same reconcile (it has `IDSS_CONFIG_REPO`; the fleet store lives under the state dir) so the standing re-supply carries it too. - Test: a fake fleet with files + docs-editing under the ADR 0247 render on disk; bump the posture; reconcile; assert `front-door.nix` equals the current render and a second reconcile is a no-op. ## Meanwhile (hand recipe, whakatohea-demo) Land the four signed `2c5fe0fa` artifacts the standing-re-supply way, commit the freshly rendered `front-door.nix` into `/srv/idss/config` BEFORE `rerender-gateway --switch` (one switch carries both), and advance `update.json` `current`/`high_water` to `2c5fe0fa`/2835 with `active` cleared (Poll never prunes parked entries below the floor — an Approve on one would walk the box backwards). Related: #1821, #1816, ADR 0271 / DDR 0270, ADR 0259, ADR 0208 ruling 3a, `internal/clan/frontdoor_attach.go`, `internal/provision/deploy.go`.

swarm-claim host=elitebook-distributed-server-03 run=32049
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=32049 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1845 — status success

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

envelope
{
  "issue": 1845,
  "status": "success",
  "commits": [
    "c85d2bb38b24a2c483ebffe3c8cca7df67ca620a"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/rerender_gateway.go",
    "control-plane/cmd/control-plane/rerender_gateway_test.go",
    "docs/GOTCHAS.md",
    "internal/clan/gateway_attach.go",
    "internal/provision/frontdoor_reconcile.go",
    "internal/provision/frontdoor_reconcile_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/provision/ -run ReconcileFrontDoor",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./control-plane/cmd/control-plane/ -run RerenderGateway",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/provision/ ./internal/clan/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "pre-push go-ci gate (gofmt, go build ./..., go vet ./..., go test ./..., golangci-lint run ./..., dev-tag build, broker)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The control plane re-attaches the front door from the LIVE fleet set at composition (startup after a self-swap)": "internal/provision/frontdoor_reconcile.go Orchestrator.ReconcileFrontDoor (AttachFrontDoor(frontDoorLiveSet(gateway, fleetFrontDoorServices(...)))); wired in control-plane/cmd/control-plane/main.go gated on c.whole BEFORE the update scheduler's resume re-deploys the gateway",
    "rerender-gateway grows the same reconcile so the standing re-supply carries it too": "control-plane/cmd/control-plane/rerender_gateway.go productionFrontDoorReconcile + runRerenderGateway reconciles the door and switches at the reconcile tip (posture from clan.ReadGatewayFacts, live fleet from configRepoInventory + openEnrollLedger)",
    "Unchanged render is a single-writer no-op": "TestReconcileFrontDoor_HealsAStaleRenderThenNoOps asserts the second reconcile is byte-identical at the same tip (frontdoor_reconcile_test.go)",
    "Test: a fake fleet with files + docs-editing under the ADR 0247 render on disk; bump the posture; reconcile; assert front-door.nix equals the current render and a second reconcile is a no-op": "internal/provision/frontdoor_reconcile_test.go TestReconcileFrontDoor_HealsAStaleRenderThenNoOps (real clan adapter over a temp config repo; seeds a stale ADR-0247 door; reconcile heals it to the ADR-0271 render carrying admin.<apex>; second reconcile is a byte-identical no-op) + TestReconcileFrontDoor_AssemblesTheFleetWideUnionWithNoDeployNode (files + docs-editing union)",
    "Fail loud rather than switch a stale door (ADR 0100)": "TestRunRerenderGateway_ReconcileFailureIsLoud + TestRunRerenderGateway_SwitchesAtTheFrontDoorReconcileTip (rerender_gateway_test.go)"
  },
  "summary": "A standing community now reconciles front-door.nix from the live fleet at control-plane composition and inside rerender-gateway, so a pre-ADR-0271 community's next release/re-supply heals its door and keeps its control panel.",
  "blockers": []
}
**close-report** for #1845 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1845, "status": "success", "commits": [ "c85d2bb38b24a2c483ebffe3c8cca7df67ca620a" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/rerender_gateway.go", "control-plane/cmd/control-plane/rerender_gateway_test.go", "docs/GOTCHAS.md", "internal/clan/gateway_attach.go", "internal/provision/frontdoor_reconcile.go", "internal/provision/frontdoor_reconcile_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/provision/ -run ReconcileFrontDoor", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./control-plane/cmd/control-plane/ -run RerenderGateway", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/provision/ ./internal/clan/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "pre-push go-ci gate (gofmt, go build ./..., go vet ./..., go test ./..., golangci-lint run ./..., dev-tag build, broker)", "exit_code": 0 } ], "criteria": { "The control plane re-attaches the front door from the LIVE fleet set at composition (startup after a self-swap)": "internal/provision/frontdoor_reconcile.go Orchestrator.ReconcileFrontDoor (AttachFrontDoor(frontDoorLiveSet(gateway, fleetFrontDoorServices(...)))); wired in control-plane/cmd/control-plane/main.go gated on c.whole BEFORE the update scheduler's resume re-deploys the gateway", "rerender-gateway grows the same reconcile so the standing re-supply carries it too": "control-plane/cmd/control-plane/rerender_gateway.go productionFrontDoorReconcile + runRerenderGateway reconciles the door and switches at the reconcile tip (posture from clan.ReadGatewayFacts, live fleet from configRepoInventory + openEnrollLedger)", "Unchanged render is a single-writer no-op": "TestReconcileFrontDoor_HealsAStaleRenderThenNoOps asserts the second reconcile is byte-identical at the same tip (frontdoor_reconcile_test.go)", "Test: a fake fleet with files + docs-editing under the ADR 0247 render on disk; bump the posture; reconcile; assert front-door.nix equals the current render and a second reconcile is a no-op": "internal/provision/frontdoor_reconcile_test.go TestReconcileFrontDoor_HealsAStaleRenderThenNoOps (real clan adapter over a temp config repo; seeds a stale ADR-0247 door; reconcile heals it to the ADR-0271 render carrying admin.<apex>; second reconcile is a byte-identical no-op) + TestReconcileFrontDoor_AssemblesTheFleetWideUnionWithNoDeployNode (files + docs-editing union)", "Fail loud rather than switch a stale door (ADR 0100)": "TestRunRerenderGateway_ReconcileFailureIsLoud + TestRunRerenderGateway_SwitchesAtTheFrontDoorReconcileTip (rerender_gateway_test.go)" }, "summary": "A standing community now reconciles front-door.nix from the live fleet at control-plane composition and inside rerender-gateway, so a pre-ADR-0271 community's next release/re-supply heals its door and keeps its control panel.", "blockers": [] } ``` </details>
Author
Owner

Live proof on whakatohea-demo, 2026-09-24 19:22Z. The hand update landed the 2c5fe0fa artifacts plus the hand-rendered ADR 0271 front-door.nix (commit b2b8b9b in the box's config repo). The new control plane's first poll found c85d2bb3 (seq 2849, this fix) already on the feed and applied it unattended: artifacts verified, bridge restarted + self-tested (#1689), ADR 0259 self-swap, then at 19:22:43Z the new binary logged front-door reconcile at startup: re-attached the gateway front door from the live fleet (heals a pre-ADR-0271 door …, #1845) and the resume converged on c85d2bb3 at 19:23:05Z.

Outside-in after: apex 200 (Portal shell), admin.<apex>/ → 302 /authz/signin?rd=… (panel gated, the door exists), id.<apex>/login 200, files.<apex>/status.php 200; /etc/nix/nix.conf now carries extra-substituters = https://nix.cache.idss.nz (the #1801 render finally on a standing box); update.json current c85d2bb3/2849, high-water 2849, no parked releases.

One collision worth knowing: rerender-gateway --switch run by hand at the same moment lost the NixOS switch lock to the rollout's own deploy (Could not acquire lock, exit 11) — the re-render was committed (a5220a8) and the rollout's resume then deployed that HEAD, so nothing was lost, but a hand re-supply must not race a live rollout. Follow-up filed for the stale doorway RELEASE marker the lane leaves behind.

**Live proof on whakatohea-demo, 2026-09-24 19:22Z.** The hand update landed the `2c5fe0fa` artifacts plus the hand-rendered ADR 0271 `front-door.nix` (commit `b2b8b9b` in the box's config repo). The new control plane's first poll found `c85d2bb3` (seq 2849, this fix) already on the feed and applied it unattended: artifacts verified, bridge restarted + self-tested (#1689), ADR 0259 self-swap, then at 19:22:43Z the new binary logged `front-door reconcile at startup: re-attached the gateway front door from the live fleet (heals a pre-ADR-0271 door …, #1845)` and the resume converged on `c85d2bb3` at 19:23:05Z. Outside-in after: apex `200` (Portal shell), `admin.<apex>/` → `302 /authz/signin?rd=…` (panel gated, the door exists), `id.<apex>/login` `200`, `files.<apex>/status.php` `200`; `/etc/nix/nix.conf` now carries `extra-substituters = https://nix.cache.idss.nz` (the #1801 render finally on a standing box); `update.json` current `c85d2bb3`/2849, high-water 2849, no parked releases. One collision worth knowing: `rerender-gateway --switch` run by hand at the same moment lost the NixOS switch lock to the rollout's own deploy (`Could not acquire lock`, exit 11) — the re-render was committed (`a5220a8`) and the rollout's resume then deployed that HEAD, so nothing was lost, but a hand re-supply must not race a live rollout. Follow-up filed for the stale doorway `RELEASE` marker the lane leaves behind.
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#1845
No description provided.