Repository navigation
fix(graph): serve memory_edges in GET /graph; fix FK violations in MCP add_edge and dream - #1370
Merged
Merged
Conversation
… MCP add_edge and dream - new Uteke::graph_view: unified, bounded graph (memory_edges + explicit graph edges), keyed by memory id, live memories only, node_id neighbourhood, limit + truncated; GET /graph and MCP uteke_graph use it - edges also carry source/target (the names Corin reads) - GraphStore::add_edge_for_memories / remove_edge_between: MCP uteke_graph_add_edge/remove_edge and dream contradiction edges no longer violate graph_edges FK - fix registry descriptions: /edges is not an alias of /graph; /graph documents node_id/limit Fixes #1365 Fixes #1366 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Uteke::graph_view(newgraph_view.rs): one bounded graph for viewers. Edges =memory_edgesbetween live memories (the datarememberwrites automatically; derivedreferenced_bybacklinks omitted) plus explicitgraph_edges, nodes keyed by memory id (memory_idfield kept),namespacefilter,node_id= that memory's neighbourhood,limit(default 500, max 5000) with atruncatedflag.GET /graphand MCPuteke_graphuse it (the MCP tool now also lists the latest edges and takeslimit).source/targetin addition tosource_id/target_id.GraphStore::add_edge_for_memories/remove_edge_between; MCPuteke_graph_add_edge/uteke_graph_remove_edgeanddreamcontradiction edges used raw memory ids against thegraph_nodesFK and failed./edgesis not an alias of/graph;/graphdocumentsnode_id/limit(docs/api-reference.mdregenerated;docs/core-contract.jsonunchanged).Why
Consumer check (graph audit, epic #1345): Corin's graph view calls
GET /graph(+node_id),POST/DELETE /graph/edge,GET /edges. It expectsmemory_edgesdata keyed by memory id and{source,target,relation,weight}edges, but the server returned onlygraph_nodes/graph_edges(almost always empty, hence "0 usage") withsource_id/target_id, and ignorednode_id. A non-empty response would not even deserialize in Corin. The two write paths into that store (MCP, dream) were also broken by the FK, so nothing could fill it.Behaviour change (LAB)
GET /graphnode ids are now memory ids (previously graph-node ids;POST /graph/edgestill returns the node ids it created, and both id kinds are still accepted by POST/DELETE). Existing testgraph_edge_post_resolves_memory_ids_to_nodesupdated accordingly. All graph routes are tier LAB, so no cloud contract change. Recall is not touched, so the benchmark gate is unaffected.Testing
node_id,limit/truncated, explicit edges re-keyed, FK violation reproduced then fixed, deserialization into Corin's struct shape) + 1 new server test (node_idandlimitover HTTP) + 1 updated.cargo fmt --check,cargo clippy --workspace --all-targetsclean;cargo test --workspacegreen (core 636, server 62); vecq-only core build green (633).dreamend-to-end edge creation (covered throughadd_edge_for_memories).Fixes #1365, fixes #1366
🤖 Generated with Claude Code