fix(api): /api/neuron/list/<type> off-by-one (list-by-type returned [] for all types) #58
Reference in New Issue
Block a user
Delete Branch "fix/list-typed-slice-offset"
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?
/api/neuron/list/<type>off-by-one — list-by-type returned [] for everythinghandlefor/api/neuron/list/sliced the node type at offset 16, but"/api/neuron/list/"is 17chars — so
node_typecame out as"/BacklogItem"(leading slash),engram_scan_nodes_by_type_json("/…")matched nothing, and every
list/<type>returned[]despite a 5,140-node engram.Proven live:
/api/neuron/knowledge(literal-type scan) returns real nodes;/api/neuron/list/Knowledge(slice path) returned
[]. Fix:16 → 17. elc-clean.Impact: this silently broke typed-node listing app- and tool-wide — including
reviewBacklog(MCP) andany UI/tool that lists by type. It's the foundational half of why the backlog never read back (the other
half is the MCP wrapper using
/memory+/recallinstead of the typed create/list — separate fix).⚠️ Soul-core: needs
dist/soul.cregen — rides the same rebuild as #56 + #57.str_slice(clean, 16, ...) left a leading slash on node_type ('/BacklogItem'), so engram_scan_nodes_by_type_json matched nothing and list/<type> returned [] for EVERY type — silently breaking backlog + typed-node listing across the app and MCP tools (reviewBacklog). Proven live: the literal-scan endpoint /api/neuron/knowledge returns nodes; /api/neuron/list/Knowledge returned []. elc-clean. NOTE: soul-core — needs dist/soul.c regen (Will); rides the same rebuild as #56/#57. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>