Commit Graph
1 Commits
Author SHA1 Message Date
inference-admin 241ac800c6 panel state: a reminder is history, not a state — renewals clear grace, grace expires
ci/woodpecker/push/woodpecker Pipeline was canceled
mark@ofosos.org showed as in grace while his contribution was live. The sweep's
own trail says it plainly: reminded 2026-11-04 for the cycle that looked unpaid,
grace elapsed 2026-11-11, and `renewed` logged at 19:02 on 2026-11-13 (last
charge 2026-11-11, next reset 2026-11-26). The panel said grace anyway, because
member_membership_state() asked only "is there a row in payment_reminders?".

That table is a HISTORY — kept so the sweep does not re-remind inside a cycle. It
is not a state, and treating it as one broke two things: a reminder never
expired (grace is PAYMENT_GRACE_DAYS long), and a renewal never cleared it.

Now the LATEST reconciliation decision decides:
  renewed / would_renew            -> active (they are paying)
  reminder inside the window       -> in_grace
  reminder past the window         -> awaiting_contribution, saying grace elapsed
  would_deactivate / deactivated   -> awaiting_contribution
Ordered by decided_at, not id: the same member had id 2296 dated 2026-11-11 next
to id 2286 dated 2026-11-13, so "latest by id" reads the wrong decision.

Reads still fail safe: an unreadable DB reports active, never a payment problem.

tests/test_membership_state.py pins all of it, including the ordering trap.
2026-11-13 21:53:27 +00:00