Guest invites provision immediately: remove the member approval gate

Operator decision 2026-11-08: the remaining protections (active member,
1 guest per inviter per rolling 30 days, one guest per recipient ever,
no existing portal row, MANUAL_MEMBERS refusal, the $2 cap and the
GUEST_DAYS box) are sufficient without the approval step.

* POST /broker/guests provisions through provision_guest_member at once —
  no pending state; no guest_requests row is ever written.
* GUEST_AUTO_APPROVE flag removed (the live env never carried it).
* guest_request_guard keeps the member-path rules and drops the
  trial-era pending-request checks; the 30-day window is counted from
  the guests ledger.
* GET /admin/guest-requests + approve/reject removed; GET /admin/guest-ledger
  serves the panel's duplicate-send guard.
* The member trail keeps legacy rejected requests as history only.

Built on the sibling $2-cap commit 6be8e2d.
This commit is contained in:
inference-bot committed 2026-11-08 20:20:30 +00:00
1 parent f1a86d9d76
commit 285aa66525
3 files changed
+195 -401

No files matched your search

+10 -14
View File
@@ -72,22 +72,18 @@ guest per recipient ever; the inviter must be an active member; an existing
portal row under the recipient address is refused. Guests are subscribed to
the newsletter and invited to NOTHING else (no Loomio, no Matrix).
**Member self-serve invitations (trial gate).** `POST /broker/guests` (the
member-dashboard broker identity — a guest identity fails it) lets a MEMBER
**Member self-serve invitations (provision immediately).** `POST /broker/guests`
(the member-dashboard broker identity — a guest identity fails it) lets a MEMBER
invite a guest from their dashboard: `{"email", "name"}`. The same guards run
BEFORE anything is created (`guest_request_guard`: everything above, plus the
recipient is never a `MANUAL_MEMBERS` address or an already-pending request,
and the inviter's rolling window counts pending + approved REQUESTS too).
With `GUEST_AUTO_APPROVE` **off** (the default) the request lands PENDING in
the `guest_requests` table and the operator approves or rejects it from the
panel — `GET /admin/guest-requests` (queue + ledger, pending vs approved in
one view), `POST /admin/guest-requests/{id}/approve` (fires the full guest
pipeline above; every guard re-runs and a moved-state refusal is recorded on
the request) or `.../reject`. The recipient is contacted only on approval;
the inviting member sees pending/not-approved in their own trail via
`GET /broker/guests`. With `GUEST_AUTO_APPROVE=1` a member's request
provisions immediately — flipping the gate is an env change, not a code
change.
recipient is never a `MANUAL_MEMBERS` address), and a valid invitation
**provisions immediately** — the approval gate was removed on 2026-11-08 as
operator policy; the remaining protections (active member, one guest per
inviter per rolling 30 days, one guest per recipient ever, the $2 cap and the
`GUEST_DAYS` box) were judged sufficient. `provision_guest_member` re-runs
every guard, so a moved-state refusal still refuses. The member sees their
invitation trail — each guest with its status and expiry — via
`GET /broker/guests`.
**Sweep safety.** `reconcile_memberships()` never deactivates a guest for
lacking an OC contribution. A guest lapses only by its own rules, handled by