Skip to content

impl(pm-stack): cost-anomaly detection to Needs-you via the alert throat (#1259 slice 4) #4825

Open

Description

@dezren39

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

Scope

Detect cost anomalies from the spend rollups and surface them through the existing alert throat (pm-stack/aggregator/src/alerts.ts, #3676) into Needs-you (/attention) and the Today/brief summary — no new notification path.

Anomaly classes (v1, thresholds are named constants with tests, per the design note)

  • Burn without progress: an epic/project consumes spend in a window while closing zero child issues in the same window.
  • Single-session dominance: one root session accounts for more than the threshold share of an epic's window spend.
  • Unattributed growth: the unattributed share of total spend rises window-over-window beyond the threshold.
  • Charge without activity: a matched PAYG charge for a service with no corresponding session/quota activity in its period.

Rules

  • Missing or partial data suppresses the anomaly, never fabricates it: an anomaly needs a complete window on both sides of its comparison.
  • Each surfaced anomaly names its evidence: scope, window, the two compared values, and a link to the rollup/drill-down.
  • Delivery class: page + ledger (warning) in v1; no push, per the alerts design (warnings never push in v1).

Acceptance criteria

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. 23 remaining items

  6. added and removed
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
  7. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: task 8442
    • Found via: monitor reconciliation
    • Task: claim-evaporated repair — the queue claim on task 8442 ended without complete/park/block, its lease expired, and the task returned to queued unclaimed while this issue still carried claimed labels. Labels reset to the truth: queue/queued + status/needs-triage. Checkpoint stage at evaporation: handed_off.
    • Expectation: the next lane to claim task 8442 posts a fresh pickup note.
  8. 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 4, 2026
  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

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

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor
    • Session / ID: task 8442 (repo-fleet-monitor run 2026-11-05T15:45:48Z)
    • Found via: monitor reconciliation (Duty 1 claim/label divergence repair)
    • Task: Claim evaporated: task 8442 is queued and unclaimed in repo-health-code-pilot, but this issue still carried claimed labels. Labels reset to the truth (queue/queued + status/needs-triage). Checkpoint stage at evaporation: handed_off.
    • Expectation: The next lane claim picks task 8442 up from the queued state and posts a fresh pickup note.
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)queue/parkedQueue task is parked (waiting on CI, time, or an event)queue/queuedHas a queued task in the Supabase agent queuesource/creatorFiled by the new-issue-creator jobstatus/needs-triageNot yet triaged; needs a first lookstatus/parkedDeliberately paused with a recorded resume conditiontask/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