mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-14 00:00:30 +00:00
110cbb5773
Phase 2 continued. evaluateCanonicalMetricAlert — the main metric path behind CheckUnifiedResource — no longer reconstructs previous state and re-evaluates: the reducer core owns the transition, keyed by the canonical metric spec ID. The spec's explicit critical threshold and recovery latch map onto the rule (Critical pointer; CriticalDisabled when the spec omits escalation at high triggers, where the legacy derived cap would incorrectly escalate); the hysteresis-latched hold keeps its no-refresh behavior; explicit metric intent policies gate in the reducer with monotonic-tick grace, and the legacy delay applies otherwise. New occurrences take start time and ack restoration from the core and record fired events. Both metric wrappers now observe on the manager clock seam (policyNow), keeping simulated-clock tests and production behavior on one path. The host-dedup tests read the core's pending incidents instead of the retired pendingAlerts map.