Standing re-supply never re-renders the Attach modules (anysync-stack.nix etc.), names the machine by slug, and drives clan through a dev shell the gateway lacks — #1813's re-pin could not land on whakatohea-demo without hand steps #1821

Closed
opened 2026-09-24 14:50:43 +00:00 by ben · 2 comments
Owner

Symptom

Landing idss#1813 (the any-sync image re-pin) on the ALREADY-STANDING whakatohea-demo gateway by the standing re-supply recipe (scripts/lib/rehearsal-standing-lib.sh oc_standing_resupply, ADR 0208 ruling 3a / #1275) did not change the gateway: after the control-plane binary at 20a6777 was landed and control-plane rerender-gateway <node> committed a re-render, machines/gateway/anysync-stack.nix still carried all five v0.13 digests, and a clan machines update would have switched a closure with the OLD pins. Proven live 2026-09-24 (comment on #1813 has the transcript).

Causes (three, each enough on its own)

  1. RerenderGatewaySurface re-renders only the gateway's own surface (control-plane.nix / gateway-guest.nix, internal/clan/gateway_attach.go). Every Attach* module written at founding or by a post-founding install — anysync-stack.nix (RenderAnySync), keri-stack.nix, idss-idp.nix, front-door.nix, files.nix, … — is never re-rendered on a standing community. So a render-affecting change to ANY of those modules (this time: image digests; next time: a unit ordering, a port, a reconciler script) lands only on communities founded after it. The #1214 lesson (GOTCHAS #179) was fixed for one surface, not for the module set.
  2. The node id the recipe passes is the slug. oc_standing_resupply runs rerender-gateway '$slug' and clan machines update '$slug'; on a community founded by the operator app the clan machine is named gateway (machines/gateway/, gateway-render.json lives there). rerender-gateway whakatohea-demo fails loud on the missing sidecar; only rehearsal machines happen to be named by slug.
  3. nix develop --command clan machines update … assumes a dev shell in the community config repo. /srv/idss/config on a founded gateway provides none ("flake does not provide attribute devShells…"). The adapter's own resolution (internal/clan/toolpin.go: clan on PATH, else nix run <PinnedClanRef> --) and the gateway clan env (internal/clan/gatewayclanenv.go: HOME=/root, SOPS_AGE_KEY_FILE=/var/lib/sops-nix/key.txt, IDSS_CONFIG_REPO, git identity) are what actually work on the box; the shell recipe carries neither, so sops cannot decrypt the vars and the switch fails.

What worked by hand (the shape of the fix)

  • render the module with the just-landed binary's render code, byte-exact: RenderAnySync(AnySyncConfig{Apex}), i.e. exactly what InstallAnySync / writeGatewayIdentityModules write — the write is idempotent (spec #1495 story 8), so re-running it on a standing community is safe and the single writer no-ops when nothing changed;
  • commit as control-plane@idss; clan machines update gateway via nix run …#clan-cli with the gateway clan env.

