Skip to content

The console colours each load gauge over its own thresholds #580

Closed

Description

@V3RON

Why

#569 gives the Load panel's CPU, memory and disk figures each a bar, and only the memory gauge takes a colour — from the worker's own pressure word. CPU and disk stay grey whatever they show: a machine at 97% busy across twelve cores looked no different from one idling at 5%, and the operator cannot scan a worker's page and spot an overloaded host at a glance, which is the point of the bars.

The worker sends no threshold for CPU or disk (busyPercent, cores, totalBytes, availableBytes, freeBytes, limited — no level), and teaching it one is a wire change with its own protocol bump (ADR 0013, #567 is the precedent). This task does not do that. The console holds its own opinion instead, in one file, and says whose it is.

In short

ui/src/load-thresholds.ts owns the numbers and the comparison. LOAD_THRESHOLDS = { warnPercent: 85, errorPercent: 95 }; levelOf(percent) answers a tone: error at or over 95, warn at or over 85, idle below, idle for a figure the reading does not carry. No earlier readings, no hold, no state carried between renders — the verdict is the current reading's, by decision, not by oversight: a hold needs history, history lives with the sampler in the daemon, and a page reload would otherwise change the verdict. The trade is accepted: a build spike colours the CPU bar for one 15-second cycle.

  • CPU and disk take levelOf of their gauge's percent.
  • Memory takes the worker's pressure word where it sends one (normal/warn/critical → ok/warn/error) — the worker's judgement of the same fact outranks ours — and falls back to levelOf where it sends none, which is every Linux worker.
  • The colour is the bar's alone: the figures stay numbers, the card's one-line summary does not colour, and simlock status reports the same figures with no verdict. CONSOLE.md and DESIGN.md say the rule and say it is the console's.

Done when

  • Unit (ui/src/load-thresholds.test.ts, ui/src/views/worker-detail.test.tsx): each threshold at and just below its value; order and bounds of the two numbers; undefined → idle; the detail colours CPU and disk by the table across both edges; memory falls back at 97% and stays neutral at 6%; the pressure word wins at 50%.
  • Lane (e2e/console/workers.spec.ts): the colour test answers the page's own read of /v1/workers with the memory figures and the word set per case, and expects the same colour on a CI machine of any free-memory level — including the case where the word and the threshold disagree. Both themes.
  • docs/CONSOLE.md names the numbers and says where memory's word wins; docs/internal/DESIGN.md bounds the one place in the console where a colour says what no word does to the gauge.
  • pnpm test:console --project=chromium green.

Out of scope

  • A wire or protocol change: the daemon sending a level, or thresholds reaching the worker view.
  • queueDepth, load history, graphs.
  • A CPU or disk threshold in the daemon (what this would grow into if the console's opinion earns its keep; the CLI verdicts and the agent surfaces need the daemon-side number, which the UI constants cannot give them — see the parent thread).

Activity

  1. added
    task:draftScope written; technical spec or its spec check missing.
    on Oct 15, 2026
  2. added 4 commits that reference this issue on Oct 15, 2026
    99fa39d
    276fdd4
    a4dbbff
    6e553d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    task:draftScope written; technical spec or its spec check missing.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions