GeezerVison is showing github.com — impl(pm-stack): cost-anomaly detection to Needs-you via the alert throat (#1259 slice 4) · Issue #4825 · developing-today/code
impl(pm-stack): cost-anomaly detection to Needs-you via the alert throat (#1259 slice 4) #4825DescriptionPart 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).
Activitydezren39 commented on Nov 3, 2026 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 dezren39 commented on Nov 27, 2026 🤖 Agent note · baseline closure for PR #15921 (lane 0452-B-B, bravo SUSTAIN shepherd, 2026-11-27)
Closing the open question from lane 2233-A-A's 05:04Z note (metadata only; no CI logs read):
- Baseline 45942763820 (developing-today/fleet, identical command on main): status completed, conclusion FAILURE (created 2026-11-27T04:55:50Z, updated 05:41:55Z).
- Baseline 45942780583 (developing-today/fleet, the three pre-existing suites on main): status completed, conclusion FAILURE (created 2026-11-27T04:56:02Z, updated 05:43:21Z).
Per the author lane's own test: the clean baseline on main also failed, so the branch run 45940294659 failure was environmental for that command set, not a defect in PR #15921's diff. This corroborates the conclusion already reached by lanes 2322-F / 2337-A-E (missing web-push install; re-dispatches with bun install — 45946472834 and 45947175059 — concluded success on exact head 27cc6b8).
No further action: PR #15921 is already MERGED (merge commit f8c7981). Refs #4825 — issue stays open for the certified-sources slice. developing-today-fleet commented on Nov 28, 2026 🤖 Agent note · state: claimed
- Agent: muse-archer, lane 1952-L (bravo SUSTAIN author lane, 2026-11-27 19:52 CST)
- Premise + ownership check: read this issue and ALL 47 comments firsthand. No live claim (last notes are the merged wiring slice PR pm-aggregator: wire cost-anomaly detector into the alert tick (#4825 wiring slice) #15921 and its baseline closure, both ended), no held/user labels. Remainder per COST-ANOMALY.md "Still needed": the producer's certified auxiliary sources have no in-repository implementations yet.
- Slice taken: the charges-side certified sources only — a new pure module implementing the producer's
monthlyCharges and serviceActivity seams from the charges pipeline's matched charges (feat(usage-hub): v3 charges auto-matching — Plaid + Gmail alerts to services #1057 output, via matchedChargesFrom) plus a complete per-service-month activity census, certifying coverage: "complete" only when an ok coverage span covers the whole calendar month (the spend-rollups coverage rule); anything else is partial and suppresses in the detector — a zero is never certified from an absent/partial census. The rollup-side seams (closure counts, busiest root, source-population totals) and production activation stay open on this issue.
- Route: Git-API contents route (no clones), verification via fleet Actions exec / repo CI on the pushed branch, merge under standing authority on verified green.
developing-today-fleet commented on Nov 28, 2026 🤖 Agent note · state: slice landed, claim released
- Agent: muse-archer, lane 1952-L (bravo SUSTAIN author lane)
- Landed: PR feat(pm-stack): certified charges-side sources for the #4825 cost-anomaly producer #16395 MERGED 2026-11-28T02:24:38Z, merge commit
21132927d91c54e549df24e200fc5290edd9833e — pm-stack/aggregator/src/cost-anomaly-sources.ts: the charges-side certified sources for the cost-anomaly producer. monthlyCharges from the charges pipeline's matched charges (exact cent totals per service+month, no new money path); serviceActivity from a per-service-month activity census. Certification = the spend-rollups rule applied to calendar months: complete only on a whole-month ok coverage span; absent/conflicting/invalid census data certifies nothing (null / partial, detector stays silent). COST-ANOMALY.md updated in the same PR.
- Verification: fleet-command run 46096473653 on the exact PR head
e9ea1c91095f — success, log-verified 24 pass / 0 fail across the four cost-anomaly suites, all 9 new tests by name.
- Remainder on this issue (unchanged): rollup-side certified sources (closure counts, busiest root session, source-population totals), production rollup ingestion, and the activation slice. Issue stays OPEN for those.
developing-today-fleet commented on Nov 28, 2026 🤖 Agent note · state: claimed
- Agent: muse-archer, lane 2052-L (bravo SUSTAIN author lane 2, 2026-11-27 20:52 CST)
- Premise + ownership check: read this issue and ALL comments firsthand. No live claim — the last note is lane 1952-L's release (2026-11-28T02:25:02Z) after its charges-side slice PR feat(pm-stack): certified charges-side sources for the #4825 cost-anomaly producer #16395 merged; no held/user labels, no Drew-decision gate, no laptop dependency.
- Slice taken: the rollup-side certified sources named in 1952-L's remainder — closure counts, busiest root session, and source-population totals for the cost-anomaly producer, implemented as a pure module from the spend-rollup store with the same certification rule as the charges-side sources (certify
complete only on whole-window ok coverage; absent/partial data certifies nothing and the detector stays silent). Production rollup ingestion and the activation slice stay open on this issue.
- Route: Git-API contents route (no clones, no local builds), verification via fleet Actions exec / repo CI on the pushed branch's exact head, merge under standing authority on verified green.
developing-today-fleet commented on Nov 28, 2026 🤖 Agent note · state: slice landed, claim released
- Agent: muse-archer, lane 2052-L (bravo SUSTAIN author lane 2)
- Landed: PR pm-stack: certified rollup-side sources for the cost-anomaly producer (#4825) #16411 MERGED 2026-11-28T03:29:17Z, merge commit
5a898f588fa12c8a3308b3868350ffad3cadc601 — pm-stack/aggregator/src/cost-anomaly-rollup-sources.ts: the rollup-side certified sources for the cost-anomaly producer. certifiedClosedChildren from a per-scope-window closure census; certifiedBusiestRoot as the maximum folded root total of a per-epic-window root-session census (certified only when every root entry is whole-window certified — a partially covered root set could conceal a larger root); certifiedSourceTotal from a per-window source-population census (before attribution, never a sum of overlapping rollup rows). Same certification contract as the charges-side sources: complete only on a whole-window ok coverage span; absent/conflicting/invalid census data certifies nothing. COST-ANOMALY.md updated in the same PR.
- Verification: fleet-command run 46101737585 on the exact PR head
daa711cf91db431618e3348da9676bce2cc0d232 — completed/success, log-verified 39 pass / 0 fail across the five cost-anomaly suites (all 14 new tests by name) and bunx tsc --noEmit clean.
- Remainder on this issue (unchanged): production rollup ingestion is not wired by the current repository, and the activation slice (a production caller injecting the evidence loader, after source-to-rollup reconciliation and Needs-you/Today presentation checks per COST-ANOMALY.md). Issue stays OPEN for those. All producer seams now have in-repository implementations.
developing-today-fleet commented on Nov 28, 2026 🤖 Agent note · state: claimed
Agent: muse-archer, lane 0252-I (bravo SUSTAIN author lane, 2026-11-28 02:52 CST)
Premise + ownership check: read this issue and ALL 51 comments firsthand, plus COST-ANOMALY.md on current main. No live claim — the last notes are lane 2052-L's release (2026-11-28T03:30:15Z) after PR #16411 merged; no held/user labels, no Drew-decision gate.
Slice taken: the pre-activation verification leg named in COST-ANOMALY.md "Still needed" — (1) source-to-rollup reconciliation and (2) warning presentation verification, without sending pushes and without activating the producer in production. New test file wires the REAL certified source modules (charges-side cost-anomaly-sources.ts from PR #16395, rollup-side cost-anomaly-rollup-sources.ts from PR #16411) through loadCostAnomalyEvidence into a real AlertsStore (bun:sqlite), then renders the posted incidents through renderAlerts (the /alerts page — the current architecture's warning surface per render-attention.ts: incident alerts live on /alerts; warnings are page + ledger, no push in v1) and asserts: every constructed anomaly presents with its evidence (scope, window, both compared values, drill-down link), severity warning, no deliveries/escalations pending, and the presented values reconcile exactly to the census totals and rollup-store values that produced them. Production rollup ingestion and activation stay open on this issue.
developing-today-fleet commented on Nov 28, 2026 🤖 Agent note · state: slice landed, claim released
Agent: muse-archer, lane 0252-I (bravo SUSTAIN author lane)
Landed: PR #16533 MERGED 2026-11-28T09:21:27Z, merge commit 2aac60d3d0be46c1118e996c376cf4f407be678e — the pre-activation verification leg from COST-ANOMALY.md "Still needed": new pm-stack/aggregator/test/cost-anomaly-presentation-4825.test.ts (reconciliation + presentation + suppression, fed only through the real certified source modules from #16395/#16411) and the COST-ANOMALY.md record of the result.
Verification: fleet-command run 46129156885 (dezren39/fleet) completed success on the exact PR head 34ffd4c7247651d3eda16beb9bc12cb937d6b4f9 — job log re-read: Target HEAD matches, 18 pass / 0 fail across the four cost-anomaly suites, bunx tsc --noEmit in the same chain.
Still open on this issue (unchanged): production rollup ingestion is not wired by the current repository, and no production caller injects the evidence loader — activation stays off until ingestion lands.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|