diff --git a/app/main.py b/app/main.py index 8973665..f78b0a6 100644 --- a/app/main.py +++ b/app/main.py @@ -4402,8 +4402,9 @@ async def reconcile_memberships() -> dict: # Policy (operator decision 2026-11-04). Open Collective aligns every member's # charge onto the collective's common billing day, so anchoring an allowance # reset to the PAYMENT date lets a charge move the boundary and skip a cycle -# entirely: [redacted member reference] [redacted timeline], -# and our reset rule re-anchored them to a new day with no reset in between. So the +# entirely: a member who joins mid-month can be charged on the common billing +# day within weeks, and the old reset rule re-anchored them to that new day +# with no reset in between. So the # reset is anchored to the day of the month the member JOINED, and renewal is # decided by asking Open Collective directly whether a recurring contribution is # live — on our own schedule, not inferred from webhook delivery. A webhook that @@ -5013,13 +5014,16 @@ def shortfall_reason(prev: str, cur: str) -> str: return f"allowance shortfall, truncated paid cycle {prev}→{cur} (OC billing alignment)" -# Members already made whole OUTSIDE this mechanism, keyed by (email, OC charge -# reference). [redacted member reference] received a manual allowance reset -# on 2026-11-04 for the cycle OC truncated ([redacted timeline]); that -# specific charge is excluded so a re-run never credits it again. Later charges -# form new cycles and are credited normally. -SHORTFALL_REMEDIATED: set[tuple[str, str]] = { - ("[redacted member reference]", "[redacted member reference]"), +# Charges already made whole OUTSIDE this mechanism, keyed by the OC charge +# reference alone (the same idempotence key the shortfall path uses). The one +# listed charge received a manual allowance reset on 2026-11-04 for the cycle +# OC truncated; it is excluded so a re-run never credits it again. Later +# charges form new cycles and are credited normally. The member's identity and +# the full timeline behind this entry are recorded in the operations docs and +# the ledger — deliberately NOT in this public repository (audit H2, +# 2026-11-05: the exclusion used to embed a member's email and billing dates). +SHORTFALL_REMEDIATED: set[str] = { + "[redacted member reference]", } @@ -5286,7 +5290,7 @@ async def reconcile_allowance_shortfalls(send: bool = False) -> dict: if rec and rec.get("role") == "ADMIN": skipped.append({**c, "email": email, "why": "operator account"}) continue - if (email, c["reference"]) in SHORTFALL_REMEDIATED: + if c["reference"] in SHORTFALL_REMEDIATED: skipped.append({**c, "email": email, "why": "already remediated by a manual allowance reset (2026-11-04)"}) continue diff --git a/tests/test_allowance_shortfall.py b/tests/test_allowance_shortfall.py index d511952..d2f2472 100644 --- a/tests/test_allowance_shortfall.py +++ b/tests/test_allowance_shortfall.py @@ -108,9 +108,10 @@ check("reason names the cycle", shortfall_reason("2026-10-07", "2026-11-02"), "allowance shortfall, truncated paid cycle 2026-10-07→2026-11-02 (OC billing alignment)") -# --- the manual-remediation exclusion is keyed on (email, charge ref) -check("remediated member/charge excluded", - ("[redacted member reference]", "[redacted member reference]") in SHORTFALL_REMEDIATED, True) +# --- the manual-remediation exclusion is keyed on the charge ref alone +# --- (no member PII in this public repo; identity/timeline live in ops docs) +check("remediated charge excluded by reference", + "[redacted member reference]" in SHORTFALL_REMEDIATED, True) print(f"\n{'FAILED' if failures else 'OK'} — {failures} failure(s)") sys.exit(1 if failures else 0)