runtime: restore engram_recall_json + cgi_* accessors (unblocks the soul build) #126

Merged
will.anderson merged 1 commits from fix/elc-rebuildable-compiler-builtins into dev 2026-08-16 00:57:12 +00:00
Owner

neuron's soul calls engram_recall_json and cgi_principal; both existed in the runtime neuron vendored (v1.0.0-20260501) and were absent here, so the soul could not link against current el at all.

The trap this avoids. They look like redundant wrappers over one impl:

engram_search_json(q, limit) -> eg_search_json_impl(q, limit, 0)  LEXICAL
engram_recall_json(q, limit) -> eg_search_json_impl(q, limit, 1)  SEMANTIC

Not interchangeable. Documented at neuron-api.el:613 — search stays lexical because ~40 internal call sites pass a KEY and seven of them delete every record returned. Point those at a semantic matcher and they delete fuzzy matches. Conversely, pointing recall at search silently downgrades the mind's whole retrieval surface from semantic to lexical, with no error.

Implemented over engram_activate(), which already IS the semantic path the old with_legs=1 branch built by hand. Output shape matches search (flat array via engram_emit_node_json) because callers parse search's shape.

Verified: the soul compiles, links, boots, and serves /health against current el.

Follow-up, not decided here: current el ships engram_retrieve_geometric_json, apparently the intended successor. Repointing recall at it would remove the two-wrapper shape entirely and may be the right end state — but it's a behavioral change that must be measured against neuron/tools/retrieval-eval/'s gold set, not assumed. This commit preserves existing behavior exactly.

neuron's soul calls `engram_recall_json` and `cgi_principal`; both existed in the runtime neuron vendored (v1.0.0-20260501) and were absent here, so **the soul could not link against current el at all**. **The trap this avoids.** They look like redundant wrappers over one impl: ``` engram_search_json(q, limit) -> eg_search_json_impl(q, limit, 0) LEXICAL engram_recall_json(q, limit) -> eg_search_json_impl(q, limit, 1) SEMANTIC ``` Not interchangeable. Documented at neuron-api.el:613 — search stays lexical because ~40 internal call sites pass a KEY and **seven of them delete every record returned**. Point those at a semantic matcher and they delete fuzzy matches. Conversely, pointing recall at search silently downgrades the mind's whole retrieval surface from semantic to lexical, with no error. Implemented over `engram_activate()`, which already IS the semantic path the old `with_legs=1` branch built by hand. Output shape matches search (flat array via `engram_emit_node_json`) because callers parse search's shape. **Verified:** the soul compiles, links, boots, and serves `/health` against current el. **Follow-up, not decided here:** current el ships `engram_retrieve_geometric_json`, apparently the intended successor. Repointing recall at it would remove the two-wrapper shape entirely and may be the right end state — but it's a behavioral change that must be measured against `neuron/tools/retrieval-eval/`'s gold set, not assumed. This commit preserves existing behavior exactly.
will.anderson added 1 commit 2026-08-16 00:56:57 +00:00
runtime: restore engram_recall_json + cgi_* accessors
El SDK CI - dev / build-and-test (pull_request) Failing after 10m24s
7351fb0a8d
neuron's soul calls engram_recall_json (neuron-api.el:618, memory.el:80) and
cgi_principal (studio.el:72). Both existed in the runtime neuron vendored
(v1.0.0-20260501) and were absent here, so the soul could not link against
current el at all.

The dangerous part is what the obvious "fix" would have done. These look like
redundant wrappers over one impl:

    engram_search_json(q, limit)  -> eg_search_json_impl(q, limit, 0)  LEXICAL
    engram_recall_json(q, limit)  -> eg_search_json_impl(q, limit, 1)  SEMANTIC

They are not interchangeable, and the split is documented at neuron-api.el:613:
search stays LEXICAL because ~40 internal call sites pass a KEY and seven of
them DELETE every record returned. Point those at a semantic matcher and they
delete fuzzy matches. Conversely, pointing recall at search silently downgrades
the mind's entire retrieval surface from semantic to lexical — no error, just
permanently worse recall.

Implemented over engram_activate(), which in this runtime already IS the
semantic path the old with_legs=1 branch built by hand (embeds the query via
eg_embed_fetch, scores by cosine, then spreads activation one hop). Output
shape matches engram_search_json — a flat array via engram_emit_node_json —
because callers parse search's shape, not activate's envelope.

Verified: neuron's soul now compiles and links against current el, boots, and
serves /health with layers initialized.

NOTE for follow-up: current el also ships engram_retrieve_geometric_json, a
structure-first retrieval that appears to be the intended successor to recall.
Repointing the two recall call sites at it may well be the right end state and
would remove the two-wrapper shape entirely — but that is a behavioral change
that must be measured against neuron/tools/retrieval-eval/'s gold set, not
assumed. This commit preserves existing behavior exactly; it does not decide
that question.
will.anderson merged commit 7557ea6e19 into dev 2026-08-16 00:57:12 +00:00
Sign in to join this conversation.