⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
src/review/alerts.ts's header says "On each cron tick, snapshot agent health and push a THROTTLED Discord alert when something drifts." It has 15+ dedicated test cases (test/unit/alerts.test.ts) covering throttling, claim races, and send paths. Repo-wide grep shows runAnomalyAlerts/src/review/alerts is imported nowhere except its own test -- no cron handler, no route, nothing in src/index.ts references it. It appears to sit alongside (not replaced by) ops-wire.ts's runOpsAlerts (structured log + PagerDuty), which IS wired -- Discord and PagerDuty are different notification channels serving the same underlying anomaly signal.
Requirements
Wire runAnomalyAlerts into the same cron tick that already calls runOpsAlerts, so the built-and-tested Discord alerting channel actually fires alongside the PagerDuty path. Do not delete src/review/alerts.ts as part of this issue -- wiring it in is the requested fix; removal would require a separate confirmation that the channel is genuinely unwanted, which is out of scope here. Note: this issue should land after (or together with) the fix for notification_deliveries table collision, since alerts.ts currently writes to a colliding table name that must be corrected first for this wiring to work correctly (see the linked sub-issue).
Deliverables
All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
src/** -- 99%+ patch coverage, branch-counted, on the new cron wiring.
Expected Outcome
The fully-built, already-tested Discord anomaly-alerting channel actually fires on real cron ticks, alongside the existing PagerDuty path, instead of sitting dead in the codebase.
Links & Resources
src/review/alerts.ts
test/unit/alerts.test.ts
src/review/ops-wire.ts
Context
src/review/alerts.ts's header says "On each cron tick, snapshot agent health and push a THROTTLED Discord alert when something drifts." It has 15+ dedicated test cases (test/unit/alerts.test.ts) covering throttling, claim races, and send paths. Repo-wide grep showsrunAnomalyAlerts/src/review/alertsis imported nowhere except its own test -- no cron handler, no route, nothing insrc/index.tsreferences it. It appears to sit alongside (not replaced by)ops-wire.ts'srunOpsAlerts(structured log + PagerDuty), which IS wired -- Discord and PagerDuty are different notification channels serving the same underlying anomaly signal.Requirements
Wire
runAnomalyAlertsinto the same cron tick that already callsrunOpsAlerts, so the built-and-tested Discord alerting channel actually fires alongside the PagerDuty path. Do not deletesrc/review/alerts.tsas part of this issue -- wiring it in is the requested fix; removal would require a separate confirmation that the channel is genuinely unwanted, which is out of scope here. Note: this issue should land after (or together with) the fix fornotification_deliveriestable collision, sincealerts.tscurrently writes to a colliding table name that must be corrected first for this wiring to work correctly (see the linked sub-issue).Deliverables
runAnomalyAlertsis called from the same cron entry point that callsrunOpsAlertsrunOpsAlertsandrunAnomalyAlertsAll of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
src/**-- 99%+ patch coverage, branch-counted, on the new cron wiring.Expected Outcome
The fully-built, already-tested Discord anomaly-alerting channel actually fires on real cron ticks, alongside the existing PagerDuty path, instead of sitting dead in the codebase.
Links & Resources
src/review/alerts.tstest/unit/alerts.test.tssrc/review/ops-wire.ts