A compact health indicator in the lg+ topbar reflecting the OVERALL health of
the Hanzo cloud, pulled from the brand's Gatus status page (status.hanzo.ai).
How it pulls status: the badge fetches a same-origin /system-status BFF route
(app/system-status/route.ts) which server-side fetches
status.<brand>/api/v1/endpoints/statuses and returns a small JSON summary. This
sidesteps the status API's missing CORS header (a browser fetch cross-origin is
blocked) and matches the console's established BFF pattern — the badge renders
NATIVELY from the JSON summary (no iframe, no third-party script).
- src/lib/status/summary.ts — PURE summarizeStatuses(): collapses the Gatus feed
to { overall, total, up, down[] }; defensive (garbage → 'unknown', never throws).
- src/lib/status/summary.test.ts — vitest: operational/degraded/down/unknown +
last-result-wins + garbage input (7 tests).
- app/system-status/route.ts — GET BFF; bounded fetchWithTimeout(4s); fail-soft
→ overall:'unknown' at HTTP 200 (never 500); Cache-Control max-age=30.
- src/config/index.ts — per-brand statusUrl (status.<brand-domain>) +
NEXT_PUBLIC_STATUS_URL override, mirroring docsUrl.
- src/components/ui/SystemStatusBadge.tsx — compact dot+label pill (theme-aware
$green10/$yellow10/$red10 tokens), a Popover status panel listing any down
components + a "View full status" link; polls 60s, pauses when tab hidden,
non-blocking ("Checking…" until first response).
- src/components/DashboardShell.tsx — mounts <SystemStatusBadge/> as the first
topbar control.
Verification: vitest src/lib/status 7/7 green; tsc --noEmit clean for all changed
files (the only tsc errors in the tree are pre-existing @hanzo/usage module
resolution in unrelated ai-accounts/* files — a dep present in package.json but
not in this worktree's reused node_modules; my files import none of it). Not
deployed; no package.json version bump (release agent owns that).