Spec: monitoring — keep the operator continuously aware of fleet health, and surface every fault with a safe response (P5) #18
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Wayfinder map: Matou/ourcloud#7 — monitoring's definition was locked on ticket #9 (2026-07-21). This child spec inherits the map's cross-feature constraints (clan substrate behind the
clanseam; theenrollseam's post-enrollment fleet-reporting face; Netbird mesh; tiered recovery; the cross-cutting UX rulings — advice never veto (ADR 0015), members not users (ADR 0034), logging is cross-cutting with drill-in everywhere (ADR 0027)) and links back to it as the parent artifact. Grilled 2026-07-24 (/grill-ux-with-docs) in auto-accept mode; Ben signed off both gates the same day (ADRs 0069/0070, DDRs 0071/0072accepted). The three ✎ screen-states the grill forced were wireframed the same day.Flow:
docs/ux/flows/p5-monitoring.mermaid.Wireframes:
docs/ux/wireframes/p5-monitoring/(P5-S1, ✎ P5-S1x, P5-S2, ✎ P5-S2x, P5-S3, P5-S4, ✎ P5-S4x).Decisions: ADR 0069 (
monitororchestrator = control-plane single test seam), ADR 0070 (two signal sources + monitoring-owned classifier; advised actions areclanops), DDR 0071 (absence of signal is never silently healthy), DDR 0072 (the respond ladder is advice-not-veto with honest degradation).Problem Statement
An operator — low-skill, low-time — cannot sit and watch a fleet of machines. Services members depend on (chat, files, video, git) run across devices that come and go, in buildings the operator may not be in. When something degrades or fails, the operator needs to learn about it in plain language, understand what is safe to do, and either fix it in one click or hand it off — without systems expertise, and without ever being falsely reassured. Left to raw tools this means: reading dashboards of metrics they can't interpret; guessing whether a quiet machine is asleep-as-normal or dead; being paged for every laptop that closes its lid, until real alerts are ignored; being told a service "restarted ✓" when it crashed again a minute later; and being offered a plausible-looking one-click fix for a problem no one-click fix can safely touch. None of that should require expertise, none of it should train the operator to distrust the alerts, and — above all — the system must never show green for a machine it has simply stopped hearing from.
Solution
Monitoring is the fleet's always-current status surface plus the life of an alert, all driven by the community's own control plane over the mesh, so a closed browser never misses anything.
Always current — the status surface (P5-S1). The control plane continuously aggregates health, metrics and heartbeats over the mesh and classifies severity by rule — info (expected), warning (degraded redundancy), critical (a service down, a backup failing). No anomaly is required to see the truth: every device and every service shows its state now, with backups' last-good in the same view.
Absence of signal is never a silent green (P5-S1x). When a device stops heartbeating, the silence is judged against that node's own pattern: an always-on node gone dark is critical and raises an alert; an intermittent node quiet on its known pattern is info and raises nothing. A device the system has simply stopped hearing from is never shown as healthy.
Notify → drill in → respond. When an anomaly crosses a threshold the operator is notified in the operator app and at the alert contact (email/phone set at founding, configured in monitoring), with a plain-language diagnosis and — when one is safe — a single advised action (P5-S2). When no safe automatic fix exists, monitoring says so and offers none rather than fabricating one (P5-S2x). The operator can drill in to the timeline, events and logs (P5-S3, Open/Download from every surface), then respond (P5-S4): apply the advised one-click fix (restart service / re-apply config / rebalance, each logged, then the fleet re-aggregates), acknowledge it as expected (optionally tuning the device's expected pattern), or escalate to rescue. Advice, never a veto.
Honest degradation (P5-S4x). A fix that was applied but did not hold is reported as a re-raise, never a success, with an escalating-specificity re-diagnosis ("chat has crashed 7× this week; a restart has failed to hold twice today"), and escalate to rescue is the natural next rung. Monitoring's job ends at the hand-off.
User Stories
Acceptance criteria are Given/When/Then, sourced from the flow nodes and edges of
p5-monitoring.mermaid, including the error, empty and partial branches.Always-current status surface (P5-S1)
As an operator, I want a single always-current view of every device and service, so that I can see my community's health at a glance without running anything.
As an operator, I want each condition classified by severity, so that I can tell an expected quiet from a real outage without interpreting metrics.
As an operator, I want the resting all-healthy state to be a real shown state, so that "everything is fine" is something I can positively see rather than an empty screen.
Device gone silent (P5-S1x) — DDR 0071
As an operator, I want a machine we've stopped hearing from to never be shown as healthy, so that a powered-off or crashed node can't hide behind "no news is good news".
As an operator, I want an always-on node gone dark to raise a critical alert, so that a real outage reaches me fast.
As an operator, I want an intermittent node quiet on its own known pattern to stay quiet, so that laptops and personal-machine VMs doing exactly what's expected don't train me to ignore alerts.
Notify (P5-S2)
As an operator, I want to be notified in plain language with one recommended action when something crosses a threshold, so that I know what happened and what to do without reading logs.
As an operator, I want the notification to let me act or open the dashboard, so that I can fix fast or investigate.
Notify — no safe automatic action (P5-S2x) — DDR 0072
Drill in (P5-S3)
Respond (P5-S4)
As an operator, I want to apply the advised one-click fix and have it logged, so that I can resolve common faults without systems knowledge.
clanoperation (restart / re-apply the current known-good revision / a service's out-of-band rebalance), inheriting the change-flow discipline, not a bespoke mutation path.As an operator, I want to acknowledge expected behaviour without changing anything, so that a known-normal condition can be closed without a needless fix.
As an operator, I want to escalate anything bigger than a one-click fix, so that a serious problem reaches the rescue tools instead of being poked at.
As an operator, I want repeated consequences of an unreliable device surfaced with growing specificity, so that I understand a pattern rather than seeing the same isolated alert.
Fix didn't hold (P5-S4x) — DDR 0072
As an operator, I want a fix that didn't hold reported as a re-raise, not a success, so that I'm never told a problem is solved when it isn't.
As an operator, I want the re-diagnosis to grow more specific and point me to escalation, so that a fix that keeps failing leads somewhere instead of looping.
Alert contact
Implementation Decisions
monitor— a Go package in the control plane, and the single test seam (ADR 0069). The continuous loop that aggregates fleet health, classifies severity, raises/clears alerts, delivers notifications, and offers the advised fixes lives on the gateway and only there. It is the fourth orchestrator in the per-feature placement pattern (founding→helper, join→agent, provision/update→control plane, monitor→control plane). The Vue dashboard is thin UI over it; the operator app receives notifications and renders status but runs no monitoring logic. Because the loop runs server-side, a closed browser interrupts nothing and a gateway restart resumes from persisted alert state and the next tick — no snapshot-resume machinery.enrollseam's existing post-enrollmentFleetReporting.Reportheartbeat (agent version, uptime, clan connection up/degraded/down, VM health) — monitoring reads the stored latest report and its history (history is what makes a node's own pattern knowable). Correctness comes from re-running the same per-serviceHealthCheckprovisioning gates on once at deploy (ADRs 0061/0062) — monitoring re-runs it on a schedule and invents no second definition of "healthy". Severity (info/warning/critical) is computed bymonitor, by rule, from per-service health + node liveness/history + capability tags (intermittent) + current coverage/HA gaps. The expected-vs-unexpected-silence rule (DDR 0071) lives in this classifier.enrollseam'sRequestView).clanoperations (ADR 0070). restart service → the seam's explicit-restart mechanism; re-apply config →Deployof the current known-good exact revision (idempotent reconcile); rebalance → a catalogue service's out-of-band reconciler op (the S13 clanService pattern). Each is logged and re-aggregated; all inherit the change-flow discipline (scoped, exact-revision, classified failures).Notifier. Delivery to the alert contact (email/phone) alongside the operator app is the only genuinely new egress. It is an interface faked in seam tests; its concrete channel isneeds_human_decision(see Further Notes).FleetReporting.Reportalready carries liveness and ADRs 0061/0062 already provide for the steady-state health-check re-run, so neitherenrollnorclanchanges. If implementation finds the stored heartbeat history needs an explicit read accessor, that is a control-plane-internal helper, not a seam change.Testing Decisions
clanoperation. Never assert the classifier's internal shape or the loop's scheduling mechanics.monitorheadlessly in-process against fakes: a fake heartbeat source replayingFleetReporting.Reportstreams with controllable gaps; fake per-serviceHealthChecks that pass/fail on command; a fake fleet-state provider (capability tags incl. intermittent, observed heartbeat pattern, coverage/HA gaps); a fake clock (expected-vs-unexpected silence, "failed twice this week", thresholds are all time-dependent); a fakeNotifier(assert what was delivered and its severity, sending nothing); and a fakeclan.Clan(assert the advised action issues the right op and the loop re-aggregates). Above the seam: nothing — Vue renders alert states, it does not decide them.clanop and is logged.enrollseam's monotonic resource-state-machine testing (the alert lifecycle is shaped likeRequestView); the S13 prototype's clan fakes (spikes/S13-clan-orchestration/).Out of Scope
needs_human_decision, not designed here.Notifierconcrete delivery channel. The interface is in scope and faked in tests; the wiring to a real email path (the community mail service) and a real SMS path (an external provider) isneeds_human_decision.Further Notes
monitorcontrol-plane single seam (ADR 0069) was signed off at the grill's two gates on 2026-07-24 and is re-confirmed here as the sole seam every acceptance criterion executes at — consistent with founding, device-add and provisioning re-confirming their seams at spec time.needs_human_decisioncarried forward: theNotifierdelivery channel (email via the community mail service; SMS via an external provider), and the deferred summoning mechanism for a physical-only critical silence.no-triage(notready-for-agent) — mirroring provisioning #17. The live swarm must not pick up a whole feature spec as an agent task; monitoring joins the Phase-2 slice-map with the other feature specs, andto-ticketswill emit the implementable tasks afterward.Closed in the 2026-08-27
other-state sweep (Ben's ruling) — child spec complete: 7/7 monitoring slices done, all 17 derived tickets closed.