monitor: a permanently failed alert delivery leaves no trace on any operator surface #288

Closed
opened 2026-08-05 23:10:20 +00:00 by ben · 1 comment
Owner

internal/monitor/notify.go:261 — _ = o.notifier.Deliver(ctx, d) discards the typed error that internal/notify/notify.go:110 deliberately returns after exhausting its retries. There is no durable outbox, so a permanently failed alert-contact email leaves no trace anywhere — and this channel is the one designed to survive a fleet outage (the moment it fails is exactly the moment it matters).

The alert itself standing on the status surface is not enough: the operator relying on email doesn't know the email never went.

Acceptance

  • A delivery that exhausts retries is recorded (delivery-failure state on the alert or contact) and surfaces where alert contacts are managed (the existing alerts/contact surface — e.g. "last delivery failed" on the contact card).
  • Test: notifier returns the exhausted-retries error ⇒ the failure is readable from the monitor's surface, not just a log line.

Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code).

`internal/monitor/notify.go:261` — `_ = o.notifier.Deliver(ctx, d)` discards the typed error that `internal/notify/notify.go:110` deliberately returns after exhausting its retries. There is no durable outbox, so a permanently failed alert-contact email leaves no trace anywhere — and this channel is the one designed to survive a fleet outage (the moment it fails is exactly the moment it matters). The alert itself standing on the status surface is not enough: the operator relying on email doesn't know the email never went. **Acceptance** - A delivery that exhausts retries is recorded (delivery-failure state on the alert or contact) and surfaces where alert contacts are managed (the existing alerts/contact surface — e.g. "last delivery failed" on the contact card). - Test: notifier returns the exhausted-retries error ⇒ the failure is readable from the monitor's surface, not just a log line. --- _Filed from the 2026-08-05 fail-loud audit (three-agent pre-production sweep; findings verified against code)._
Author
Owner

Fixed in 436b208 (on origin/main).

internal/monitor/notify.go Orchestrator.deliver discarded the typed exhausted-retries error the production notifier returns (internal/notify/notify.go:110), so a permanently failed alert-contact email left no trace on any operator surface. deliver now records each real alert-contact delivery outcome into a new ContactDelivery mark (Failed, At, AlertID, Detail), read where the contact is managed via Orchestrator.AlertContactDelivery(): an exhausted delivery reads a failure carrying the alert and the error text, a delivery that goes through clears it, and SetAlertContact clears any stale mark. The raise stays best-effort (a failed send never un-raises the alert).

Red-first tests in internal/monitor/contact_test.go: exhausted delivery ⇒ failure readable from the monitor surface, clears on a recovered re-delivery; a contact change clears a standing failure. go test/go vet/golangci-lint green (monitor, notify).

Fixed in 436b208 (on `origin/main`). `internal/monitor/notify.go` `Orchestrator.deliver` discarded the typed exhausted-retries error the production notifier returns (`internal/notify/notify.go:110`), so a permanently failed alert-contact email left no trace on any operator surface. `deliver` now records each real alert-contact delivery outcome into a new `ContactDelivery` mark (`Failed`, `At`, `AlertID`, `Detail`), read where the contact is managed via `Orchestrator.AlertContactDelivery()`: an exhausted delivery reads a failure carrying the alert and the error text, a delivery that goes through clears it, and `SetAlertContact` clears any stale mark. The raise stays best-effort (a failed send never un-raises the alert). Red-first tests in `internal/monitor/contact_test.go`: exhausted delivery ⇒ failure readable from the monitor surface, clears on a recovered re-delivery; a contact change clears a standing failure. `go test`/`go vet`/`golangci-lint` green (monitor, notify).
ben closed this issue 2026-08-06 02:14:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#288
No description provided.