You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: query starts from tests and docs instead of the code the question is about #4983
graphify query often starts from tests, docs and config instead of the code the question is about, and then lists nodes by hop and degree, so the right file is cut off by the budget.
query scores node names only. A test named after a bug repeats the question's words in its own name (UsernameValidatorsTests, test_sqlmigrate_for_non_transactional_databases), so it wins the exact-name tier.
Measured with graphify benchmark --questions (#4342) on 177 SWE-bench Lite issues (question = issue title, answer = non-test files of the gold patch): 43% of start nodes were tests, and an expected file is in the first 5 files shown only 49% of the time on v8 (293 Lite + Verified questions).
Proposed solution
Inside query only:
Rank source above tests, docs and config (x0.3 weight via the existing paths._is_test_path), unless the question asks about tests or docs. The per-term seed guarantee stays.
List the answer file by file, best file first, so the budget keeps the most relevant files.
path, explain, traversal and the budget are unchanged. Result on 293 questions: top-5 49% -> 56% (26 gained, 4 lost, paired p = 6e-5), same answer size. PR: #4982.
Alternatives considered
Indexing words inside function bodies gives a much larger gain (top-5 ~73% on held-out questions, smaller answers) but stores ~15% more in graph.json; better as a separate follow-up on top of this. Open ranking PRs (#3417, #2403, #4504, ...) were measured on the same questions; the best reached 51% top-5.
Only the query answer order and its seeds change. No change to node/edge ids, graph.json, cache, MCP tool signatures, path, explain or incremental builds. An agent that relied on tests appearing first in query sees source first unless the question mentions tests.
Additional context
Benchmark questions and scripts: SWE-bench Lite + Verified issues, one graph per base commit, graphify benchmark --questions from #4342.
Activity
github-actions commentedon Nov 3, 2026
Thanks for opening this issue, @rohit-jsfreaky. 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.
safishamsi commentedon Nov 3, 2026
Fixed in 0.9.102 (published to PyPI) via #4982. Query ranks source above tests and docs (a soft weight, not exclusion) and answers file-first.