feat(server): event-store health probe

Third HealthProbe (after disk + llama): times a cheap lastGlobalSequence()
read as an event-store responsiveness heartbeat — DEGRADED on throw or when
latency exceeds eventStoreLatencyWarnMs (default 500). Read-only by design
(no probe writes into the source-of-truth log; Invariant #1). Plugs into the
existing HealthMonitor; no new events. Observability spec §4.

Also wraps a long line in LlamaServerHealthProbeTest to clear a detekt
MaxLineLength finding introduced in aaf896d.
This commit is contained in:
2026-06-14 18:40:29 +04:00
parent 0957f7c69e
commit 7a1362c973
5 changed files with 214 additions and 1 deletions
@@ -29,6 +29,10 @@ data class CorrexConfig(
* timeout within this window is reported as DEGRADED (liveness). [llamaTpsWarnBelow] is the
* tokens/sec floor below which the probe reports degradation (KV-cache pressure, thermal throttle);
* 0.0 disables the degradation dimension (no baseline to compare against on a fresh install).
*
* [eventStoreLatencyWarnMs] is the read-latency threshold above which the event-store probe reports
* DEGRADED. A single cheap read (lastGlobalSequence) is timed each tick; a slow or throwing read
* signals contention or unavailability. 500 ms suits typical SQLite on a homelab SSD.
*/
@Serializable
data class HealthConfig(
@@ -38,6 +42,7 @@ data class HealthConfig(
val diskWarnGrowthBytesPerMin: Long = 50_000_000,
val llamaLivenessTimeoutMs: Long = 5_000,
val llamaTpsWarnBelow: Double = 0.0,
val eventStoreLatencyWarnMs: Long = 500,
)
/**