monitoring: dashboard alert-contact editor (retire notYetServed(setAlertContact)) #387

Closed
opened 2026-08-10 03:11:24 +00:00 by ben · 2 comments
Owner

Follow-up filed on closing #369 (ADR 0153 §4).

#369 made founding the FIRST production caller of SetAlertContact (seeded from the S2 operator contact at boot, control-plane/cmd/control-plane/whole_composition.go). The operator still cannot CHANGE it from the dashboard: dashboard/src/lib/api/monitoringClient.ts:117 returns notYetServed('setAlertContact').

Scope: wire the dashboard setAlertContact editor to a real control-plane API over Orchestrator.SetAlertContact (P5 monitoring, not Settings — ticket #9), so the operator can edit the contact founding seeded. SetAlertContact already replaces (v1 holds one contact) and clears the stale delivery-failure mark (#288).

Follow-up filed on closing #369 (ADR 0153 §4). #369 made founding the FIRST production caller of `SetAlertContact` (seeded from the S2 operator contact at boot, `control-plane/cmd/control-plane/whole_composition.go`). The operator still cannot CHANGE it from the dashboard: `dashboard/src/lib/api/monitoringClient.ts:117` returns `notYetServed('setAlertContact')`. Scope: wire the dashboard `setAlertContact` editor to a real control-plane API over `Orchestrator.SetAlertContact` (P5 monitoring, not Settings — ticket #9), so the operator can edit the contact founding seeded. `SetAlertContact` already replaces (v1 holds one contact) and clears the stale delivery-failure mark (#288).
Author
Owner

This was generated by AI during triage.

Triage

Category: enhancement · State: ready-for-agent

Redundancy check: searched internal/controlapi for an alert-contact route (none exists — only GET /api/v1/monitor/alert-count), and the dashboard's HttpMonitoringClient for a real alertContact()/setAlertContact() (both are stubs: the read always resolves null, the write rejects via notYetServed). Not already implemented.

Prior rejection check: no .out-of-scope/ entries exist in this repo yet.

Design contract: present — docs/ux/flows/p5-monitoring.mermaid and docs/ux/wireframes/p5-monitoring/p5-s2-notify.html cover the alert-contact surface; no needs-design gate applies.

Verification: confirmed by reading the code, not by reproducing a runtime bug (this is an enhancement, not a bug report). The orchestrator already has both halves of the domain logic — a Contact-returning read and a validating write — fully implemented and documented; only the transport (HTTP route + generated client + dashboard client method) is missing. The dashboard already has a consuming UI component that calls both the read and the write method on the client interface — so both directions need wiring, not just the write path the issue body names, or the component will load with a client that always reports "no contact configured" even after a successful save.

Agent Brief

Category: enhancement
Summary: Wire the dashboard's alert-contact editor to the control plane's real alert-contact read/write, retiring both monitoring-client stubs.

Current behavior:
The monitoring orchestrator holds the single community-level alert contact and already exposes a read accessor (returns the contact plus whether one is configured) and a write mutator (validates the contact is reachable, replaces the standing contact, and clears any stale delivery-failure mark). Neither is reachable from the dashboard: the control-plane HTTP API has no alert-contact route (only a raised-alert count route exists), and the dashboard's live monitoring client's read method always resolves to "no contact configured" while its write method rejects outright. The dashboard already ships a card component that calls both the read and the write client methods, so today it always renders as unconfigured and cannot save.

Desired behavior:
The dashboard's alert-contact card reads the real, currently-configured community alert contact on load (or "none configured" when genuinely none is set — that's still a truthful state, not necessarily an error), and saving a new contact from the card persists it through the control plane to the orchestrator, following the same transport pattern already established for the read-only status and alert-count surfaces (spec-first: the OpenAPI spec is the contract, the generated client is the transport, the monitoring client maps wire snake_case to the view's camelCase). A write with neither email nor phone is refused with a clear error surfaced to the operator, and the standing contact is left unchanged. A successful write clears any stale delivery-failure mark on the card.

Key interfaces:

  • The monitoring API spec needs new operation(s) for reading and setting the community alert contact, mirroring the existing status/alert-count operations' shape and error conventions.
  • The generated control-plane client needs the corresponding typed methods.
  • The live monitoring client's read method should map the wire contact to the view's Contact type (or null when unconfigured) instead of always resolving null; its write method should call through instead of rejecting.
  • The control-plane API layer needs handler(s) backed by the orchestrator's existing read/write methods, translating the write's "not reachable" validation error into the appropriate HTTP error response.

Acceptance criteria:

  • Loading the dashboard's alert-contact card against a community with a configured contact shows that contact (not "unconfigured").
  • Loading the card against a community with no contact configured shows "unconfigured" (not an error).
  • Submitting a new contact with an email or phone from the card persists it — a subsequent read (e.g. a reload) reflects the new value.
  • Submitting a contact with neither email nor phone is refused; the standing contact is unchanged and the operator sees an error.
  • A successful contact change clears any prior delivery-failure mark shown on the card.
  • The new client methods follow the existing snake_case-wire / camelCase-view mapping convention used by the other live monitoring methods.

Out of scope:

  • Any other stubbed monitoring verb (serviceDetail, respond, apply, acknowledge, tunePattern, escalate) — separate migration tickets.
  • Multi-contact support — v1 holds exactly one alert contact by design.
  • Changing where the alert contact is edited (P5 monitoring, not Settings) — that boundary was already ruled in ticket #9.
> *This was generated by AI during triage.* ## Triage **Category:** enhancement · **State:** ready-for-agent **Redundancy check:** searched `internal/controlapi` for an alert-contact route (none exists — only `GET /api/v1/monitor/alert-count`), and the dashboard's `HttpMonitoringClient` for a real `alertContact()`/`setAlertContact()` (both are stubs: the read always resolves `null`, the write rejects via `notYetServed`). Not already implemented. **Prior rejection check:** no `.out-of-scope/` entries exist in this repo yet. **Design contract:** present — `docs/ux/flows/p5-monitoring.mermaid` and `docs/ux/wireframes/p5-monitoring/p5-s2-notify.html` cover the alert-contact surface; no `needs-design` gate applies. **Verification:** confirmed by reading the code, not by reproducing a runtime bug (this is an enhancement, not a bug report). The orchestrator already has both halves of the domain logic — a `Contact`-returning read and a validating write — fully implemented and documented; only the transport (HTTP route + generated client + dashboard client method) is missing. The dashboard already has a consuming UI component that calls both the read and the write method on the client interface — so both directions need wiring, not just the write path the issue body names, or the component will load with a client that always reports "no contact configured" even after a successful save. ## Agent Brief **Category:** enhancement **Summary:** Wire the dashboard's alert-contact editor to the control plane's real alert-contact read/write, retiring both monitoring-client stubs. **Current behavior:** The monitoring orchestrator holds the single community-level alert contact and already exposes a read accessor (returns the contact plus whether one is configured) and a write mutator (validates the contact is reachable, replaces the standing contact, and clears any stale delivery-failure mark). Neither is reachable from the dashboard: the control-plane HTTP API has no alert-contact route (only a raised-alert count route exists), and the dashboard's live monitoring client's read method always resolves to "no contact configured" while its write method rejects outright. The dashboard already ships a card component that calls both the read and the write client methods, so today it always renders as unconfigured and cannot save. **Desired behavior:** The dashboard's alert-contact card reads the real, currently-configured community alert contact on load (or "none configured" when genuinely none is set — that's still a truthful state, not necessarily an error), and saving a new contact from the card persists it through the control plane to the orchestrator, following the same transport pattern already established for the read-only status and alert-count surfaces (spec-first: the OpenAPI spec is the contract, the generated client is the transport, the monitoring client maps wire snake_case to the view's camelCase). A write with neither email nor phone is refused with a clear error surfaced to the operator, and the standing contact is left unchanged. A successful write clears any stale delivery-failure mark on the card. **Key interfaces:** - The monitoring API spec needs new operation(s) for reading and setting the community alert contact, mirroring the existing status/alert-count operations' shape and error conventions. - The generated control-plane client needs the corresponding typed methods. - The live monitoring client's read method should map the wire contact to the view's `Contact` type (or null when unconfigured) instead of always resolving null; its write method should call through instead of rejecting. - The control-plane API layer needs handler(s) backed by the orchestrator's existing read/write methods, translating the write's "not reachable" validation error into the appropriate HTTP error response. **Acceptance criteria:** - [ ] Loading the dashboard's alert-contact card against a community with a configured contact shows that contact (not "unconfigured"). - [ ] Loading the card against a community with no contact configured shows "unconfigured" (not an error). - [ ] Submitting a new contact with an email or phone from the card persists it — a subsequent read (e.g. a reload) reflects the new value. - [ ] Submitting a contact with neither email nor phone is refused; the standing contact is unchanged and the operator sees an error. - [ ] A successful contact change clears any prior delivery-failure mark shown on the card. - [ ] The new client methods follow the existing snake_case-wire / camelCase-view mapping convention used by the other live monitoring methods. **Out of scope:** - Any other stubbed monitoring verb (`serviceDetail`, `respond`, `apply`, `acknowledge`, `tunePattern`, `escalate`) — separate migration tickets. - Multi-contact support — v1 holds exactly one alert contact by design. - Changing where the alert contact is edited (P5 monitoring, not Settings) — that boundary was already ruled in ticket #9.
Author
Owner

Landed in 699d733 on origin/main.

The dashboard alert-contact editor is now wired to the control plane over HTTP; both monitoring-client stubs retire.

What shipped

  • OpenAPI spec: GET/POST /monitor/alert-contact (getMonitorAlertContact / postMonitorAlertContact), new AlertContactView + Contact schemas and AlertContact requestBody; generated client regenerated (check:client in sync).
  • internal/controlapi/monitor_contact.go: MonitorContactService + WithMonitorContact option served over the real *monitor.Orchestrator. The read projects the configured contact or {configured:false} (truthful empty); the write replaces (v1 holds one) and maps monitor.ErrNoContactAddress to a 400 Problem with the standing contact left intact. A successful change clears the #288 delivery-failure mark (orchestrator-side, already in SetAlertContact).
  • main.go: controlapi.WithMonitorContact(c.mon) wired into the composition root.
  • dashboard/src/lib/api/monitoringClient.ts: alertContact() maps the wire view to Contact | null through camelize (snake_case-wire / camelCase-view convention); setAlertContact(contact) POSTs through. The already-shipped AlertContactCard now reads/writes live.

Acceptance evidence

  • Go seam round-trip TestHandler_AlertContactReadsAndWritesOverHTTP (real orchestrator over HTTP): resting reads configured:false; a set is reflected on reload; an unreachable contact is refused 400 and the standing contact is unchanged.
  • Dashboard transport seam dashboard/tests/unit/monitoringAlertContactTransport.test.ts (injected fetch, no fake in path): read mapping, none→null, the POST body, and 400→throw.
  • Card behaviour covered by the existing monitoringAlertContact.test.ts (6 tests).

Verify: Go build/vet/test + golangci-lint (nix .#go-ci) green; dashboard tsc build + 1003 vitest green; STATUS.md updated (header + milestone log).

Landed in `699d733` on `origin/main`. The dashboard alert-contact editor is now wired to the control plane over HTTP; both monitoring-client stubs retire. **What shipped** - OpenAPI spec: `GET`/`POST /monitor/alert-contact` (`getMonitorAlertContact` / `postMonitorAlertContact`), new `AlertContactView` + `Contact` schemas and `AlertContact` requestBody; generated client regenerated (`check:client` in sync). - `internal/controlapi/monitor_contact.go`: `MonitorContactService` + `WithMonitorContact` option served over the real `*monitor.Orchestrator`. The read projects the configured contact or `{configured:false}` (truthful empty); the write replaces (v1 holds one) and maps `monitor.ErrNoContactAddress` to a 400 Problem with the standing contact left intact. A successful change clears the #288 delivery-failure mark (orchestrator-side, already in `SetAlertContact`). - `main.go`: `controlapi.WithMonitorContact(c.mon)` wired into the composition root. - `dashboard/src/lib/api/monitoringClient.ts`: `alertContact()` maps the wire view to `Contact | null` through `camelize` (snake_case-wire / camelCase-view convention); `setAlertContact(contact)` POSTs through. The already-shipped `AlertContactCard` now reads/writes live. **Acceptance evidence** - Go seam round-trip `TestHandler_AlertContactReadsAndWritesOverHTTP` (real orchestrator over HTTP): resting reads `configured:false`; a set is reflected on reload; an unreachable contact is refused 400 and the standing contact is unchanged. - Dashboard transport seam `dashboard/tests/unit/monitoringAlertContactTransport.test.ts` (injected fetch, no fake in path): read mapping, none→null, the POST body, and 400→throw. - Card behaviour covered by the existing `monitoringAlertContact.test.ts` (6 tests). **Verify**: Go build/vet/test + golangci-lint (nix `.#go-ci`) green; dashboard tsc build + 1003 vitest green; `STATUS.md` updated (header + milestone log).
ben closed this issue 2026-08-10 05:39:53 +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#387
No description provided.