members: invites — mint single/multi-use invites + open-invites ledger #53

Closed
opened 2026-07-25 04:56:18 +00:00 by ben · 1 comment
Owner

Parent

Feature spec: #19 (members).

What to build

From the Members list the operator opens Invite (P6-S1 → S2) to mint an invite — the shareable link/QR that admits one person as a member. Minting with defaults produces a single-use invite that expires in 14 days, carries a join-as komiti preset, and renders as both a link and a QR with a copy affordance. Multi-use is a deliberate choice, never a default: the USES control sits at single-use, and switching it to multi-use is an explicit act (DDR 0073) that lets one printed QR admit a roomful at a hui — every signup still landing in the approval queue until expiry or revocation.

Invites are their own object with their own ledger (open → used-up | expired | revoked), never a phantom member row. The open-invites ledger shows each invite's label, komiti preset, single- or multi-use, uses so far, and expiry; revoking one immediately stops it admitting signups and marks it revoked in the ledger only. Every invite always admits a plain member — the operator role is never grantable through an invite; it is granted later in member detail. All of this runs through the member orchestrator (ADR 0077) with the invite ledger in the control-plane runtime store.

Acceptance criteria

  • (story 3) 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 a copy affordance.
  • (story 4) 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.
  • (story 5) Given open invites exist, when I view the ledger, then each shows label, preset, single/multi-use, uses so far, and expiry; and when I revoke one, then it immediately stops admitting signups and shows revoked in the ledger only.
  • (story 6) Given any invite, when a person joins through it, then their role is member; the operator role is grantable only later, in member detail.

Blocked by

  • #42 — Invite opens from the list surface

Task manifest

task: members:invites
implements_flow: p6-members
implements_edge: S1→S2
wireframe: docs/ux/wireframes/p6-members/p6-s2-invite.html
interface: the `member` orchestrator (ADR 0077) — mint invite (single/multi-use, 14-day expiry, komiti preset, always plain member), list open-invites ledger, revoke invite; ledger state open → used-up | expired | revoked in the control-plane runtime store
seam: "`member` orchestrator seam tests (control plane, Go) \u2014 in-memory invite ledger, audit sink; copy enroll's ledger/revocation family"
acceptance:
  - 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 link + QR with copy
  - given: the USES control defaults to single-use
    when: I switch it to multi-use
    then: the choice is explicit and the invite admits any number of signups until expiry or revocation, each awaiting approval
  - given: open invites exist
    when: I view the ledger and revoke one
    then: each row shows label, preset, single/multi-use, uses so far, expiry; revoke stops admitting immediately and shows revoked in the ledger only
  - given: any invite
    when: a person joins through it
    then: their role is member; operator is grantable only later in member detail
depends_on: [member-list-audit]
out_of_scope: [the signup/waiting/approval side and dead-invite screen (join-approval's), by-hand credential creation (by-hand-creation's), bulk email/CSV invites, open no-invite signup]
needs_human_decision: []
## Parent Feature spec: #19 (members). ## What to build From the Members list the operator opens Invite (P6-S1 → S2) to mint an invite — the shareable link/QR that admits one person as a member. Minting with defaults produces a single-use invite that expires in 14 days, carries a join-as komiti preset, and renders as both a link and a QR with a copy affordance. Multi-use is a deliberate choice, never a default: the USES control sits at single-use, and switching it to multi-use is an explicit act (DDR 0073) that lets one printed QR admit a roomful at a hui — every signup still landing in the approval queue until expiry or revocation. Invites are their own object with their own ledger (open → used-up | expired | revoked), never a phantom member row. The open-invites ledger shows each invite's label, komiti preset, single- or multi-use, uses so far, and expiry; revoking one immediately stops it admitting signups and marks it revoked in the ledger only. Every invite always admits a plain member — the operator role is never grantable through an invite; it is granted later in member detail. All of this runs through the `member` orchestrator (ADR 0077) with the invite ledger in the control-plane runtime store. ## Acceptance criteria - [ ] (story 3) 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 a copy affordance. - [ ] (story 4) 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. - [ ] (story 5) Given open invites exist, when I view the ledger, then each shows label, preset, single/multi-use, uses so far, and expiry; and when I revoke one, then it immediately stops admitting signups and shows revoked in the ledger only. - [ ] (story 6) Given any invite, when a person joins through it, then their role is member; the operator role is grantable only later, in member detail. ## Blocked by - #42 — Invite opens from the list surface ## Task manifest ```yaml task: members:invites implements_flow: p6-members implements_edge: S1→S2 wireframe: docs/ux/wireframes/p6-members/p6-s2-invite.html interface: the `member` orchestrator (ADR 0077) — mint invite (single/multi-use, 14-day expiry, komiti preset, always plain member), list open-invites ledger, revoke invite; ledger state open → used-up | expired | revoked in the control-plane runtime store seam: "`member` orchestrator seam tests (control plane, Go) \u2014 in-memory invite ledger, audit sink; copy enroll's ledger/revocation family" acceptance: - 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 link + QR with copy - given: the USES control defaults to single-use when: I switch it to multi-use then: the choice is explicit and the invite admits any number of signups until expiry or revocation, each awaiting approval - given: open invites exist when: I view the ledger and revoke one then: each row shows label, preset, single/multi-use, uses so far, expiry; revoke stops admitting immediately and shows revoked in the ledger only - given: any invite when: a person joins through it then: their role is member; operator is grantable only later in member detail depends_on: [member-list-audit] out_of_scope: [the signup/waiting/approval side and dead-invite screen (join-approval's), by-hand credential creation (by-hand-creation's), bulk email/CSV invites, open no-invite signup] needs_human_decision: [] ```
Author
Owner

