control-panel observability child spec: device telemetry (P9) — Fleet drill-in + resource telemetry #769

Closed
opened 2026-08-25 04:16:54 +00:00 by matou-build-agent · 1 comment

Parent

Program map: #7 — Wayfinder map: OurCloud v1 program scope (Phase 0).
Design ticket: #759 — control-panel observability: Fleet device drill-in + resource telemetry (the arc was filed from the 2026-08-24 matou-distributed-servers comparison rather than charted on the map; the map's v1 scope is what it lands inside).

Design tier this spec is written against (all present, all accepted):

  • DDR docs/adr/0202-design-device-telemetry-observing-drill-in.md — the ruling DDR; also mints the shared telemetry kit primitives and grading constants the sibling observability DDRs 0203–0206 reference.
  • Flow docs/ux/flows/p9-device-telemetry.mermaid (+ the one new shell.mermaid edge DF → P9-S1).
  • Wireframes docs/ux/wireframes/p9-device-telemetry/ — p9-df-fleet-telemetry-columns, p9-s1-device-detail, p9-s1x-readings-gone-stale, p9-s2-device-silent-last-known, p9-s3-no-telemetry-yet, p9-s3x-telemetry-unavailable. Their data-field / data-action / data-status attributes are the stable element-ID contract every acceptance criterion below is written against.
  • Vocabulary CONTEXT.md — Telemetry (Language) and Device telemetry (P9) object-states (Design nouns), merged with the arc.

Siblings in the same observability arc (each specs separately, then all fan in at one /slice-map): #760 logs, #761 network, #762 replication matrix, #763 activity feed, #764 topology map (deferred).

Problem Statement

An operator can act on a device but cannot look at one. The Fleet tab's resting list gives each device exactly two doors — the health chip into monitoring's service drill-in (P5-S3) and change / set up into provisioning's standing surface (P4-S1) — and there is no third: no per-device surface, and no CPU, memory, disk or temperature reading anywhere in the control panel.

So the questions an operator actually asks when something feels wrong have no answer in the panel. Is this device running out of disk? Is chat slow because the box is loaded, or because chat is broken? This device has been quiet — what was it doing before it went quiet? Today the honest answer is "SSH in", which is exactly the operator this product is built for (low-skill, low-time) not doing it. The panel is strong on verbs and thin on truth: it tells the operator what they may change, never how the fleet is doing.

The absence also costs honesty. Because there is no telemetry surface, there is nowhere for the fleet's most common quiet failure — a reading that stopped arriving — to be named. A number that silently stops updating is worse than no number, and the panel currently has neither.

Solution

Looking at a device becomes its own surface, and it changes nothing. ADR 0063 rules P4 the standing surface for changing a node; P9 is the observing counterpart, and the split stays clean in both directions — P9 offers no act that alters the fleet, and its one changing door is a hand-off into P4.

