Self-load fix: relevance-ranked inspect_graph projection + regenerated soul.c + architecture docs #149
Open
will.anderson
wants to merge 8 commits from
fix/bound-session-payload into main
pull from: fix/bound-session-payload
merge into: :main
:main
:fix-mcp-wrapper-tool-schemas
:docs-cognitive-architecture
:docs/session-2026-08-13-language-faculty
:docs/geo-operators-el-cutover-reversal-2026-08-13
:docs/engram-cognitive-architecture-2026-08-12
:engram-store-wiring
:el-route-decorators
:fix/bound-session-payload
:feat/cgi-identity-accessors
:fix/restore-soul-identity-producer
:rebase/openai-tools-onto-main
:rebase/gate-state-key-reads-onto-main
:rebase/structural-audit-onto-main
:feat/self-seeded-context
:integrate/semantic-plus-writethrough
:feat/semantic-leg-dropout
:feat/semantic-substrate
:feat/gold-set-heldout
:feat/evidence-weighted-merge
:feat/structural-audit
:feat/claim24-unfloored-semantic
:feat/executive-filter-recall
:feat/bm25-lexical-leg
:feat/semantic-seeded-assoc
:feat/associative-recall-leg
:feat/hybrid-semantic-recall
:chore/retrieval-measurement-contract
:feat/retrieval-eval-harness
:feat/soul-write-through
:feat/recall-through-activation
:chore/regen-soul-amalgam-20260807
:feat/gate-state-key-reads
:fix/129-on-openai-tools
:fix/129-history-amplification
:fix/liveness-engine-91
:feat/soul-openai-tools-v2
:fix/resume-server-tool-replay
:fix/soul-history-provenance-20260805
:feat/soul-plain-chat-generation-20260805
:feat/soul-native-web-search-20260804
:ci/pin-vendored-runtime
:reconcile/soul-union-main
:fix/bound-session-payload-main
:fix/receipts-wrapper-forget
:fix/receipts-agent-tools
:reconcile/neuron-wip-to-main
:hotfix/trackb-threat-to-others
:reconcile/hotfix-to-main-launch
:hotfix/elc-source-typos
:fix/safety-contact-truncation
:fix/genesis-boot-crash
:fix/immutable-on-hotfix
:feat/bounded-persona-floor
:ci/rdynamic-http-handler
:ci/harden-gate-boot
:feat/agent-phase1-soul
:salvage/elh-state-20260704
:feat/soul-model-self-report
:feat/openai-format-providers
:el-runtime-repoint
:feat/plan-mode-endpoint
:fix/operator-identity-home-resolution
:fix/wrapper-backlog-endpoints
:fix/list-typed-slice-offset
:feat/connectors-call-route
:fix/chat-vision-attachments
:fix/prevent-engram-corruption
:fix/emergency-regressions
:fix/session-continuity-hook
:fix/context-dedup-shared-ids
:fix/engram-float-parser
:improve/recall-context-format
:improve/recall-context-dedup
:improve/recall-cross-session-continuity
:improve/recall-emotional-recall
:improve/recall-activation-seed
:improve/recall-recall-completeness
:improve/recall-temporal-precision
:improve/recall-engram-scoring
:improve/recall-recall-reliability
:improve/recall-session-start-recall
:improve/reliability-engram-write
:improve/reliability-state-management
:improve/soul-memory-formation
:improve/safety-crisis-detection
:improve/reliability-route-error-recovery
:improve/reliability-llm-retry
:improve/reliability-session-boundary
:improve/reliability-safety-resilience
:improve/reliability-engram-connection
:improve/soul-routes-api
:improve/reliability-cross-session-affective
:propose/agent-workspace-root-read
:improve/reliability-conv-history
:improve/soul-strip
:improve/soul-chat-pipeline
:docs/conversation-retrieval-design
:propose/no-fake-tools-in-chat-mode
:fix/ci-soul-build-single-file
:fix/canonical-self-bridge
:feat/agent-tool-workspace-scope
:fix/agentic-tools-duplicate-web-search
:green/agentic-fixes
:feat/connectors-soul
:feat/layer-safety
:feat/layer-imprint
:feat/layer-stewardship
:test/layer-composition
:test/layer-safety
:test/layer-stewardship
:test/layer-imprint
:feat/memory-delete-update
:feat/native-web-search
No Reviewers
Labels
Clear labels
BETA-CRITICAL
blocks-public-beta
HELD
ORTHOGONAL
P0
POST-BETA
security
On the beta critical path — must resolve before ship
Must be fixed before any public beta
Blocked pending an external decision (counsel / dual sign-off)
Parallel workstream (testing/hardening) — safe to assign off critical path
Drop-everything severity
Important but not blocking the beta ship
Security vulnerability
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: neuron-technologies/neuron#149
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "fix/bound-session-payload"
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?
Self-load fix: bound
inspect_graph+ regeneratedsoul.cProblem
The soul could not load its own identity. Traversing high-fanout identity anchors (voice, writing-imprint, self-root) returns ~670KB neighborhoods; the MCP wrapper's client context overflowed and the socket closed mid self-load.
Fix
handle_api_inspect_graphgains an opt-in relevance-ranked projection behindcompact=1(ortrue):api_neigh_better/api_neigh_rank).snip=600) —api_neigh_full.{id,label,node_type,tier,edge,pointer:true}stubs —api_neigh_pointer.api_compact_neighbors,api_neigh_full,api_neigh_pointer,api_neigh_rank,api_neigh_better,api_float_or.The MCP wrapper (
mcp-wrapper/src/main.el) appends&compact=1on itsinspectGraphand fetch-by-id paths.Isolation — the app is unaffected
Absent the flag, the response is byte-identical to the old plain traversal. The studio app never sends
compact, so it is unchanged. Only the MCP wrapper opts in.Before / after
Throwaway soul (port 17771) over a read-only copy of the live snapshot, node
kn-10fa60db…("Self — Voice and Communication"):?id=…&depth=1(default)?id=…&depth=1&compact=1Both valid JSON. ~26x smaller; the wrapper's self-load no longer socket-closes.
Why
dist/soul.cis in this PRCI compiles the committed single-TU
dist/soul.cdirectly (runningelb/elcon the Linux runner OOM-kills it), so an.el-only change would build the OLD behavior.dist/soul.cwas regenerated on macOS and verified:ccline (0 errors) → 902KB arm64 binary;The regen also syncs the amalgamation to this branch's
.elsources — the previously-committedsoul.cpredated this branch's self-review commits (which changedawareness.el/routes.el/neuron-api.elwithout re-amalgamating). The regeneratedsoul.creflects the full branch source.Docs
docs/architecture/00–05added.01,02, and05corrected so the relevance-rankedinspect_graphprojection reads as committed source (previously flagged "not present / not committed fact"); doc05also documents the amalgamation mechanism and that this PR regeneratedsoul.c.Verification boundary
No live process, port, binary, or
~/.neuronwas touched. All verification used a throwaway soul on port 17771 over a read-only copy of the live snapshot. Cutover / deploy is a separate call — please do not merge on my behalf; let CI run.str_eq("", "") is true, so an auto-term extractor that kept FAILING reported a rising auto_term_streak. The signal meaning "fixated on one term" and the signal meaning "producing no term at all" were the same number — opposite failures needing opposite responses. Observed live as {"auto_term":"","auto_term_streak":3}. Same class of bug already fixed for wm_top0_streak on 2026-07-31; auto_term was missed then. Empty now reads 0, and the empty run is counted on its own axis (auto_term_empty_streak) so extractor failure is visible rather than disguised as health. Also surfaces the new runtime gauges in the heartbeat: hebb_warm, hebb_max, hebb_links (is the graph learning any structure at all?) and dup_wm_global.High-fanout identity anchors (voice, writing-imprint, self-root) have ~670KB neighborhoods. inspect_graph returned the full traversal, which overflowed the MCP client's context and socket-closed the wrapper mid self-load -- the soul could not traverse its own identity graph. handle_api_inspect_graph gains an opt-in `compact` projection (compact=1|true): the neighborhood is relevance-ranked, the top K (default 12) keep a UTF-8-safe content snippet (default snip=600), and the remainder collapse to lightweight {id,label,node_type,tier,edge,pointer:true} stubs. This bounds the voice node from 669,799B -> 25,353B (HTTP 200, valid JSON) and the wrapper's soul-load no longer socket-closes. New helpers: api_compact_neighbors, api_neigh_full, api_neigh_pointer, api_neigh_rank, api_neigh_better, api_float_or. The flag is gated: ABSENT it, the response is byte-identical to the old plain traversal, so the studio app (which never sends it) is unaffected. The MCP wrapper (mcp-wrapper/src/main.el) appends &compact=1 on its inspectGraph and fetch-by-id paths. dist/soul.c is REGENERATED so CI ships the fix: CI compiles the committed single-TU dist/soul.c directly (running elb/elc on the Linux runner OOM-kills it), so an .el-only change would build the OLD behavior. Regenerated and verified on macOS -- compiles with the CI cc line (0 errors) and, on a throwaway soul over a copy of the live snapshot, serves compact ~25KB / non-compact ~670KB. The regen also syncs the amalgamation to this branch's .el sources, which had drifted several self-review commits ahead of the previously-committed soul.c. Docs: docs/architecture/00-05 added; 01/02/05 corrected so the relevance-ranked inspect_graph projection reads as committed source, not an in-flight concern.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.