Repository navigation
Description
Pre-flight checks
- I searched existing issues and PRs for
context_filter+ inheritance; nothing found
What happened?
query_graph's context_filter keeps only edges whose context attribute is in the filter (serve.py _filter_graph_by_context, data.get("context") in filters). Heritage edges (inherits / implements) get a context only from the TypeScript extractor (type). The C#, Java and Python extractors emit them without one: extractors/engine.py add_edge() sets context only when it is passed, and e.g. the C# base_list branch calls add_edge(class_nid, base_nid, relation, line, metadata=metadata).
As a result, no context_filter value can select inheritance in C#, Java or Python: ["type"] works for TypeScript only, and ["inherits"] matches nothing in any language (_CONTEXT_FILTER_ALIASES has no entry for it).
The failure is silent. The traversal returns the seed node(s) and no edges, with no hint that the filter matched zero edges. On our C# graph, OneTimeAsyncStartable is the base class of ~550 types (get_neighbors(relation_filter="inherits") lists them all), yet query_graph comes back with 1 nodes found for both context_filter=["inherits"] and ["type"].
Expected: heritage edges are selectable by context the same way in every language, and an explicit filter that matches no edge in the graph is reported instead of producing an empty-looking answer.
Steps to reproduce
Same hierarchy in four languages, graphify extract . --code-only --no-viz:
src/Shapes.cs namespace Demo { public interface IShape { double Area(); } public class Base { } public class Square : Base, IShape { public double Area() => 1; } }
src/shapes.ts export interface IShape { area(): number } export class Base {} export class Square extends Base implements IShape { area() { return 1 } }
src/Shapes.java interface IShape { double area(); } class Base {} class Square extends Base implements IShape { public double area() { return 1; } }
src/shapes.py class Base: pass / class Square(Base): def area(self): return 1
Error output or graph output
Heritage edges in the resulting graph.json:
src/shapes.ts implements context='type' square -> ishape
src/shapes.ts inherits context='type' square -> base
src/Shapes.cs inherits context=None square -> base
src/Shapes.cs implements context=None square -> ishape
src/Shapes.java implements context=None square -> ishape
src/Shapes.java inherits context=None square -> base
src/shapes.py inherits context=None square -> base
On a real C# graph:
query_graph(question="OneTimeAsyncStartable subclasses", context_filter=["inherits"])
Graph: ... (91973 nodes) | Traversal: BFS depth=3 | Start: ['OneTimeAsyncStartable'] | Context: inherits (explicit) | 1 nodes found
NODE OneTimeAsyncStartable [src=src/Common/.../OneTimeAsyncStartable.cs loc=L15 ...]
The same result for context_filter=["type"]. The ~550 incoming inherits edges are in the graph: get_neighbors(label="OneTimeAsyncStartable", relation_filter="inherits") returns them.
Suggested fix
- Give heritage edges one consistent
contextin every extractor (TypeScript already usestype), or letcontext_filterfall back to the edgerelationfor structural relations (inherits,implements,extends, e.g. via_CONTEXT_FILTER_ALIASESplus a relation match in_filter_graph_by_context). - When an explicit
context_filtermatches no edge in the graph, say so in the header, e.g.Context: inherits (explicit, matched 0 edges), so an empty traversal is not mistaken for "no relationships".
Graphify version
0.9.107
Operating System
Linux x86_64 (openSUSE Leap 16)
Python Version
3.13.13
Installation Method
uv tool install "graphifyy[openai,mcp]==0.9.107"
Additional Environment Details
Code-only extraction, no provider involved.
Activity
github-actions commentedon Nov 12, 2026
Thanks for opening this issue, @janmaticka. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
fix(query): let context_filter reach heritage edges without a context (…
safishamsi commentedon Nov 12, 2026
Fixed by #5179 (9762d8b), released in graphify 0.9.108. Thanks @janmaticka for the report and @sunhouy for the fix.
fix(serve): keep cross-repo calls edges when a query filters on call