Skip to content

fix(alerts): an escalation chain routes an anomaly rule - #2328

Merged
Makisuo merged 5 commits into
mainfrom
fix/alerts-anomaly-chain-routing
Nov 7, 2026
Merged

Makisuo merged 5 commits into
mainfrom
fix/alerts-anomaly-chain-routing

fix(web-data): chain diagnosis claims only destination deliveries

669bf05
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Nov 7, 2026 in 1m 55s

Confidence 10/10 · No issues found

🟢 Confidence 10/10 · safe to merge. Routing helpers are pinned on backend, web-data and editor tests; the only unprovable state, member-only chains, is now reported as unknown by design.
no findings · tests covered · risk medium

An escalation chain on a tier now counts as routing an anomaly rule at save, at push, in hub status and in diagnosis, so a chain-only rule saves, pages, and stops being reported unrouted. Server and client agree, and the behavior is tested on both sides.

  • anyTierRouted lets a scoped anomaly rule save with only a chain
  • tierRoutedUpTo lets a chain-routed anomaly tier send the mobile push
  • isRuleRouted clears the unrouted flag and diagnosis copy for chain-only rules
  • isAnomalyUnrouted unblocks the editor's save check for chains

Fixed since the last review

  • ✅ F2 · Chain-only notification stage never sees a member or schedule page
What was checked
  • AlertRuleDocument.destinationIds is the rollup of tier destinations, so the chain-only diagnosis branch cannot catch a tier-routed rule
  • A chain on the critical tier starts a run and one push, asserted in AlertsService.anomaly.test.ts
  • An unrouted anomaly rule still returns before the push: tierRoutedUpTo is false on empty tiers

669bf05 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.