Skip to content

impl(pm-stack): PAYG dollar attribution via the charges pipeline (#1259 slice 5) #4826

Open

Description

@dezren39

Part of epic #1184; implementation follow-up of design issue #1259 (spend rollups). Design note: doc/spend-rollups-design-1259.md.

Scope

Attach real PAYG dollar charges to pools/services in the spend rollups, extending the existing charges pipeline — pm-stack/aggregator/src/charges-collect.ts / charges-match.ts / charges-catalog.ts (#1057, Plaid + Gmail charge candidates matched to services) — instead of building a second money path.

Rules (per the design note)

  • Only matched, real charges enter the dollars column. Unmatched charges stay visible in the existing unmatched-charge surfacing; they are never force-attributed to a project/epic.
  • A charge attributes to a project/epic only through the pool/service it matched AND attributed session activity for that pool in the charge period; otherwise it lands at stack level as "unattributed dollars" — shown, not hidden.
  • Dollars are never converted to or from tokens or share-of-window, in either direction, anywhere in this slice.
  • OpenCode's per-session cost field is a list-price estimate: it is excluded from the dollars column entirely (drill-down labelling is the rendering slice's job).

Acceptance criteria

  • Tests: matched charge with in-period attributed activity → project/epic dollars; matched charge without → stack-level unattributed dollars; unmatched charge → absent from rollups, still surfaced as unmatched.
  • Reconciliation: rollup dollars for a period equal the charges pipeline's matched totals for that period.
  • No code path in the PR reads a per-session cost value into a dollars total (guarded by a test on the rollup writer inputs).

Checks

  • bun test and bunx tsc --noEmit in pm-stack/aggregator pass (CI on the PR).

Activity

  1. added
    kind/featureNew feature or capability request
    priority/normalOrdinary priority (the default)
    effort/mMedium: expected under 1 day of work
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 3, 2026
  2. added
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  3. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  5. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  6. added
    queue/queuedHas a queued task in the Supabase agent queue
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (PR opened)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator 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