observability: ui-kit-telemetry-primitives — OcGaugeRing, OcResourceBar, OcStatusDot and the one statusGrades module #799

Closed
opened 2026-08-25 10:58:02 +00:00 by matou-build-agent · 2 comments

Parent

Feature spec: #769 — control-panel observability child spec: device telemetry (P9) (DDR 0202).
Design ticket #759; slice-map fan-in #770; wayfinder map #7.
Slice ui-kit-telemetry-primitives of docs/slices/observability.yaml; covers spec #769 stories 33–37.

What to build

The arc's shared root: three kit primitives and one status-grading constants module,
minted once so five observability surfaces cannot drift into five definitions of "high".
OcGaugeRing is the r=15.9 dasharray-as-percentage donut at 64px (a null percentage renders
—, never 0; a stale state mutes the stroke over whatever the percentage would otherwise
grade). OcResourceBar is the 48×7 track with a tabular-nums readout that bolds on bad.
OcStatusDot has three tones and its off state is muted, not a fault — presence and urgency
stay different ideas. The statusGrades module holds RESOURCE_WARN_PCT 60,
RESOURCE_BAD_PCT 80, CERT_WARN_DAYS 30, CERT_BAD_DAYS 14 and the grade→token map, and
the no-red rule is encoded there once: both warn and bad paint from
--oc-status-warning, with bad told apart by emphasis and copy, never by a third hue.

