You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
impl(pm-stack): spend rollup store — weekly/monthly per project/epic, versioned restatement (#1259 slice 2) #4823
Part of epic #1184; implementation follow-up of design issue #1259 (spend rollups). Design note: doc/spend-rollups-design-1259.md. Depends on the attribution projection slice of #1259.
Scope
Persist weekly and monthly spend rollups per project and per epic from the snapshot history, in the existing append-only snapshot store pattern (pm-stack/aggregator/src/snapshots.ts): one rollup record per (window, scope, unit) with full unit separation.
Rules (per the design note)
Three unit families are stored and rendered as distinct measures, never merged: tokens per pool; PAYG dollars (real charges only); plan-pool share-of-window (percent of a pool window consumed).
A week/month counts only if the source was available for the whole window; partial windows are labelled partial, never read as zero spend.
Rollups are immutable once written for an attributionVersion. When attribution rules change, history is restated as a new version alongside the old, with the version labelled in output — raw events are never edited and old rollups are never silently overwritten.
Backfill horizon: from the start of retained snapshot history; the rollup record names its coverage start so a short history cannot masquerade as a long one.
Acceptance criteria
Rollup writer + reader with tests: complete window, partial window, restatement under a new attribution version, and coverage-start labelling.
Reconciliation test: rollup totals equal projection totals for the same window/version.
No merged cross-unit figure exists anywhere in the stored schema (schema review + a test that rejects a synthetic merged field).
Checks
bun test and bunx tsc --noEmit in pm-stack/aggregator pass (CI on the PR).
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
Verdict: still live, not routable yet. No queue task is enqueued from this triage. The implementation should be queued after #4822 merges, and the blocker stays on this issue until then. Priority and effort labels unchanged.
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
dezren39 commentedon Nov 3, 2026
Triage at current main (3e363c9), queue task 8439
git grep -i rollupunderpm-stack/only finds the usage-snapshot compaction and epic rollups, which are unrelated. No open PR covers rollups except unrelated fix(pm-stack): keep roadmap rows visible and validate horizons (#1207) #3958 and perf(id): index the canonical replay's outcomes instead of scanning (#4128) #5002.attributionVersion, unattributed reason codes), and that projection is not on main. impl(pm-stack): spend attribution projection — session to issue/epic resolution, unattributed shown (#1259 slice 1) #4822 is open, so slice 2 cannot start yet.doc/spend-rollups-design-1259.md: slice 1 (impl(pm-stack): spend attribution projection — session to issue/epic resolution, unattributed shown (#1259 slice 1) #4822) → slice 2 (this issue) → slices 3 (impl(pm-stack): render spend beside progress on Projects/Roadmap cards (#1259 slice 3) #4824) and 4 (impl(pm-stack): cost-anomaly detection to Needs-you via the alert throat (#1259 slice 4) #4825). Slice 5 (impl(pm-stack): PAYG dollar attribution via the charges pipeline (#1259 slice 5) #4826) is independent of 3/4 once this lands.Verdict: still live, not routable yet. No queue task is enqueued from this triage. The implementation should be queued after #4822 merges, and the blocker stays on this issue until then. Priority and effort labels unchanged.
Found via: coverage pass 2026-11-03