mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-04 13:16:01 +00:00
fa9cc5d691
When the alert manager suppresses an alert because it is flapping, today the suppression is silent: the operator sees no alert and no diagnosis. That trains people not to trust Pulse on flapping resources -- the detector did its job, but the user just sees absence. Add a one-shot Manager callback that fires exactly when a tracking key crosses from quiet into the flapping cooldown window. The callback is the hook downstream surfaces (patrol, findings) will use to explain what is flapping and why Pulse stopped notifying. Lock-safety: checkFlappingLocked now returns (suppress, justTransitioned). The caller (dispatchAlert) reads the transition signal, then dispatches the callback from a fresh goroutine. The alerts manager mutex is never held while the callback runs, so subscribers may take their own locks or re-enter the alerts package without deadlock. Subsequent dispatches inside the cooldown window remain silent: the transition flag is only set on the call that flips flappingActive from false to true.