flux-keeper 0.1.0

Health monitoring, stuck detection, watchdog — the guardian of agent uptime
Documentation
  • Coverage
  • 0%
    0 out of 21 items documented0 out of 16 items with examples
  • Size
  • Source code size: 12.75 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 387.82 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 31s Average build duration of successful builds.
  • all releases: 31s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Lucineer/flux-keeper
    1 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • SuperInstance

flux-keeper 🏥

Health monitoring, stuck detection, and watchdog for agent fleets. Tracks vitals (energy, memory, task completion, response time) and triggers alerts, recovery, or apoptosis on failure cascades.

use flux_keeper::{Keeper, CheckStatus};

let mut kp = Keeper::new();
kp.add_check(1, "engine-temp", /* interval: */ 30, /* timeout: */ 60, /* max_failures: */ 3);

kp.report_ok(1, 1000);  // heartbeat received
kp.report_failure(1, 1010);  // first failure → Warning

let alerts = kp.tick(1100);  // periodic eval
println!("Alerts: {:?}", alerts);

Why Keeper?

Agents get sick. They OOM, deadlock, lose connectivity, or spin in loops. Keeper catches it before it cascades:

  • Configurable per-check — interval, timeout, failure threshold
  • Three status states — Ok → Warning → Critical (automatic escalation)
  • Timeout detection — if a check hasn't reported in timeout seconds, it fires
  • Consecutive failure limit — transient glitch ≠ death (3 failures = alert)
  • No deps — pure Rust, no runtime, fits in embedded

API

let mut kp = Keeper::new();

// Register a health check
kp.add_check(1, "engine-temp", 30, 60, 3);

// Report status
kp.report_ok(1, now);
kp.report_failure(1, now);  // increments consecutive_failures

// Periodic evaluation
let new_alerts: Vec<String> = kp.tick(now);

// Read alerts
for alert in kp.alerts() {
    eprintln!("KEEPER: {}", alert);
}

// Status query
println!("Running: {}", kp.running());
let status = kp.status(1);  // Option<&CheckStatus>

Alert Escalation

State Cue Action
Ok Heartbeat received Nothing
Warning 1-2 failures Log alert, continue
Critical ≥3 consecutive failures Apoptosis trigger

Cargo.toml

[dependencies]
flux-keeper = { git = "https://github.com/Lucineer/flux-keeper" }

Fleet Context

Part of the Lucineer/Cocapn fleet. Sister crate to flux-telepathy (alert routing) and flux-confidence (calibrated decision-making under uncertainty).