Skip to content

feat(pm-stack): census data producers for cost-anomaly certified seams (#18137) - #18138

Merged
developing-today-fleet[bot] merged 3 commits into
mainfrom
lane-2137e-census-producers-18137
Dec 1, 2026
Merged

developing-today-fleet[bot] merged 3 commits into
mainfrom
lane-2137e-census-producers-18137

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #18137. Follow-on slice of #4825, per the design/decision record on #4825 (comment 7299197952, lane 2037-G): each census producer as a bounded adapter over its named completeness source. Lane 2137-E (alpha DRIVE 2026-11-30). Authored via the Git-API contents route (no checkout); every base file verified against main at 95bd3b0 before writing.

What lands

pm-stack/aggregator/src/cost-anomaly-census-producers.ts (new, pure/deterministic, no I/O):

  • Root-session census from attribution facts — attribution already folds sub-sessions into root groups; regrouped per (epic, pool, root), pool = providerID ?? "unknown", tokens = the ingestion five-field scalar total (spend-ingestion.ts convention). Completeness source: the usage export's coverage block (caller-supplied spans).
  • Source-population census from the pre-attribution session set — per-pool totals, never a sum of rollup rows.
  • Closure census from caller-supplied per-scope closure timestamps — counts in-window only; coverage ok only when the caller asserts its GitHub reads were complete (pagination exhausted).
  • Core rule enforced in the producers: a non-ok source status, a corrupt record (non-finite/negative tokens, unparseable timestamp), or a truncated closure read downgrades the emitted coverage to non-ok, so the certified seams in cost-anomaly-rollup-sources.ts return partial/null and anomalies suppress, never fabricate.
  • No production-caller wiring and no activation change in this slice (named as the remaining step in the doc).

Tests test/cost-anomaly-census-producers-4825.test.ts: 8 tests — regrouping/per-pool split, population totals, in-window closure counting, and the three downgrade paths, each asserted through the real certified seams (certifiedBusiestRoot / certifiedSourceTotal / certifiedClosedChildren).

Docs: COST-ANOMALY.md records the census producers as landed; #4825 stays open for wiring the producers into the production caller + operator opt-in.

Verification

Targeted bun test on the exact authored files (staged byte-identical copies with their real in-repo dependencies): 8 pass / 0 fail. CI is not a gate; the merge decision is the full-diff read against #18137's acceptance criteria, recorded on the issue before merge.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1b7239df-37d6-46a9-974e-0527e71b2893

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet
developing-today-fleet Bot merged commit 67381eb into main Dec 1, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the lane-2137e-census-producers-18137 branch December 1, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

impl(pm-stack): census data producers for cost-anomaly certified seams (#4825 follow-on)

0 participants