Skip to content

fix(aggregator): live source consumes auto-matched charges only inside the saas gate, so a quota-view failure hides them all (PR #2149) #3124

Closed

Description

@dezren39

Finding

PR #2149's collector publishes auto-matched charges/chargesAttention independently of the quota-view prose, but the live source consumes them only inside if (feed?.saas && feed.saas.length). When the quota-view file is unreadable the collector still runs the matcher and publishes valid charge evidence, yet liveSource().usage() falls into its fallback path and ignores it — every automatically collected charge disappears from the hub exactly when the prose source is broken. Codex flagged this P2 on the PR (comment 4409467134); it merged unchanged and is still on main. (Distinct from #2439/#2445: those are about isFleetFeed validation of these fields, not the saas gate.)

Evidence

Why it matters

The auto-matcher was built to free the charges view from hand-fed prose; gating its consumption on that same prose source reintroduces the single point of failure it removed.

Acceptance criteria

  • usage() consumes feed charges/chargesAttention even when feed.saas is absent/empty (services fall back as today; charges do not vanish).
  • A test with a feed carrying charges but no saas shows the charges and unmatched-charge flags.

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. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Design-architect pass 27 (2026-10-31) — agent note: this issue is adopted as part of Phase 3 (Delivery) of design #3161 ("a charge is evidence"). Triage: do NOT re-file, re-scope or split it — record the phase structure instead. The design records the rule this phase lands under: surfaced means delivered (surfaced keys persist only for charges in a successfully published feed), and consumption is independent (the live source consumes the charges sections on their own validity, never gated on an unrelated section). Phase 3 siblings: #3122, #3124. On landing, Phase 3 also owns the design's closing truth-up: the three rules written into the charges-match.ts / charges-collect.ts / producer headers and evidence posted on #1057. Details on #3161 and in files/designs/code-charges-pipeline-contract.md (goal workspace).

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

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triage findings (queue task 4544, lane D)

    Verdict: CONFIRMED on current main 47214f1cf277a0e8ae4bc08102d9f136a26b8703 — verified by direct read of pm-stack/aggregator/src/sources/live.ts this run:

    Fix shape (pinned for the follow-up task): hoist the feed-charge consumption out of the saas gate — compute feed.charges + the chargesAttention flags once, before the branch, and use them in every return path (feed-saas path unchanged; quota-view fallback path prefers/merges the feed charges and appends the flags; fixtures fallback keeps feed charges when a feed exists). Services/payg/subscriptions fallback behaviour stays exactly as today.

    Acceptance test: a feed carrying charges/chargesAttention but no saas (aggregator test suite, e.g. alongside pm-stack/aggregator/test/charges-*.test.ts / feed tests) shows the charges rows and the unmatched-charge attention flags in usage() output; existing saas-path behaviour unchanged.

    Dedupe: no open PR references #3124 (searched this run); the only matching PR is the merged origin #2149. A small_fix follow-up task is being enqueued from this triage.

  7. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (triage)

    • Agent: queue worker (repo-worker-code), lane D
    • Session / ID: queue task 4544 — completing as triaged
    • Found via: queue claim
    • Task: Triage complete: finding CONFIRMED on main 47214f1 (see findings note above). Follow-up fix task 4590 enqueued (small_fix, dedupe repo-health:v1:fix:…:3124) and already claimed by a fellow lane, so this issue's queue/claimed / work/assigned / status/in-progress labels stay — they now mirror task 4590's live claim, not this triage.
    • Expectation: fix lands via task 4590's PR; issue closes via that PR
    • Links: fix task 4590 · packet hidden_files/packet-3124-fix.json
  9. added 2 commits that reference this issue on Oct 31, 2026
  10. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    Fixed and merged via PR #3171 (merge commit 3bf8700).

    usage() now computes the feed's charges + unmatched-charge flags once, before the branch, and every return path consumes them: feed-saas path unchanged; quota-view fallback merges feed charges ahead of prose-extracted ones via the existing charge-level mergeChargeRows (automatic evidence wins — a Codex P2 on the first cut caught that full-row-identity dedupe would double-display a charge recorded in both places; fixed in 4ea1b99, replied on the thread, fresh Codex round on that head completed with no findings); fixtures fallback keeps feed charges + flags when a feed exists.

    Tests on the laptop (bun test in pm-stack/aggregator): new test/charges-feed-gate.test.ts 4/4 (both fallback tests fail on pre-fix code; the both-records dedupe test covers the Codex scenario); targeted suites 54/54; full suite 710 pass / 7 fail — the 7 are pre-existing PAGES-manifest assertions (#1134/#1135, aa-explorer, attention controls) reproduced on pristine main, untouched by this diff. No substantive Actions workflow triggers for this path.

    Queue task 4590 completed as fixed_merged by lane C.

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