Separate heartbeat state and scheduler status

This commit is contained in:
Meta Vens 2026-07-13 17:03:35 +01:00
commit 22b343202f
6 changed files with 45 additions and 2 deletions

View file

@ -699,6 +699,11 @@ fn run_smoke(agent_store: &Path) -> Result<serde_json::Value> {
let validation_errors = validate_agent_memory_store(&temp_agent_store)?;
let status = heartbeat_status_projection(&store_path, &artifact_dir, 1.0, 8)?;
if status["status"] != "loaded" || status["schedulerStatus"] != "active" {
anyhow::bail!(
"heartbeat status must distinguish loaded state from active scheduler physiology"
);
}
let routine = run_void_routine_store(
&store_path,
&artifact_dir,

View file

@ -34,6 +34,7 @@ pub fn heartbeat_status_projection(
"schema_version": HEARTBEAT_STATUS_SCHEMA_VERSION,
"ok": true,
"status": "missing",
"schedulerStatus": "missing",
"stateFile": null,
"storeFile": store_path,
"cultCacheStore": cultcache_status(store_path),
@ -48,6 +49,19 @@ pub fn heartbeat_status_projection(
}));
};
let cognition = load_heartbeat_cognition_entry(store_path)?;
let scheduler_status = if state.participants.is_empty() {
"unconfigured"
} else if state.participants.iter().all(|participant| {
participant.status == "active"
&& participant
.pending_turn
.as_ref()
.is_none_or(|turn| turn.status == "running")
}) {
"active"
} else {
"attention"
};
let history: Vec<_> = state
.history
.iter()
@ -62,7 +76,8 @@ pub fn heartbeat_status_projection(
Ok(serde_json::json!({
"schema_version": HEARTBEAT_STATUS_SCHEMA_VERSION,
"ok": true,
"status": "ready",
"status": "loaded",
"schedulerStatus": scheduler_status,
"stateFile": null,
"storeFile": store_path,
"cultCacheStore": cultcache_status(store_path),