engine-adapters: notifier-smtp — alert email from notify@mail.matou.nz; the family closes #173

Closed
opened 2026-07-29 05:10:02 +00:00 by ben · 1 comment
Owner

Parent

Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending.

What to build

The real Notifier (ADR 0106, wiring #85's standing ruling — not reopening it): SMTP submission to Matou-operated mail as notify@mail.matou.nz, per-community submission credentials as clan vars, bounded retry, failure recorded through the log pipeline with the operator-app channel still carrying the raise — never a silent loss, never a fabricated success, no durable outbox. Family close replaces the resting Notifier in main.go.

Acceptance criteria

  • Given a configured alert contact and a raised alert, When Deliver runs, Then a real email is submitted from notify@mail.matou.nz with severity, diagnosis and advised action
  • Given a failing SMTP submission, When retries exhaust, Then the failure is logged and the app channel still carries the alert
  • Given no configured contact, When an alert raises, Then the existing best-effort no-op behaviour stands (already specced at the seam)

Blocked by

  • bootstrap:skeleton — #23 (closed; satisfied)

Task manifest

task: engine-adapters:notifier-smtp
implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)"
interface: "monitor.Notifier — contract unchanged"
seam: "internal/monitor seam tests with the fake; adapter contract tests against a local SMTP sink"
acceptance:
  - given: an SMTP sink; when: deliveries and failures are driven; then: submissions and logged failures match, nothing silent
depends_on: [bootstrap:skeleton]
out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)]
needs_human_decision: []
## Parent Engine-adapters child spec: #161 (ADRs 0102–0107; scoped on wayfinder #160 — Ben ruled live: per-family clan-lab smokes gate each family, the arc closes on a real-hardware end-to-end, tickets arm the swarm). Everything else agent-decided, post-hoc review pending. ## What to build The real Notifier (ADR 0106, wiring #85's standing ruling — not reopening it): SMTP submission to Matou-operated mail as notify@mail.matou.nz, per-community submission credentials as clan vars, bounded retry, failure recorded through the log pipeline with the operator-app channel still carrying the raise — never a silent loss, never a fabricated success, no durable outbox. Family close replaces the resting Notifier in main.go. ## Acceptance criteria - [ ] Given a configured alert contact and a raised alert, When Deliver runs, Then a real email is submitted from notify@mail.matou.nz with severity, diagnosis and advised action - [ ] Given a failing SMTP submission, When retries exhaust, Then the failure is logged and the app channel still carries the alert - [ ] Given no configured contact, When an alert raises, Then the existing best-effort no-op behaviour stands (already specced at the seam) ## Blocked by - bootstrap:skeleton — #23 (closed; satisfied) ## Task manifest ```yaml task: engine-adapters:notifier-smtp implements_seam: "the confirmed seams + ADRs 0102-0107 are the design contract (no flow/wireframe — spec #161)" interface: "monitor.Notifier — contract unchanged" seam: "internal/monitor seam tests with the fake; adapter contract tests against a local SMTP sink" acceptance: - given: an SMTP sink; when: deliveries and failures are driven; then: submissions and logged failures match, nothing silent depends_on: [bootstrap:skeleton] out_of_scope: [screen changes (no UI surface in this arc), the release source / rollout mechanics (out of arc, wayfinder #160)] needs_human_decision: [] ```
Author
Owner

Done — the notifier family closes.

The real monitor.Notifier (ADR 0106, wiring Ben's #85 ruling): new internal/notify adapter submits alert email from notify@mail.matou.nz over SMTP to Matou-operated mail, per-community submission credentials as clan vars.

  • AC1: a configured contact + a raised alert → a real email carrying severity, diagnosis and the advised action, from notify@mail.matou.nz.
  • AC2: a failing submission → bounded retry, exhaustion recorded through the standing log pipeline (never silent, never a fabricated success), and the operator-app channel still carries the raise (no-op success — the app carries it; surfaces are queries over standing alerts).
  • AC3: no reachable contact → the existing best-effort no-op stands.

Seam: adapter contract tests against a local in-process SMTP sink (internal/notify/notify_test.go) — real net/smtp submission proven for AC1, both a fake-submitter exhaustion and a real sink rejection for AC2.

Family close (ADR 0107): main.go restingControlPlane threads a real notifier; productionNotifier reads the gateway's submission clan vars (OURCLOUD_SMTP_ADDR/FROM/USERNAME/PASSWORD) or rests as the honest no-op (nil) when unconfigured. The aggregation loop that drives it starts only when the composition root is whole (compose-aggregation-loop #181). Clan-lab smoke proof is #179.

Commit b12a8df on origin/main. go build ./... + go test ./... green.

Done — the notifier family closes. The real `monitor.Notifier` (ADR 0106, wiring Ben's #85 ruling): new `internal/notify` adapter submits alert email from `notify@mail.matou.nz` over SMTP to Matou-operated mail, per-community submission credentials as clan vars. - **AC1**: a configured contact + a raised alert → a real email carrying severity, diagnosis and the advised action, from `notify@mail.matou.nz`. - **AC2**: a failing submission → bounded retry, exhaustion recorded through the standing log pipeline (never silent, never a fabricated success), and the operator-app channel still carries the raise (no-op success — the app carries it; surfaces are queries over standing alerts). - **AC3**: no reachable contact → the existing best-effort no-op stands. Seam: adapter contract tests against a local in-process SMTP sink (`internal/notify/notify_test.go`) — real net/smtp submission proven for AC1, both a fake-submitter exhaustion and a real sink rejection for AC2. **Family close (ADR 0107)**: `main.go` `restingControlPlane` threads a real notifier; `productionNotifier` reads the gateway's submission clan vars (`OURCLOUD_SMTP_ADDR/FROM/USERNAME/PASSWORD`) or rests as the honest no-op (nil) when unconfigured. The aggregation loop that drives it starts only when the composition root is whole (compose-aggregation-loop #181). Clan-lab smoke proof is #179. Commit `b12a8df` on `origin/main`. `go build ./...` + `go test ./...` green.
ben closed this issue 2026-07-29 12:47:12 +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.

Reference
Matou/idss#173
No description provided.