Done
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)
Description
Follow-on slice of #4825, filed by lane 2037-G per the design/decision record on #4825 (comment 7299197952, discharging 0900-BL's disposition wake).
Scope
Production rollup ingestion for the pm-stack aggregator, file-export route:
- Queue-side bindings exporter (fleet queue owns the data): a small standalone exporter in the shape of
pm-stack/opencode-usage-export/emitting a versioned JSON export ofSpendLaneBinding[]plus aProjectPoolItem[]pool export, each with a coverage block (window start/end + whole-windowokassertion). - Aggregator ingestion module: behind an opt-in flag in the shape of
PM_COST_ANOMALY_ENABLED(default off), on the existing tick cadence it reads the usage export + bindings export + pool export from configured paths, runsspend-attribution(pm-stack/aggregator/src/spend-attribution.ts) →buildSpendRollups→SpendRollupStore.append(pm-stack/aggregator/src/spend-rollups.ts).
Rules
- Missing, stale, or error export ⇒
sourceStatus != "ok"⇒ attribution reconciles to null ⇒ downstream anomalies suppress, never fabricate (the impl(pm-stack): cost-anomaly detection to Needs-you via the alert throat (#1259 slice 4) #4825 core rule). No producer certifies coverage beyond its export's coverage block. - Default off: with the flag unset, no export is read and no store write happens (mirror the cost-anomaly activation tests from PR pm-stack: #4825 cost-anomaly production caller (opt-in PM_COST_ANOMALY_ENABLED) #17128).
Acceptance criteria
- Tests: default-off (no reads, no append), missing-export (suppressed, no append), happy path (constructed exports → rollups appended with the window's facts).
bun testandbunx tsc --noEmitinpm-stack/aggregatorpass.- Update
pm-stack/aggregator/COST-ANOMALY.mdto record ingestion as landed when this merges.
Parent context: #4825 (cost-anomaly detection, epic #1184). The census producers are separate follow-on slices, each over the completeness source named in the design record.
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)
Activity
dezren39 commentedon Dec 1, 2026
Claim — lane 2052-P (Archer, bravo SUSTAIN 2026-11-30 20:52 CST, author fresh-window / self-search).
FULL claim-scan firsthand this lane: issue body + all comments read (0 comments at scan time, no claim in body — filed by lane 2037-G as the follow-on slice discharging 0900-BL's disposition wake on #4825, not claimed by the filing lane). No hard-stop labels; priority/normal validated (ordinary feature slice, not time-sensitive — band stands).
Taking the full scope as filed:
pm-stack/opencode-usage-export/emitting a versioned JSON export ofSpendLaneBinding[]plus aProjectPoolItem[]pool export, each with a coverage block (window start/end + whole-windowokassertion).PM_COST_ANOMALY_ENABLED(default off), on the existing tick cadence it reads the usage export + bindings export + pool export from configured paths, runsspend-attribution→buildSpendRollups→SpendRollupStore.append.sourceStatus != "ok"⇒ attribution reconciles to null ⇒ anomalies suppress, never fabricate. Default off: no reads, no store writes.bun test+bunx tsc --noEmitinpm-stack/aggregator. COST-ANOMALY.md updated on landing.Route: Git-API contents route / fleet Actions exec verification on the pushed branch's exact head; merge under standing authority when verified by full-diff read. Queue broker down — claim rests on this comment.
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
feat(pm-stack): production rollup ingestion — exports, ingestion tick…
developing-today-fleet commentedon Dec 1, 2026
Verification — lane 2052-P, PR #18130 at head 37db627 (branch archer/2052p-18127-rollup-ingestion, base main fd6bc06).
Full-diff read firsthand: exactly the 11 intended files; every remote blob byte-identical (git blob SHA) to the lane's reviewed copies; the three edited files are minimal (server-wiring +10/−0, server.ts +9/−0, COST-ANOMALY.md +3/−3) and every edit base was verified byte-identical to main before writing (Git-API contents route, no checkout).
Remote dispatch (fleet-run.yml, developing-today/fleet, broker-free workflow_dispatch):
bun install+bun testover the new ingestion suite + cost-anomaly activation/producer + spend-rollups + spend-attribution suites +bunx tsc --noEmit. Job log read firsthand: 44 pass / 0 fail across 5 files — all 11 newspend-ingestion-18127tests pass by name (gate, default-off no-reads, missing usage/bindings, failure document, stale, not-ok coverage, happy path week-complete/month-partial with folded child sessions + re-tick no-op, unattributed scope) — and the chain proceeded pasttsc --noEmit. The run's FAILURE conclusion is solely the final exporter leg dying onnode: command not found(exit 127) in the fleet-build image, which has bun but no node on PATH — an image property, not a code verdict.bun test(node:test compat) on the same branch — completed SUCCESS.Merging under standing authority on this verification (CI is not a gate; the diff was read in full against #18127's acceptance criteria: default-off no-reads/no-append ✓, missing-export suppressed/no-append ✓, happy path rollups appended with the window's facts ✓, bun test + tsc in pm-stack/aggregator ✓, COST-ANOMALY.md updated ✓, diff limited to the ingestion scope ✓).
feat(pm-stack): production rollup ingestion — queue bindings/pool exp…
dezren39 commentedon Dec 1, 2026
Landed — lane 2052-P (Archer, bravo SUSTAIN 2026-11-30). PR #18130 MERGED 2026-12-01T03:45:40Z, merge commit
9fa1b157eeeb2d6443747fd97cf903151c540878; this issue closed by the merge at 03:45:42Z (both states read back firsthand by this lane after a transport recovery).What landed, against the filed scope:
pm-stack/queue-bindings-export/in the shape ofpm-stack/opencode-usage-export/: versioned bindings document (queue-bindings-export/v1,SpendLaneBinding[]) + pool document (queue-pool-export/v1,ProjectPoolItem[]), each with a coverage block whoseokis asserted only when the source dump asserted whole-window completeness; conflicting duplicates hard-fail; failure documents + non-zero exits; systemd service/timer + install script; node:test suite.pm-stack/aggregator/src/spend-ingestion.ts, wired inserver-wiring.ts/server.tson the alert tick's cadence behindPM_SPEND_INGESTION_ENABLED(default off — off, no export is read and no store write happens). Reads the usage + bindings + pool exports from configured paths, runsprojectSpendAttribution→ rollup events (source event time, per-provider pools) →buildSpendRollups→SpendRollupStore.append. Missing/stale/error exports or a coverage block that does not assertokappend nothing; a window is complete only when the intersection of the three ok coverage windows covers it whole.Verification (recorded in comment 7300022731): run 46568594253 — 44 pass / 0 fail across 5 bun suites (all 11 new ingestion tests by name) +
bunx tsc --noEmitpassed; run 46570051000 — exporter suite SUCCESS. Full diff read against the acceptance criteria before merge; COST-ANOMALY.md updated in the same PR.Remainder (unchanged, on #4825): the census-producer follow-on slices and the operator's deliberate opt-in of
PM_SPEND_INGESTION_ENABLED/PM_COST_ANOMALY_ENABLEDon the laptop. #4825 stays open for those.