feat(graph): US-GF-03 query_graph NL scoped subgraph#84
Merged
Conversation
Add MCP query_graph and CLI graph-query / query --kind subgraph: seed retrieval → BFS/path expand → token-budget trim with provenance labels on every edge (REL-042 / FR-GF-05 / FR-GF-06).
Strengthen US-GF-03 MCP assertions (seeds, provenance, budget, empty question), create persona fixture so agent_focus/diary pass, register schema checks, and add scripts/mcp-smoke-tools.py with honest skip labels.
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.
Summary
query_graph(question, token_budget?, max_depth?)— keyword seed retrieval → bounded BFS expand (or shortest path for "what connects A to B?") → token-budget trim → TOON via existing MCP envelope. Every edge carriesconfidence_label(EXTRACTED/INFERRED/AMBIGUOUS).leankg graph-query "<question>"andleankg query --kind subgraph(existing--kind name|type|…unchanged).src/graph/nl_query.rswith the real Graphify-style scoped subgraph pipeline; marks tracker rows DONE.Test plan
cargo test --release --lib(668 passed)cargo test --release --lib nl_query(5 passed)cargo test --release --test mcp_tools_redundancy_tests query_graphcargo test --release --test redundant_tools_matrixcargo clippy --release --lib -- -D warningsleankg graph-query --helpleankg graph-query "what connects X to Y?"Made with Cursor