feat(navigate): path + describe graph navigation (Phase 3/4)#14
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c72d05bb48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """Resolve a path/symbol token to one or more graph nodes (file or symbols).""" | ||
| frow = repo.file_by_path(conn, token) | ||
| if frow is not None: | ||
| return [("file", int(frow["id"]))] |
There was a problem hiding this comment.
Include file-contained symbols in path resolution
When a user supplies a file path as either endpoint, this seeds only the file node. The graph stores imports on file nodes but normal call/reference edges on the symbols inside the file, with no containment edge connecting a file to its symbols, so codebase-index path src/api/service.py refresh_access_token reports no path even when a function in service.py directly calls that target. Seed the file's symbols as well (as impact does) or add containment edges, otherwise the advertised symbols-or-files path mode misses common file-to-symbol/file connections.
Useful? React with 👍 / 👎.
5b2fe8e to
966e6cd
Compare
Phase 3 of porting graphify into codebase-index. - `codebase-index path <A> <B>`: shortest undirected dependency/call path between two symbols/files, annotated with edge type + confidence (inferred/ambiguous hops marked). Multi-source BFS, bounded for large graphs. - `codebase-index describe <symbol>`: node card — definition(s), callers, callees, in/out degree, module, god-node rank. graphify's `explain Symbol` idea, named `describe` to avoid colliding with the existing how-it-works `explain`. - MCP tools path_between + describe_symbol; graph/navigate.py holds both payloads. - Tests: test_navigate.py (path found/unresolved/disconnected, describe card/miss); CLI + MCP goldens added. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c72d05b to
a6e2c81
Compare
Phase 3 of 4 — porting safishamsi/graphify into codebase-index
Makes the graph navigable, not just searchable.
Added
codebase-index path <A> <B>— shortest undirected dependency/call path between two symbols or files (how is X connected to Y?). Multi-source BFS over the resolved graph, bounded for scale. Renders the node chain annotated with each link's edge type and confidence;inferred/ambiguoushops are marked, so a path is only as trustworthy as its weakest edge.codebase-index describe <symbol>— a node card: definition(s), direct callers and callees (with confidence), in/out degree, the symbol's module, and its god-node rank. This is graphify'sexplain Symbol, nameddescribeso it doesn't collide with the existing how-it-worksexplain.path_between+describe_symbolMCP tools.Examples (this repo)
Tests / CI
test_navigate.py: path found / unresolved / disconnected; describe card / miss. CLI + MCP goldens added.pytest: 392 passed, 14 skipped ·ruff: clean ·mypy: clean🤖 Generated with Claude Code