promote stage -> main: reconciled el runtime (engram search + natives + durable truncation fix + Windows port) #82
Reference in New Issue
Block a user
Delete Branch "stage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Promotes the reconciled el cluster to main. Once merged, el main carries: #66 tokenized/ranked engram search + natives (engram_prune_telemetry etc.), #79 durable HTTP truncation fix (both runtimes), and the v1.0.0 release-runtime Windows port + header completion. This is the reconciled runtime the desktop soul cross-compiles against — no more skew, no franken-runtime.
Validated: native soul-contract gate A/B/C PASS (988 POST 218B + GET 208B, complete JSON); Windows exe-execution gate PASS on windows-latest (real neuron.exe serves untruncated 988 JSON); both runtimes gcc -fsyntax-only clean.
Supersedes/absorbs #65 #66 #67 #68 #69 #79 (#78 already closed).
1. engram_neighbors_json (release runtime): BFS frontier/visited strings were el_strdup'd (arena-tracked) but manually freed, so el_request_end() double-freed every one — SIGABRT in http_worker under load (2 prod crashes today via /api/neuron/session/begin and /api/neuron/graph; reproduced and verified fixed with ASAN). Introduced when porting from the dev runtime, which correctly uses plain strdup. Third instance of the arena-vs-manual-free class (after EngramNode 07-15 and idmap keys 07-16). 2. server.el: let-in-if scoping sweep — defaults assigned inside if-blocks never mutated the outer binding, so /api/search and /api/activate always ran with q="", created nodes got node_type=""/salience=0.0, edges got relation=""/weight=0.0, and save/load with no path hit engram_save(""). Rewritten to the let-if-else expression form. /api/activate now also rejects empty queries instead of wiping carried WM weights. 3. engram_activate: retrieval reinforcement (ACT-R base-level learning) — nodes promoted to WM that survive both capacity caps now get last_activated/activation_count updated, so frequently retrieved memories decay slower than abandoned ones. Scoped to promoted-only to avoid flattening dampening across BFS fan-out.