Repository navigation
MCP typed_walk tool: handles only, CLI limits, refuse unknown edge type (MN-REQ-14.7 slice, #247) - #256
Merged
Conversation
…ation (MN-REQ-14.7 slice)
…limits, save/load)
…wn_relation refusal (CI model check)
# Conflicts: # CHANGELOG.md
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.
Why
Owner goal (t999u, 2026-11-04 13:03 TPE): LLM agents can run typed walks over MCP, with handles only. No real id ever appears on the LLM MCP surface, and handles are opaque. The limits match the CLI. An unknown edge type is refused instead of returning an empty walk. This is the MN-REQ-14.7 slice for typed walks, #247 item 2.
What
typed_walk. Its arguments arestart, edge_type, direction="out", min_hops=1, max_hops=1, where=None, limit=50, session, caller. It routesquery typed-walk --json-handles, so it works in-process and through TCP serve. serve.py, serve_pool.py and upgrade.py are not touched.{ok, exit_code, session_id, errors, walk:{type,dir,hops,limit}, rows:[{row,hops,start:{kind,handle},steps:[{edge:{type,dir,handle},node:{kind,handle[,props]}}]}], stats:{rows,truncated,cursor:null}}.props, with id, hid and elementId removed.{ok:false, error:{code,message}}. The error text is scrubbed of ids.h_plus 26 base32 chars of HMAC-SHA256 keyed by the session id, over the node or edge nickname (or the hid when a node has no nickname).stale_handle). Neither does a handle of a deleted node.startaccepts a handle or a nickname fromfind.typed_walk.pyconstants: limit 1..500 (default 50), 20,000 typed edge reads and 1,048,576 reply bytes. Truncation shows up instats.truncatedas limit, budget or bytes.unknown_relationin the engine, so the CLI and MCP both refuse it.typed_walkis listed in the requirements.sysml READ-SURFACES block and intests/evict_surfaces.py.Proof
memnet serveon :38765 and connected a realmemnet-mcpover stdio withMEMNET_MCP_TRANSPORT=tcp.stale_handle.NO_SUCHwas refusedunknown_relation, andlimit=501was refusedlimit_out_of_range.limit=1settruncated: limit. The default limit came back as 50._elN).tests/test_typed_walk_mcp.pyhas 18 tests. Each protection was removed in turn to confirm a test fails without it.LATER
find,mutate,pin_mapand the other tools still return real ids. A persisted HandleTable is still needed.unknown_relationcheck is an O(E) scan. An O(1) per-relation count needs amem_store.pyedit..cursor/skills/mcp-memnettool table doesn't listtyped_walkyet.