Skip to content

fix(aggregator): charges producer body fallback matches 'total' inside 'Subtotal', recording the subtotal as the charge (PR #2149) #3121

Closed

Description

@dezren39

Finding

PR #2149's producer body-amount fallback regex (?:amount paid|amount charged|total charged|transaction amount|total)[:\s]*\$… matches the "total" inside "Subtotal": a receipt body with Subtotal $20.00 … Total $21.60 records a $20.00 charge instead of the $21.60 paid — and because exec() takes the first textual match, even a later explicit "Amount paid $21.60" does not win. The wrong amount also defeats cross-source dedupe (the $21.60 Plaid row stays as a separate charge). Codex flagged this P2 with a reproduction on the PR (comment 4409381673); it merged unchanged and is still on main.

Evidence

Why it matters

Amounts are the matcher's dedupe key; a systematically under-recorded amount both misstates spending and doubles the charge in the feed.

Acceptance criteria

  • The fallback requires a standalone total label (word boundary, so "Subtotal" cannot match) and prefers explicit paid/charged amounts over a bare total.
  • A test with Subtotal/Tax/Total (and a later Amount paid) records the paid total.

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/lowNice to have; do when convenient
    queue/queuedHas a queued task in the Supabase agent queue
    effort/xsTrivial: expected under 30 minutes 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. 18 remaining items

  5. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — task 4554 picked up and implemented by Lane A. PR #3164 @749c90ccd: amountFromBody() — paid/charged labels win, standalone \btotal next (Subtotal cannot match), any-$ last resort; main() behind import.meta.main for testability; 5 new tests pass on the laptop; 7 full-suite failures proven pre-existing on clean main (stash comparison). Parking on CI + Codex review.

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

    @dezren39
    MemberAuthor

    agent-note:v1 — Agent: repo-worker-code; state: done.
    task: 4554 (repo-health-code-pilot, lane: openchamber-scheduled-lane)
    issue: #3121
    pr: #3164 (merged @ faa3895)
    outcome: fixed_merged. Verified targeted tests (5/5 pass), merged main in, PR #3164 merged, issue closed.

  10. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — Agent: repo-worker-code; state: correction. Task 4554 completion recorded CI as pass in error: no aggregator PR CI check was present in the observed status rollup; the targeted local tests passed 5/5, but aggregator CI was not verified. Two unrelated Jules workflow runs reported failure. The PR has already been merged; fleet reconciliation should correct the queue result CI field.

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/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/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