Skip to content

fix(aggregator): charges producer turns declined purchase alerts and outstanding invoices into charge candidates (PR #2149) #3120

Closed

Description

@dezren39

Finding

PR #2149's Gmail charge producer turns two kinds of NOT-a-charge mail into charge candidates:

  1. Declined/failed purchase alerts — a subject like "Your $20.00 purchase at OpenAI was declined" passes the query and isNotChargeSubject, the amount and merchant parse cleanly, and a payment that never occurred is recorded as a charge (Codex P2, comment 4409381650).
  2. Outstanding invoices — a subject like "Your OpenAI invoice" with a body saying "Amount due $20.00 / Due Nov 1" is accepted; the body fallback extracts $20 with no evidence of payment, and when payment lands >3 days later the Plaid transaction is kept as a second charge (Codex P2, comment 4409467123).

Both merged unchanged and are still on main: isNotChargeSubject has no declined/failed pattern, and nothing requires payment evidence.

Evidence

Why it matters

The producer's stated discipline is "never guessed at" — but declined and merely-due amounts are guesses that a charge occurred, and they flow into matched rows and the once-only attention strip as real spending.

Acceptance criteria

  • Subjects/bodies indicating a declined or failed purchase produce no candidate (counted as skipped).
  • An invoice whose only amount is an amount DUE (no paid/charged evidence) produces no candidate.
  • Tests pin both shapes; genuine receipts/alerts still produce candidates.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    effort/sSmall: expected under 2 hours of work
    app/aggregatorPackage/app: aggregator (pm-stack in this repo)
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — Agent: pr-diff-review-b; state: filed. Filed from PR diff review lane B (late-arriving Codex P2 evidence on the source PR, verified against current main ada2d88; see the issue body for PR, comment, and file:line evidence). Enqueued as a repo-task/v1 triage packet on repo-health-code-pilot.

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 31, 2026
  4. 38 remaining items

  5. added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Oct 31, 2026
  6. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

  7. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 31, 2026
  8. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  9. added a commit that references this issue on Oct 31, 2026
  10. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane E shift
    • Session / ID: queue task 4577
    • Found via: queue claim (resume after park)
    • Task: PR 3193 merged — Codex re-review at head d6dfa4c clean ("Didn't find any major issues", has_unresolved_findings:false, 19:51Z), sole Codex P2 thread resolved, merge state CLEAN. Laptop tests at head verified first-hand previous shift (producer 15/15, charges 42/42); head SHA unchanged since. No CI workflow covers pm-stack/aggregator (CodeRabbit NEUTRAL only).
    • Expectation: done = PR merged (merge commit 49a2a22), issue closed
    • Links: PR fix(aggregator): charges producer — reject declined alerts and amount-due-only invoices (#3120) #3193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/aggregatorPackage/app: aggregator (pm-stack in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobsource/pr-diff-reviewFiled by the pr-diff-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions