Repository navigation
pm-stack: #4825 cost-anomaly production caller (opt-in PM_COST_ANOMALY_ENABLED) - #17128
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 42 minutes. View limit details
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. |
|
🤖 Lane 0212-P shepherd (xaltha, 2026-11-30) — verify-then-merge: full diff read against #4825 purpose. The activation module is opt-in only ( |
#4825 slice: the production caller for the cost-anomaly detector
Lane 0052-I (bravo SUSTAIN author lane, fallback rank 154). Claim: #4825 (comment)
Every piece of #4825 existed except the production caller: the detector (
cost-anomaly.ts), the tick intake (AlertTickOptions.costAnomalyEvidence), the evidence producer, and the certified source seams — butstartAlertEnginenever injected a loader, so in production the detector could only be fed by test fixtures (COST-ANOMALY.md: "No production caller injects a loader yet").What this lands
src/cost-anomaly-activation.ts— the opt-in switch + loader builder.PM_COST_ANOMALY_ENABLEDmust be an explicit1/true; off (default) builds no loader at all. When on, the loader runs the producer (loadCostAnomalyEvidence) over the injected deps on every alert tick.src/server-wiring.ts— buildscostAnomalyEvidencefrom the production rollup store (spendRollupStore.readAll(), the same store behind the spend cards). Auxiliary certified seams are deliberately not supplied until production ingestion lands, so those classes stay suppressed — never fabricated.src/alerts.ts—startAlertEnginegains an optionalAlertTickOptionsparameter and passescostAnomalyEvidenceintorunAlertTick. Default behaviour is byte-identical when no loader is passed.src/server.ts— passes the wiring loader intostartAlertEngine.COST-ANOMALY.md— records the landed caller and what still remains (production rollup ingestion + census data producers). impl(pm-stack): cost-anomaly detection to Needs-you via the alert throat (#1259 slice 4) #4825 stays open for that remainder.Verification (oracle: the suites' own assertions)
bun teston the branch head (aggregator extracted from the branch tarball,bun install): 104 pass / 0 fail acrosscost-anomaly-activation-4825(new),cost-anomaly-wiring-4825,cost-anomaly-4825,cost-anomaly-producer-4825,cost-anomaly-sources-4825,cost-anomaly-rollup-sources-4825,cost-anomaly-presentation-4825, andalerts.test.ts.0/false/yes→ off;1/true→ on), no loader while off, uncertified seams → tick posts nothing (honest silence), certified closure seam → exactly one burn warning through the production loader, certified closure + busiest-root → both store-fed warnings.bunx tsc --noEmit: no errors in any touched file (the only errors are pre-existing partial-extraction artifacts for sibling packagespm-stack/projector/pm-stack/grist, absent from the extracted tree).Refs #4825 (slice; the issue remains open for production ingestion).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.