mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-14 00:00:30 +00:00
7c212b906e
Phase 1 of docs/ALERT_ENGINE_EVOLUTION.md. internal/alerts/reducer is a pure transition core for the metric-threshold family — hysteresis trigger/clear, sustained-for delay with dip reset, warning/critical severity derivation with the percentage 99-cap — characterized from Manager.checkMetric, with time entering only through the signal's ObservedAt so every sequence is deterministic and replayable. reducer_parity_test.go drives the live manager and the reducer through identical observation sequences (simulated time via the established pending-backdate trick) and fails on any divergence after every step, with the manager as the reference. The harness proved itself on its first run by catching the stale-resolve defect fixed in the previous commit. Registers coverage gap alert-lifecycle-contract-coverage. Remaining slices: offline/confirmation families, ack lifecycle, intent interaction, shadow-mode runtime feed.