path_between: directed call chains (#17, step 2) — re-land of #89 onto main - #90
Merged
Merged
Conversation
The old path_between walked UNDIRECTED over EVERY relation and cut each hop to sorted(frontier)[:200]. On proton-enterprise that (a) hid a depth-4 path entirely (the arbitrary cut visits ~9% of the graph) and (b) when uncapped returned shared-include junk -- HTTPHandler.cpp -imports-> Context <-imports- NativeLog.cpp -- through hubs like String (degree 5,226). Neither is a call path. Now: a bidirectional BFS with a total-visited budget (no per-hop cut). mode='calls' follows only calls/indirect_call, directed, trying A->B then B->A, always listing the chain caller-first with 'direction' saying which way it runs. mode='related' is undirected over all relations but never routes THROUGH a connector node (kind symbol/file) -- they may be endpoints, never bridges, and the two search sides meeting AT one is not a path. mode='auto' (default) tries calls then related and says which it found. Returns a dict; when nothing is found it explains why (depth / budget / no connection) and returns the direct callees of A and callers of B, because the extracted C++ call graph is incomplete and the agent needs a next step, not 'null'. Measured on the real graph: execute -> buildChainImpl found in 0.01s; asked backwards, reported as b_to_a; the #17 question (HTTP processQuery -> NativeLog produce) returns an honest 'no call chain' with executeQuery and NativeLog::doProcessRequest as next hops. Agent prompt now tells the model to bridge a broken chain with neighbors + read_source instead of stopping. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 21, 2026
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.
Re-lands #89 onto
main.#89 was stacked on
feat/ingest-kinds-and-namesand got merged into that branch 29 seconds after #88 had been squash-merged tomain, so its commit never reachedmain(mainstill has the oldpath_between). This PR is that same commit cherry-picked onto currentmain— the tree is byte-identical to the head that was reviewed in #89 (git diff origin/feat/call-path-traversal HEADis empty).See #89 for the full description, measurements and testing. Summary: bidirectional BFS with a visited budget (no arbitrary per-hop cut);⚠️
mode="calls"= directed call chain, either direction, listed caller-first;mode="related"never routes throughsymbol/fileconnectors;mode="auto"says which it found; a miss returns the reason pluscallees_of_a/callers_of_b.path_betweenreturns an object instead of a list/null.Tests: the full suite passed on this exact tree in #89 (326 passed, 10 skipped, 1 pre-existing unrelated failure). Re-run here: the infra-free subset only (parser, MCP/agent tool surfaces, version) — the local test database is down at the moment.
After merging, the stale branches
feat/ingest-kinds-and-namesandfeat/call-path-traversalcan be deleted.🤖 Generated with Claude Code