feat(tui-go): health-checks pane

Surface the health subsystem (llama/event-store/disk probes) in the TUI,
mirroring the session-stats pane: ClientMessage.GetHealthChecks ->
ServerMessage.HealthChecks (health.checks, reuses HealthReport) ->
StreamQueries.healthChecks via HealthInspectionService; Go OverlayHealth on
key H + palette 'health checks', pull-based fetch, per-subject status with
degraded loud. Empty/disabled -> visible fallback (no blank/lie). Go+Kotlin
golden tests pin the wire contract field-for-field. Observability spec §4/§3.
This commit is contained in:
2026-06-14 18:57:51 +04:00
parent 09f05549a0
commit fd67a6c68d
13 changed files with 285 additions and 3 deletions
+41
View File
@@ -152,6 +152,14 @@ func PreviewFrame(kind string, w, h int) string {
m.overlay = OverlayStats
m.statsFor = "04a546aa"
m.stats = sampleStats()
case "health":
m.connected = true
m.currentModel = "llama-cpp:default"
m.sessions = sampleSessions()
m.selectedID = "04a546aa"
m.overlay = OverlayHealth
m.health = sampleHealth()
}
return m.View()
}
@@ -193,6 +201,39 @@ func sampleStats() *protocol.StatsDto {
}
}
func sampleHealth() *protocol.HealthDto {
return &protocol.HealthDto{
Overall: "DEGRADED",
Subjects: []protocol.HealthSubjectDto{
{
Subject: "DISK",
Status: "DEGRADED",
Metric: "free_bytes",
ObservedValue: 512_000_000,
Detail: "disk free below 1 GB threshold",
Since: "2026-06-14T10:00:00Z",
},
{
Subject: "EVENT_STORE",
Status: "HEALTHY",
Metric: "write_latency_ms",
ObservedValue: 4,
Detail: "ok",
Since: "2026-06-14T09:00:00Z",
},
{
Subject: "LLAMA_SERVER",
Status: "HEALTHY",
Metric: "http_status",
ObservedValue: 200,
Detail: "ok",
Since: "2026-06-14T08:30:00Z",
},
},
CheckedAt: "2026-06-14T10:05:00Z",
}
}
func sampleWorkflows() []Workflow {
return []Workflow{
{ID: "healthcheck", Description: "ping endpoints and report status"},