Skip to content

feat(pm-stack): certified charges-side sources for the #4825 cost-anomaly producer - #16395

Merged
developing-today-fleet[bot] merged 3 commits into
mainfrom
lane/1952l-4825-charges-sources
Nov 28, 2026
Merged

developing-today-fleet[bot] merged 3 commits into
mainfrom
lane/1952l-4825-charges-sources

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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 via matchedChargesFrom, 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: 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.

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-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 28, 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: 988a10e1-2b62-474d-bc37-f225308b18e9

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

Copy link
Copy Markdown
Contributor Author

🤖 Agent note · verification — lane 1952-L

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.

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.

0 participants