integrate: stack PRs #65–#69 (elc OOM guard, tokenized+semantic engram search, get_node_by_label, win portability) for green CI #71
Reference in New Issue
Block a user
Delete Branch "hotfix/stage-elc-engram-integration"
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?
Integration branch stacking the five open runtime/compiler PRs (#65–#69) onto
mainso they compile GREEN together through the real CI build, ahead of the held stage→main release.What this contains (dependency order)
hotfix/elc-fixes— parser: bound token reads to Eof (OOM guard).parser.elonly.fix/engram-lexical-tokenized-search— tokenized + ranked lexical search.el_runtime.c.hotfix/runtime-engram-get-node-by-label— addsengram_get_node_by_labelnative (+ .h/seed/codegen).hotfix/win-runtime-portability— Win32setsockoptcast +el_platform_win.hfsync shim.feat/engram-semantic-search— semantic layer (nomic-embed-text), cosine ∪ lexical.el_runtime.c merge
#65/#68/#69/#66 merged cleanly (distinct regions). #67 conflicted with #66 in
engram_search,engram_activate,engram_search_jsonand the post-istr_containshelper block. Resolved by hand to preserve #66's tokenized ranking AND layer #67's semantic union: a node is a hit if it covers ≥1 query token OR its cosine clears the threshold; lexical hits always outrank pure-semantic (token count ≥ 1 > cosine). Falls back byte-identically to tokenized-lexical when curl is absent or Ollama unreachable.Runtime pre-validated locally:
cc -c el_runtime.ccompiles clean both with and without-DHAVE_CURL.Scope note
Held: do NOT publish el-runtime-c/-h and do NOT release stage→main. This PR is validation-only (PR event does not trigger the push-guarded Artifact Registry publish). Do not merge until the release hold is lifted.
http_handler_fn / http_handler4_fn were defined only inside el_runtime.c, so soul modules (routes/chat/...) that reference them via cross-module forward declarations couldn't see the types — which broke the Windows link of every module. Moving the public function-pointer types to the shared header is the correct home and unblocks the build on all platforms (identical typedef, C11-safe redefinition in el_runtime.c). With this, the soul links into a native Windows neuron.exe (mingw, static) that boots and serves HTTP on :7770 — verified /health → 200 {"status":"alive",...} in a Win11 VM. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>deb0520)Lexical istr_contains alone can't surface a node whose words don't appear in the query. This adds an optional dense-vector layer: node content and the query are embedded through Ollama (nomic-embed-text), and nodes are ranked by cosine similarity unioned with lexical hits, so a paraphrase query reaches the right node. Wired into all three query entry points in el_runtime.c: - engram_search_json (HTTP /api/search): collect lexical ∪ semantic candidates, score (lexical base 1.0 + cosine; pure-semantic = cosine), rank, emit top-N. Stable sort preserves old order when semantic is off. - engram_search (internal el_val twin): lexical ∪ semantic union. - engram_activate seed loop (HTTP /api/activate): a node seeds if it lexically matches OR clears the cosine threshold; pure-semantic seeds enter scaled by cosine so paraphrase spreads without overpowering. Degradable by design: the whole layer is gated on HAVE_CURL plus a one-shot runtime probe. If curl is compiled out, Ollama is unreachable, or ENGRAM_SEMANTIC=0, every entry point yields zero semantic signal and callers fall back byte-for-byte to the pre-existing lexical search. Node embeddings are cached in process memory keyed by node id with an FNV-1a content hash for invalidation; the query is embedded once per call — so the graph is not re-embedded on every query. nomic task prefixes (search_query:/search_document:) are applied for retrieval separation. Build steps gain -DHAVE_CURL so the engram artifact compiles the layer in (-lcurl was already linked). Env: ENGRAM_SEMANTIC, ENGRAM_EMBED_URL, ENGRAM_EMBED_MODEL, ENGRAM_SEMANTIC_MIN (cosine threshold, default 0.6).