Health badge

The badge in the top-right corner of every TUI screen is a 60-second snapshot of your project’s error rate.

Reading it

The badge format is:

<status>  err <%>  <trend>
StatusColorGlyphMeaning
idlegray·No logs in the last 20 minutes
healthygreenError rate < 5%
warningyellowError rate 5%–20%
criticalredError rate ≥ 20%

Trend arrow compares the current 20-minute window to the previous 20-minute window:

ArrowMeaning
Error rate is rising (red)
Error rate is falling (green)
Flat — change within 0.5pp (gray)

Examples:

  • ✓ healthy err 3% → — calm, stable
  • ⚠ warning err 8% ↑ — rate climbing, attention worth your while
  • ✗ critical err 25% ↑ — something is broken right now
  • · idle — quiet project (or no logs ingested yet)

What it polls

Every 60 seconds, the TUI hits:

GET /api/logs/<projectId>/health-trend?from=<20m-ago>&to=<now>

The backend returns two error ratios (current, previous) plus log counts (totalCurrent, totalPrevious). The TUI derives the status and trend client-side. Loading state shows · health; if the request fails, you’ll see health ?.

Tuning

The thresholds are intentionally fixed for now (5% / 20%) — most projects fall into clear bands at those cutoffs. If your project lives at a different baseline (e.g. high info-to-error ratio normally), the badge will still tell you when things change relative to the previous window via the trend arrow.

A future version will likely make the threshold configurable from the project settings.

Where it isn’t

The badge intentionally doesn’t appear in dialog overlays (palette, help, wizards) — those take focus, and a polling indicator there would just steal attention.

See also

  • Alerting — get notified outside the terminal when error rate spikes
  • Embed widgets — public-facing status pages
// related

See also