self-review 2026-05-15: enrich heartbeat ISE with wm_active count

Heartbeat ISEs now include wm_active: number of nodes currently in
working memory. Makes ISEs observable enough to diagnose activation
health without a separate query.
This commit is contained in:
2026-05-15 08:37:42 -05:00
parent 0ef8883370
commit 1dbc68f012
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -43,7 +43,8 @@ fn emit_heartbeat() -> Void {
let ts: Int = time_now()
let nc: Int = engram_node_count()
let ec: Int = engram_edge_count()
let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"boot\":" + boot + ",\"idle\":" + idle + ",\"node_count\":" + int_to_str(nc) + ",\"edge_count\":" + int_to_str(ec) + ",\"ts\":" + int_to_str(ts) + "}"
let wmc: Int = engram_wm_count()
let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"boot\":" + boot + ",\"idle\":" + idle + ",\"node_count\":" + int_to_str(nc) + ",\"edge_count\":" + int_to_str(ec) + ",\"wm_active\":" + int_to_str(wmc) + ",\"ts\":" + int_to_str(ts) + "}"
ise_post(payload)
}
+5 -1
View File
@@ -76,8 +76,12 @@ el_val_t ise_post(el_val_t content) {
el_val_t emit_heartbeat(void) {
el_val_t pulse = state_get(EL_STR("soul.pulse"));
el_val_t boot = state_get(EL_STR("soul_boot_count"));
el_val_t idle = int_to_str(idle_count());
el_val_t ts = time_now();
el_val_t payload = el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(EL_STR("{\"event\":\"heartbeat\",\"pulse\":"), pulse), EL_STR(",\"boot\":")), boot), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}"));
el_val_t nc = engram_node_count();
el_val_t ec = engram_edge_count();
el_val_t wmc = engram_wm_count();
el_val_t payload = el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(EL_STR("{\"event\":\"heartbeat\",\"pulse\":"), pulse), EL_STR(",\"boot\":")), boot), EL_STR(",\"idle\":")), idle), EL_STR(",\"node_count\":")), int_to_str(nc)), EL_STR(",\"edge_count\":")), int_to_str(ec)), EL_STR(",\"wm_active\":")), int_to_str(wmc)), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}"));
ise_post(payload);
return 0;
}