feat(awareness): enrich heartbeat ISE with graph stats and idle count

Heartbeat ISEs previously emitted only {event, pulse, boot, ts} —
sparse enough to be nearly useless for observability. Now they include
node_count, edge_count (from engram_node_count/edge_count builtins),
and the current idle cycle count. This gives each heartbeat a snapshot
of graph growth over time and rhythm health without adding any overhead.
This commit is contained in:
2026-05-14 11:06:03 -05:00
parent b163fa6b85
commit 0ef8883370
+4 -1
View File
@@ -39,8 +39,11 @@ fn ise_post(content: String) -> Void {
fn emit_heartbeat() -> Void {
let pulse: String = state_get("soul.pulse")
let boot: String = state_get("soul_boot_count")
let idle: String = int_to_str(idle_count())
let ts: Int = time_now()
let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"boot\":" + boot + ",\"ts\":" + int_to_str(ts) + "}"
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) + "}"
ise_post(payload)
}