operator-session: the founded community's own operator is refused at their admin door — the kanidm path never seeds the founder row into the members ledger (sig b5659a2277df) #1242

Closed
opened 2026-09-05 21:18:12 +00:00 by ben · 1 comment
Owner

The failure

Archive drive run 7 (test-results/private-path/20260905T205312Z on elitebook-03, commit 5ca8855a = #1240 landed) — founding-prefix GREEN (604 s), operator-session RED after 63 s (artifacts/legs.json). The door marker records https://admin.e2e-drive.idss.internal:41715/ → 302, the passkey login and the authorization code both succeed (logs/guest-kanidm.log), and — for the first time — the token exchange completes (#1240 is proven good: no signin_exchange, no x509 warning in logs/guest-control-plane.log). The community SSO session is minted and the gate reaches its decision.

The gate then refuses the community's own founding operator. The page the leg read (artifacts/ceremony/admin-door-neither-landed.png, and the error text) is our own DA-S2 refusal surface:

Operators only — The control panel is for operators.
SIGNED IN AS operator
WHERE TO GO: Your community's services live at the portal … Go to your community · Sign out

The reporter could not file this itself (filing cap hit on #1235: 2 already filed), so #1235 was parked ready-for-human; this ticket is the healer's diagnosis (artifacts/healer-refusal.json, action file, rule 3 product surface), verified line by line against main 5ca8855a, filed and ruled by hand.

The defect

On the kanidm path the admin pseudo-service is answered straight from the members ledger:

  • internal/member/komiti.go:583-588 — GateDecision: if service == AdminService { if o.isOperator(sessionIdentity) → allow; else deny GateReasonOperatorsOnly }.
  • internal/member/komiti.go:631-637 — isOperator = ledger.Load() → findMember(ls, personID) → ok && m.Role == RoleOperator. An unknown person is not an operator.
  • internal/controlapi/refusal.go:128-136 — refusalOperators renders exactly the copy above.

The session identity is operator — the FIXED kanidm account name on every kanidm render: clan.OperatorAccount (internal/clan/vmguest.go:110), declared into the guest's kanidm at vmguest.go:705 and into the public gateway's at vmguest.go:1508; the founding passkey is minted against it (internal/fleetwire/enrolment.go:243).

Nothing on the kanidm path ever writes a member row for it. The ledger is member.NewFileLedger(<stateDir>/members.json) (control-plane/cmd/control-plane/whole_composition.go:617); a missing file loads as a zero LedgerState (internal/member/ledger.go:259). The only production writer of a founder row is the IDIP founder register (internal/fleetwire/founderroster.go:115-126 → POST /api/v1/idip/roster/register), and internal/founding/founderroster.go:49-52 says so in words: "On the kanidm path it is never called (no IDIP roster)." The kanidm founding's "admin" step is a log line and a view field only (internal/founding/deploy.go:631-632: ds.Admin = adminAccount(s.Draft) + "operator admin seeded from declarative config" — logs/founding-state.log shows that row rested done with "admin": "drive@example.nz", no ledger written). resting_composition.go:261-263 still carries the TODO: "founding seeds the founder row as runtime data, out of scope for #155". The member package doc (internal/member/member.go:14-17) and MembersView (member.go:42-43) both promise "the founder as row one, never empty" — that seed was never built.

So on the founded guest: no members.json → zero state → isOperator("operator") = false → operators-only deny. The founding operator is locked out of their own control panel by their own gate, on every kanidm path (VM private, own-VPS, self-hosted, rented). Nothing caught it before because no kanidm-path drive entered the panel through the front door until #1236 added the operator-session leg (the public journeys' oidc-admin legs sign into Nextcloud, not the panel; the IDIP journey has the founder register + IdipGateDecider). Twin of the IDIP oidc-admin red #1018 closed.

The same red is latent on provision-nextcloud.live.spec.ts and settings-brand-reapply.live.spec.ts (both carry establishAdminDoorSession since bf9507ad), and on every standing community's members page (row one is missing there too).

RULED (agent, two-way under ADR 0174 — Ben vetoes async): shape A — the control plane seeds the founder row itself, idempotently, at boot, on the kanidm path.

The row the gate needs is fully derivable without founding's help: Member{PersonID: clan.OperatorAccount, Role: RoleOperator, Status: StatusActive} — the ledger carries no name or email (those are IdP attributes joined at list time, ADR 0077), and the account name is a compile-time constant on every kanidm render. A boot seed also heals every already-founded community (rehearsal-e, rehearsal-b, any real one) on its next control-plane start, which no founding-leg fix can.

Rejected:

  • B — a founding leg writing through the control-plane API forward (mirror of internal/fleetwire/founderroster.go). Needs a new write verb on the kanidm control plane, a new founding op on four drives, and leaves every standing community locked out until re-founded; founding has no datum to contribute that the plane does not already hold.
  • C — the gate consults the kanidm operators group instead of the ledger. ADR 0076 puts the operator role in the ledger here (GrantOperator/RevokeOperator in internal/member/roles.go write it); a second source of truth reopens the #277-class drift the rederive fixed.

What to build

  1. control-plane/cmd/control-plane/whole_composition.go ~617, right after membersLedger := member.NewFileLedger(...) and ONLY when this is the kanidm path (deps.idp != nil; never when deps.idipIdentity — the IDIP path's roster + IdipGateDecider own that answer): load the ledger; if it holds no row with Role == RoleOperator, prepend Member{PersonID: clan.OperatorAccount, Role: member.RoleOperator, Status: member.StatusActive} (row one — the never-empty rule, DDR 0095) and Save. Log one INFO line naming the seeded account. Put the seed in a small named function in internal/member (e.g. SeedFounder(ledger, personID) (seeded bool, err error)) so it is unit-testable without the composition.
  2. Guard = "no operator row at all", not "no operator row": roles.go:93 forbids revoking the last operator, so a zero-operator ledger can only mean unseeded — the seed can never resurrect a deliberately demoted account or fight a GrantOperator to someone else.
  3. A Save failure at boot fails loud like the composition's other file-store faults (ADR 0088) — never a silent skip that leaves the gate refusing.
  4. Update the stale prose: resting_composition.go:261-263 (the "out of scope for #155" TODO), the internal/member/member.go package doc ("seeded by founding as runtime data" → the plane seeds it at boot on the kanidm path; the founder register does on IDIP), and the oidc-admin/operator-session context in internal/member/komiti.go:631-634 if it names founding.
  5. Tests: (a) unit — empty ledger → seeded once, row one is operator/operator/active; second call no-op; ledger with an operator row under another PersonID → untouched; (b) composition seam (idip_wholeness_test.go style) — kanidm deps with a fresh state dir write members.json with row one = operator; idipIdentity: true writes nothing. go test ./internal/member/ ./control-plane/... green.
  6. STATUS.md lead in the same commit.

Acceptance

  • On the next #1235 fire (it re-fires when this closes) operator-session goes green: establishAdminDoorSession lands on [data-status="dashboard-chrome"], and the drive advances to gateway-change / browse-catalogue with a REAL session behind it.
  • A founded community's members page shows the founder as row one, not an empty list.
  • IDIP drive unaffected (no members.json write on that path).

Evidence: elitebook-03:~/swarm/Matou/idss/test-results/private-path/20260905T205312Z/ — artifacts/legs.json, artifacts/healer-refusal.json, artifacts/ceremony/admin-door-neither-landed.png, logs/guest-control-plane.log, logs/guest-kanidm.log, logs/founding-state.log.

## The failure Archive drive run 7 (`test-results/private-path/20260905T205312Z` on elitebook-03, commit `5ca8855a` = #1240 landed) — `founding-prefix` GREEN (604 s), `operator-session` RED after 63 s (`artifacts/legs.json`). The door marker records `https://admin.e2e-drive.idss.internal:41715/` → **302**, the passkey login and the authorization code both succeed (`logs/guest-kanidm.log`), and — for the first time — the token exchange completes (#1240 is proven good: no `signin_exchange`, no x509 warning in `logs/guest-control-plane.log`). The community SSO session is minted and the gate reaches its *decision*. The gate then refuses the community's own founding operator. The page the leg read (`artifacts/ceremony/admin-door-neither-landed.png`, and the error text) is our own DA-S2 refusal surface: ``` Operators only — The control panel is for operators. SIGNED IN AS operator WHERE TO GO: Your community's services live at the portal … Go to your community · Sign out ``` The reporter could not file this itself (filing cap hit on #1235: 2 already filed), so #1235 was parked ready-for-human; this ticket is the healer's diagnosis (`artifacts/healer-refusal.json`, action `file`, rule 3 product surface), verified line by line against main `5ca8855a`, filed and ruled by hand. ## The defect On the kanidm path the admin pseudo-service is answered straight from the members ledger: - `internal/member/komiti.go:583-588` — `GateDecision`: `if service == AdminService { if o.isOperator(sessionIdentity) → allow; else deny GateReasonOperatorsOnly }`. - `internal/member/komiti.go:631-637` — `isOperator` = `ledger.Load()` → `findMember(ls, personID)` → `ok && m.Role == RoleOperator`. **An unknown person is not an operator.** - `internal/controlapi/refusal.go:128-136` — `refusalOperators` renders exactly the copy above. The session identity is `operator` — the FIXED kanidm account name on **every** kanidm render: `clan.OperatorAccount` (`internal/clan/vmguest.go:110`), declared into the guest's kanidm at `vmguest.go:705` and into the public gateway's at `vmguest.go:1508`; the founding passkey is minted against it (`internal/fleetwire/enrolment.go:243`). **Nothing on the kanidm path ever writes a member row for it.** The ledger is `member.NewFileLedger(<stateDir>/members.json)` (`control-plane/cmd/control-plane/whole_composition.go:617`); a missing file loads as a zero `LedgerState` (`internal/member/ledger.go:259`). The only production writer of a founder row is the **IDIP** founder register (`internal/fleetwire/founderroster.go:115-126` → `POST /api/v1/idip/roster/register`), and `internal/founding/founderroster.go:49-52` says so in words: *"On the kanidm path it is never called (no IDIP roster)."* The kanidm founding's "admin" step is a log line and a view field only (`internal/founding/deploy.go:631-632`: `ds.Admin = adminAccount(s.Draft)` + `"operator admin seeded from declarative config"` — `logs/founding-state.log` shows that row rested done with `"admin": "drive@example.nz"`, no ledger written). `resting_composition.go:261-263` still carries the TODO: *"founding seeds the founder row as runtime data, out of scope for #155"*. The `member` package doc (`internal/member/member.go:14-17`) and `MembersView` (`member.go:42-43`) both promise "the founder as row one, never empty" — that seed was never built. So on the founded guest: no `members.json` → zero state → `isOperator("operator")` = false → operators-only deny. **The founding operator is locked out of their own control panel by their own gate**, on every kanidm path (VM private, own-VPS, self-hosted, rented). Nothing caught it before because no kanidm-path drive entered the panel through the front door until #1236 added the `operator-session` leg (the public journeys' `oidc-admin` legs sign into Nextcloud, not the panel; the IDIP journey has the founder register + `IdipGateDecider`). Twin of the IDIP `oidc-admin` red #1018 closed. The same red is latent on `provision-nextcloud.live.spec.ts` and `settings-brand-reapply.live.spec.ts` (both carry `establishAdminDoorSession` since `bf9507ad`), and on every standing community's members page (row one is missing there too). ## RULED (agent, two-way under ADR 0174 — Ben vetoes async): **shape A — the control plane seeds the founder row itself, idempotently, at boot, on the kanidm path.** The row the gate needs is fully derivable without founding's help: `Member{PersonID: clan.OperatorAccount, Role: RoleOperator, Status: StatusActive}` — the ledger carries no name or email (those are IdP attributes joined at list time, ADR 0077), and the account name is a compile-time constant on every kanidm render. A boot seed also **heals every already-founded community** (`rehearsal-e`, `rehearsal-b`, any real one) on its next control-plane start, which no founding-leg fix can. Rejected: - **B — a founding leg writing through the control-plane API forward** (mirror of `internal/fleetwire/founderroster.go`). Needs a new write verb on the kanidm control plane, a new founding op on four drives, and leaves every standing community locked out until re-founded; founding has no datum to contribute that the plane does not already hold. - **C — the gate consults the kanidm operators group instead of the ledger.** ADR 0076 puts the operator role in the ledger here (`GrantOperator`/`RevokeOperator` in `internal/member/roles.go` write it); a second source of truth reopens the #277-class drift the rederive fixed. ## What to build 1. `control-plane/cmd/control-plane/whole_composition.go` ~617, right after `membersLedger := member.NewFileLedger(...)` and ONLY when this is the kanidm path (`deps.idp != nil`; never when `deps.idipIdentity` — the IDIP path's roster + `IdipGateDecider` own that answer): load the ledger; if it holds **no row with `Role == RoleOperator`**, prepend `Member{PersonID: clan.OperatorAccount, Role: member.RoleOperator, Status: member.StatusActive}` (row one — the never-empty rule, DDR 0095) and `Save`. Log one INFO line naming the seeded account. Put the seed in a small named function in `internal/member` (e.g. `SeedFounder(ledger, personID) (seeded bool, err error)`) so it is unit-testable without the composition. 2. Guard = "no operator row at all", not "no `operator` row": `roles.go:93` forbids revoking the last operator, so a zero-operator ledger can only mean unseeded — the seed can never resurrect a deliberately demoted account or fight a `GrantOperator` to someone else. 3. A `Save` failure at boot fails loud like the composition's other file-store faults (ADR 0088) — never a silent skip that leaves the gate refusing. 4. Update the stale prose: `resting_composition.go:261-263` (the "out of scope for #155" TODO), the `internal/member/member.go` package doc ("seeded by founding as runtime data" → the plane seeds it at boot on the kanidm path; the founder register does on IDIP), and the `oidc-admin`/`operator-session` context in `internal/member/komiti.go:631-634` if it names founding. 5. Tests: (a) unit — empty ledger → seeded once, row one is `operator`/operator/active; second call no-op; ledger with an operator row under another PersonID → untouched; (b) composition seam (`idip_wholeness_test.go` style) — kanidm deps with a fresh state dir write `members.json` with row one = operator; `idipIdentity: true` writes nothing. `go test ./internal/member/ ./control-plane/...` green. 6. STATUS.md lead in the same commit. ## Acceptance - On the next #1235 fire (it re-fires when this closes) `operator-session` goes green: `establishAdminDoorSession` lands on `[data-status="dashboard-chrome"]`, and the drive advances to `gateway-change` / `browse-catalogue` with a REAL session behind it. - A founded community's members page shows the founder as row one, not an empty list. - IDIP drive unaffected (no `members.json` write on that path). Evidence: `elitebook-03:~/swarm/Matou/idss/test-results/private-path/20260905T205312Z/` — `artifacts/legs.json`, `artifacts/healer-refusal.json`, `artifacts/ceremony/admin-door-neither-landed.png`, `logs/guest-control-plane.log`, `logs/guest-kanidm.log`, `logs/founding-state.log`. <!-- rehearsal-sig: b5659a2277df -->

close-report for #1242 — status success

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

envelope
{
  "issue": 1242,
  "status": "success",
  "commits": [
    "10c31f6e"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/founder_seed_test.go",
    "control-plane/cmd/control-plane/resting_composition.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "internal/member/ledger.go",
    "internal/member/member.go",
    "internal/member/seed.go",
    "internal/member/seed_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/member/ ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/member/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "On the next #1235 fire operator-session goes green: establishAdminDoorSession lands on dashboard-chrome and the drive advances with a REAL session": "whole_composition.go seeds Member{operator,RoleOperator,StatusActive} at boot on the kanidm path, so member.GateDecision(admin) -> isOperator(operator) is now true and the gate admits the founder instead of the operators-only refusal; proven at the composition seam by founder_seed_test.go TestKanidmPathSeedsFounderRow (members.json row-one = operator/operator/active). Drive re-fire is the #1235 lane's proof.",
    "A founded community's members page shows the founder as row one, not an empty list": "SeedFounder prepends the founder as row one (internal/member/seed.go); TestSeedFounderWritesRowOneOnEmptyLedger asserts len==1 and row one = operator/operator/active; MembersView's never-empty rule now has its seed.",
    "IDIP drive unaffected (no members.json write on that path)": "the seed is gated on deps.idp != nil and skipped on deps.idipIdentity; founder_seed_test.go TestIDIPPathSeedsNoFounderRow asserts the IDIP compose writes zero member rows."
  },
  "summary": "The control plane idempotently seeds the founder operator row into the members ledger at boot on the kanidm path, so the gate stops refusing the community's own founding operator at their admin door.",
  "blockers": []
}
**close-report** for #1242 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1242, "status": "success", "commits": [ "10c31f6e" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/founder_seed_test.go", "control-plane/cmd/control-plane/resting_composition.go", "control-plane/cmd/control-plane/whole_composition.go", "internal/member/ledger.go", "internal/member/member.go", "internal/member/seed.go", "internal/member/seed_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/member/ ./control-plane/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/member/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 } ], "criteria": { "On the next #1235 fire operator-session goes green: establishAdminDoorSession lands on dashboard-chrome and the drive advances with a REAL session": "whole_composition.go seeds Member{operator,RoleOperator,StatusActive} at boot on the kanidm path, so member.GateDecision(admin) -> isOperator(operator) is now true and the gate admits the founder instead of the operators-only refusal; proven at the composition seam by founder_seed_test.go TestKanidmPathSeedsFounderRow (members.json row-one = operator/operator/active). Drive re-fire is the #1235 lane's proof.", "A founded community's members page shows the founder as row one, not an empty list": "SeedFounder prepends the founder as row one (internal/member/seed.go); TestSeedFounderWritesRowOneOnEmptyLedger asserts len==1 and row one = operator/operator/active; MembersView's never-empty rule now has its seed.", "IDIP drive unaffected (no members.json write on that path)": "the seed is gated on deps.idp != nil and skipped on deps.idipIdentity; founder_seed_test.go TestIDIPPathSeedsNoFounderRow asserts the IDIP compose writes zero member rows." }, "summary": "The control plane idempotently seeds the founder operator row into the members ledger at boot on the kanidm path, so the gate stops refusing the community's own founding operator at their admin door.", "blockers": [] } ``` </details>
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.

Reference
Matou/idss#1242
No description provided.