mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 11:48:24 +01:00
George, 2026-08-29, pasting his Telegram: 'refactor whatever is sending this
abomination.' The morning read as: identical FAILED triples at 08:01, 08:31,
09:01, 09:32, 10:02, 10:33; a six-pack of FAILED+RECOVERED for a 5-minute
deploy blip; closures naming state keys ('RECOVERED:
rtc_revampit_configured_host_does_not_resolve__typing_static_nvi',
'agentwork_reparaturbonus-zh'); UNIT DOWN bodies that repeat the unit name
four times in systemd boilerplate while burying the app's actual error; and
two URL monitors speaking two dialects.
One rule set, all in lib-alert.sh and its callers:
- Reminders BACK OFF: the claim stamp holds 'ts count'; each claim quadruples
the next wait (30m, 2h, 8h, capped at a day). alert_clear resets the
ladder. claim_once is the decision without the delivery, so callers can
digest.
- The sweep gets ONE-TICK GRACE: first sighting watches, never pages — the
OnFailure notifier owns the instant page and already declines deploy blips.
A blip inside the grace produces zero messages, failure or closure.
- DIGESTS: N failures on one tick are one 'STILL FAILING: a; b' message; same
for recoveries.
- Recovery names the SUBJECT, never the key: alert_transition remembers the
human subject at bad-time (explicit arg, else text-to-first-colon, else
key) — fixes every alert_transition caller fleet-wide at one seam.
- The notifier page shows the APP's error: systemd liturgy filtered from the
journal tail; '🔴 DOWN: appcron-kivvi-dunning — curl: (22) … HTTP 500'.
- fleet-uptime.yml speaks the same dialect ('🔴 DOWN: app (…)',
'✅ RECOVERED: app', no ISO timestamp — Telegram stamps messages).
92 tests green; mutation-verified per area: no-grace → 8 red, key-recovery →
3 red, flat-backoff → 1 red.
Claude-Session: https://claude.ai/code/session_018RmMktaYn8MuJdEqjp5gWU
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>