From b1022eb02a3b2461db3ca035f32ae6fa5fb16845 Mon Sep 17 00:00:00 2001 From: Inferencebot Date: Fri, 13 Nov 2026 22:27:55 +0000 Subject: [PATCH] oc-incognito: take the slug from the member's own row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Setting the source was not enough, and verification is what caught it: mmoya still produced no allowance decision at all. The reconciler gets a member's OC slug from the member INDEX — which is keyed by email, and DROPS anyone whose profile hides its email. So `oc_slug` came back empty, the member fell into "not in the live Open Collective member list — cannot verify payment", and was counted as skipped. An oc-incognito member would have been "not manual" and still not reconciled: a nicer label over the same hole. For source oc-incognito the slug now comes from the member's own row, which is the same key fetch_member_orders() groups orders by — the whole reason matching can work for these people. The test pins the fallback, not just the source. --- app/main.py | 13 +++++++++++++ tests/test_oc_incognito.py | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/app/main.py b/app/main.py index bfeeb90..7fbf755 100644 --- a/app/main.py +++ b/app/main.py @@ -7708,6 +7708,19 @@ async def reconcile_allowances(send: bool = False) -> dict: counts["skipped"] += 1 # the co-op's own account continue oc_slug = (rec or {}).get("slug") or "" + if not oc_slug and member_source(email, conn) == "oc-incognito": + # OC's member index DROPS anyone whose profile hides its email, so it + # can never supply the slug for these members — and without one the + # reconciler cannot see their orders at all and skips them as + # "not in the live Open Collective member list". Their own row holds + # the slug, and it is the same key fetch_member_orders() groups by, + # which is why matching works once we use it. (mmoya@mmoya.org, + # 2026-11-13: source oc-incognito, slug incognito-5ad60182, a live + # monthly contribution the member index could not see.) + oc_slug = slug + if oc_slug: + logger.info("Allowance reconcile: %s is oc-incognito; using their stored slug %s", + email, oc_slug) if not oc_slug: decisions.append({"email": email, "slug": slug, "anchor_day": anchor_day, "cycle": "", "decision": "skipped", diff --git a/tests/test_oc_incognito.py b/tests/test_oc_incognito.py index 66f1c0f..f4169bb 100644 --- a/tests/test_oc_incognito.py +++ b/tests/test_oc_incognito.py @@ -93,6 +93,10 @@ recon = src[src.index("async def reconcile_allowances"):] recon = recon[:recon.index("def ", recon.index("for row in rows"))] check('member_source(email, conn) == "manual"' in recon, "the reconciliation skips only source == manual") +check('member_source(email, conn) == "oc-incognito"' in recon and "oc_slug = slug" in recon, + "an oc-incognito member takes the OC slug from their own row — the index cannot give it " + "(it drops anyone without an email), and without a slug the reconciler skips them as " + "'cannot verify payment'") check("in MANUAL_MEMBERS" not in recon, "and no longer keys on the raw list (an oc-incognito member must not be skipped)") check("not is_manual_member(email)" in src,