86e269fa91
Two fixes, one found by making the other. 1. HEBBIAN WRITE-BACK. This daemon learned 1,198 associations in 23h48m and kept none of them: it syncs FROM the engram server and never pushes, and mem_save() is unreachable in HTTP mode by design (soul.el only sets soul_snapshot_path inside `is_genesis && safe_to_seed`, false whenever ENGRAM_URL is set, because the server owns persistence). So the one process that runs idle cognition -- where essentially all co-activation happens -- was the one process that could not remember what it learned. hebb_consolidate() now drains the runtime's write-back queue on every heartbeat and POSTs it as ONE batch to /api/edges/batch. One request, one durable write, not one 60MB snapshot per edge. Also drains on clean shutdown, so an exit between beats doesn't take the last 8 minutes of learning with it. _auth is required and its absence is silent: check_auth_ok exempts GET and /api/neuron/state-events (which is why ise_post works keyless) but gates every other mutation on "_auth" in the BODY -- http_serve surfaces no headers, so there is no Bearer path. An unauthorized reply is NON-EMPTY, so the obvious `if resp == "" return 0` check would have reported delivery of edges that were refused, after the drain had already destroyed them. Caught before it shipped. Gauges hebb_wb_pending/_drained/_dropped/_sent go into the heartbeat so a consolidation path that stops delivering is visible in the stream. 2. A READ ROUTE MUST NEVER WRITE THE CANONICAL SNAPSHOT. GET /api/graph/edges serialized this process's graph straight over $HOME/.neuron/engram/snapshot.json -- the engram SERVER's durable store -- and read the edges back out of it. I triggered it myself this morning fetching edges for the census above: snapshot.json went from the server's 41,213 edges to the soul's 42,431, and the next engram restart loaded the soul's graph as canonical. It happened to be a superset (Knowledge 1198->1218, Memory 1238->1242, no durable type down), so nothing was lost. That was luck. Had the soul been running a partial load -- the exact failure soul.el's safe_to_seed guard exists to catch -- one GET would have destroyed the store, with no write-side guard able to see it coming. The engram server fixed this same class of bug on 2026-07-21 by routing exports to a dotted sidecar; the soul kept the original pattern. Same fix: exports go to .soul-edges-export.json. Also stops a 60MB serialize-and-reread per GET. Verified: boot 26 loaded 42,432 edges with hebb_max 0.4941 carried across the restart -- the first time this daemon has ever started knowing what it learned.
43 lines
2.5 KiB
Plaintext
43 lines
2.5 KiB
Plaintext
// auto-generated by elc --emit-header — do not edit
|
|
extern fn is_protected_node(id: String) -> Bool
|
|
extern fn api_err_protected(id: String) -> String
|
|
extern fn api_json_escape(s: String) -> String
|
|
extern fn api_query_param(path: String, key: String) -> String
|
|
extern fn api_query_int(path: String, key: String, default_val: Int) -> Int
|
|
extern fn api_ok(extra: String) -> String
|
|
extern fn api_err(msg: String) -> String
|
|
extern fn api_nonempty(s: String) -> Bool
|
|
extern fn api_or_empty(s: String) -> String
|
|
extern fn api_persisted(id: String) -> Bool
|
|
extern fn api_not_persisted(id: String) -> String
|
|
extern fn tombstone_node(id: String) -> String
|
|
extern fn tombstoned_id_set() -> String
|
|
extern fn memory_hide_tombstoned(raw: String, path: String) -> String
|
|
extern fn handle_api_begin_session(body: String) -> String
|
|
extern fn handle_api_compile_ctx(body: String) -> String
|
|
extern fn handle_api_remember(body: String) -> String
|
|
extern fn handle_api_node_create(body: String) -> String
|
|
extern fn handle_api_node_delete(body: String) -> String
|
|
extern fn handle_api_node_update(body: String) -> String
|
|
extern fn handle_api_recall(method: String, path: String, body: String) -> String
|
|
extern fn handle_api_search_knowledge(method: String, path: String, body: String) -> String
|
|
extern fn handle_api_browse_knowledge(path: String, body: String) -> String
|
|
extern fn handle_api_capture_knowledge(body: String) -> String
|
|
extern fn handle_api_evolve_knowledge(body: String) -> String
|
|
extern fn handle_api_promote_knowledge(body: String) -> String
|
|
extern fn handle_api_browse_processes(method: String, path: String, body: String) -> String
|
|
extern fn handle_api_define_process(body: String) -> String
|
|
extern fn handle_api_log_state_event(body: String) -> String
|
|
extern fn handle_api_list_state_events(method: String, path: String, body: String) -> String
|
|
extern fn handle_api_inspect_config(path: String, body: String) -> String
|
|
extern fn handle_api_tune_config(body: String) -> String
|
|
extern fn handle_api_inspect_graph(method: String, path: String, body: String) -> String
|
|
extern fn handle_api_link_entities(body: String) -> String
|
|
extern fn handle_api_forget(body: String) -> String
|
|
extern fn handle_api_evolve_memory(body: String) -> String
|
|
extern fn handle_api_memory_delete(body: String) -> String
|
|
extern fn handle_api_memory_update(body: String) -> String
|
|
extern fn handle_api_cultivate(body: String) -> String
|
|
extern fn handle_api_list_typed(node_type: String, path: String, body: String) -> String
|
|
extern fn handle_api_consolidate(body: String) -> String
|