Self-load fix: relevance-ranked graph projection + architecture docs (clean re-merge) #155
Reference in New Issue
Block a user
Delete Branch "merge-pr149-v2"
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?
Re-does PR #149's merge clean off current main. Real conflicts resolved:
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.