Consumed downstream by ui-kit-logs-screen (#791, OcStatusDot) and dashboard-network-surface
(#792, OcStatusDot + the cert-day constants). Not consumed by #793 or #796 — both specs
refuse it in their own words, so no edge is drawn to them (slice-map ruling 1).

Acceptance criteria

  • (story 33) Given OcGaugeRing with { pct, label, state }, when it renders, then it is 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.
  • (story 33) Given pct: null, then the ring renders — over a bare track — never 0; and 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 grade.
  • (story 33) Given product type scale, then the default ring is 64px with a value ≥0.8rem and a label ≥0.75rem.
  • (story 34) 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 in font-variant-numeric: tabular-nums; a bad grade additionally bolds the readout in the warning ink; and pct: null renders — alone.
  • (story 35) Given OcStatusDot with { tone: 'healthy' | 'warning' | 'muted' }, then it renders a 9px round dot in --oc-status-healthy / --oc-status-warning / --oc-ink-soft at reduced opacity; and given an absent or off subject, then the muted tone is used — deliberately not a fault colour.
  • (story 36) Given the statusGrades 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, with ok → --oc-status-healthy and both warn and bad → --oc-status-warning.
  • (story 36) Given the whole kit build, then no destructive/red token is emitted by any grade — asserted against the rendered CSS, not by review.
  • (story 4/33) Given readings at exactly 60 and exactly 80, then they grade warn and bad respectively — the boundaries are asserted.

Blocked by

  • shell:ui-kit-mount-slot-contract (#29 — done, satisfied)

Task manifest

task: observability:ui-kit-telemetry-primitives
interface: kit exports `OcGaugeRing({ pct, label, state })`, `OcResourceBar({ pct })`, `OcStatusDot({
  tone })` and a `statusGrades` constants module (`RESOURCE_WARN_PCT` 60, `RESOURCE_BAD_PCT` 80, `CERT_WARN_DAYS`
  30, `CERT_BAD_DAYS` 14, grade→token map) — the single source every observability surface reads
seam: 'kit unit tests (prior art `ocPrimitives.test.ts`, `baseLayer.test.ts`, `themingContract.test.ts`):
  dasharray-as-percentage geometry, `null → —` never `0`, the stale mute overriding the grade, the tabular-nums
  readout, the muted (non-fault) off dot, the 60/80 boundaries, and a rendered-CSS assertion that no red/destructive
  token is emitted by any grade'
acceptance:
- given: '`OcGaugeRing` with `pct: null`'
  when: it renders
  then: it shows `—` over a bare track, never `0`
- given: a reading of exactly 60 and one of exactly 80
  when: the grade map is applied
  then: they grade `warn` and `bad`, both painting from `--oc-status-warning`
- given: '`state: ''stale''` on an 83% ring'
  when: it renders
  then: the stroke mutes to `--oc-line` and no bad emphasis is carried
- given: '`OcStatusDot` with an absent subject'
  when: it renders
  then: the muted tone is used, not a fault colour
- given: the whole kit build
  when: the rendered CSS is asserted
  then: no red/destructive token is emitted by any grade
depends_on:
- shell:ui-kit-mount-slot-contract
out_of_scope:
- any consuming surface — DF's columns, the P9 drill-in, the logs screen, the network surface are their
  own slices
- a new grade tier — a sibling needing one amends DDR 0202 rather than minting beside it
- resource-pressure alert behaviour (#769 puts new alert behaviour out of scope; monitoring would read
  these same constants the day one is specced)
- 'any use by #793 or #796 — both specs refuse these primitives (ruling 1); drawing that edge is the false
  root the fan-in rejected'
- the dark-mode re-point of any token (rides the dark-mode slice, ADR 0122)
needs_human_decision: []

Emitted by /to-tickets over docs/slices/observability.yaml in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.

## Parent Feature spec: **#769** — control-panel observability child spec: device telemetry (P9) (DDR 0202). Design ticket #759; slice-map fan-in **#770**; wayfinder map #7. Slice `ui-kit-telemetry-primitives` of `docs/slices/observability.yaml`; covers spec #769 stories 33–37. ## What to build The arc's shared root: three kit primitives and one status-grading constants module, minted once so five observability surfaces cannot drift into five definitions of "high". `OcGaugeRing` is the `r=15.9` dasharray-as-percentage donut at 64px (a `null` percentage renders `—`, never `0`; a `stale` state mutes the stroke over whatever the percentage would otherwise grade). `OcResourceBar` is the 48×7 track with a tabular-nums readout that bolds on *bad*. `OcStatusDot` has three tones and its off state is **muted, not a fault** — presence and urgency stay different ideas. The `statusGrades` module holds `RESOURCE_WARN_PCT` 60, `RESOURCE_BAD_PCT` 80, `CERT_WARN_DAYS` 30, `CERT_BAD_DAYS` 14 and the grade→token map, and **the no-red rule is encoded there once**: both `warn` and `bad` paint from `--oc-status-warning`, with *bad* told apart by emphasis and copy, never by a third hue. Consumed downstream by `ui-kit-logs-screen` (#791, `OcStatusDot`) and `dashboard-network-surface` (#792, `OcStatusDot` + the cert-day constants). **Not** consumed by #793 or #796 — both specs refuse it in their own words, so no edge is drawn to them (slice-map ruling 1). ## Acceptance criteria - [ ] (story 33) Given `OcGaugeRing` with `{ pct, label, state }`, when it renders, then it is 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. - [ ] (story 33) Given `pct: null`, then the ring renders `—` over a bare track — never `0`; and 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 grade. - [ ] (story 33) Given product type scale, then the default ring is 64px with a value ≥0.8rem and a label ≥0.75rem. - [ ] (story 34) 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 in `font-variant-numeric: tabular-nums`; a *bad* grade additionally bolds the readout in the warning ink; and `pct: null` renders `—` alone. - [ ] (story 35) Given `OcStatusDot` with `{ tone: 'healthy' | 'warning' | 'muted' }`, then it renders a 9px round dot in `--oc-status-healthy` / `--oc-status-warning` / `--oc-ink-soft` at reduced opacity; and given an absent or off subject, then the **muted** tone is used — deliberately not a fault colour. - [ ] (story 36) Given the `statusGrades` 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, with `ok → --oc-status-healthy` and **both** `warn` and `bad → --oc-status-warning`. - [ ] (story 36) Given the whole kit build, then no destructive/red token is emitted by any grade — asserted against the rendered CSS, not by review. - [ ] (story 4/33) Given readings at exactly 60 and exactly 80, then they grade `warn` and `bad` respectively — the boundaries are asserted. ## Blocked by - `shell:ui-kit-mount-slot-contract` (#29 — done, satisfied) ## Task manifest ```yaml task: observability:ui-kit-telemetry-primitives interface: kit exports `OcGaugeRing({ pct, label, state })`, `OcResourceBar({ pct })`, `OcStatusDot({ tone })` and a `statusGrades` constants module (`RESOURCE_WARN_PCT` 60, `RESOURCE_BAD_PCT` 80, `CERT_WARN_DAYS` 30, `CERT_BAD_DAYS` 14, grade→token map) — the single source every observability surface reads seam: 'kit unit tests (prior art `ocPrimitives.test.ts`, `baseLayer.test.ts`, `themingContract.test.ts`): dasharray-as-percentage geometry, `null → —` never `0`, the stale mute overriding the grade, the tabular-nums readout, the muted (non-fault) off dot, the 60/80 boundaries, and a rendered-CSS assertion that no red/destructive token is emitted by any grade' acceptance: - given: '`OcGaugeRing` with `pct: null`' when: it renders then: it shows `—` over a bare track, never `0` - given: a reading of exactly 60 and one of exactly 80 when: the grade map is applied then: they grade `warn` and `bad`, both painting from `--oc-status-warning` - given: '`state: ''stale''` on an 83% ring' when: it renders then: the stroke mutes to `--oc-line` and no bad emphasis is carried - given: '`OcStatusDot` with an absent subject' when: it renders then: the muted tone is used, not a fault colour - given: the whole kit build when: the rendered CSS is asserted then: no red/destructive token is emitted by any grade depends_on: - shell:ui-kit-mount-slot-contract out_of_scope: - any consuming surface — DF's columns, the P9 drill-in, the logs screen, the network surface are their own slices - a new grade tier — a sibling needing one amends DDR 0202 rather than minting beside it - resource-pressure alert behaviour (#769 puts new alert behaviour out of scope; monitoring would read these same constants the day one is specced) - 'any use by #793 or #796 — both specs refuse these primitives (ruling 1); drawing that edge is the false root the fan-in rejected' - the dark-mode re-point of any token (rides the dark-mode slice, ADR 0122) needs_human_decision: [] ``` --- *Emitted by `/to-tickets` over `docs/slices/observability.yaml` in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.*
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=10077
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10077 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #799 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 799,
  "status": "success",
  "commits": [
    "d773676f2bc586068557adf40c687ba0c7658e57"
  ],
  "changed_files": [
    "STATUS.md",
    "packages/ui-kit/package.json",
    "packages/ui-kit/src/index.ts",
    "packages/ui-kit/src/statusGrades.ts",
    "packages/ui-kit/src/components/OcGaugeRing.vue",
    "packages/ui-kit/src/components/OcResourceBar.vue",
    "packages/ui-kit/src/components/OcStatusDot.vue",
    "packages/ui-kit/tests/unit/ocTelemetryPrimitives.test.ts"
  ],
  "tests": [
    {
      "command": "npx vitest run (packages/ui-kit, 142 tests)",
      "exit_code": 0
    },
    {
      "command": "npm run build (vue-tsc -p tsconfig.json)",
      "exit_code": 0
    },
    {
      "command": "npx eslint packages/ui-kit",
      "exit_code": 0
    },
    {
      "command": "npx prettier --check (new files)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 33: OcGaugeRing renders SVG donut viewBox 0 0 36 36, r=15.9, stroke-width=4, stroke-linecap=round, rotated -90, stroke-dasharray '<pct> 100'": "OcGaugeRing.vue value circle; ocTelemetryPrimitives.test.ts 'renders an SVG donut whose dasharray reads directly as a percentage'",
    "story 33: pct null renders — over a bare track never 0; state stale mutes value stroke to --oc-line and value text to --oc-ink-soft regardless of grade": "OcGaugeRing.vue valueStroke/valueInk computed + v-if on value circle; tests 'pct: null renders — over a bare track, never 0' and 'state: stale mutes the stroke ... no bad emphasis'",
    "story 33: default ring 64px, value >=0.8rem, label >=0.75rem": "OcGaugeRing.vue svg width/height 64 + scoped font-size 0.8rem/0.75rem; test 'renders at product type scale'",
    "story 34: OcResourceBar 48x7 track on --oc-fill radius 4 filled from grade map, mono NN% tabular-nums >=0.8rem; bad bolds readout in warning ink; null renders — alone": "OcResourceBar.vue; tests 'renders a 48x7 track ... tabular-nums readout', 'fills from the grade map', 'a bad grade bolds the readout in the warning ink', 'pct: null renders — alone'",
    "story 35: OcStatusDot healthy/warning/muted at reduced opacity; absent/off subject uses muted (non-fault)": "OcStatusDot.vue tones + default tone muted; tests 'paints its three tones', 'an absent subject uses the muted tone by default'",
    "story 36: statusGrades exports RESOURCE_WARN_PCT 60, RESOURCE_BAD_PCT 80, CERT_WARN_DAYS 30, CERT_BAD_DAYS 14 and grade->token map (ok healthy, warn+bad warning)": "statusGrades.ts; test 'exports the resource and cert thresholds at their fixed values' + 'the grade->token map paints ok healthy and BOTH warn and bad from the warning tier'",
    "story 36: no destructive/red token emitted by any grade — asserted against rendered CSS": "statusGrades GRADE_TOKEN + primitives bind colour inline from it; tests 'no telemetry primitive names a destructive token or a hex colour in its styles' and 'every grade, rendered, resolves its colour to only healthy or the warning tier'",
    "story 4/33: readings at exactly 60 and 80 grade warn and bad — boundaries asserted": "gradeResource in statusGrades.ts; test 'resource: exactly 60 grades warn and exactly 80 grades bad'"
  },
  "summary": "Minted the observability arc's shared root — OcGaugeRing/OcResourceBar/OcStatusDot and the statusGrades constants module encoding the no-red rule once — with 19 seam tests green.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #799 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 799, "status": "success", "commits": [ "d773676f2bc586068557adf40c687ba0c7658e57" ], "changed_files": [ "STATUS.md", "packages/ui-kit/package.json", "packages/ui-kit/src/index.ts", "packages/ui-kit/src/statusGrades.ts", "packages/ui-kit/src/components/OcGaugeRing.vue", "packages/ui-kit/src/components/OcResourceBar.vue", "packages/ui-kit/src/components/OcStatusDot.vue", "packages/ui-kit/tests/unit/ocTelemetryPrimitives.test.ts" ], "tests": [ { "command": "npx vitest run (packages/ui-kit, 142 tests)", "exit_code": 0 }, { "command": "npm run build (vue-tsc -p tsconfig.json)", "exit_code": 0 }, { "command": "npx eslint packages/ui-kit", "exit_code": 0 }, { "command": "npx prettier --check (new files)", "exit_code": 0 } ], "criteria": { "story 33: OcGaugeRing renders SVG donut viewBox 0 0 36 36, r=15.9, stroke-width=4, stroke-linecap=round, rotated -90, stroke-dasharray '<pct> 100'": "OcGaugeRing.vue value circle; ocTelemetryPrimitives.test.ts 'renders an SVG donut whose dasharray reads directly as a percentage'", "story 33: pct null renders — over a bare track never 0; state stale mutes value stroke to --oc-line and value text to --oc-ink-soft regardless of grade": "OcGaugeRing.vue valueStroke/valueInk computed + v-if on value circle; tests 'pct: null renders — over a bare track, never 0' and 'state: stale mutes the stroke ... no bad emphasis'", "story 33: default ring 64px, value >=0.8rem, label >=0.75rem": "OcGaugeRing.vue svg width/height 64 + scoped font-size 0.8rem/0.75rem; test 'renders at product type scale'", "story 34: OcResourceBar 48x7 track on --oc-fill radius 4 filled from grade map, mono NN% tabular-nums >=0.8rem; bad bolds readout in warning ink; null renders — alone": "OcResourceBar.vue; tests 'renders a 48x7 track ... tabular-nums readout', 'fills from the grade map', 'a bad grade bolds the readout in the warning ink', 'pct: null renders — alone'", "story 35: OcStatusDot healthy/warning/muted at reduced opacity; absent/off subject uses muted (non-fault)": "OcStatusDot.vue tones + default tone muted; tests 'paints its three tones', 'an absent subject uses the muted tone by default'", "story 36: statusGrades exports RESOURCE_WARN_PCT 60, RESOURCE_BAD_PCT 80, CERT_WARN_DAYS 30, CERT_BAD_DAYS 14 and grade->token map (ok healthy, warn+bad warning)": "statusGrades.ts; test 'exports the resource and cert thresholds at their fixed values' + 'the grade->token map paints ok healthy and BOTH warn and bad from the warning tier'", "story 36: no destructive/red token emitted by any grade — asserted against rendered CSS": "statusGrades GRADE_TOKEN + primitives bind colour inline from it; tests 'no telemetry primitive names a destructive token or a hex colour in its styles' and 'every grade, rendered, resolves its colour to only healthy or the warning tier'", "story 4/33: readings at exactly 60 and 80 grade warn and bad — boundaries asserted": "gradeResource in statusGrades.ts; test 'resource: exactly 60 grades warn and exactly 80 grades bad'" }, "summary": "Minted the observability arc's shared root — OcGaugeRing/OcResourceBar/OcStatusDot and the statusGrades constants module encoding the no-red rule once — with 19 seam tests green.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#799
No description provided.