rehearsal drive red at deploy-takeover #628

Closed
opened 2026-08-21 02:01:24 +00:00 by matou-build-agent · 1 comment

(headless diagnosis unparseable — raw stdout saved to logs/reporter-claude.out)

drive 20260821T015833Z red at deploy-takeover: the gateway deploy failed — The gateway deploy failed. [There is no old operating system to roll back to — this machine was taken over for the community.]
evidence: test-results/…/20260821T015833Z/ on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)

(headless diagnosis unparseable — raw stdout saved to logs/reporter-claude.out) drive `20260821T015833Z` red at `deploy-takeover`: `the gateway deploy failed — The gateway deploy failed. [There is no old operating system to roll back to — this machine was taken over for the community.]` evidence: `test-results/…/20260821T015833Z/` on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596) <!-- rehearsal-sig: 800a2936720b -->
Author
Member

Ruling

Ruled by agent under ADR 0174 — veto anytime. This is a two-way door: a
revertible Go/nix-string commit (e912f2fe), provable without any
member-facing or destructive action — a Go unit test plus a direct nix eval against the drive's own captured config, both red-then-green.

Diagnosis

The reporter's own headless session failed (OAuth session expired and could not be refreshed — logs/reporter-claude.out / healer-claude.out), so the
ticket carried only unparsed raw stdout. Diagnosed by hand from the drive's
artifacts (test-results/drive-selfhosted/20260821T015833Z/):

verdict.json: red at deploy-takeover, 9/10 legs green.
founding-state.log's failure detail truncates to a bare Failed assertions: with no assertion body — traced to a real gap in the eval
path (clan.Readiness carries no Tail, and excerpt()'s token grep keeps
the assertion header but not its body line; filed separately as #629,
not fixed here).

Recovered the real cause by running nix eval directly against the drive's
own captured state/clan-config/ (copied off the run dir, no droplet
touched):

error: Failed assertions:
- services.kanidm.provision.systems.oauth2.gate-oidc.scopeMaps refers to
  unknown groups: idm_all_persons

Root cause: internal/clan/vmguest.go's gatewayKanidmProvision (the
full-install/self-hosted public-gateway kanidm provision, #452) declares the
gate-oidc client's scopeMaps.idm_all_persons — intentionally targeting
kanidm's real builtin all-persons group ("any person may sign in") — but
never adds idm_all_persons to this same block's own
services.kanidm.provision.groups. nixpkgs' kanidm module's
assertGroupsKnown (nixos/modules/services/security/kanidm.nix) checks
every scopeMaps key against that STATIC declared-groups list, never the
live server's actual builtin groups — so a real, always-present kanidm group
still fails eval as "unknown" unless it is separately declared. This is
deterministic, not a race: every self-hosted/own-VPS full-install deploy
that reaches deploy-takeover with a community apex hits it.

Fix

internal/clan/vmguest.go's gatewayKanidmProvision: declares
idm_all_persons = { overwriteMembers = false; }; alongside its four
sibling structural groups (operators/members/kaitiaki/the files-admin
group) — the same no-op-membership shape they already use, so kanidm's own
builtin membership is never touched; this purely satisfies the static
eval-time check.

Proof

  • New red-then-green unit test:
    TestRenderControlPlaneSurface_GateOIDCScopeMapGroupIsDeclared
    (internal/clan/vmguest_test.go) — failed against the prior render (no
    idm_all_persons group declared), passes after the fix.
  • TestAttachGateway_ControlPlaneProvisionsKanidmOnOwnVPS's structural-group
    count updated 4→5 to match (internal/clan/gateway_attach_test.go).
  • Real nix eval against this exact drive's own captured config: copied
    test-results/drive-selfhosted/20260821T015833Z/state/clan-config/ to
    scratch, nix eval …#nixosConfigurations.gateway…drvPath reproduced the
    red with the unpatched config, then reproduced green after applying the
    identical one-line fix by hand (a store derivation path printed both from
    the hand-patched copy and from the actual Go render's output spliced in).
  • go build ./..., go vet ./..., go test ./... — all green.

Commit: e912f2fe4d1316c518dd290acbed50fb6099a44e on main.

NOT re-proved by a fresh live drive this session — same
/tmp/matou-session-runner.lock constraint noted on #622–#626; the next
unattended selfhosted rehearsal is the live proof.

Follow-up filed

#629 — the diagnosability gap this drive also exposed (the eval-preflight
path drops the raw nix eval log entirely, and excerpt()'s token grep
cannot keep a bare assertion-body line), which is why this drive's real
cause reached no artifact and had to be reproduced by hand. Different
subsystem, not fixed here.

