Bound beginSession/compileCtx payloads to a compact digest (main) #103

Merged
will.anderson merged 1 commits from fix/bound-session-payload-main into main 2026-08-01 16:42:06 +00:00
Owner

Lands the payload-bounding fix (originally PR #102, commit 872120c) onto main. PR #102 targeted the hotfix branch and carried hotfix-compiled generated C; this PR ports the .el source onto current main and regenerates the C from main's tree.

The fix

handle_api_begin_session / handle_api_compile_ctx concatenated unbounded engram nodes as full objects (content up to ~90KB each; the self-identity hub ~90KB alone) → ~900KB responses that, after MCP re-escaping, closed the client socket on every beginSession. Now each list is capped (8 activated / 10 recent for begin_session; 10 / 20 for compile_ctx) and every node projected to a light identity + a bounded, UTF-8-safe content snippet via new helpers api_compact_node / api_compact_node_array / api_compact_activated / api_utf8_trunc / api_num_or_zero. Response drops ~900KB → ~12KB; full content stays available via recall / fetch / inspectGraph.

Generated C

  • dist/soul.c — the CI-built amalgamation — regenerated from source (elc whole-program compile of soul.el). This is what CI compiles, so the bounding is now actually present in a main build.
  • dist/neuron-api.c — per-module artifact regenerated for consistency.

The soul.c regen also compiles in already-merged source that the previously-committed soul.c was stale against (agent write/edit receipt fixes from #100/#101). This is soul.c catching up to main's own sources, not a behavioral change authored here.

Verification

  • cc -O2 -DHAVE_CURL build of regenerated soul.c: clean (warnings only, no errors) → working binary.
  • scripts/verify-soul-contract.sh on a throwaway port/HOME: PRESENCE PASS (27/27 routes), IMMUTABILITY PASS.
  • Bounding structurally present in soul.c (api_compact_activated, self_neighbors":[], content_truncated). The identical source fix was already verified live (900KB → ~13KB, graph intact).

Supersedes #102 (which will be closed).

Lands the payload-bounding fix (originally PR #102, commit 872120c) onto **main**. PR #102 targeted the hotfix branch and carried hotfix-compiled generated C; this PR ports the `.el` source onto current main and regenerates the C from main's tree. ## The fix `handle_api_begin_session` / `handle_api_compile_ctx` concatenated unbounded engram nodes as full objects (content up to ~90KB each; the self-identity hub ~90KB alone) → ~900KB responses that, after MCP re-escaping, closed the client socket on every `beginSession`. Now each list is capped (8 activated / 10 recent for begin_session; 10 / 20 for compile_ctx) and every node projected to a light identity + a bounded, UTF-8-safe content snippet via new helpers `api_compact_node` / `api_compact_node_array` / `api_compact_activated` / `api_utf8_trunc` / `api_num_or_zero`. Response drops ~900KB → ~12KB; full content stays available via recall / fetch / inspectGraph. ## Generated C - `dist/soul.c` — the CI-built amalgamation — regenerated from source (`elc` whole-program compile of `soul.el`). This is what CI compiles, so the bounding is now actually present in a main build. - `dist/neuron-api.c` — per-module artifact regenerated for consistency. The soul.c regen also compiles in already-merged source that the previously-committed soul.c was **stale** against (agent write/edit receipt fixes from #100/#101). This is soul.c catching up to main's own sources, not a behavioral change authored here. ## Verification - `cc -O2 -DHAVE_CURL` build of regenerated soul.c: clean (warnings only, no errors) → working binary. - `scripts/verify-soul-contract.sh` on a throwaway port/HOME: **PRESENCE PASS** (27/27 routes), **IMMUTABILITY PASS**. - Bounding structurally present in soul.c (`api_compact_activated`, `self_neighbors":[]`, `content_truncated`). The identical source fix was already verified live (900KB → ~13KB, graph intact). Supersedes #102 (which will be closed).
will.anderson added 1 commit 2026-08-01 16:37:21 +00:00
Bound beginSession/compileCtx payloads to a compact digest
Neuron Soul CI / build (pull_request) Successful in 4m19s
Neuron Soul CI / deploy (pull_request) Has been skipped
9bbb4f2af8
Port the payload-bounding fix (PR #102, commit 872120c) onto main. The
session-init endpoints projected unbounded engram nodes (~900KB), closing
the MCP client socket on every beginSession. Cap the lists (8 activated /
10 recent for begin_session, 10/20 for compile_ctx) and project each node
to a light identity + a bounded, UTF-8-safe content snippet via
api_compact_node / api_compact_activated / api_utf8_trunc. Response drops
~900KB -> ~12KB; full content stays available via recall/fetch/inspectGraph.

Regenerate dist/soul.c (the CI-built amalgamation) and dist/neuron-api.c
from source. The soul.c regen also compiles in already-merged source the
previously-committed soul.c was stale against (agent write/edit receipt
fixes, #100/#101); verified via scripts/verify-soul-contract.sh
(PRESENCE + IMMUTABILITY PASS) and a clean CI-style cc build.
will.anderson merged commit b75d5c8c30 into main 2026-08-01 16:42:06 +00:00
Sign in to join this conversation.