Skip to content

feat(navigate): path + describe graph navigation (Phase 3/4)#14

Merged
denfry merged 1 commit into
mainfrom
feat/path-describe-navigation
Jun 23, 2026
Merged

feat(navigate): path + describe graph navigation (Phase 3/4)#14
denfry merged 1 commit into
mainfrom
feat/path-describe-navigation

Conversation

@denfry

@denfry denfry commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Phase 3 of 4 — porting safishamsi/graphify into codebase-index

Stacked on #13 (Phase 2), which is stacked on #12 (Phase 1). Review in order. GitHub retargets the base as each merges.

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/ambiguous hops 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's explain Symbol, named describe so it doesn't collide with the existing how-it-works explain.
  • path_between + describe_symbol MCP tools.

Examples (this repo)

$ codebase-index describe Database
describe: Database · module src/codebase_index/storage · in 67 / out 0 · god node #2
definition(s): class Database at src/codebase_index/storage/db.py:15
callers (67): cli.py:52, mcp/server.py:110, service.py:84 …

$ codebase-index path renew refresh_access_token
renew (src/api/service.py)  → call →  refresh_access_token (src/auth/token.py)   · 1 hop

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"]))]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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>
@denfry denfry force-pushed the feat/path-describe-navigation branch from c72d05b to a6e2c81 Compare June 23, 2026 20:52
@denfry denfry changed the base branch from feat/architecture-command to main June 23, 2026 21:01
@denfry denfry merged commit 5676b9a into main Jun 23, 2026
10 checks passed
@denfry denfry deleted the feat/path-describe-navigation branch June 23, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant