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
feat(pm-stack): certified charges-side sources for the #4825 cost-anomaly producer - #16395
Refs #4825 — charges-side certified sources slice (issue stays open for the rollup-side seams + activation).
What
New pure module pm-stack/aggregator/src/cost-anomaly-sources.ts: the first in-repository implementations of the cost-anomaly producer's auxiliary seams, covering the two charges-side seams:
certifiedServiceActivity — per-service-month activity census → ServiceActivityRecord; absent entry, conflicting duplicates, or invalid counts return null (uncertified).
Certification follows the spend-rollups coverage rule applied to calendar months: complete only when an ok coverage span covers the whole month as instants; anything else is partial and suppresses in the detector — an absent/partial census never certifies a zero.
COST-ANOMALY.md "Still needed" updated in the same PR: charges-side seams landed; rollup-side seams (closure counts, busiest root, source-population totals), production ingestion, and activation remain.
Verification
Oracle: the #4825 certification contract — complete only on whole-month ok coverage; totals are the pipeline's matched rows summed exactly in cents. New tests in test/cost-anomaly-sources-4825.test.ts (grouping/cent exactness, coverage certification, absent/conflicting/invalid census, end-to-end producer→detector firing exactly the constructed charge anomaly). Exact-head fleet dispatch evidence to be posted on this PR before merge.
Exact-head verification: fleet-command run 46096473653 (dispatch_id 1952L-16395, ref pinned to this PR's head e9ea1c91095f1467444ee4e15587e86382df304b) — conclusion success. Command: cd pm-stack/aggregator && bun install --no-progress && bun test test/cost-anomaly-sources-4825.test.ts test/cost-anomaly-producer-4825.test.ts test/cost-anomaly-4825.test.ts test/cost-anomaly-wiring-4825.test.ts. Log-verified non-vacuous: 24 pass / 0 fail, including all 9 new cost-anomaly-sources-4825 tests by name and the producer end-to-end tick. Merging under standing authority on this evidence + CLEAN/MERGEABLE.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #4825 — charges-side certified sources slice (issue stays open for the rollup-side seams + activation).
What
New pure module
pm-stack/aggregator/src/cost-anomaly-sources.ts: the first in-repository implementations of the cost-anomaly producer's auxiliary seams, covering the two charges-side seams:monthlyChargeTotals/certifiedMonthlyCharges— deduplicated monthly totals from the charges pipeline's matched charges (feat(usage-hub): v3 charges auto-matching — Plaid + Gmail alerts to services #1057 output viamatchedChargesFrom, spend-dollars rule (1): no new money path), exact integer-cent sums per service+month.certifiedServiceActivity— per-service-month activity census →ServiceActivityRecord; absent entry, conflicting duplicates, or invalid counts return null (uncertified).Certification follows the spend-rollups coverage rule applied to calendar months:
completeonly when an ok coverage span covers the whole month as instants; anything else ispartialand suppresses in the detector — an absent/partial census never certifies a zero.COST-ANOMALY.md"Still needed" updated in the same PR: charges-side seams landed; rollup-side seams (closure counts, busiest root, source-population totals), production ingestion, and activation remain.Verification
Oracle: the #4825 certification contract — complete only on whole-month ok coverage; totals are the pipeline's matched rows summed exactly in cents. New tests in
test/cost-anomaly-sources-4825.test.ts(grouping/cent exactness, coverage certification, absent/conflicting/invalid census, end-to-end producer→detector firing exactly the constructed charge anomaly). Exact-head fleet dispatch evidence to be posted on this PR before merge.Author lane 1952-L (bravo SUSTAIN), claim: #4825 (comment)
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-28T02:06:25Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": null, "model": null, "lane_start_issues": [], "workspace_ref": null, "auth_subject": "archer", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.