STATUS.md updated in the same commit.

## Ruling Ruled by agent under ADR 0174 — veto anytime. This is a two-way door: a revertible Go/nix-string commit (`e912f2fe`), provable without any member-facing or destructive action — a Go unit test plus a direct `nix eval` against the drive's own captured config, both red-then-green. ## Diagnosis The reporter's own headless session failed (`OAuth session expired and could not be refreshed` — `logs/reporter-claude.out` / `healer-claude.out`), so the ticket carried only unparsed raw stdout. Diagnosed by hand from the drive's artifacts (`test-results/drive-selfhosted/20260821T015833Z/`): `verdict.json`: red at `deploy-takeover`, 9/10 legs green. `founding-state.log`'s failure detail truncates to a bare `Failed assertions:` with no assertion body — traced to a real gap in the eval path (`clan.Readiness` carries no `Tail`, and `excerpt()`'s token grep keeps the assertion *header* but not its body line; filed separately as #629, not fixed here). Recovered the real cause by running `nix eval` directly against the drive's own captured `state/clan-config/` (copied off the run dir, no droplet touched): ``` error: Failed assertions: - services.kanidm.provision.systems.oauth2.gate-oidc.scopeMaps refers to unknown groups: idm_all_persons ``` Root cause: `internal/clan/vmguest.go`'s `gatewayKanidmProvision` (the full-install/self-hosted public-gateway kanidm provision, #452) declares the `gate-oidc` client's `scopeMaps.idm_all_persons` — intentionally targeting kanidm's real builtin all-persons group ("any person may sign in") — but never adds `idm_all_persons` to this same block's own `services.kanidm.provision.groups`. nixpkgs' kanidm module's `assertGroupsKnown` (`nixos/modules/services/security/kanidm.nix`) checks every `scopeMaps` key against that STATIC declared-groups list, never the live server's actual builtin groups — so a real, always-present kanidm group still fails eval as "unknown" unless it is separately declared. This is deterministic, not a race: every self-hosted/own-VPS full-install deploy that reaches `deploy-takeover` with a community apex hits it. ## Fix `internal/clan/vmguest.go`'s `gatewayKanidmProvision`: declares `idm_all_persons = { overwriteMembers = false; };` alongside its four sibling structural groups (`operators`/`members`/`kaitiaki`/the files-admin group) — the same no-op-membership shape they already use, so kanidm's own builtin membership is never touched; this purely satisfies the static eval-time check. ## Proof - New red-then-green unit test: `TestRenderControlPlaneSurface_GateOIDCScopeMapGroupIsDeclared` (`internal/clan/vmguest_test.go`) — failed against the prior render (no `idm_all_persons` group declared), passes after the fix. - `TestAttachGateway_ControlPlaneProvisionsKanidmOnOwnVPS`'s structural-group count updated 4→5 to match (`internal/clan/gateway_attach_test.go`). - **Real `nix eval` against this exact drive's own captured config**: copied `test-results/drive-selfhosted/20260821T015833Z/state/clan-config/` to scratch, `nix eval …#nixosConfigurations.gateway…drvPath` reproduced the red with the unpatched config, then reproduced green after applying the identical one-line fix by hand (a store derivation path printed both from the hand-patched copy and from the actual Go render's output spliced in). - `go build ./...`, `go vet ./...`, `go test ./...` — all green. Commit: `e912f2fe4d1316c518dd290acbed50fb6099a44e` on `main`. **NOT re-proved by a fresh live drive this session** — same `/tmp/matou-session-runner.lock` constraint noted on #622–#626; the next unattended `selfhosted` rehearsal is the live proof. ## Follow-up filed #629 — the diagnosability gap this drive also exposed (the eval-preflight path drops the raw `nix eval` log entirely, and `excerpt()`'s token grep cannot keep a bare assertion-body line), which is why this drive's real cause reached no artifact and had to be reproduced by hand. Different subsystem, not fixed here. `STATUS.md` updated in the same commit.
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.

Reference
Matou/idss#628
No description provided.