What we want
We want graphify queries to distinguish between edge kinds that are currently traversed together.
Examples:
- calls vs type/declaration references
- imports vs executable relationships
- field references vs other symbol mentions
A query like who calls X? should prefer call-heavy results instead of mixing calls, imports, and declaration-style references.
Why
This improves query precision in larger or noisier graphs and makes edge disambiguation a graph-level, cross-language capability.
Model boundary:
relation = semantic edge type
context = syntactic disambiguation where needed
Proposal
Add a cross-language context layer for edges where it improves query quality, and use it during query traversal.
Initial contexts:
Queries should support:
- explicit filtering
- small heuristic inference when the query clearly implies a context
Examples:
graphify query "extract" --context call
who calls extract -> infer call when no explicit filter is provided
Scope
- add/standardize edge
context where supported
- support context-aware filtering in:
- CLI
graphify query
- MCP
query_graph
- show active context filtering in query output
Non-goals
- do not move
inherits / implements into context
- do not replace
relation with context
- do not build broad NLP intent parsing
- do not treat this as a fix for general
explain / path disambiguation
References #569
This is related to #569, but narrower in scope.
#569 is mainly about resolving the right node or candidate set in large, noisy graphs
- this issue is about traversing the right edge kinds once the node is found
In short:
#569 = node resolution / disambiguation
- this issue = edge-context-aware traversal
Done when
- queries can explicitly filter by context
- obvious query phrasing can infer context when no filter is passed
- output makes the active context visible
- extraction/tests cover the touched languages
What we want
We want graphify queries to distinguish between edge kinds that are currently traversed together.
Examples:
A query like
who calls X?should prefer call-heavy results instead of mixing calls, imports, and declaration-style references.Why
This improves query precision in larger or noisier graphs and makes edge disambiguation a graph-level, cross-language capability.
Model boundary:
relation= semantic edge typecontext= syntactic disambiguation where neededProposal
Add a cross-language
contextlayer for edges where it improves query quality, and use it during query traversal.Initial contexts:
callimportfieldQueries should support:
Examples:
graphify query "extract" --context callwho calls extract-> infercallwhen no explicit filter is providedScope
contextwhere supportedgraphify queryquery_graphNon-goals
inherits/implementsintocontextrelationwithcontextexplain/pathdisambiguationReferences #569
This is related to #569, but narrower in scope.
#569is mainly about resolving the right node or candidate set in large, noisy graphsIn short:
#569= node resolution / disambiguationDone when