Two things land:

  1. The Fleet resting list gains telemetry at a glance. DF grows three columns — CPU / MEM / DISK — each a graded resource bar, joined into the same aggregating read that already fills the health chip, so a row and a drill-in can never disagree (DDR 0155 §3). Grading is shared kit constants: ≥60% warn, ≥80% bad. A non-reporting row shows an honest —, never 0% and never a frozen bar. Temperature stays drill-in-only so the row stays one line at product type scale (ADR 0122 amendment).

  2. The device name opens an observing drill-in, in place on Fleet. P9-S1 mounts over the list the way P4-S1 and device-add already do (DDR 0101 §1 / DDR 0109), with "← Fleet" back — never a new tab (ADR 0094's six are closed) and never a route of its own. It shows three gauge rings with the sample age always named, temperature and heartbeat as plain facts, the services this device runs wearing monitoring's own chips (each detail → P5-S3), Open / Download logs (the standing ADR 0027 rule), an explicit Refresh, and one act — Change this device → P4-S1.

Telemetry is monitoring's truth, and its freshness is a verdict, not a timestamp comparison. The control plane's monitoring loop already aggregates health, heartbeats and checks over the mesh; resource readings become a fourth thing it collects and classifies. The classification travels on the wire as a named state; the surface renders it and computes nothing (ADR 0097). That is what makes the five object-states honest:

  • reporting — the latest sample is within cadence; readings wear their grade with the age named (P9-S1).
  • stale — a sample was due and didn't arrive (age > 2× the collection cadence): rings mute, the exact age is named, and an old number never wears a live grade. No stale-green. Heartbeat and health are separate truths, stated separately (P9-S1x).
  • last-known — the device went silent: readings render as a dated record ("last known · 14:02, before the silence"), never as live. Judging the silence stays monitoring's classifier (DDR 0071); this surface carries its verdict and the door to P5-S1x, and never re-judges (P9-S2).
  • no telemetry yet — a connected-not-set-up device has no first sample: track-only rings and an honest — (never a fabricated 0%), the reason named, the prominent act the P4 hand-off (P9-S3).
  • unavailable — the read itself fails on an online device: a rendered, retryable state (the #298 fail-loud discipline), never a toast and never a blank — and the facts owned by other truths (chip, heartbeat, services) keep rendering (P9-S3x).

Three kit primitives are minted here and consumed by the whole observability arc: OcGaugeRing, OcResourceBar, OcStatusDot, plus one status-grading constants module (RESOURCE_WARN_PCT / RESOURCE_BAD_PCT, CERT_WARN_DAYS / CERT_BAD_DAYS, and the grade→token map). The kit compiles no red: grade bad paints from --oc-status-warning and is told apart by a bold readout and named copy, never a third colour.

User Stories

A — The Fleet resting list gains telemetry (DF, amended by DDR 0202)

  1. As an operator, I want CPU, memory and disk shown per device on the Fleet list, so that I can see which device is under pressure without opening anything.

    • Given the Fleet tab at rest with the aggregating read settled, When the resting list renders, Then the table (data-field="fleet-list") carries the columns DEVICE, ROLE, HEALTH, CPU, MEM, DISK and a trailing action column, and every reporting row renders a resource bar per telemetry cell (data-field="cpu-<id>" / "mem-<id>" / "disk-<id>") with a mono NN% readout.
    • Given the gateway founding made, Then it is still row one with its telemetry joined (the never-empty rule, DDR 0095, is untouched by the amendment).
  2. As an operator, I want a device's row and its detail to agree always, so that I never have to decide which number to believe.

    • Given a device's readings, When both the DF row and the P9-S1 drill-in render them, Then both are projected from the same aggregating read of the fleet store × monitoring (DDR 0155 §3) — the drill-in adds facts (temperature, heartbeat, services) but never a second, separately-fetched CPU/MEM/DISK number.
  3. As an operator, I want a device that isn't reporting to say so rather than show a stale or invented number, so that the glance surface is never a lie.

    • Given a node whose telemetry state is anything other than reporting, When its DF row renders, Then each telemetry cell shows — (data-status="none", the .rb bar in its .none variant) — never 0%, never a frozen bar at the last value.
    • Given an asleep-expected helper (kauri) and a connected-not-set-up device (mātai), Then both render — in all three telemetry cells while their health chips keep rendering their own verbatim truth.
  4. As an operator, I want the pressure grading to be consistent and never alarming in the wrong colour, so that I learn one visual language across the whole panel.

    • Given a reading below 60%, Then its bar grades ok (data-status="ok").
    • Given a reading ≥60% and <80%, Then it grades warn (data-status="warn").
    • Given a reading ≥80%, Then it grades bad (data-status="bad"), painted from --oc-status-warning with the readout bolded — no red token is emitted anywhere in the rendered CSS.
  5. As an operator, I want the device's name to be the thing I click to look at it, so that the row's grammar states what each control does.

    • Given any DF row, When the operator activates the device name (data-action="device-detail-<id>"), Then P9-S1 opens for that device in place on the Fleet tab.
    • Given the same row, Then change / set up (data-action="change-node-<id>" / "set-up-<id>") still opens provisioning's P4-S1 and the health chip still opens monitoring's P5-S3 — unchanged owners, unchanged actions.
    • Given the row as a whole, Then clicking outside the three named controls opens nothing (no implicit whole-row target).
  6. As an operator on a narrow window, I want the list to stay one line per device, so that the fleet stays scannable.

    • Given the resting list, Then telemetry readouts render at ≥0.8rem mono and column headers at ≥0.75rem (the ADR 0122 amendment floor), temperature has no column, and each row occupies one line.

B — Opening and closing the observing drill-in (edges DF → P9-S1 / P9-S3, P9-S1 → DF)

  1. As an operator, I want looking at a device to keep me on Fleet, so that I never lose my place in the panel.

    • Given P9-S1 open, Then it is mounted over the Fleet tab's list (the DDR 0101 §1 / DDR 0109 in-place pattern), the browser URL stays /fleet, no seventh tab appears (ADR 0094), and no modal is used.
    • Given P9-S1 open, When the operator activates data-action="back-to-fleet", Then the resting list returns and is re-read, so a device whose state changed while the drill-in was open shows its new row.
  2. As an operator, I want the drill-in to be honestly read-only, so that I can look at a struggling device without fear of changing it.

    • Given any P9 frame, Then the only fleet-affecting control offered is the hand-off to provisioning (data-action="change-device-<id>" on an active device, data-action="set-up-<id>" on a not-yet-set-up one); no assess, role, service or threshold act exists on the surface.
  3. As an operator, I want opening a device that has never reported to land somewhere sensible, so that a fresh device is not a dead end.

    • Given a connected-not-set-up device on DF, When the operator activates its name, Then P9-S3 opens (edge DF → P9-S3) rather than an empty P9-S1.

C — Telemetry reporting (P9-S1)

  1. As an operator, I want the three readings shown as gauges with their grade, so that I can read pressure at a glance.

    • Given a device whose telemetry state is reporting, Then data-field="telemetry-gauges" renders three rings — gauge-cpu, gauge-mem, gauge-disk — each carrying its percentage as a mono value and its grade as data-status="ok" | "warn" | "bad" under the same constants as story 4.
  2. As an operator, I want to know how old the numbers are every single time, so that I am never guessing at freshness.

    • Given reporting, Then the gauges' label names the sample age (e.g. TELEMETRY · SAMPLED 18 S AGO) — the age is present in every P9 frame, never omitted because the reading looks current.
  3. As an operator, I want a nearly-full disk called out in words, so that colour alone never has to carry the warning.

    • Given any reading graded bad, Then a callout (data-field="disk-bad-callout" for disk) names the condition in plain words including the percentage, and its only door routes to provisioning (data-action="change-device-<id>-from-callout") — the observing surface offers no fix of its own.
  4. As an operator, I want the device's plain facts beside its readings, so that I have the context to interpret them.

    • Given P9-S1, Then data-field="device-facts" (always-on/intermittent, install mode, joined date), data-field="last-heartbeat" and data-field="temperature" render as stated facts.
    • Given a device that reports no temperature sensor, Then data-field="temperature" reads "not reported" — never a fabricated value, and never graded or alerted on (v1 rules temperature ungraded).
  5. As an operator, I want the services this device runs listed with monitoring's own chips, so that "the box is fine, chat isn't" is one glance.

    • Given P9-S1, Then data-field="services-on-device" lists each service this device runs with an OcStatusDot, monitoring's chip verbatim, and data-action="service-detail-<service>" opening monitoring's P5-S3 (edge P9-S1 → P5-S3).
    • Given the list, Then it is the seams' services-on-this-device truth — container chips are not the service model.
  6. As an operator, I want logs reachable from the device I am looking at, so that the standing rule holds here too.

    • Given any P9 frame, Then data-action="open-logs" and data-action="download-logs" are offered (ADR 0027), emitted as routed intents scoped to this device — the logs surface itself is DDR 0203's (#760) and is not built by this spec.
  7. As an operator, I want to force a fresh read when I am watching something, so that I am not waiting on a cadence.

    • Given P9-S1, When the operator activates data-action="refresh-telemetry", Then the surface re-reads through its injected client behind the shared async guard and re-renders the returned state and sample age.

D — Readings gone stale (P9-S1x; edges P9-S1 → P9-S1x → P9-S1)

  1. As an operator, I want a reading that stopped arriving to be named as a failure, not shown as if current, so that I am never reassured by an old number.

    • Given a device whose latest sample age exceeds 2× the collection cadence, Then the surface's telemetry state is stale, data-field="stale-callout" (data-status="stale") names it in plain words with the exact age and the wall-clock time of the last sample.
    • Given stale, Then every gauge renders data-status="stale" with its stroke muted to --oc-line and its value in --oc-ink-soft — an 83% disk carries no bad emphasis while it is 26 minutes old, and no gauge renders a healthy grade (no stale-green).
  2. As an operator, I want stale readings and a healthy device to be stated as two separate facts, so that neither is blended into a dishonest summary.

    • Given stale while heartbeats are current, Then the health chip and data-field="last-heartbeat" keep rendering their own current truth ("the device is answering") beside the stale telemetry, and the service chips stay live because they ride monitoring's separate classification.
  3. As an operator, I want the surface to recover on its own when samples resume, so that I don't have to reload to learn things are fine.

    • Given stale, When a fresh sample lands and the next read returns state reporting, Then the surface returns to P9-S1 with live grades and the new age, with no operator act required (edge P9-S1x → P9-S1).

E — Device silent, last-known record (P9-S2; edges P9-S1 → P9-S2 → P5-S1x / P9-S1)

  1. As an operator, I want a silent device's numbers presented as a dated record, so that nothing on the screen can be mistaken for liveness.

    • Given a device monitoring has classified as silent, Then the telemetry state is last-known, the gauges' label reads as a dated record ("LAST KNOWN · 14:02, BEFORE THE SILENCE"), and every gauge renders data-status="last-known" muted (DDR 0096).
    • Given last-known, Then data-field="silent-callout" (data-status="device-silent") names how long heartbeats have been absent and states explicitly that everything below is the last-known record, not the device's state now.
  2. As an operator, I want the judgement about the silence to come from monitoring, so that two surfaces can never disagree about whether a quiet device is a problem.

    • Given last-known, Then the callout carries monitoring's classifier verdict verbatim (expected vs unexpected, DDR 0071) and offers data-action="open-silence-classification" into monitoring's P5-S1x — the P9 surface performs no classification of its own.
  3. As an operator, I want a gone-quiet device's logs still offered, so that I can look at its last lines during a rescue.

    • Given last-known, Then open-logs / download-logs remain offered; the Refresh control is not offered (there is nothing to refresh from a silent device).
    • Given last-known, Then each service row renders its OcStatusDot in the muted tone with monitoring's own chip — absence is a fact rendered in soft ink, never in a fault colour; urgency belongs to monitoring's alert.
  4. As an operator, I want live readings to resume by themselves when the device comes back, so that recovery needs no ceremony.

    • Given last-known, When heartbeats return and a fresh sample lands, Then the next read returns reporting and the surface renders P9-S1 (edge P9-S2 → P9-S1).

F — No telemetry yet (P9-S3; edges DF → P9-S3, P9-S3 → P4-S1 / P9-S1)

  1. As an operator, I want a brand-new device to explain itself rather than show an empty screen, so that "nothing here" is designed, not defaulted.

    • Given a connected device that has never reported a sample, Then the telemetry state is none, data-field="no-telemetry-callout" (data-status="no-telemetry-yet") names the absence and its reason ("connected but hasn't reported its first sample — readings appear once it's set up and serving"), and states that nothing is wrong.
    • Given none, Then each gauge renders data-status="none" as a bare track with — as its value — never 0%, which would read as an idle machine (DDR 0095 spirit).
  2. As an operator, I want the facts that are known about a fresh device shown, so that the screen still earns its place.

    • Given none, Then data-field="device-facts" states the consented install mode, pairing date and the pairing-time probed specs (CPU count, RAM, disk), and data-field="last-heartbeat" states the agent is answering.
    • Given none, Then data-field="services-on-device" states "none yet — services are chosen at set-up" rather than rendering an empty list.
  3. As an operator, I want set-up to be the obvious next step on a fresh device, so that the observing surface hands me off cleanly.

    • Given none, Then the prominent act is data-action="set-up-<id>" opening provisioning's P4-S1 (edge P9-S3 → P4-S1, ADR 0063), and no Change this device control is shown.
    • Given none, When the device's first sample lands, Then the next read returns reporting and the surface renders P9-S1 (edge P9-S3 → P9-S1).

G — Telemetry unavailable (P9-S3x; edge P9-S3x → P9-S1)

  1. As an operator, I want a failed telemetry read to be a rendered, retryable state, so that failure is never silent and never a toast.

    • Given an online device whose telemetry read faults, Then data-field="unavailable-callout" (data-status="telemetry-unavailable") names the failure in plain words, states the honest boundary ("the device itself is online and its services are serving"), and offers data-action="retry-telemetry" plus a footer data-action="retry-telemetry-footer".
    • Given unavailable, Then the gauges render data-status="unavailable" with — — no last value is re-shown as if it were current.
  2. As an operator, I want one failed truth not to take down the others, so that a partial failure stays partial.

    • Given unavailable, Then the health chip, data-field="last-heartbeat" and data-field="services-on-device" keep rendering from their own reads — the drill-in is never blanked by the telemetry fault.
    • Given unavailable, When the operator retries and the read succeeds, Then the surface renders the returned state (edge P9-S3x → P9-S1).
  3. As an operator, I want a whole-surface read failure handled the same honest way the rest of the panel handles it, so that I get one behaviour to learn.

    • Given the P9 read itself fails at transport (not the collector), Then the surface renders the shared error state with a retry (the #298 fail-loud discipline, as FleetSurface already does for the aggregating read) — never a blank pane.
    • Given unavailable is distinct from stale, Then the two are never conflated: stale means samples existed and aged out; unavailable means the read itself failed.

H — Freshness, cadence and where the judgement lives

  1. As an operator, I want the surface to keep itself current without me, so that a device I am watching updates on its own.

    • Given P9-S1 mounted, Then it re-reads on the mount registry's supplied cadence (30 s, the pattern the Services surface already uses), the timer is cleared on unmount, and the component invents no polling interval of its own.
  2. As a maintainer, I want the freshness verdict computed once, server-side, so that no two surfaces can disagree about whether a reading is current.

    • Given any telemetry projection served to the dashboard, Then it carries a named state (reporting / stale / last-known / none / unavailable) computed by monitoring, plus the sample timestamp and its rendered age.
    • Given the dashboard, Then it renders that state verbatim and performs no timestamp comparison, no threshold arithmetic and no staleness judgement of its own (ADR 0097).
  3. As a maintainer, I want the staleness bar and the grading thresholds to be system-defined, so that no operator can tune the panel into dishonesty.

    • Given v1, Then the staleness bar is 2× the collection cadence and the grading thresholds are kit constants — neither is an operator-editable setting anywhere in the panel (ADR 0070's posture).
    • Given monitoring's own raise thresholds for resource pressure, Then they read the same constants, so a widget's grade and an alert's severity can never disagree about where "high" begins.

I — The shared telemetry kit primitives (minted here; the arc consumes them)

  1. As a maintainer, I want one gauge-ring primitive, so that every observability surface draws pressure the same way.

    • Given OcGaugeRing with { pct, label, state }, Then it renders an SVG donut with viewBox="0 0 36 36", r="15.9", stroke-width="4", stroke-linecap="round", rotated −90°, and stroke-dasharray="<pct> 100" — the circumference ≈ 100 so the dasharray reads directly as a percentage.
    • Given pct: null, Then it renders — over a bare track — never 0.
    • Given state: 'stale', Then the value stroke mutes to --oc-line and the value text to --oc-ink-soft, regardless of what the percentage would otherwise grade.
    • Given product type scale, Then the default ring is 64px with a value ≥0.8rem and a label ≥0.75rem (never the prototype's 46px/9px).
  2. As a maintainer, I want one resource-bar primitive, so that dense surfaces grade identically to gauges.

    • Given OcResourceBar with { pct }, Then it renders a 48×7px track on --oc-fill at radius 4, filled from the grade map, with a mono NN% readout ≥0.8rem using font-variant-numeric: tabular-nums; a bad grade additionally bolds the readout in the warning ink.
    • Given pct: null, Then it renders — alone.
  3. As a maintainer, I want one status-dot primitive whose off state is not a fault, so that presence and urgency stay different ideas.

    • Given OcStatusDot with { tone: 'healthy' | 'warning' | 'muted' }, Then it renders a 9px round dot: healthy --oc-status-healthy, warning --oc-status-warning, muted --oc-ink-soft at reduced opacity.
    • Given an absent or off subject, Then the muted tone is used — deliberately not a fault colour.
  4. As a maintainer, I want the grading thresholds in exactly one module, so that the arc cannot drift into five different definitions of "high".

    • Given the kit's status-grading constants module, Then it exports RESOURCE_WARN_PCT = 60, RESOURCE_BAD_PCT = 80, CERT_WARN_DAYS = 30, CERT_BAD_DAYS = 14 and the grade→token map, and it is the single source every observability surface reads.
    • Given the grade→token map, Then ok → --oc-status-healthy and both warn and bad → --oc-status-warning (bad adds emphasis) — the no-red rule encoded in one place.
    • Given the whole kit build, Then no destructive/red token is emitted; if the palette ever gains one, the grade map is the one place to re-point.
  5. As a sibling observability surface, I want to reference these primitives rather than mint my own, so that the arc stays one visual language.

    • Given DDRs 0203–0206's surfaces, Then they consume OcGaugeRing / OcResourceBar / OcStatusDot / the grading constants as specified here; a sibling needing a new grade tier amends DDR 0202 rather than minting beside it.

J — Collecting the readings (monitoring's fourth signal)

  1. As a maintainer, I want resource readings collected by the loop that already senses the fleet, so that no new telemetry substrate is invented.

    • Given an enrolled node's periodic report, Then it carries nullable resource readings (CPU %, memory %, disk %, temperature) node_exporter-style, landing through the existing authenticated ingest — an unenrolled caller is refused exactly as today and nothing lands.
    • Given monitoring's aggregation, Then it stores each node's latest sample with its timestamp and derives the telemetry state per story 31; no history series is stored (see Out of Scope).
  2. As a maintainer, I want a node that reports nothing to be represented as nothing, so that absence never becomes zero anywhere in the stack.

    • Given a node that has never reported readings, Then its readings are null through every layer — wire, projection and view — and the none state is what reaches the surface; no layer substitutes 0.
    • Given a node that reports some readings but not others (e.g. no temperature sensor), Then the present readings render and the absent one renders as not reported — a partial sample is not discarded.
  3. As an operator, I want the whole list to keep working if telemetry collection is broken, so that one new signal cannot take the Fleet tab down.

    • Given monitoring cannot produce readings for some or all nodes, Then the Fleet aggregating read still returns the list with health chips and — telemetry — the list is never refused because a reading is missing.

Implementation Decisions

Seams — one dashboard seam, one control-plane seam, both grown not minted

  • The Fleet aggregating read is the highest seam and it grows; no new dashboard seam is minted. The Fleet tab's one read (FleetSource.load() in the dashboard, FleetService behind GET /fleet in the control plane) gains per-node telemetry, and the same seam gains a per-device read for the drill-in's fuller record. One owner, one injected client, one fake in the component tests. Rejected: a separate TelemetrySource — it would give the row and the drill-in two paths to the same truth, which is exactly what DDR 0155 §3 forbids.
  • Shape of the growth (view types, not files):
    • The fleet node view gains nullable cpuPct / memPct / diskPct, a sampledAt timestamp and the monitoring-computed telemetry state. Nullable is load-bearing: it is what makes — structural rather than a rendering convention.
    • The seam gains a per-device read keyed by node id, returning the same readings plus temperature (nullable), heartbeat age, the pairing-time probed specs, the services-on-this-device join (each with monitoring's chip), and — for the last-known state — monitoring's silence verdict and the reference P5-S1x opens on.
    • The control-plane handler stays a thin projection over the owners (fleet store × monitoring), re-deriving nothing, mapping faults to the shared Problem body, exactly as the existing Fleet route does.
    • Wire stays snake_case, camelised at the client boundary (standards:wire-snake-case #126); the OpenAPI spec is the contract and the generated client is the transport (ADR 0037) — no hand-rolled fetch.
  • Telemetry state is computed in monitoring, once. The classifier owns: the stale bar (age > 2× cadence), the last-known projection (it already owns silence classification, DDR 0071), none (no sample ever), and unavailable (the collector faulted for an online node). The dashboard receives a named state and renders it. This is the single decision that makes stories 17, 20, 24, 27 and 31 checkable rather than a matter of front-end discipline.
  • A telemetry fault is reported inside the payload, not as a failed read. For an online device whose collector faults, the per-device read returns state: unavailable with the other facts populated — so the drill-in renders story 28's partial state. A transport-level failure of the read itself falls to the shared async guard's rendered error state, as FleetSurface already does. The two are deliberately different mechanisms for two different failures.

Surface

  • P9-S1 mounts inside the Fleet surface, alongside the existing in-place drill-ins (P4-S1 assess, device-add, the DF2 codes ledger) — the same ← Fleet back control and the same "close and re-read" behaviour the setup drill-in already has. No router change, no new tab, no modal.
  • Shell composes and computes nothing (ADR 0097): it renders monitoring's chips, grades and states verbatim. The one thing shell "computes" remains the never-empty framing of row one.
  • Client pattern is the house one: injected client + the shared async guard + explicit Refresh + the mount registry's supplied refreshMs (30 s), timer cleared on unmount. Rejected with the prototype: Pinia stores and a component-invented setInterval.
  • Every P9 frame's data-field / data-action / data-status attributes are the built contract, carried verbatim from the wireframes so design-verify can check the shipped UI against them.

The kit

  • Three new primitives and one constants module, specified in DDR 0202 §"The shared telemetry kit primitives" and restated as acceptance criteria in stories 33–36. Proposed names: OcGaugeRing, OcResourceBar, OcStatusDot, and a statusGrades module. All visuals express as --oc-* tokens (ADR 0122); the prototype contributes only two mechanics — the r=15.9 dasharray-as-percentage donut and the graded bar.
  • The no-red rule is encoded in the grade map, not in each component. bad differs from warn by emphasis and copy, never by hue.

Collection

  • Readings ride the existing report path — an additive, nullable block on the enrolled node's periodic status report, landing through the authenticated ingest that already refuses strangers. No new agent binary, no new port, no new ingest surface.
  • Latest sample only. Monitoring stores the most recent reading per node with its timestamp; there is no series, because there is no history surface in v1 (see Out of Scope).
  • Not adopted from the prototype: the short-name keyspace, hand-fed env topology, container chips as the service model, Pinia, naive polling, and IP-visibility gating.

Testing Decisions

A good test states externally-observable behaviour at a seam and never reaches into implementation detail. Four seams, all pre-existing — this spec adds no new seam class:

  1. The dashboard component seam (the primary one). FleetSurface / the new device-detail screen driven against the hand-written fake of the grown Fleet seam, asserting on the wireframes' data-field / data-action / data-status contract. This is where every object-state is proven: reporting, stale, last-known, none, unavailable, plus the DF columns, the — honesty rule, the no-stale-green rule, the routing of each action to its owning feature, and back-closes-and-re-reads. Prior art: fleet.test.ts, monitoringDrillIn.test.ts, monitoringSilence.test.ts, surfaceFaultFrame.test.ts; the fake grows from the existing Fleet fake so its default fleet stays the wireframes' fleet.
  2. The transport seam. The Fleet endpoint's integration test grown for the new fields and the per-device route: the aggregating read returns readings and state, a gateway-alone fleet still serialises structurally, a node with no readings serialises null (never 0), an owner read that faults maps to the shared Problem body, and the generated client camelises the new fields. Prior art: fleet_integration_test.go and fleetLive.test.ts.
  3. The monitoring seam. The classifier's unit tests for the telemetry state machine: a fresh sample is reporting; a sample older than 2× cadence is stale; a silent node projects last-known carrying the existing silence verdict; a never-reported node is none; a collector fault on a live node is unavailable; an unenrolled reporter is refused and nothing lands; a partial sample keeps its present readings. Prior art: monitor_test.go, silence_test.go, authenticated_stream_test.go.
  4. The kit seam. The primitives' own unit tests: the dasharray-as-percentage geometry, null → — (never 0), the stale mute overriding the grade, the tabular-nums readout, the muted (non-fault) off dot, the threshold boundaries at exactly 60 and 80, and a rendered-CSS assertion that no red/destructive token is emitted by any grade. Prior art: ocPrimitives.test.ts, baseLayer.test.ts, themingContract.test.ts.

Two cross-cutting checks ride existing harnesses rather than new ones: the theming contract tests (every new visual is an --oc-* token, ADR 0122) and the callout-vocabulary test (the bad grade is named in copy, not carried by colour alone).

Out of Scope

  • History charts / time series. The surface is now-focused; P5-S3 keeps the last-24h strip for services. A metrics-history slice is a later arc, and no series is stored by this one.
  • Per-process or per-service resource breakdown. Readings are per-device; anything finer belongs to logs and monitoring.
  • Threshold editing. The grading constants and the staleness bar are system-defined; there is no operator knob.
  • Temperature grading or alerting. Shown as a plain fact only — there is no honest cross-hardware threshold to grade against in v1.
  • The logs surface itself. P9 emits open-logs / download-logs scoped to the device; building the surface that receives them is DDR 0203 / #760.
  • The other observability siblings' surfaces — network (#761), replication matrix (#762), activity feed (#763), topology map (#764, deferred). They consume this spec's primitives and constants; none is built here.
  • A member-facing tier. The panel is operators-only behind the community door (DDR 0172); P9 inherits that whole.
  • Any act that changes a device. Assess, role, services, storage and remediation all stay provisioning's (ADR 0063); this surface only hands off.
  • New alert behaviour. Whether resource pressure raises an alert (and at what severity) rides monitoring's existing rules against the shared constants; designing new alert copy or ladders is not this spec's.

Further Notes

Vertical slices (named for the fan-in /slice-map)

  1. ui-kit:telemetry-primitives — OcGaugeRing, OcResourceBar, OcStatusDot, the status-grading constants module. No dependencies; the whole observability arc depends on it, so it wants to be an early root.
  2. monitor:node-readings — the additive readings on the node report, the latest-sample store, and the telemetry state classifier. Depends on nothing new.
  3. transport:fleet-telemetry — the Fleet aggregating read grows per-node readings and state (OpenAPI + handler + generated client). Depends on 2.
  4. shell:fleet-telemetry-columns — DF's three columns and the device-name look-at affordance. Depends on 1 and 3.
  5. transport:device-telemetry-detail — the per-device read on the same seam (temperature, heartbeat, probed specs, services join, silence verdict). Depends on 2.
  6. shell:device-detail-drill-in — P9-S1 / S1x / S2 / S3 / S3x mounted in place on Fleet. Depends on 1, 4 and 5.

Cross-arc note for the fan-in: slice 1 is a shared root for #760–#763, and slice 2 is where a resource-pressure alert (if monitoring ever raises one) would read the same constants. The activity feed (#763) and logs (#760) also consume OcStatusDot.

The DDR's two open gates (veto-open, not blocking)

DDR 0202 is accepted with two decisions held open for Ben under the ADR 0174 posture — each has a proposed default that this spec is written against, and the veto is asynchronous:

  • G1 — DF wears three telemetry columns (default: yes; CPU / MEM / DISK, temperature excluded, — for non-reporting rows). This is the density of the panel's most-seen resting surface — a taste call on a signed frame. A veto retires stories 1, 3, 4 and 6 and leaves the drill-in whole.
  • G2 — the device name is the look-at affordance (default: name-as-link opening P9-S1 in place; change/chip untouched). A veto swaps story 5's affordance for a per-row view action; everything downstream works identically.

Neither gate changes a seam, a state, a threshold or a primitive — which is why the rest of the spec can be sliced without waiting on them.

Implementation-time notes

  • The canonical DF frame (docs/ux/wireframes/shell/shell-df-fleet.html) gains its ✎ telemetry-columns note in the commit that implements slice 4, per the ADR 0042 discipline; p9-df-fleet-telemetry-columns.html is the amendment depiction, not a second canonical frame.
  • The prototype (matou-distributed-servers, roles/admin_dashboard/) is a reference for widget mechanics only. Its styling is a drifted fork of the same Mātou visual language; nothing visual transfers.
  • CONTEXT.md's Telemetry entry rules the copy: say readings or telemetry, never metrics, vitals, stats or resource usage as a noun; never "offline" for stale readings, "down" for a silent device, "0%" for an absent reading, or "live" for a last-known record.

Produced by /to-spec in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #759.

## Parent Program map: [#7 — Wayfinder map: OurCloud v1 program scope (Phase 0)](https://git.matou.nz/Matou/idss/issues/7). Design ticket: [#759 — control-panel observability: Fleet device drill-in + resource telemetry](https://git.matou.nz/Matou/idss/issues/759) (the arc was filed from the 2026-08-24 `matou-distributed-servers` comparison rather than charted on the map; the map's v1 scope is what it lands inside). Design tier this spec is written against (all present, all `accepted`): - **DDR** [`docs/adr/0202-design-device-telemetry-observing-drill-in.md`](https://git.matou.nz/Matou/idss/src/branch/main/docs/adr/0202-design-device-telemetry-observing-drill-in.md) — the ruling DDR; also **mints the shared telemetry kit primitives and grading constants** the sibling observability DDRs 0203–0206 reference. - **Flow** `docs/ux/flows/p9-device-telemetry.mermaid` (+ the one new `shell.mermaid` edge DF → P9-S1). - **Wireframes** `docs/ux/wireframes/p9-device-telemetry/` — `p9-df-fleet-telemetry-columns`, `p9-s1-device-detail`, `p9-s1x-readings-gone-stale`, `p9-s2-device-silent-last-known`, `p9-s3-no-telemetry-yet`, `p9-s3x-telemetry-unavailable`. Their `data-field` / `data-action` / `data-status` attributes are the stable element-ID contract every acceptance criterion below is written against. - **Vocabulary** `CONTEXT.md` — *Telemetry* (Language) and *Device telemetry (P9) object-states* (Design nouns), merged with the arc. Siblings in the same observability arc (each specs separately, then all fan in at one `/slice-map`): #760 logs, #761 network, #762 replication matrix, #763 activity feed, #764 topology map (deferred). ## Problem Statement An operator can *act* on a device but cannot *look* at one. The Fleet tab's resting list gives each device exactly two doors — the health chip into monitoring's service drill-in (P5-S3) and *change* / *set up* into provisioning's standing surface (P4-S1) — and there is no third: no per-device surface, and no CPU, memory, disk or temperature reading anywhere in the control panel. So the questions an operator actually asks when something feels wrong have no answer in the panel. *Is this device running out of disk?* *Is chat slow because the box is loaded, or because chat is broken?* *This device has been quiet — what was it doing before it went quiet?* Today the honest answer is "SSH in", which is exactly the operator this product is built for (low-skill, low-time) not doing it. The panel is strong on verbs and thin on truth: it tells the operator what they may change, never how the fleet is doing. The absence also costs honesty. Because there is no telemetry surface, there is nowhere for the fleet's most common quiet failure — *a reading that stopped arriving* — to be named. A number that silently stops updating is worse than no number, and the panel currently has neither. ## Solution **Looking at a device becomes its own surface, and it changes nothing.** ADR 0063 rules P4 the standing surface for *changing* a node; P9 is the observing counterpart, and the split stays clean in both directions — P9 offers no act that alters the fleet, and its one changing door is a hand-off into P4. Two things land: 1. **The Fleet resting list gains telemetry at a glance.** DF grows three columns — CPU / MEM / DISK — each a graded resource bar, joined into the *same* aggregating read that already fills the health chip, so a row and a drill-in can never disagree (DDR 0155 §3). Grading is shared kit constants: ≥60% warn, ≥80% bad. A non-reporting row shows an honest **—**, never `0%` and never a frozen bar. Temperature stays drill-in-only so the row stays one line at product type scale (ADR 0122 amendment). 2. **The device name opens an observing drill-in, in place on Fleet.** P9-S1 mounts over the list the way P4-S1 and device-add already do (DDR 0101 §1 / DDR 0109), with "← Fleet" back — never a new tab (ADR 0094's six are closed) and never a route of its own. It shows three gauge rings with the sample age always named, temperature and heartbeat as plain facts, the services this device runs wearing monitoring's own chips (each *detail* → P5-S3), Open / Download logs (the standing ADR 0027 rule), an explicit Refresh, and one act — *Change this device* → P4-S1. **Telemetry is monitoring's truth, and its freshness is a verdict, not a timestamp comparison.** The control plane's monitoring loop already aggregates health, heartbeats and checks over the mesh; resource readings become a fourth thing it collects and classifies. The classification travels on the wire as a named state; the surface renders it and computes nothing (ADR 0097). That is what makes the five object-states honest: - **reporting** — the latest sample is within cadence; readings wear their grade with the age named (P9-S1). - **stale** — a sample was due and didn't arrive (age > 2× the collection cadence): rings mute, the exact age is named, and an old number never wears a live grade. **No stale-green.** Heartbeat and health are separate truths, stated separately (P9-S1x). - **last-known** — the device went silent: readings render as a dated *record* ("last known · 14:02, before the silence"), never as live. Judging the silence stays monitoring's classifier (DDR 0071); this surface carries its verdict and the door to P5-S1x, and never re-judges (P9-S2). - **no telemetry yet** — a connected-not-set-up device has no first sample: track-only rings and an honest **—** (never a fabricated 0%), the reason named, the prominent act the P4 hand-off (P9-S3). - **unavailable** — the read itself fails on an online device: a rendered, retryable state (the #298 fail-loud discipline), never a toast and never a blank — and the facts owned by other truths (chip, heartbeat, services) keep rendering (P9-S3x). Three kit primitives are **minted here and consumed by the whole observability arc**: `OcGaugeRing`, `OcResourceBar`, `OcStatusDot`, plus one status-grading constants module (`RESOURCE_WARN_PCT` / `RESOURCE_BAD_PCT`, `CERT_WARN_DAYS` / `CERT_BAD_DAYS`, and the grade→token map). **The kit compiles no red**: grade *bad* paints from `--oc-status-warning` and is told apart by a bold readout and named copy, never a third colour. ## User Stories ### A — The Fleet resting list gains telemetry (DF, amended by DDR 0202) 1. As an operator, I want CPU, memory and disk shown per device on the Fleet list, so that I can see which device is under pressure without opening anything. - **Given** the Fleet tab at rest with the aggregating read settled, **When** the resting list renders, **Then** the table (`data-field="fleet-list"`) carries the columns `DEVICE`, `ROLE`, `HEALTH`, `CPU`, `MEM`, `DISK` and a trailing action column, and every reporting row renders a resource bar per telemetry cell (`data-field="cpu-<id>" / "mem-<id>" / "disk-<id>"`) with a mono `NN%` readout. - **Given** the gateway founding made, **Then** it is still row one with its telemetry joined (the never-empty rule, DDR 0095, is untouched by the amendment). 2. As an operator, I want a device's row and its detail to agree always, so that I never have to decide which number to believe. - **Given** a device's readings, **When** both the DF row and the P9-S1 drill-in render them, **Then** both are projected from the **same** aggregating read of the fleet store × monitoring (DDR 0155 §3) — the drill-in adds facts (temperature, heartbeat, services) but never a second, separately-fetched CPU/MEM/DISK number. 3. As an operator, I want a device that isn't reporting to say so rather than show a stale or invented number, so that the glance surface is never a lie. - **Given** a node whose telemetry state is anything other than *reporting*, **When** its DF row renders, **Then** each telemetry cell shows `—` (`data-status="none"`, the `.rb` bar in its `.none` variant) — never `0%`, never a frozen bar at the last value. - **Given** an asleep-expected helper (`kauri`) and a connected-not-set-up device (`mātai`), **Then** both render `—` in all three telemetry cells while their health chips keep rendering their own verbatim truth. 4. As an operator, I want the pressure grading to be consistent and never alarming in the wrong colour, so that I learn one visual language across the whole panel. - **Given** a reading below 60%, **Then** its bar grades `ok` (`data-status="ok"`). - **Given** a reading ≥60% and <80%, **Then** it grades `warn` (`data-status="warn"`). - **Given** a reading ≥80%, **Then** it grades `bad` (`data-status="bad"`), painted from `--oc-status-warning` with the readout bolded — **no red token is emitted anywhere in the rendered CSS**. 5. As an operator, I want the device's name to be the thing I click to look at it, so that the row's grammar states what each control does. - **Given** any DF row, **When** the operator activates the device name (`data-action="device-detail-<id>"`), **Then** P9-S1 opens for that device in place on the Fleet tab. - **Given** the same row, **Then** *change* / *set up* (`data-action="change-node-<id>" / "set-up-<id>"`) still opens provisioning's P4-S1 and the health chip still opens monitoring's P5-S3 — unchanged owners, unchanged actions. - **Given** the row as a whole, **Then** clicking outside the three named controls opens nothing (no implicit whole-row target). 6. As an operator on a narrow window, I want the list to stay one line per device, so that the fleet stays scannable. - **Given** the resting list, **Then** telemetry readouts render at ≥0.8rem mono and column headers at ≥0.75rem (the ADR 0122 amendment floor), temperature has no column, and each row occupies one line. ### B — Opening and closing the observing drill-in (edges DF → P9-S1 / P9-S3, P9-S1 → DF) 7. As an operator, I want looking at a device to keep me on Fleet, so that I never lose my place in the panel. - **Given** P9-S1 open, **Then** it is mounted over the Fleet tab's list (the DDR 0101 §1 / DDR 0109 in-place pattern), the browser URL stays `/fleet`, no seventh tab appears (ADR 0094), and no modal is used. - **Given** P9-S1 open, **When** the operator activates `data-action="back-to-fleet"`, **Then** the resting list returns and is re-read, so a device whose state changed while the drill-in was open shows its new row. 8. As an operator, I want the drill-in to be honestly read-only, so that I can look at a struggling device without fear of changing it. - **Given** any P9 frame, **Then** the only fleet-affecting control offered is the hand-off to provisioning (`data-action="change-device-<id>"` on an active device, `data-action="set-up-<id>"` on a not-yet-set-up one); no assess, role, service or threshold act exists on the surface. 9. As an operator, I want opening a device that has never reported to land somewhere sensible, so that a fresh device is not a dead end. - **Given** a connected-not-set-up device on DF, **When** the operator activates its name, **Then** P9-S3 opens (edge DF → P9-S3) rather than an empty P9-S1. ### C — Telemetry reporting (P9-S1) 10. As an operator, I want the three readings shown as gauges with their grade, so that I can read pressure at a glance. - **Given** a device whose telemetry state is *reporting*, **Then** `data-field="telemetry-gauges"` renders three rings — `gauge-cpu`, `gauge-mem`, `gauge-disk` — each carrying its percentage as a mono value and its grade as `data-status="ok" | "warn" | "bad"` under the same constants as story 4. 11. As an operator, I want to know how old the numbers are every single time, so that I am never guessing at freshness. - **Given** *reporting*, **Then** the gauges' label names the sample age (e.g. `TELEMETRY · SAMPLED 18 S AGO`) — the age is present in every P9 frame, never omitted because the reading looks current. 12. As an operator, I want a nearly-full disk called out in words, so that colour alone never has to carry the warning. - **Given** any reading graded *bad*, **Then** a callout (`data-field="disk-bad-callout"` for disk) names the condition in plain words including the percentage, and its only door routes to provisioning (`data-action="change-device-<id>-from-callout"`) — the observing surface offers no fix of its own. 13. As an operator, I want the device's plain facts beside its readings, so that I have the context to interpret them. - **Given** P9-S1, **Then** `data-field="device-facts"` (always-on/intermittent, install mode, joined date), `data-field="last-heartbeat"` and `data-field="temperature"` render as stated facts. - **Given** a device that reports no temperature sensor, **Then** `data-field="temperature"` reads "not reported" — never a fabricated value, and never graded or alerted on (v1 rules temperature ungraded). 14. As an operator, I want the services this device runs listed with monitoring's own chips, so that "the box is fine, chat isn't" is one glance. - **Given** P9-S1, **Then** `data-field="services-on-device"` lists each service this device runs with an `OcStatusDot`, monitoring's chip verbatim, and `data-action="service-detail-<service>"` opening monitoring's P5-S3 (edge P9-S1 → P5-S3). - **Given** the list, **Then** it is the seams' services-on-this-device truth — container chips are not the service model. 15. As an operator, I want logs reachable from the device I am looking at, so that the standing rule holds here too. - **Given** any P9 frame, **Then** `data-action="open-logs"` and `data-action="download-logs"` are offered (ADR 0027), emitted as routed intents scoped to this device — the logs surface itself is DDR 0203's (#760) and is not built by this spec. 16. As an operator, I want to force a fresh read when I am watching something, so that I am not waiting on a cadence. - **Given** P9-S1, **When** the operator activates `data-action="refresh-telemetry"`, **Then** the surface re-reads through its injected client behind the shared async guard and re-renders the returned state and sample age. ### D — Readings gone stale (P9-S1x; edges P9-S1 → P9-S1x → P9-S1) 17. As an operator, I want a reading that stopped arriving to be named as a failure, not shown as if current, so that I am never reassured by an old number. - **Given** a device whose latest sample age exceeds **2× the collection cadence**, **Then** the surface's telemetry state is *stale*, `data-field="stale-callout"` (`data-status="stale"`) names it in plain words with the exact age and the wall-clock time of the last sample. - **Given** *stale*, **Then** every gauge renders `data-status="stale"` with its stroke muted to `--oc-line` and its value in `--oc-ink-soft` — **an 83% disk carries no bad emphasis while it is 26 minutes old**, and no gauge renders a healthy grade (no stale-green). 18. As an operator, I want stale readings and a healthy device to be stated as two separate facts, so that neither is blended into a dishonest summary. - **Given** *stale* while heartbeats are current, **Then** the health chip and `data-field="last-heartbeat"` keep rendering their own current truth ("the device is answering") beside the stale telemetry, and the service chips stay live because they ride monitoring's separate classification. 19. As an operator, I want the surface to recover on its own when samples resume, so that I don't have to reload to learn things are fine. - **Given** *stale*, **When** a fresh sample lands and the next read returns state *reporting*, **Then** the surface returns to P9-S1 with live grades and the new age, with no operator act required (edge P9-S1x → P9-S1). ### E — Device silent, last-known record (P9-S2; edges P9-S1 → P9-S2 → P5-S1x / P9-S1) 20. As an operator, I want a silent device's numbers presented as a dated record, so that nothing on the screen can be mistaken for liveness. - **Given** a device monitoring has classified as silent, **Then** the telemetry state is *last-known*, the gauges' label reads as a dated record ("LAST KNOWN · 14:02, BEFORE THE SILENCE"), and every gauge renders `data-status="last-known"` muted (DDR 0096). - **Given** *last-known*, **Then** `data-field="silent-callout"` (`data-status="device-silent"`) names how long heartbeats have been absent and states explicitly that everything below is the last-known record, not the device's state now. 21. As an operator, I want the judgement about the silence to come from monitoring, so that two surfaces can never disagree about whether a quiet device is a problem. - **Given** *last-known*, **Then** the callout carries **monitoring's classifier verdict verbatim** (expected vs unexpected, DDR 0071) and offers `data-action="open-silence-classification"` into monitoring's P5-S1x — the P9 surface performs no classification of its own. 22. As an operator, I want a gone-quiet device's logs still offered, so that I can look at its last lines during a rescue. - **Given** *last-known*, **Then** `open-logs` / `download-logs` remain offered; the Refresh control is not offered (there is nothing to refresh from a silent device). - **Given** *last-known*, **Then** each service row renders its `OcStatusDot` in the **muted** tone with monitoring's own chip — absence is a fact rendered in soft ink, never in a fault colour; urgency belongs to monitoring's alert. 23. As an operator, I want live readings to resume by themselves when the device comes back, so that recovery needs no ceremony. - **Given** *last-known*, **When** heartbeats return and a fresh sample lands, **Then** the next read returns *reporting* and the surface renders P9-S1 (edge P9-S2 → P9-S1). ### F — No telemetry yet (P9-S3; edges DF → P9-S3, P9-S3 → P4-S1 / P9-S1) 24. As an operator, I want a brand-new device to explain itself rather than show an empty screen, so that "nothing here" is designed, not defaulted. - **Given** a connected device that has never reported a sample, **Then** the telemetry state is *none*, `data-field="no-telemetry-callout"` (`data-status="no-telemetry-yet"`) names the absence **and its reason** ("connected but hasn't reported its first sample — readings appear once it's set up and serving"), and states that nothing is wrong. - **Given** *none*, **Then** each gauge renders `data-status="none"` as a bare track with `—` as its value — **never `0%`**, which would read as an idle machine (DDR 0095 spirit). 25. As an operator, I want the facts that *are* known about a fresh device shown, so that the screen still earns its place. - **Given** *none*, **Then** `data-field="device-facts"` states the consented install mode, pairing date and the pairing-time probed specs (CPU count, RAM, disk), and `data-field="last-heartbeat"` states the agent is answering. - **Given** *none*, **Then** `data-field="services-on-device"` states "none yet — services are chosen at set-up" rather than rendering an empty list. 26. As an operator, I want set-up to be the obvious next step on a fresh device, so that the observing surface hands me off cleanly. - **Given** *none*, **Then** the prominent act is `data-action="set-up-<id>"` opening provisioning's P4-S1 (edge P9-S3 → P4-S1, ADR 0063), and no *Change this device* control is shown. - **Given** *none*, **When** the device's first sample lands, **Then** the next read returns *reporting* and the surface renders P9-S1 (edge P9-S3 → P9-S1). ### G — Telemetry unavailable (P9-S3x; edge P9-S3x → P9-S1) 27. As an operator, I want a failed telemetry read to be a rendered, retryable state, so that failure is never silent and never a toast. - **Given** an online device whose telemetry read faults, **Then** `data-field="unavailable-callout"` (`data-status="telemetry-unavailable"`) names the failure in plain words, states the honest boundary ("the device itself is online and its services are serving"), and offers `data-action="retry-telemetry"` plus a footer `data-action="retry-telemetry-footer"`. - **Given** *unavailable*, **Then** the gauges render `data-status="unavailable"` with `—` — no last value is re-shown as if it were current. 28. As an operator, I want one failed truth not to take down the others, so that a partial failure stays partial. - **Given** *unavailable*, **Then** the health chip, `data-field="last-heartbeat"` and `data-field="services-on-device"` keep rendering from their own reads — the drill-in is never blanked by the telemetry fault. - **Given** *unavailable*, **When** the operator retries and the read succeeds, **Then** the surface renders the returned state (edge P9-S3x → P9-S1). 29. As an operator, I want a whole-surface read failure handled the same honest way the rest of the panel handles it, so that I get one behaviour to learn. - **Given** the P9 read itself fails at transport (not the collector), **Then** the surface renders the shared error state with a retry (the #298 fail-loud discipline, as `FleetSurface` already does for the aggregating read) — never a blank pane. - **Given** *unavailable* is distinct from *stale*, **Then** the two are never conflated: *stale* means samples existed and aged out; *unavailable* means the read itself failed. ### H — Freshness, cadence and where the judgement lives 30. As an operator, I want the surface to keep itself current without me, so that a device I am watching updates on its own. - **Given** P9-S1 mounted, **Then** it re-reads on the mount registry's supplied cadence (30 s, the pattern the Services surface already uses), the timer is cleared on unmount, and the component invents no polling interval of its own. 31. As a maintainer, I want the freshness verdict computed once, server-side, so that no two surfaces can disagree about whether a reading is current. - **Given** any telemetry projection served to the dashboard, **Then** it carries a **named state** (`reporting` / `stale` / `last-known` / `none` / `unavailable`) computed by monitoring, plus the sample timestamp and its rendered age. - **Given** the dashboard, **Then** it renders that state verbatim and performs **no timestamp comparison, no threshold arithmetic and no staleness judgement of its own** (ADR 0097). 32. As a maintainer, I want the staleness bar and the grading thresholds to be system-defined, so that no operator can tune the panel into dishonesty. - **Given** v1, **Then** the staleness bar is 2× the collection cadence and the grading thresholds are kit constants — neither is an operator-editable setting anywhere in the panel (ADR 0070's posture). - **Given** monitoring's own raise thresholds for resource pressure, **Then** they read the same constants, so a widget's grade and an alert's severity can never disagree about where "high" begins. ### I — The shared telemetry kit primitives (minted here; the arc consumes them) 33. As a maintainer, I want one gauge-ring primitive, so that every observability surface draws pressure the same way. - **Given** `OcGaugeRing` with `{ pct, label, state }`, **Then** it renders an SVG donut with `viewBox="0 0 36 36"`, `r="15.9"`, `stroke-width="4"`, `stroke-linecap="round"`, rotated −90°, and `stroke-dasharray="<pct> 100"` — the circumference ≈ 100 so the dasharray reads directly as a percentage. - **Given** `pct: null`, **Then** it renders `—` over a bare track — never `0`. - **Given** `state: 'stale'`, **Then** the value stroke mutes to `--oc-line` and the value text to `--oc-ink-soft`, regardless of what the percentage would otherwise grade. - **Given** product type scale, **Then** the default ring is 64px with a value ≥0.8rem and a label ≥0.75rem (never the prototype's 46px/9px). 34. As a maintainer, I want one resource-bar primitive, so that dense surfaces grade identically to gauges. - **Given** `OcResourceBar` with `{ pct }`, **Then** it renders a 48×7px track on `--oc-fill` at radius 4, filled from the grade map, with a mono `NN%` readout ≥0.8rem using `font-variant-numeric: tabular-nums`; a *bad* grade additionally bolds the readout in the warning ink. - **Given** `pct: null`, **Then** it renders `—` alone. 35. As a maintainer, I want one status-dot primitive whose off state is not a fault, so that presence and urgency stay different ideas. - **Given** `OcStatusDot` with `{ tone: 'healthy' | 'warning' | 'muted' }`, **Then** it renders a 9px round dot: healthy `--oc-status-healthy`, warning `--oc-status-warning`, muted `--oc-ink-soft` at reduced opacity. - **Given** an absent or off subject, **Then** the muted tone is used — deliberately not a fault colour. 36. As a maintainer, I want the grading thresholds in exactly one module, so that the arc cannot drift into five different definitions of "high". - **Given** the kit's status-grading constants module, **Then** it exports `RESOURCE_WARN_PCT = 60`, `RESOURCE_BAD_PCT = 80`, `CERT_WARN_DAYS = 30`, `CERT_BAD_DAYS = 14` and the grade→token map, and it is the single source every observability surface reads. - **Given** the grade→token map, **Then** `ok → --oc-status-healthy` and **both** `warn` and `bad → --oc-status-warning` (bad adds emphasis) — the no-red rule encoded in one place. - **Given** the whole kit build, **Then** no destructive/red token is emitted; if the palette ever gains one, the grade map is the one place to re-point. 37. As a sibling observability surface, I want to reference these primitives rather than mint my own, so that the arc stays one visual language. - **Given** DDRs 0203–0206's surfaces, **Then** they consume `OcGaugeRing` / `OcResourceBar` / `OcStatusDot` / the grading constants as specified here; a sibling needing a new grade tier amends DDR 0202 rather than minting beside it. ### J — Collecting the readings (monitoring's fourth signal) 38. As a maintainer, I want resource readings collected by the loop that already senses the fleet, so that no new telemetry substrate is invented. - **Given** an enrolled node's periodic report, **Then** it carries nullable resource readings (CPU %, memory %, disk %, temperature) node_exporter-style, landing through the existing authenticated ingest — an unenrolled caller is refused exactly as today and nothing lands. - **Given** monitoring's aggregation, **Then** it stores each node's **latest sample with its timestamp** and derives the telemetry state per story 31; no history series is stored (see Out of Scope). 39. As a maintainer, I want a node that reports nothing to be represented as nothing, so that absence never becomes zero anywhere in the stack. - **Given** a node that has never reported readings, **Then** its readings are null through every layer — wire, projection and view — and the `none` state is what reaches the surface; no layer substitutes `0`. - **Given** a node that reports some readings but not others (e.g. no temperature sensor), **Then** the present readings render and the absent one renders as not reported — a partial sample is not discarded. 40. As an operator, I want the whole list to keep working if telemetry collection is broken, so that one new signal cannot take the Fleet tab down. - **Given** monitoring cannot produce readings for some or all nodes, **Then** the Fleet aggregating read still returns the list with health chips and `—` telemetry — the list is never refused because a reading is missing. ## Implementation Decisions ### Seams — one dashboard seam, one control-plane seam, both grown not minted - **The Fleet aggregating read is the highest seam and it grows; no new dashboard seam is minted.** The Fleet tab's one read (`FleetSource.load()` in the dashboard, `FleetService` behind `GET /fleet` in the control plane) gains per-node telemetry, and the **same seam** gains a per-device read for the drill-in's fuller record. One owner, one injected client, one fake in the component tests. Rejected: a separate `TelemetrySource` — it would give the row and the drill-in two paths to the same truth, which is exactly what DDR 0155 §3 forbids. - **Shape of the growth (view types, not files):** - The fleet node view gains **nullable** `cpuPct` / `memPct` / `diskPct`, a `sampledAt` timestamp and the monitoring-computed telemetry `state`. Nullable is load-bearing: it is what makes `—` structural rather than a rendering convention. - The seam gains a **per-device read** keyed by node id, returning the same readings plus temperature (nullable), heartbeat age, the pairing-time probed specs, the services-on-this-device join (each with monitoring's chip), and — for the *last-known* state — monitoring's silence verdict and the reference P5-S1x opens on. - The control-plane handler stays a **thin projection over the owners** (fleet store × monitoring), re-deriving nothing, mapping faults to the shared Problem body, exactly as the existing Fleet route does. - Wire stays snake_case, camelised at the client boundary (standards:wire-snake-case #126); the OpenAPI spec is the contract and the generated client is the transport (ADR 0037) — no hand-rolled fetch. - **Telemetry state is computed in monitoring, once.** The classifier owns: the *stale* bar (age > 2× cadence), the *last-known* projection (it already owns silence classification, DDR 0071), *none* (no sample ever), and *unavailable* (the collector faulted for an online node). The dashboard receives a named state and renders it. This is the single decision that makes stories 17, 20, 24, 27 and 31 checkable rather than a matter of front-end discipline. - **A telemetry fault is reported inside the payload, not as a failed read.** For an online device whose collector faults, the per-device read returns `state: unavailable` with the other facts populated — so the drill-in renders story 28's partial state. A transport-level failure of the read itself falls to the shared async guard's rendered error state, as `FleetSurface` already does. The two are deliberately different mechanisms for two different failures. ### Surface - **P9-S1 mounts inside the Fleet surface**, alongside the existing in-place drill-ins (P4-S1 assess, device-add, the DF2 codes ledger) — the same `← Fleet` back control and the same "close and re-read" behaviour the setup drill-in already has. No router change, no new tab, no modal. - **Shell composes and computes nothing** (ADR 0097): it renders monitoring's chips, grades and states verbatim. The one thing shell "computes" remains the never-empty framing of row one. - **Client pattern is the house one:** injected client + the shared async guard + explicit Refresh + the mount registry's supplied `refreshMs` (30 s), timer cleared on unmount. Rejected with the prototype: Pinia stores and a component-invented `setInterval`. - **Every P9 frame's `data-field` / `data-action` / `data-status` attributes are the built contract**, carried verbatim from the wireframes so `design-verify` can check the shipped UI against them. ### The kit - **Three new primitives and one constants module**, specified in DDR 0202 §"The shared telemetry kit primitives" and restated as acceptance criteria in stories 33–36. Proposed names: `OcGaugeRing`, `OcResourceBar`, `OcStatusDot`, and a `statusGrades` module. All visuals express as `--oc-*` tokens (ADR 0122); the prototype contributes only two mechanics — the `r=15.9` dasharray-as-percentage donut and the graded bar. - **The no-red rule is encoded in the grade map, not in each component.** `bad` differs from `warn` by emphasis and copy, never by hue. ### Collection - **Readings ride the existing report path** — an additive, nullable block on the enrolled node's periodic status report, landing through the authenticated ingest that already refuses strangers. No new agent binary, no new port, no new ingest surface. - **Latest sample only.** Monitoring stores the most recent reading per node with its timestamp; there is no series, because there is no history surface in v1 (see Out of Scope). - **Not adopted from the prototype:** the `short`-name keyspace, hand-fed env topology, container chips as the service model, Pinia, naive polling, and IP-visibility gating. ## Testing Decisions A good test states externally-observable behaviour at a seam and never reaches into implementation detail. Four seams, **all pre-existing** — this spec adds no new seam class: 1. **The dashboard component seam (the primary one).** `FleetSurface` / the new device-detail screen driven against the hand-written fake of the grown Fleet seam, asserting on the wireframes' `data-field` / `data-action` / `data-status` contract. This is where every object-state is proven: reporting, stale, last-known, none, unavailable, plus the DF columns, the `—` honesty rule, the no-stale-green rule, the routing of each action to its owning feature, and back-closes-and-re-reads. Prior art: `fleet.test.ts`, `monitoringDrillIn.test.ts`, `monitoringSilence.test.ts`, `surfaceFaultFrame.test.ts`; the fake grows from the existing Fleet fake so its default fleet stays the wireframes' fleet. 2. **The transport seam.** The Fleet endpoint's integration test grown for the new fields and the per-device route: the aggregating read returns readings and state, a gateway-alone fleet still serialises structurally, a node with no readings serialises null (never `0`), an owner read that faults maps to the shared Problem body, and the generated client camelises the new fields. Prior art: `fleet_integration_test.go` and `fleetLive.test.ts`. 3. **The monitoring seam.** The classifier's unit tests for the telemetry state machine: a fresh sample is *reporting*; a sample older than 2× cadence is *stale*; a silent node projects *last-known* carrying the existing silence verdict; a never-reported node is *none*; a collector fault on a live node is *unavailable*; an unenrolled reporter is refused and nothing lands; a partial sample keeps its present readings. Prior art: `monitor_test.go`, `silence_test.go`, `authenticated_stream_test.go`. 4. **The kit seam.** The primitives' own unit tests: the dasharray-as-percentage geometry, `null → —` (never `0`), the stale mute overriding the grade, the tabular-nums readout, the muted (non-fault) off dot, the threshold boundaries at exactly 60 and 80, and a **rendered-CSS assertion that no red/destructive token is emitted** by any grade. Prior art: `ocPrimitives.test.ts`, `baseLayer.test.ts`, `themingContract.test.ts`. Two cross-cutting checks ride existing harnesses rather than new ones: the theming contract tests (every new visual is an `--oc-*` token, ADR 0122) and the callout-vocabulary test (the *bad* grade is named in copy, not carried by colour alone). ## Out of Scope - **History charts / time series.** The surface is now-focused; P5-S3 keeps the last-24h strip for services. A metrics-history slice is a later arc, and no series is stored by this one. - **Per-process or per-service resource breakdown.** Readings are per-device; anything finer belongs to logs and monitoring. - **Threshold editing.** The grading constants and the staleness bar are system-defined; there is no operator knob. - **Temperature grading or alerting.** Shown as a plain fact only — there is no honest cross-hardware threshold to grade against in v1. - **The logs surface itself.** P9 emits `open-logs` / `download-logs` scoped to the device; building the surface that receives them is DDR 0203 / #760. - **The other observability siblings' surfaces** — network (#761), replication matrix (#762), activity feed (#763), topology map (#764, deferred). They consume this spec's primitives and constants; none is built here. - **A member-facing tier.** The panel is operators-only behind the community door (DDR 0172); P9 inherits that whole. - **Any act that changes a device.** Assess, role, services, storage and remediation all stay provisioning's (ADR 0063); this surface only hands off. - **New alert behaviour.** Whether resource pressure raises an alert (and at what severity) rides monitoring's existing rules against the shared constants; designing new alert copy or ladders is not this spec's. ## Further Notes ### Vertical slices (named for the fan-in `/slice-map`) 1. **`ui-kit:telemetry-primitives`** — `OcGaugeRing`, `OcResourceBar`, `OcStatusDot`, the status-grading constants module. No dependencies; the whole observability arc depends on it, so it wants to be an early root. 2. **`monitor:node-readings`** — the additive readings on the node report, the latest-sample store, and the telemetry state classifier. Depends on nothing new. 3. **`transport:fleet-telemetry`** — the Fleet aggregating read grows per-node readings and state (OpenAPI + handler + generated client). Depends on 2. 4. **`shell:fleet-telemetry-columns`** — DF's three columns and the device-name look-at affordance. Depends on 1 and 3. 5. **`transport:device-telemetry-detail`** — the per-device read on the same seam (temperature, heartbeat, probed specs, services join, silence verdict). Depends on 2. 6. **`shell:device-detail-drill-in`** — P9-S1 / S1x / S2 / S3 / S3x mounted in place on Fleet. Depends on 1, 4 and 5. Cross-arc note for the fan-in: slice 1 is a **shared root for #760–#763**, and slice 2 is where a resource-pressure alert (if monitoring ever raises one) would read the same constants. The activity feed (#763) and logs (#760) also consume `OcStatusDot`. ### The DDR's two open gates (veto-open, not blocking) DDR 0202 is `accepted` with two decisions held open for Ben under the ADR 0174 posture — each has a **proposed default that this spec is written against**, and the veto is asynchronous: - **G1 — DF wears three telemetry columns** (default: yes; CPU / MEM / DISK, temperature excluded, `—` for non-reporting rows). This is the density of the panel's most-seen resting surface — a taste call on a signed frame. A veto retires stories 1, 3, 4 and 6 and leaves the drill-in whole. - **G2 — the device name is the look-at affordance** (default: name-as-link opening P9-S1 in place; change/chip untouched). A veto swaps story 5's affordance for a per-row *view* action; everything downstream works identically. Neither gate changes a seam, a state, a threshold or a primitive — which is why the rest of the spec can be sliced without waiting on them. ### Implementation-time notes - The **canonical DF frame** (`docs/ux/wireframes/shell/shell-df-fleet.html`) gains its `✎` telemetry-columns note in the commit that implements slice 4, per the ADR 0042 discipline; `p9-df-fleet-telemetry-columns.html` is the amendment depiction, not a second canonical frame. - The prototype (`matou-distributed-servers`, `roles/admin_dashboard/`) is a **reference for widget mechanics only**. Its styling is a drifted fork of the same Mātou visual language; nothing visual transfers. - `CONTEXT.md`'s *Telemetry* entry rules the copy: say **readings** or **telemetry**, never *metrics*, *vitals*, *stats* or *resource usage* as a noun; never "offline" for stale readings, "down" for a silent device, "0%" for an absent reading, or "live" for a last-known record. --- *Produced by `/to-spec` in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #759.*
Owner

Closed in the 2026-08-27 other-state sweep (Ben's ruling) — child spec complete: all 14 derived tickets closed (#770, #797–#804, #816, #831).

Closed in the 2026-08-27 `other`-state sweep (Ben's ruling) — child spec complete: all 14 derived tickets closed (#770, #797–#804, #816, #831).
ben closed this issue 2026-08-27 04:44:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#769
No description provided.