Proposed fix

  • rerender-gateway <node> (or a sibling rerender-modules <node>) re-renders EVERY present module from the persisted facts + the same inputs the founding write used (apex, store paths, image overrides — the enrollment sidecar may need to grow the per-module inputs it does not hold today), not just the gateway surface; a module whose render is unchanged no-ops.
  • oc_standing_resupply reads the node id from the box (ls /srv/idss/config/machines/ or the sidecar's node) instead of assuming the slug, and drives clan the way the adapter does (toolpin.go resolution + gatewayclanenv.go env) instead of nix develop.
  • A test that founds (or fakes) a machine dir with a stale module, bumps a render constant, re-supplies, and asserts the module on disk equals the fresh render.

Acceptance

  • On a standing community, after re-supply, every machines/gateway/*.nix equals the landed binary's render for that module (idempotency asserted both ways).
  • oc_standing_resupply succeeds against a gateway whose machine is named gateway and whose config repo has no dev shell.
  • The #1813 re-pin lands on a standing community through re-supply alone, no hand steps.

Related: #1813, #1275, #1214 / GOTCHAS #179, ADR 0208, scripts/lib/rehearsal-standing-lib.sh, internal/clan/gateway_attach.go, internal/clan/anysync_install.go.

## Symptom Landing idss#1813 (the any-sync image re-pin) on the ALREADY-STANDING `whakatohea-demo` gateway by the standing re-supply recipe (`scripts/lib/rehearsal-standing-lib.sh` `oc_standing_resupply`, ADR 0208 ruling 3a / #1275) did not change the gateway: after the control-plane binary at `20a6777` was landed and `control-plane rerender-gateway <node>` committed a re-render, `machines/gateway/anysync-stack.nix` still carried all five v0.13 digests, and a `clan machines update` would have switched a closure with the OLD pins. Proven live 2026-09-24 (comment on #1813 has the transcript). ## Causes (three, each enough on its own) 1. **`RerenderGatewaySurface` re-renders only the gateway's own surface** (`control-plane.nix` / `gateway-guest.nix`, `internal/clan/gateway_attach.go`). Every Attach* module written at founding or by a post-founding install — `anysync-stack.nix` (RenderAnySync), `keri-stack.nix`, `idss-idp.nix`, `front-door.nix`, `files.nix`, … — is never re-rendered on a standing community. So a render-affecting change to ANY of those modules (this time: image digests; next time: a unit ordering, a port, a reconciler script) lands only on communities founded after it. The #1214 lesson (GOTCHAS #179) was fixed for one surface, not for the module set. 2. **The node id the recipe passes is the slug.** `oc_standing_resupply` runs `rerender-gateway '$slug'` and `clan machines update '$slug'`; on a community founded by the operator app the clan machine is named `gateway` (`machines/gateway/`, `gateway-render.json` lives there). `rerender-gateway whakatohea-demo` fails loud on the missing sidecar; only rehearsal machines happen to be named by slug. 3. **`nix develop --command clan machines update …` assumes a dev shell in the community config repo.** `/srv/idss/config` on a founded gateway provides none ("flake does not provide attribute devShells…"). The adapter's own resolution (`internal/clan/toolpin.go`: `clan` on PATH, else `nix run <PinnedClanRef> --`) and the gateway clan env (`internal/clan/gatewayclanenv.go`: `HOME=/root`, `SOPS_AGE_KEY_FILE=/var/lib/sops-nix/key.txt`, `IDSS_CONFIG_REPO`, git identity) are what actually work on the box; the shell recipe carries neither, so sops cannot decrypt the vars and the switch fails. ## What worked by hand (the shape of the fix) - render the module with the just-landed binary's render code, byte-exact: `RenderAnySync(AnySyncConfig{Apex})`, i.e. exactly what `InstallAnySync` / `writeGatewayIdentityModules` write — the write is idempotent (spec #1495 story 8), so re-running it on a standing community is safe and the single writer no-ops when nothing changed; - commit as `control-plane@idss`; `clan machines update gateway` via `nix run …#clan-cli` with the gateway clan env. ## Proposed fix - `rerender-gateway <node>` (or a sibling `rerender-modules <node>`) re-renders EVERY present module from the persisted facts + the same inputs the founding write used (apex, store paths, image overrides — the enrollment sidecar may need to grow the per-module inputs it does not hold today), not just the gateway surface; a module whose render is unchanged no-ops. - `oc_standing_resupply` reads the node id from the box (`ls /srv/idss/config/machines/` or the sidecar's `node`) instead of assuming the slug, and drives clan the way the adapter does (`toolpin.go` resolution + `gatewayclanenv.go` env) instead of `nix develop`. - A test that founds (or fakes) a machine dir with a stale module, bumps a render constant, re-supplies, and asserts the module on disk equals the fresh render. ## Acceptance - On a standing community, after re-supply, every `machines/gateway/*.nix` equals the landed binary's render for that module (idempotency asserted both ways). - `oc_standing_resupply` succeeds against a gateway whose machine is named `gateway` and whose config repo has no dev shell. - The #1813 re-pin lands on a standing community through re-supply alone, no hand steps. Related: #1813, #1275, #1214 / GOTCHAS #179, ADR 0208, `scripts/lib/rehearsal-standing-lib.sh`, `internal/clan/gateway_attach.go`, `internal/clan/anysync_install.go`.

Blocked — main is red on a pre-existing failure outside this slice (the pre-push gate rejects every Go push)

The #1821 work is complete and green at its own seams (commit prepared locally, see below), but it cannot land: the pre-push Go gate (nix develop .#go-ci → go test ./...) is red on origin/main HEAD (c2e17818) in a file this slice does not touch, so git push is refused for this ticket — and, being a go test ./... gate, for every Go push on the swarm right now:

--- FAIL: TestGoldenRenderLint_NoSecretInTheConfigRepo (internal/clan/secretlint_test.go)
    machines/gateway/gateway-guest.nix: long base64 blob outside a vars/ path — "jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E="
    machines/vmguest/configuration.nix: long base64 blob outside a vars/ path — "jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E="
--- FAIL: TestGoldenRenderLint_CatchesPlantedSecretsAndShapes

Cause: #1801 embedded the cache.idss.nz-1 public binary-cache key into the gateway render (internal/clan/matoucache.go) but never added it to secretlint's goldenRenderAllowList. The proper fix needs a value-scoped allow-list entry (path-scoping these large rendered files would blanket-silence the shape and mask a real leak — the harness forbids loosening a detector), which is a change to the security-detector harness itself. I filed that as #1824 (now ready-for-agent) rather than cram a security-detector change into this unrelated slice.

What a human/next iteration must do to re-arm #1821

  1. Land #1824 (green TestGoldenRenderLint_*) so go test ./... passes on main.
  2. Re-add ready-for-agent to #1821.

The #1821 work (ready to re-apply — it is small and fully described)

Three independent causes closed:

  1. internal/clan/gateway_attach.go — RerenderGatewaySurface now also re-renders every PRESENT apex-derived content/identity module (rerenderPresentGatewayModules: keri-stack.nix, idss-idp.nix, anysync-stack.nix) WHOLE from the persisted apex, same single-writer commit; keyed on the file on disk (so an InstallAnySync-later community is re-pinned), never fabricating an absent module. front-door/acme-dns/files/code/mail accrete post-founding route inputs the sidecar does not hold — named follow-up.
  2. control-plane/cmd/control-plane/rerender_gateway.go — resolveGatewayNode reads the node id from the box (the machine dir holding gateway-render.json), so a founded gateway named gateway (not the slug) works.
  3. rerender-gateway --switch now switches the closure in place through the pinned clan adapter (toolpin.go) + the gateway clan-runner env it builds itself (gatewayclanenv.go, ensureGatewayClanEnv) — no nix develop a founded gateway's dev-shell-less flake refuses. scripts/lib/rehearsal-standing-lib.sh calls the one step, naming no slug and no nix develop.

Tests (all green at their seams): internal/clan TestRerenderGatewaySurface_LandsCurrentModuleRenders / _ModulesIdempotent; control-plane TestResolveGatewayNode + TestRunRerenderGateway_*; scripts/tests/rehearsal-standing-test.sh (30 checks). gofmt + go vet clean on the touched packages.

## Blocked — main is red on a pre-existing failure outside this slice (the pre-push gate rejects every Go push) The #1821 work is **complete and green at its own seams** (commit prepared locally, see below), but it cannot land: the pre-push Go gate (`nix develop .#go-ci` → `go test ./...`) is red on `origin/main` HEAD (c2e17818) in a file this slice does not touch, so `git push` is refused for this ticket — and, being a `go test ./...` gate, for every Go push on the swarm right now: ``` --- FAIL: TestGoldenRenderLint_NoSecretInTheConfigRepo (internal/clan/secretlint_test.go) machines/gateway/gateway-guest.nix: long base64 blob outside a vars/ path — "jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E=" machines/vmguest/configuration.nix: long base64 blob outside a vars/ path — "jryaAm0uulUbamaQ5/9Shb9SkpMW3rVv49FkzRNOf7E=" --- FAIL: TestGoldenRenderLint_CatchesPlantedSecretsAndShapes ``` Cause: #1801 embedded the `cache.idss.nz-1` public binary-cache key into the gateway render (`internal/clan/matoucache.go`) but never added it to secretlint's `goldenRenderAllowList`. The proper fix needs a **value-scoped** allow-list entry (path-scoping these large rendered files would blanket-silence the shape and mask a real leak — the harness forbids loosening a detector), which is a change to the security-detector harness itself. I filed that as **#1824** (now `ready-for-agent`) rather than cram a security-detector change into this unrelated slice. ## What a human/next iteration must do to re-arm #1821 1. Land #1824 (green `TestGoldenRenderLint_*`) so `go test ./...` passes on main. 2. Re-add `ready-for-agent` to #1821. ## The #1821 work (ready to re-apply — it is small and fully described) Three independent causes closed: 1. `internal/clan/gateway_attach.go` — `RerenderGatewaySurface` now also re-renders every PRESENT apex-derived content/identity module (`rerenderPresentGatewayModules`: keri-stack.nix, idss-idp.nix, anysync-stack.nix) WHOLE from the persisted apex, same single-writer commit; keyed on the file on disk (so an InstallAnySync-later community is re-pinned), never fabricating an absent module. front-door/acme-dns/files/code/mail accrete post-founding route inputs the sidecar does not hold — named follow-up. 2. `control-plane/cmd/control-plane/rerender_gateway.go` — `resolveGatewayNode` reads the node id from the box (the machine dir holding `gateway-render.json`), so a founded gateway named `gateway` (not the slug) works. 3. `rerender-gateway --switch` now switches the closure in place through the pinned clan adapter (toolpin.go) + the gateway clan-runner env it builds itself (gatewayclanenv.go, `ensureGatewayClanEnv`) — no `nix develop` a founded gateway's dev-shell-less flake refuses. `scripts/lib/rehearsal-standing-lib.sh` calls the one step, naming no slug and no `nix develop`. Tests (all green at their seams): `internal/clan` `TestRerenderGatewaySurface_LandsCurrentModuleRenders` / `_ModulesIdempotent`; `control-plane` `TestResolveGatewayNode` + `TestRunRerenderGateway_*`; `scripts/tests/rehearsal-standing-test.sh` (30 checks). gofmt + `go vet` clean on the touched packages.
Author
Owner

Closed 2026-10-21 (Ben's ruling): folded into the drive checklist #2055 — the live proof this ticket still owed is now a checklist item there, to be carried by the next drives on the latest versions. A proof that fails on the drive becomes a NEW ticket; this one is not reopened.

Closed 2026-10-21 (Ben's ruling): folded into the drive checklist #2055 — the live proof this ticket still owed is now a checklist item there, to be carried by the next drives on the latest versions. A proof that fails on the drive becomes a NEW ticket; this one is not reopened.
ben 2026-10-21 21:53:31 +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#1821
No description provided.