Files
loki/scripts
f313df1a16 fix(ops): one incident is one message ACROSS detectors, not just within one (#435)
06:45 `⚙️ FAILED UNIT: orangecat-cat-outcomes.service` from the host-check
sweep. 06:46 `🔴 UNIT DOWN: orangecat-cat-outcomes.service` from the OnFailure
notifier once its grace expired. One incident, two messages — and each detector
was individually correct and correctly deduplicated against itself, which is
exactly why this survived yesterday's fix. Keying the cooldown per detector
still lets N detectors send N messages about one fact.

- The cooldown key is now the SUBJECT (the unit), shared between the sweep and
  the notifier. Whichever notices first speaks; the other finds the claim taken
  and goes to the journal. Neither has to know the other exists.

- Closure is only sent for a failure that was actually announced. `✅
  RECOVERED: unit____` reached George yesterday — closure on a message nobody
  received, naming a state key instead of a unit. Recoveries now name the unit,
  and say nothing when nothing was said.

- The nightly disk GC no longer pages when it succeeds. "freed 2296MB (81% →
  78%)" at 00:02 is the box looking after itself and asking nothing of anyone;
  the disk check already pages above 85%. It still pages when the outcome is
  NOT routine — space reclaimed but still above the mark, or nothing left to
  reclaim. Its test suite gained a delivery capture, because with only a logger
  stub, moving a message from alert() to logger() is indistinguishable from
  leaving it alone.

test:ops 60 passed in the host-alert suite (was 52) and 22 in disk-gc (was 20).
Three mutations — sweep keyed on itself, closure for an unannounced failure,
routine GC paging again — each turn their suite red.


Claude-Session: https://claude.ai/code/session_01AqzRcMP1uJzd7Tav5fNxQz

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 05:04:20 +00:00
..
…
…