Done in commit e1fcde6 (sandcastle: members:invites #53).

Built the member orchestrator's invite face in internal/member/invite.go — an invite is its own object with its own InviteLedger (a members-owned record separate from the member Ledger), never a phantom member row (DDR 0073).

Acceptance clauses — all covered by seam tests (internal/member/invite_test.go):

  • story 3 TestMintInvite_DefaultsAreSingleUse14DayKomitiLinkAndQR — MintInvite with defaults ⇒ single-use, InviteTTL 14-day expiry, join-as komiti preset, Link + QR (same payload behind a crypto/rand token) with the wireframe's copy affordance.
  • story 4 TestMintInvite_MultiUseIsExplicitAndAdmitsMany — InviteSpec.MultiUse is an explicit field (never a default); a multi-use invite admits any number of signups (each StatusAwaitingApproval) and stays open, while a single-use one becomes used-up after one.
  • story 5 TestOpenInvites_LedgerColumnsAndRevoke — the ledger row carries label · preset · single/multi-use · uses so far · expiry · derived status; RevokeInvite immediately stops admission (next Admit ⇒ ErrInviteClosed) and shows revoked in the ledger only.
  • story 6 TestAdmit_AlwaysPlainMemberAwaitingApproval — for single- and multi-use, Admit returns RoleMember + StatusAwaitingApproval; an invite never grants operator (granted later in member detail).

Plus: expired-stops-admitting (time-derived), unknown-token, mint/revoke audited + operator-attributed (ActionInvite / new ActionInviteRevoke, unattributed refused), revoke idempotent. Admit is the invite's admission verb join-approval's signup builds on — it records the use but creates no member row.

go test (19 in-package tests) / go vet / gofmt / golangci-lint all clean. STATUS.md updated (header + milestone log) in the same commit.

Out of scope (untouched): the member-facing signup/waiting/approval screens + dead-invite screen (join-approval's slice), by-hand creation (#54), bulk/CSV invites, open no-invite signup.

Done in commit `e1fcde6` (`sandcastle: members:invites #53`). Built the `member` orchestrator's invite face in `internal/member/invite.go` — an invite is its own object with its own `InviteLedger` (a members-owned record separate from the member `Ledger`), never a phantom member row (DDR 0073). **Acceptance clauses — all covered by seam tests (`internal/member/invite_test.go`):** - **story 3** `TestMintInvite_DefaultsAreSingleUse14DayKomitiLinkAndQR` — `MintInvite` with defaults ⇒ single-use, `InviteTTL` 14-day expiry, join-as komiti preset, `Link` + `QR` (same payload behind a crypto/rand token) with the wireframe's copy affordance. - **story 4** `TestMintInvite_MultiUseIsExplicitAndAdmitsMany` — `InviteSpec.MultiUse` is an explicit field (never a default); a multi-use invite admits any number of signups (each `StatusAwaitingApproval`) and stays open, while a single-use one becomes used-up after one. - **story 5** `TestOpenInvites_LedgerColumnsAndRevoke` — the ledger row carries label · preset · single/multi-use · uses so far · expiry · derived status; `RevokeInvite` immediately stops admission (next `Admit` ⇒ `ErrInviteClosed`) and shows `revoked` in the ledger only. - **story 6** `TestAdmit_AlwaysPlainMemberAwaitingApproval` — for single- and multi-use, `Admit` returns `RoleMember` + `StatusAwaitingApproval`; an invite never grants operator (granted later in member detail). Plus: expired-stops-admitting (time-derived), unknown-token, mint/revoke audited + operator-attributed (`ActionInvite` / new `ActionInviteRevoke`, unattributed refused), revoke idempotent. `Admit` is the invite's admission verb join-approval's signup builds on — it records the use but creates no member row. `go test` (19 in-package tests) / `go vet` / `gofmt` / `golangci-lint` all clean. STATUS.md updated (header + milestone log) in the same commit. Out of scope (untouched): the member-facing signup/waiting/approval screens + dead-invite screen (join-approval's slice), by-hand creation (#54), bulk/CSV invites, open no-invite signup.
ben closed this issue 2026-07-25 08:03:27 +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.

Reference
Matou/idss#53
No description provided.