Capability 005: Health Indicators¶
Status: Accepted
Context¶
Before the Robot Operator commands the robot, they want to know whether the Superordinate
Controller runs and accepts commands. Today they learn it only from the outcome of a command in
the Event Log, or with curl on the command line.
Following the principle Safe when silent of the mission statement, silence must never pass for health: a Health Indicator shows green only while the Superordinate Controller answers that it is healthy.
References¶
/healthz/liveand/healthz/ready:remote_control_api.json, capability 002 of the Superordinate Controller; since its capability 004,/healthz/readyalso reflects the availability of the CAN Adapter- Base URL and response timeout: capability 003
- Status Pane: capability 002
- Target picture:
target_picture.md - Accessibility: directives in
user_experience.md
Details¶
Health Indicators¶
The Status Pane holds, above the Event Log, the heading Telemetry and one Health Indicator
per endpoint. Each shows a lamp and a text next to it. The Health Indicators stand side by side
and wrap onto the next line where the Status Pane is too narrow:
| Health Indicator | Endpoint | Green | Red | Grey |
|---|---|---|---|---|
Live |
/healthz/live |
running: 200 OK |
not responding: any other status, or no response within 2 s |
unknown: before the first outcome |
Ready |
/healthz/ready |
ready: 200 OK |
not ready: 503 or any other status, or no response within 2 s |
unknown: before the first outcome |
Timing¶
| Name | Value |
|---|---|
| Health Poll Interval | 5 s, the first poll when the page loads |
| Response timeout | 2 s, as for capability 003 |
Functional Requirements¶
- The Web App polls
/healthz/liveand/healthz/readyevery Health Poll Interval. - Each Health Indicator shows the outcome of the latest poll of its endpoint as given under Health Indicators.
Non-Functional Requirements¶
None.
Technical Requirements¶
- The lamp colors reach a contrast ratio of at least 3:1 against the background of the Status
Pane, as WCAG 2.1, success criterion 1.4.11, requires and
user_experience.mddemands.
Error Handling¶
- A poll without a response, or with an unexpected status, turns its Health Indicator red; the Web App never shows an earlier green outcome for it.
Out of Scope¶
- Entries in the Event Log for a change of health; the Event Log records the outcomes of commands
- The cause of
not ready;/healthz/readygives none - Pausing the polls while the page is hidden
Acceptance Criteria¶
All criteria except the last run against a mocked Remote Control API, with a mocked clock where time matters.
- Page loaded, both endpoints answer 200:
Liveshows greenrunning,Readyshows greenready. - Page loaded,
/healthz/readyanswers 503:Readyshows rednot ready,Livegreenrunning. - Page loaded, neither endpoint answers within 2 s:
Liveshows rednot responding,Readyrednot ready. - Page loaded, before the first answer: both show grey
unknown. /healthz/readyanswers 503, then 200:Readyturns greenreadyat the next poll, 5 s later.- The computed contrast ratio of each lamp color against the background of the Status Pane is at least 3:1.
- With the Superordinate Controller running on the notebook against
/dev/null: both show green; with the controller stopped, both turn red within 7 s (manual testtest/manual/remote_control_api.md).
Decisions¶
- The Web App polls; the Superordinate Controller does not push. The health endpoints exist already, and polling needs nothing new on the controller. Consequence: a change shows at most one Health Poll Interval plus the response timeout late.
- Each lamp carries a text. Color alone conveys no information to everyone (WCAG 2.1, success criterion 1.4.1). Consequence: the Health Indicator reads correctly without color, e.g. in a screenshot printed in black and white.
- No answer means red, not the last known state. A stale green would let silence pass for health. Consequence: a single lost poll turns a lamp red for one Health Poll Interval.