Todo
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workepic/pm-stackReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus/waiting-dependencyWaiting on a dependencytask/triageQueue packet kind: verify, reproduce, and route this item
Description
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
- One test per anomaly class: fires on the constructed pattern, silent on partial data, silent just below threshold.
- Dedupe: a continuing anomaly updates the existing incident (alert-throat dedupe), it does not re-post every tick.
- Anomaly constants live in one named place, so Drew's threshold rulings (open questions in the design(pm-stack): spend rollups — token and dollar attribution per project and per epic, rendered on Projects/Roadmap #1259 design note) change one file.
Checks
bun testandbunx tsc --noEmitinpm-stack/aggregatorpass (CI on the PR).
Metadata
Metadata
Assignees
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workepic/pm-stackReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus/waiting-dependencyWaiting on a dependencytask/triageQueue packet kind: verify, reproduce, and route this item
Activity
dezren39 commentedon 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
129 remaining items
developing-today-fleet commentedon Nov 29, 2026
Census 2026-11-29 (Felix):
doc/spend-rollups-design-1259.md), surfacing through the EXISTING alert throat (pm-stack/aggregator/src/alerts.ts, feat(aggregator): alert throat — sentinel incident intake, Supabase ledger, Web Push delivery + ack #3676) into Needs-you — no new notification path. A verification leg already landed (PR test(pm-stack): #4825 pre-activation verification — reconciliation + warning presentation #16533 merged 2026-11-28: cost-anomaly presentation test suite).developing-today-fleet commentedon Nov 30, 2026
Claim — lane 0052-I (Archer, bravo SUSTAIN 2026-11-30 00:52 CST): the production-caller slice of #4825.
Premise checked firsthand this lane: issue + all comments read; the detector, warning-only intake, evidence producer and all certified source seams are already on main (
pm-stack/aggregator/COST-ANOMALY.md: "This does not complete #4825"). The named remainder is: (1) a production caller that injects the evidence loader intorunAlertTick(AlertTickOptions.costAnomalyEvidence), built from the producer + certified sources over the rollup store, explicitly opt-in (default off — the doc bars turning a producer on merely because tests pass); (2) production rollup ingestion wiring if the store reader already exists in-repo.Taking that bounded slice: wire the opt-in production caller in the aggregator server wiring, add tests proving default-off (no evidence read, no alert-store call) and enabled (store → producer → intake → ledger) behaviour, update COST-ANOMALY.md, verify, merge. Queue broker down (#16762) — claim rests on this comment.
feat(pm-stack): #4825 cost-anomaly production activation (opt-in loader)
test(pm-stack): #4825 activation gate + production loader tests
feat(pm-stack): #4825 startAlertEngine passes the cost-anomaly loader…
docs(pm-stack): #4825 detector header names the production caller
feat(pm-stack): #4825 server wiring builds the opt-in cost-anomaly lo…
feat(pm-stack): #4825 alert engine receives the cost-anomaly loader
docs(pm-stack): #4825 COST-ANOMALY records the landed production caller
Merge pull request #17128 from developing-today/archer/4825-cost-anom…
developing-today-fleet commentedon Nov 30, 2026
Resolution — lane 0322-E (Archer, delta PRESS 2026-11-30): the #4825 production-caller slice has landed.
PR #17128 #17128 was MERGED 2026-11-30T08:17:06Z (merge commit 94e7883, head 4281523) by lane 0212-P (xaltha), whose verify-then-merge diff-read note is on the PR (comment 2026-11-30T08:16:53Z).
This lane (0322-E, the staged primary for #17128 after 0152-K → 0237-G/X → 0252-D → 0307-E all ended transport-blocked) independently re-verified post-merge on recovery: two agreeing reads (GraphQL + REST) confirm state MERGED, 7 commits, 7 files +227/−11; full diff read against #4825's stated purpose — new
pm-stack/aggregator/src/cost-anomaly-activation.ts(opt-in gate: only explicit1/truebuilds a loader),server-wiring.tsloader overspendRollupStore.readAll()with auxiliary certified seams deliberately unsupplied (those classes stay suppressed, never fabricated),alerts.tsoptionalAlertTickOptionspass-through (default behaviour unchanged),server.tswiring,COST-ANOMALY.mdupdated, newtest/cost-anomaly-activation-4825.test.ts(5 tests). Diff is exactly the stated purpose, no scope creep.#4825 stays OPEN for the remainder the PR itself names: production rollup ingestion + census data producers for the auxiliary certified seams. Claim released.
developing-today-fleet commentedon Nov 30, 2026
Disposition — lane 0900-BL (xaltha, wave 0900 surplus leads, 2026-11-30): remainder mapped firsthand; not lane-shaped as one slice. No claim taken.
Release check first: the true latest state is Archer lane 0322-E's release (comment 7274506513, 2026-11-30T09:39:24Z) after PR #17128 (production caller, opt-in) merged — no live claim stands. This lane re-read the body, all 58 comments,
COST-ANOMALY.md, and the code on current main.What is landed (verified in code, not just comments): detector + thresholds (
src/cost-anomaly.ts), alert-tick intake (runAlertTick+AlertTickOptions.costAnomalyEvidence), evidence producer (src/cost-anomaly-producer.ts), all certified source seams (src/cost-anomaly-sources.ts,src/cost-anomaly-rollup-sources.ts), pre-activation reconciliation/presentation tests (PR #16533), and the opt-in production caller (src/cost-anomaly-activation.ts, PR #17128; default OFF viaPM_COST_ANOMALY_ENABLED).Remainder, precisely:
buildSpendRollups+SpendRollupStore.appendexist (src/spend-rollups.ts) but nothing in production calls either (grep-verified this lane: the only references are tests and the reader side inserver-wiring.ts). Ingestion needsSpendRollupEvents, whose production source per the design(pm-stack): spend rollups — token and dollar attribution per project and per epic, rendered on Projects/Roadmap #1259 design is the per-session usage export (pm-stack/opencode-usage-export/) run through spend attribution (src/spend-attribution.ts) — and attribution itself has NO production caller either (grep-verified: no server module imports it). Its inputs are session records, lane bindings (session→task→issue), and pool items; the bindings live in the fleet queue's database, which the aggregator does not read today. So ingestion is not "wire one caller": it first needs a decided route for bindings + export files into the aggregator's runtime — a design decision spanning two systems, not a bounded lane slice.okcoverage; certifying from a partial source would break the issue's core rule (partial data suppresses, never fabricates), so a producer cannot be written against a source whose completeness is unestablished.Why this is a disposition, not a claim: the next step is a design/decision slice (name the bindings + export route into the aggregator, and the completeness source for each census), after which ingestion and each census producer become bounded slices in the shape of the earlier ones. Until that route is named, any single-lane "ingestion" PR would either invent a data path or certify coverage it cannot prove.
Wake: a comment on this issue naming the bindings/export route (or a design record under #1259) → ingestion becomes a bounded slice; each census producer becomes drawable as its source's completeness is established. Issue stays OPEN; priority/normal stands.
developing-today-fleet commentedon Nov 30, 2026
🤖 P3.1 reparenting — Felix lane 0640-XW (plan: #17071). This issue was an open sub-issue under closed parent #1259. The destination rule (UU) points to the closed parent's own open parent — #1184 — but #1184 is at GitHub's 100 sub-issue cap (verified live this lane), so this issue is detached to top-level instead. GraphQL
removeSubIssue, verifiedparent: null. No state, labels, or priority band changed.developing-today-fleet commentedon Dec 1, 2026
Design/decision slice — lane 2037-G (alpha DRIVE 2026-11-30), discharging 0900-BL's wake. FULL claim-scan firsthand (body + all 60 comments): no live claim stands (0322-E released after PR #17128 merged; 0900-BL took no claim). 0900-BL's disposition named the next step exactly: a design/decision slice naming (a) the bindings + export route into the aggregator and (b) the completeness source for each census. This comment is that slice; the route below follows the repo's existing patterns and invents no new coupling.
Decision: file-export route, producer-side exporters, aggregator-side ingestion
Attribution's input contract is already fixed in code (
pm-stack/aggregator/src/spend-attribution.ts):SpendAttributionInput { sourceStatus, sessions, bindings: SpendLaneBinding[], pool: ProjectPoolItem[], … }. The three inputs get to the aggregator the same way session usage already does — as versioned export files (thepm-stack/opencode-usage-export/precedent: a small standalone exporter with service/timer on the host that owns the data):SpendLaneBinding[]for a stated window. The aggregator never reads the queue database — the queue DB stays behind its owner's exporter, exactly as OpenCode session data stays behind the usage exporter.ProjectPoolItem[]from the same queue-side exporter family (pool items are queue-owned data too).Ingestion (the bounded follow-on slice): an aggregator module that, on the existing tick cadence and behind an opt-in flag in the shape of
PM_COST_ANOMALY_ENABLED(default off), reads the three exports from configured paths, runsspend-attribution→buildSpendRollups→SpendRollupStore.append(pm-stack/aggregator/src/spend-rollups.ts). That is the whole slice: three file readers, the already-written pure pipeline, one store append, tests for default-off / missing-export / happy path.Completeness sources (one per census; the issue's core rule governs)
Every export carries a coverage block: window start/end + the producer's whole-window
okassertion. Missing, stale, or error exports map tosourceStatus != "ok"→ attributionreconciled = null→ anomalies suppress, never fabricate. No producer certifies beyond its coverage block.parentId; roots are enumerable from the same file). Completeness source: the usage export's coverage block.partial, notok.charges-collect/charges-match). Completeness source: the collection run's stated window and success/failure per source.What this unblocks
Key: 2037-G