Spec: members — belonging, the gated door, and the member lifecycle (P6) #19

Closed
opened 2026-07-24 19:57:13 +00:00 by ben · 1 comment
Owner

Parent

Wayfinder map: #7 (OurCloud v1 program scope — Phase 0). Members' definition and boundary rulings were locked on #9 (2026-07-21); this child spec consumes the members grill and wireframe set (2026-07-24, live confirm-and-fill with Ben, both gates passed in-session): DDR 0073 + ADRs 0074–0078, the rebuilt docs/ux/flows/p6-members.mermaid (10 screens), and the confirmed wireframe set in docs/ux/wireframes/p6-members/ (commits c239a67, bbe22a0).

Problem Statement

A community's people need to belong to its OurCloud the way they belong to the community — invited by someone they know, joining on their own phone, using every service with one account — without anyone running "user administration." The operator (low-skill, low-time, the P1 persona) needs to see who belongs, let the right people in, group them into komiti that actually control something, help when someone loses a passkey, and — when someone leaves — end their access everywhere at once while their data is handed on or kept, never silently lost. Today none of this exists: kanidm holds the machinery (ADR 0038) but there is no member-facing door, no lifecycle surface, and no honest answer to "what happens to their stuff."

Solution

The Members tab (in shell's dashboard frame) plus a small member-facing surface on the member's own phone. Belonging is always an explicit operator decision (DDR 0073): invites are single-use by default (multi-use is a deliberate choice for a hui), and every join waits in an approval queue grouped by invite. One community account propagates to every service over OIDC; kanidm stays invisible — every member-visible auth moment is branded. Komiti have teeth: front-door service access enforced at the gateway's auth gate, plus per-app role mapping where a catalogue port declares it (ADR 0076). Suspension is instant at the community's front door (ADR 0074). Removal decides data's fate per service on each port's declared terms — and v1 never deletes member data (ADR 0075). Everything audit-logged with drill-in (ADR 0027).

User Stories

The list and first run

  1. As an Operator, I want the Members list to show every member with their role, komiti, and status, so that I always know who belongs and in what state. (P6-S1)
    • Given members exist in states active / awaiting approval / hasn't signed in yet / suspended, When I open Members, Then each row shows name, komiti, role (member|operator), and its status pill, and kaitiaki show a badge on their row.
  2. As an Operator, I want the first-run Members list to show my own row plus an invite panel, so that the surface is never an empty dead end. (P6-S1 first-run)
    • Given a freshly founded community, When I open Members, Then row one is the founder (me) with the operator role, and a prominent "Invite people" panel is shown — never an empty screen.

Invites

  1. As an Operator, I want to mint a single-use invite link/QR with a komiti preset, so that I can admit one person I've chosen. (P6-S1 → S2)
    • Given I open Invite, When I mint with defaults, Then the invite is single-use, expires in 14 days, carries the join-as komiti preset, and renders as both link and QR with copy affordance.
  2. As an Operator, I want to deliberately mint a multi-use invite, so that one printed QR can admit a roomful at a hui. (P6-S2, DDR 0073)
    • Given the USES control defaults to single-use, When I switch it to multi-use, Then the choice is explicit (never a default), and the resulting invite admits any number of signups until expiry or revocation — each still waiting for approval.
  3. As an Operator, I want an open-invites ledger with revocation, so that a leaked or stale invite is one click from dead. (P6-S1)
    • Given open invites exist, When I view the ledger, Then each shows label, preset, single/multi-use, uses so far, and expiry; When I revoke one, Then it immediately stops admitting signups and shows revoked in the ledger only.
  4. As an Operator, I want invites to always admit plain members, so that no invite can mint an operator. (CONTEXT: Invite)
    • Given any invite, When a person joins through it, Then their role is member; the operator role is grantable only later, in member detail.

Joining (the member's side)

  1. As a Member, I want to open an invite and create my one community account on a branded screen, so that I know it's legit and only ever have one login. (P6-S2 → S3)
    • Given I open a live invite on my phone, When the signup screen loads, Then it carries the community's brand, asks my name, offers a passkey (recommended, never required) with a password fallback.
  2. As a Member, I want submitting to land me in a clear waiting state, so that I know an operator must let me in. (P6-S3 → S5, DDR 0073)
    • Given I submit the signup, When the account is created, Then I see the branded waiting screen (account created, waiting for approval), no service opens for me yet, a single-use invite is now consumed, and a "check again" affordance polls my state.
  3. As a Member, I want approval to just work, so that one login opens every community service. (P6-S5 → S1)
    • Given I am awaiting approval, When an operator approves me, Then my account propagates to every service over OIDC (no per-app accounts) and my next check/sign-in succeeds everywhere my komiti open.
  4. As a Member, I want a dead invite to tell me plainly it's dead — and nothing more, so that a revoked invite never reads as an accusation. (P6-S3x, DDR 0073)
    • Given an invite that is expired, revoked, or used up, When I open it, Then I see one branded screen ("this invite isn't active any more — ask the community for a fresh one") that never distinguishes which way it died, with no retry and no sign-in link.
  5. As a Member, I want a decline to resolve honestly, so that I'm not left staring at a spinner forever. (P6-S5 → S5x, DDR 0073)
    • Given I am on the waiting screen, When an operator declines me, Then the screen resolves to a branded "you weren't approved this time — talk to the community" state with no reason shown, my credential stops working, and a retry requires a fresh invite.

Approval (the operator's side)

  1. As an Operator, I want pending people grouped by the invite that admitted them, so that I can judge a batch by its provenance. (P6-S1, DDR 0073)
    • Given signups await approval, When I view Members, Then each pending row names its invite, and rows group by invite.
  2. As an Operator, I want approve-all on an invite's group, so that a 40-person hui is one action, not 40. (P6-S1)
    • Given a multi-use invite admitted several signups, When I tap approve-all on that group, Then every listed person becomes active in one action and each approval is audit-logged individually.
  3. As an Operator, I want declining to be terminal and tidy, so that a wrong signup leaves nothing behind. (P6-S5x)
    • Given a pending signup, When I decline it, Then the account is removed, the invite stays consumed, the reason I optionally record lives only in the audit log, and no member row remains.

By hand

  1. As an Operator, I want to create a username + temporary password for someone who doesn't do links, so that everyone can belong regardless of phone habits. (P6-S2 → S1)
    • Given I create credentials by hand, When the account exists, Then it needs no approval (creating is approving), shows "hasn't signed in yet" until first login, and first login prompts a credential of their own.

Member detail and reset

  1. As an Operator, I want a member's detail to show role, komiti, per-service access, and kaitiaki designation, so that one screen answers "what can this person touch?" (P6-S1 → S4)
    • Given I drill into a member, Then I see role, komiti chips (+ add), the per-service access derived from the matrix, kaitiaki designation state, and the lifecycle actions.
  2. As an Operator, I want Reset access to mint a single-use reset link/QR, so that "I got a new phone" is fixed across a table, with no email machinery. (P6-S4, CONTEXT: Reset link)
    • Given an active member lost their credential, When I mint a reset link, Then it is single-use, short-expiry, revocable, audit-logged, reuses the branded credential screen on their device; Given the member is suspended, Then minting is blocked until un-suspend (suspension cannot be quietly bypassed).

Suspension

  1. As an Operator, I want suspend to be one switch that bites instantly at the front door, so that pausing someone doesn't depend on app session luck. (P6-S4, ADR 0074)
    • Given an active member with live app sessions, When I suspend them, Then the IdP disables the account, the gateway's auth gate denies their very next browser request to any service, and the reconciler disables their non-OIDC app credentials within minutes.
  2. As an Operator, I want the suspend copy to be honest about the two speeds, so that I never over-promise to my community. (P6-S4)
    • Given the suspend control, Then its copy reads "paused at the community's front door immediately; background app access (sync clients) within minutes" — never claiming instant for the client-protocol tail.
  3. As an Operator, I want un-suspend to be the same switch back, so that a pause is genuinely reversible. (P6-S4)
    • Given a suspended member, When I un-suspend, Then the three moves reverse (IdP enable, gate allow, credentials re-enabled) and the member returns to active.

Removal

  1. As an Operator, I want removal to show the honest per-service fate list before I confirm, so that I know exactly what happens to their data, where. (P6-S4 → S6, ADR 0075)
    • Given I choose remove, Then I see each deployed service with its declared fate — reassign (with a picker offering active members only) where the port supports it, "archived — kept in place" where it doesn't — plus the "nothing is deleted" note.
  2. As an Operator, I want removal to end access first and move data second, so that a departing person is out even if a service is slow. (P6-S6, ADRs 0074/0075)
    • Given I confirm removal, Then the suspend moves run first (access ends immediately), then the fate verbs execute per service, each audit-logged separately.
  3. As an Operator, I want a failed fate verb to leave removal honestly incomplete, so that nothing is silently dropped. (P6-S6 → S6x, ADR 0075)
    • Given one service's fate verb fails, Then membership is already ended, the removal shows incomplete with the failed service named and its verb retryable, other services' fates unaffected; When retries succeed, Then the removal completes and returns to Members.
  4. As an Operator, I want removing or suspending a recovery-share holder to warn me, so that I never degrade Tier-3 recovery by accident. (P6-S4/S6, ADR 0015)
    • Given the member holds a recovery share (kaitiaki or operator), When I suspend or remove them, Then I see "holds a recovery share — rearrange shared safekeeping in Rescue first" as advice, never a veto: I can proceed, and rescue surfaces the degraded coverage.

Komiti and access

  1. As an Operator, I want to create, rename, and delete komiti in the Members tab, so that groupings live where people live. (P6-S1 → S7, ADR 0076)
    • Given I manage komiti, When I delete one, Then its doors and mappings close and no member account is touched; the operator role and kaitiaki never appear among komiti.
  2. As an Operator, I want each service to be open to all members by default or restricted to named komiti, so that "the finance komiti's tools" is real, not a label. (P6-S7, ADR 0076)
    • Given a service restricted to a komiti, When a member outside it sends any browser request to that service, Then the gateway's auth gate denies it — the member never reaches the app at all; Given the default, Then every service is open to all members.
  3. As an Operator, I want per-app role mapping where a port declares it, so that a komiti is a team in Chat and a group in Files without my wiring anything. (P6-S7, ADR 0076)
    • Given a port declares claim-native groups, Then komiti appear as app groups from the OIDC claim; Given a port declares a reconciler-mapped construct (team, org, group folder), Then the mapping is applied by the reconciler and shown on the komiti detail; Given a port declares neither, Then the komiti detail says "front door only" for that service, honestly.
  4. As an Operator, I want matrix changes to bite on the next request, so that access follows the decision, not a deploy. (P6-S7)
    • Given I restrict or open a service, Then the auth gate enforces the new matrix on each affected member's next request.

Kaitiaki, roles, audit

  1. As an Operator, I want to designate a kaitiaki on member detail, so that rescue's share ceremony knows its people. (P6-S4, ADR 0078)
    • Given I designate a member kaitiaki, Then it grants no access (a designation, not a role — stored as the hidden kanidm kaitiaki group), shows as a badge in the list, and rescue reads the designation from the IdP.
  2. As an Operator, I want to grant and revoke the operator role only from member detail, so that operator-making is always a deliberate act. (P6-S4)
    • Given an active member, When I grant operator, Then it is audit-logged and never flows from any invite; When I revoke it, Then the member remains an active member.
  3. As an Operator, I want every identity action audit-logged with drill-in, so that operators are always visible to each other. (all screens, ADR 0027)
    • Given any lifecycle action (invite, approve, decline, create, reset, suspend, remove, fate verb, komiti/matrix change, designation, role change), Then a structured entry lands in the standing log pipeline attributed to the acting operator, and member detail drills into that member's trail.

Implementation Decisions

  • One orchestrator, control-plane-hosted (ADR 0077). The member orchestrator is the control plane's fourth single-seam orchestrator (pattern: founding→helper, join→agent, provision/update/monitor→control plane). It owns every lifecycle verb and the public signup face; the dashboard UI is thin over its API. Server-side execution buys the 0058 property: a closed browser interrupts nothing (mid-removal included).
  • The idp port (ADR 0077). A new internal Go interface over kanidm's runtime API — create person, groups/membership, enable/disable, credential reset tokens. Founding declares clients/system groups/scope maps in Nix; persons and komiti are runtime data and pass only through this port (supersedes the spike-era persons-in-Nix shape). kanidm stays invisible (ADR 0038); the port is the swap-point.
  • The gated door (DDR 0073). Invites: single-use default, multi-use deliberate, 14-day default expiry, revocable, komiti preset, always admitting plain members. Every join lands awaiting approval; approve/decline are operator acts; decline is terminal (account removed, invite consumed). By-hand creation carries no approval step. Unhappy ends never leak reasons (one dead-invite screen; honest not-approved state; reasons only in the audit log). No outbound member notifications in v1.
  • The identity-aware ingress (ADR 0074). Caddy forward_auth on every browser request to every service, checked against the control plane's auth gate (an OIDC client of kanidm holding the community SSO session). Suspend = IdP disable + gate deny (instant) + reconciler credential-disable (minutes). Client-protocol paths (WebDAV/CalDAV/S3) are declared exempt per port and covered by the credential sweep. Un-suspend reverses the three moves.
  • Port-declared offboarding (ADR 0075). Each catalogue port declares its fates (reassign and/or archive) and ships matching reconciler offboard verbs. The removal confirm shows the per-service fate list; reassign targets active members only; v1 never deletes member data (no ADR 0060 destructive confirm needed); partial completion (removal incomplete) is a first-class, retryable state.
  • Komiti teeth (ADR 0076). A komiti is a kanidm group. Front door: the auth gate enforces the service × komiti matrix (default: open to all members), owned by Members. Inside apps: claim-native groups ride the OIDC token; richer constructs are reconciler-mapped where declared; "front door only" said honestly where neither.
  • The catalogue-port contract grows in the ADR 0062 parts pattern (growing the catalogue never edits members code): ingress fragment + client-protocol exempt paths (0074), disable-credentials verb (0074), offboard fate capability + verbs (0075), optional role-mapping declaration + verb (0076).
  • State homes by the sovereignty test (ADR 0078). People/komiti/credentials/suspension truth in kanidm — whose store becomes the first-class backed-up Identity dataset; access matrix + role mappings in the config repo (the Tier-1 replica carries the access policy); invite/reset ledgers in the control-plane runtime store only (die with a disaster, correctly); audit in the ADR 0027 logging pipeline; gate state a re-derivable projection (suspend's fast path writes through it).
  • Roles and designations. Exactly two access roles (member, operator). Kaitiaki is a designation (hidden kanidm group), granting nothing; rescue reads it. The share-holder warning on suspend/remove is advice, never veto (ADR 0015).
  • Wire/API contract. Shared Go types are the schema (ADR 0037); the dashboard consumes the orchestrator through the OpenAPI-specced control-plane API; the public signup face is a public endpoint of the same control plane (the enroll public-face discipline: token-authenticated, nothing strong before approval).

Testing Decisions

  • What makes a good test here: drive the member orchestrator through its public interface and assert externally visible outcomes — states, ledger entries, gate decisions, audit records, and the calls made to the idp/port fakes — never internals. A decline is a successful state transition, not an error. Terminal states never move; idempotent re-submission (double-tapped signup, re-sent approve) never duplicates a person.
  • The single seam (re-confirmed by Ben at spec time): the member orchestrator with fake idp, fake catalogue-port verbs, in-memory invite/reset ledgers, audit, and gate-state. The member/invite state machines, approval and removal orchestration, and matrix logic run real. The auth gate's decision function is tested at the same seam (given session identity + matrix + deny-list → allow/deny); Caddy wiring itself is not unit-tested here.
  • Prior art to copy:
    • enroll's state-machine + ledger test family → invite ledger and member state machine (idempotency anchors, terminal-states-never-move, consumed-invite-refuses-reuse, revocation of an in-flight artifact).
    • enroll's approve/decline + crash-resume family → the approval queue (grouped approve-all, decline-is-terminal, resume to the same awaiting-approval row, no duplicates).
    • Provisioning's per-service partial-failure family (ADR 0061) → removal fates (one verb fails → incomplete, named, retryable, others unaffected) and the suspend sweep with one service down.
  • Non-gating real-lab members smoke (fake-drift insurance, explicitly not an acceptance gate): on the clan-lab fleet with real kanidm — mint invite → phone-shaped signup → approve → OIDC sign-in to a real service → suspend and observe the gateway deny the next request → remove with an archive fate. Mirrors the founding/device-add/provisioning/monitoring smokes.

Out of Scope

  • Bulk email/CSV invites (would make outbound mail load-bearing).
  • Open signup (the no-invite front door) — the approval step exists; the mechanism does not.
  • Any outbound member notifications (email/SMS) on approve/decline/suspend/remove — members find out in person or at next sign-in.
  • Self-service credential reset (reset is an operator-minted link; sign-in says "ask your operator").
  • Archive deletion / retention policy — v1 never deletes member data; "delete archives after N months" waits for a policy surface.
  • A member self-service account page (kanidm's own UI stays unexposed).
  • A third access role or delegation; komiti nesting; cross-community identity.
  • Per-app role mapping beyond what a port declares (mandatory uniform mapping rejected — ADR 0076).

Further Notes

Cross-feature edges for the slice-map (Phase 2):

  • founding — seeds the founder's person account (the never-empty row one), the auth gate as an OIDC client, the default-open access matrix, and the hidden kaitiaki group.
  • provisioning — the per-service ingress route template gains the forward_auth block; service rows may display "restricted to ⟨komiti⟩" (display only; the matrix is members-owned).
  • every catalogue port — contract additions: exempt paths, disable-credentials, offboard fates + verbs, optional role mappings (ADRs 0074/0075/0076).
  • backups — the Identity dataset (kanidm store) must be in the recommended default policy from day one (ADR 0078); archived members' data stays in coverage.
  • rescue — reads kaitiaki from the IdP; receives the share-holder degradation surfaced by the suspend/remove warning.
  • shell — the Members tab mounts in the dashboard frame; the audit drill-in terminates in shell's logs viewer (ADR 0027).

Carried decisions: none new — no needs_human_decision items arose; the §12 leftovers touching members (none directly; escrow/summoning are rescue's and monitoring's) stay where they are routed.

Labelled no-triage (the #17/#18 precedent): the live swarm must not pick this up before the Phase-2 slice-map orders the DAG.

## Parent Wayfinder map: #7 (OurCloud v1 program scope — Phase 0). Members' definition and boundary rulings were locked on #9 (2026-07-21); this child spec consumes the members grill and wireframe set (2026-07-24, live confirm-and-fill with Ben, both gates passed in-session): **DDR 0073** + **ADRs 0074–0078**, the rebuilt `docs/ux/flows/p6-members.mermaid` (10 screens), and the confirmed wireframe set in `docs/ux/wireframes/p6-members/` (commits `c239a67`, `bbe22a0`). ## Problem Statement A community's people need to belong to its OurCloud the way they belong to the community — invited by someone they know, joining on their own phone, using every service with one account — without anyone running "user administration." The operator (low-skill, low-time, the P1 persona) needs to see who belongs, let the right people in, group them into komiti that actually control something, help when someone loses a passkey, and — when someone leaves — end their access everywhere at once while their data is handed on or kept, never silently lost. Today none of this exists: kanidm holds the machinery (ADR 0038) but there is no member-facing door, no lifecycle surface, and no honest answer to "what happens to their stuff." ## Solution The Members tab (in shell's dashboard frame) plus a small member-facing surface on the member's own phone. **Belonging is always an explicit operator decision** (DDR 0073): invites are single-use by default (multi-use is a deliberate choice for a hui), and every join waits in an approval queue grouped by invite. One community account propagates to every service over OIDC; kanidm stays invisible — every member-visible auth moment is branded. Komiti have teeth: front-door service access enforced at the gateway's auth gate, plus per-app role mapping where a catalogue port declares it (ADR 0076). Suspension is instant at the community's front door (ADR 0074). Removal decides data's fate per service on each port's declared terms — and v1 never deletes member data (ADR 0075). Everything audit-logged with drill-in (ADR 0027). ## User Stories **The list and first run** 1. As an Operator, I want the Members list to show every member with their role, komiti, and status, so that I always know who belongs and in what state. *(P6-S1)* - **Given** members exist in states active / awaiting approval / hasn't signed in yet / suspended, **When** I open Members, **Then** each row shows name, komiti, role (member|operator), and its status pill, and kaitiaki show a badge on their row. 2. As an Operator, I want the first-run Members list to show my own row plus an invite panel, so that the surface is never an empty dead end. *(P6-S1 first-run)* - **Given** a freshly founded community, **When** I open Members, **Then** row one is the founder (me) with the operator role, and a prominent "Invite people" panel is shown — never an empty screen. **Invites** 3. As an Operator, I want to mint a single-use invite link/QR with a komiti preset, so that I can admit one person I've chosen. *(P6-S1 → S2)* - **Given** I open Invite, **When** I mint with defaults, **Then** the invite is single-use, expires in 14 days, carries the join-as komiti preset, and renders as both link and QR with copy affordance. 4. As an Operator, I want to deliberately mint a multi-use invite, so that one printed QR can admit a roomful at a hui. *(P6-S2, DDR 0073)* - **Given** the USES control defaults to single-use, **When** I switch it to multi-use, **Then** the choice is explicit (never a default), and the resulting invite admits any number of signups until expiry or revocation — each still waiting for approval. 5. As an Operator, I want an open-invites ledger with revocation, so that a leaked or stale invite is one click from dead. *(P6-S1)* - **Given** open invites exist, **When** I view the ledger, **Then** each shows label, preset, single/multi-use, uses so far, and expiry; **When** I revoke one, **Then** it immediately stops admitting signups and shows revoked in the ledger only. 6. As an Operator, I want invites to always admit plain members, so that no invite can mint an operator. *(CONTEXT: Invite)* - **Given** any invite, **When** a person joins through it, **Then** their role is member; the operator role is grantable only later, in member detail. **Joining (the member's side)** 7. As a Member, I want to open an invite and create my one community account on a branded screen, so that I know it's legit and only ever have one login. *(P6-S2 → S3)* - **Given** I open a live invite on my phone, **When** the signup screen loads, **Then** it carries the community's brand, asks my name, offers a passkey (recommended, never required) with a password fallback. 8. As a Member, I want submitting to land me in a clear waiting state, so that I know an operator must let me in. *(P6-S3 → S5, DDR 0073)* - **Given** I submit the signup, **When** the account is created, **Then** I see the branded waiting screen (account created, waiting for approval), no service opens for me yet, a single-use invite is now consumed, and a "check again" affordance polls my state. 9. As a Member, I want approval to just work, so that one login opens every community service. *(P6-S5 → S1)* - **Given** I am awaiting approval, **When** an operator approves me, **Then** my account propagates to every service over OIDC (no per-app accounts) and my next check/sign-in succeeds everywhere my komiti open. 10. As a Member, I want a dead invite to tell me plainly it's dead — and nothing more, so that a revoked invite never reads as an accusation. *(P6-S3x, DDR 0073)* - **Given** an invite that is expired, revoked, or used up, **When** I open it, **Then** I see one branded screen ("this invite isn't active any more — ask the community for a fresh one") that never distinguishes which way it died, with no retry and no sign-in link. 11. As a Member, I want a decline to resolve honestly, so that I'm not left staring at a spinner forever. *(P6-S5 → S5x, DDR 0073)* - **Given** I am on the waiting screen, **When** an operator declines me, **Then** the screen resolves to a branded "you weren't approved this time — talk to the community" state with no reason shown, my credential stops working, and a retry requires a fresh invite. **Approval (the operator's side)** 12. As an Operator, I want pending people grouped by the invite that admitted them, so that I can judge a batch by its provenance. *(P6-S1, DDR 0073)* - **Given** signups await approval, **When** I view Members, **Then** each pending row names its invite, and rows group by invite. 13. As an Operator, I want approve-all on an invite's group, so that a 40-person hui is one action, not 40. *(P6-S1)* - **Given** a multi-use invite admitted several signups, **When** I tap approve-all on that group, **Then** every listed person becomes active in one action and each approval is audit-logged individually. 14. As an Operator, I want declining to be terminal and tidy, so that a wrong signup leaves nothing behind. *(P6-S5x)* - **Given** a pending signup, **When** I decline it, **Then** the account is removed, the invite stays consumed, the reason I optionally record lives only in the audit log, and no member row remains. **By hand** 15. As an Operator, I want to create a username + temporary password for someone who doesn't do links, so that everyone can belong regardless of phone habits. *(P6-S2 → S1)* - **Given** I create credentials by hand, **When** the account exists, **Then** it needs no approval (creating is approving), shows "hasn't signed in yet" until first login, and first login prompts a credential of their own. **Member detail and reset** 16. As an Operator, I want a member's detail to show role, komiti, per-service access, and kaitiaki designation, so that one screen answers "what can this person touch?" *(P6-S1 → S4)* - **Given** I drill into a member, **Then** I see role, komiti chips (+ add), the per-service access derived from the matrix, kaitiaki designation state, and the lifecycle actions. 17. As an Operator, I want Reset access to mint a single-use reset link/QR, so that "I got a new phone" is fixed across a table, with no email machinery. *(P6-S4, CONTEXT: Reset link)* - **Given** an active member lost their credential, **When** I mint a reset link, **Then** it is single-use, short-expiry, revocable, audit-logged, reuses the branded credential screen on their device; **Given** the member is suspended, **Then** minting is blocked until un-suspend (suspension cannot be quietly bypassed). **Suspension** 18. As an Operator, I want suspend to be one switch that bites instantly at the front door, so that pausing someone doesn't depend on app session luck. *(P6-S4, ADR 0074)* - **Given** an active member with live app sessions, **When** I suspend them, **Then** the IdP disables the account, the gateway's auth gate denies their very next browser request to any service, and the reconciler disables their non-OIDC app credentials within minutes. 19. As an Operator, I want the suspend copy to be honest about the two speeds, so that I never over-promise to my community. *(P6-S4)* - **Given** the suspend control, **Then** its copy reads "paused at the community's front door immediately; background app access (sync clients) within minutes" — never claiming instant for the client-protocol tail. 20. As an Operator, I want un-suspend to be the same switch back, so that a pause is genuinely reversible. *(P6-S4)* - **Given** a suspended member, **When** I un-suspend, **Then** the three moves reverse (IdP enable, gate allow, credentials re-enabled) and the member returns to active. **Removal** 21. As an Operator, I want removal to show the honest per-service fate list before I confirm, so that I know exactly what happens to their data, where. *(P6-S4 → S6, ADR 0075)* - **Given** I choose remove, **Then** I see each deployed service with its declared fate — reassign (with a picker offering active members only) where the port supports it, "archived — kept in place" where it doesn't — plus the "nothing is deleted" note. 22. As an Operator, I want removal to end access first and move data second, so that a departing person is out even if a service is slow. *(P6-S6, ADRs 0074/0075)* - **Given** I confirm removal, **Then** the suspend moves run first (access ends immediately), then the fate verbs execute per service, each audit-logged separately. 23. As an Operator, I want a failed fate verb to leave removal honestly incomplete, so that nothing is silently dropped. *(P6-S6 → S6x, ADR 0075)* - **Given** one service's fate verb fails, **Then** membership is already ended, the removal shows incomplete with the failed service named and its verb retryable, other services' fates unaffected; **When** retries succeed, **Then** the removal completes and returns to Members. 24. As an Operator, I want removing or suspending a recovery-share holder to warn me, so that I never degrade Tier-3 recovery by accident. *(P6-S4/S6, ADR 0015)* - **Given** the member holds a recovery share (kaitiaki or operator), **When** I suspend or remove them, **Then** I see "holds a recovery share — rearrange shared safekeeping in Rescue first" as advice, never a veto: I can proceed, and rescue surfaces the degraded coverage. **Komiti and access** 25. As an Operator, I want to create, rename, and delete komiti in the Members tab, so that groupings live where people live. *(P6-S1 → S7, ADR 0076)* - **Given** I manage komiti, **When** I delete one, **Then** its doors and mappings close and no member account is touched; the operator role and kaitiaki never appear among komiti. 26. As an Operator, I want each service to be open to all members by default or restricted to named komiti, so that "the finance komiti's tools" is real, not a label. *(P6-S7, ADR 0076)* - **Given** a service restricted to a komiti, **When** a member outside it sends any browser request to that service, **Then** the gateway's auth gate denies it — the member never reaches the app at all; **Given** the default, **Then** every service is open to all members. 27. As an Operator, I want per-app role mapping where a port declares it, so that a komiti is a team in Chat and a group in Files without my wiring anything. *(P6-S7, ADR 0076)* - **Given** a port declares claim-native groups, **Then** komiti appear as app groups from the OIDC claim; **Given** a port declares a reconciler-mapped construct (team, org, group folder), **Then** the mapping is applied by the reconciler and shown on the komiti detail; **Given** a port declares neither, **Then** the komiti detail says "front door only" for that service, honestly. 28. As an Operator, I want matrix changes to bite on the next request, so that access follows the decision, not a deploy. *(P6-S7)* - **Given** I restrict or open a service, **Then** the auth gate enforces the new matrix on each affected member's next request. **Kaitiaki, roles, audit** 29. As an Operator, I want to designate a kaitiaki on member detail, so that rescue's share ceremony knows its people. *(P6-S4, ADR 0078)* - **Given** I designate a member kaitiaki, **Then** it grants no access (a designation, not a role — stored as the hidden kanidm `kaitiaki` group), shows as a badge in the list, and rescue reads the designation from the IdP. 30. As an Operator, I want to grant and revoke the operator role only from member detail, so that operator-making is always a deliberate act. *(P6-S4)* - **Given** an active member, **When** I grant operator, **Then** it is audit-logged and never flows from any invite; **When** I revoke it, **Then** the member remains an active member. 31. As an Operator, I want every identity action audit-logged with drill-in, so that operators are always visible to each other. *(all screens, ADR 0027)* - **Given** any lifecycle action (invite, approve, decline, create, reset, suspend, remove, fate verb, komiti/matrix change, designation, role change), **Then** a structured entry lands in the standing log pipeline attributed to the acting operator, and member detail drills into that member's trail. ## Implementation Decisions - **One orchestrator, control-plane-hosted (ADR 0077).** The `member` orchestrator is the control plane's fourth single-seam orchestrator (pattern: `founding`→helper, `join`→agent, `provision`/`update`/`monitor`→control plane). It owns every lifecycle verb and the public signup face; the dashboard UI is thin over its API. Server-side execution buys the 0058 property: a closed browser interrupts nothing (mid-removal included). - **The `idp` port (ADR 0077).** A new internal Go interface over kanidm's runtime API — create person, groups/membership, enable/disable, credential reset tokens. Founding declares clients/system groups/scope maps in Nix; **persons and komiti are runtime data** and pass only through this port (supersedes the spike-era persons-in-Nix shape). kanidm stays invisible (ADR 0038); the port is the swap-point. - **The gated door (DDR 0073).** Invites: single-use default, multi-use deliberate, 14-day default expiry, revocable, komiti preset, always admitting plain members. Every join lands awaiting approval; approve/decline are operator acts; decline is terminal (account removed, invite consumed). By-hand creation carries no approval step. Unhappy ends never leak reasons (one dead-invite screen; honest not-approved state; reasons only in the audit log). No outbound member notifications in v1. - **The identity-aware ingress (ADR 0074).** Caddy `forward_auth` on every browser request to every service, checked against the control plane's auth gate (an OIDC client of kanidm holding the community SSO session). Suspend = IdP disable + gate deny (instant) + reconciler credential-disable (minutes). Client-protocol paths (WebDAV/CalDAV/S3) are declared exempt per port and covered by the credential sweep. Un-suspend reverses the three moves. - **Port-declared offboarding (ADR 0075).** Each catalogue port declares its fates (reassign and/or archive) and ships matching reconciler offboard verbs. The removal confirm shows the per-service fate list; reassign targets active members only; **v1 never deletes member data** (no ADR 0060 destructive confirm needed); partial completion (removal incomplete) is a first-class, retryable state. - **Komiti teeth (ADR 0076).** A komiti is a kanidm group. Front door: the auth gate enforces the service × komiti matrix (default: open to all members), owned by Members. Inside apps: claim-native groups ride the OIDC token; richer constructs are reconciler-mapped where declared; "front door only" said honestly where neither. - **The catalogue-port contract grows in the ADR 0062 parts pattern** (growing the catalogue never edits members code): ingress fragment + client-protocol exempt paths (0074), disable-credentials verb (0074), offboard fate capability + verbs (0075), optional role-mapping declaration + verb (0076). - **State homes by the sovereignty test (ADR 0078).** People/komiti/credentials/suspension truth in kanidm — whose store becomes the first-class backed-up **Identity dataset**; access matrix + role mappings in the config repo (the Tier-1 replica carries the access policy); invite/reset ledgers in the control-plane runtime store only (die with a disaster, correctly); audit in the ADR 0027 logging pipeline; gate state a re-derivable projection (suspend's fast path writes through it). - **Roles and designations.** Exactly two access roles (member, operator). Kaitiaki is a designation (hidden kanidm group), granting nothing; rescue reads it. The share-holder warning on suspend/remove is advice, never veto (ADR 0015). - **Wire/API contract.** Shared Go types are the schema (ADR 0037); the dashboard consumes the orchestrator through the OpenAPI-specced control-plane API; the public signup face is a public endpoint of the same control plane (the `enroll` public-face discipline: token-authenticated, nothing strong before approval). ## Testing Decisions - **What makes a good test here:** drive the `member` orchestrator through its public interface and assert externally visible outcomes — states, ledger entries, gate decisions, audit records, and the calls made to the `idp`/port fakes — never internals. A decline is a successful state transition, not an error. Terminal states never move; idempotent re-submission (double-tapped signup, re-sent approve) never duplicates a person. - **The single seam (re-confirmed by Ben at spec time):** the `member` orchestrator with fake `idp`, fake catalogue-port verbs, in-memory invite/reset ledgers, audit, and gate-state. The member/invite state machines, approval and removal orchestration, and matrix logic run real. The auth gate's decision function is tested at the same seam (given session identity + matrix + deny-list → allow/deny); Caddy wiring itself is not unit-tested here. - **Prior art to copy:** - `enroll`'s state-machine + ledger test family → invite ledger and member state machine (idempotency anchors, terminal-states-never-move, consumed-invite-refuses-reuse, revocation of an in-flight artifact). - `enroll`'s approve/decline + crash-resume family → the approval queue (grouped approve-all, decline-is-terminal, resume to the same awaiting-approval row, no duplicates). - Provisioning's per-service partial-failure family (ADR 0061) → removal fates (one verb fails → incomplete, named, retryable, others unaffected) and the suspend sweep with one service down. - **Non-gating real-lab members smoke (fake-drift insurance, explicitly not an acceptance gate):** on the clan-lab fleet with real kanidm — mint invite → phone-shaped signup → approve → OIDC sign-in to a real service → suspend and observe the gateway deny the next request → remove with an archive fate. Mirrors the founding/device-add/provisioning/monitoring smokes. ## Out of Scope - Bulk email/CSV invites (would make outbound mail load-bearing). - Open signup (the no-invite front door) — the approval *step* exists; the mechanism does not. - Any outbound member notifications (email/SMS) on approve/decline/suspend/remove — members find out in person or at next sign-in. - Self-service credential reset (reset is an operator-minted link; sign-in says "ask your operator"). - Archive deletion / retention policy — v1 never deletes member data; "delete archives after N months" waits for a policy surface. - A member self-service account page (kanidm's own UI stays unexposed). - A third access role or delegation; komiti nesting; cross-community identity. - Per-app role mapping beyond what a port declares (mandatory uniform mapping rejected — ADR 0076). ## Further Notes **Cross-feature edges for the slice-map (Phase 2):** - **founding** — seeds the founder's person account (the never-empty row one), the auth gate as an OIDC client, the default-open access matrix, and the hidden `kaitiaki` group. - **provisioning** — the per-service ingress route template gains the `forward_auth` block; service rows may display "restricted to ⟨komiti⟩" (display only; the matrix is members-owned). - **every catalogue port** — contract additions: exempt paths, disable-credentials, offboard fates + verbs, optional role mappings (ADRs 0074/0075/0076). - **backups** — the **Identity dataset** (kanidm store) must be in the recommended default policy from day one (ADR 0078); archived members' data stays in coverage. - **rescue** — reads kaitiaki from the IdP; receives the share-holder degradation surfaced by the suspend/remove warning. - **shell** — the Members tab mounts in the dashboard frame; the audit drill-in terminates in shell's logs viewer (ADR 0027). **Carried decisions:** none new — no `needs_human_decision` items arose; the §12 leftovers touching members (none directly; escrow/summoning are rescue's and monitoring's) stay where they are routed. **Labelled `no-triage`** (the #17/#18 precedent): the live swarm must not pick this up before the Phase-2 slice-map orders the DAG.
Author
Owner

Closed in the 2026-08-27 other-state sweep (Ben's ruling) — child spec complete: 17/17 members slices done, all 24 derived tickets closed; invite-member rehearsal leg green 2026-08-26.

Closed in the 2026-08-27 `other`-state sweep (Ben's ruling) — child spec complete: 17/17 members slices done, all 24 derived tickets closed; invite-member rehearsal leg green 2026-08-26.
ben closed this issue 2026-08-27 04:43:55 +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#19
No description provided.