soul loop-2: session events, conversation persistence, richer health + inbox

- soul.el: emit_session_start_event() logs structured InternalStateEvent on every boot; pre-serve snapshot saves boot-time graph mutations before any requests arrive
- routes.el: /health now returns boot count, node/edge counts, pulse; /api/sessions endpoint surfaces session-start history
- awareness.el: perceive() tries soul-inbox-pending then soul-inbox fallback, catches both tagging conventions
- chat.el: conv_history_persist/load provide cross-restart conversation continuity via engram
This commit is contained in:
2026-05-06 22:04:06 -05:00
parent 4fc0294a49
commit f2599919be
4 changed files with 111 additions and 3 deletions
+13 -1
View File
@@ -23,7 +23,19 @@ fn make_action(kind: String, payload: String) -> String {
}
fn perceive() -> String {
return engram_activate_json("soul-inbox-pending", 2)
// Try the primary inbox first
let from_pending: String = engram_activate_json("soul-inbox-pending", 2)
let pending_ok: Bool = !str_eq(from_pending, "") && !str_eq(from_pending, "[]")
if pending_ok {
return from_pending
}
// Fallback: broader inbox scan
let from_inbox: String = engram_activate_json("soul-inbox", 2)
let inbox_ok: Bool = !str_eq(from_inbox, "") && !str_eq(from_inbox, "[]")
if inbox_ok {
return from_inbox
}
return "[]"
}
fn attend(node_json: String) -> String {