Skip to content

Repo map tool with dependency graph and PageRank - #13

Merged
tjdoomer merged 2 commits into
mainfrom
feature/repo-map
Apr 2, 2026
Merged

tjdoomer merged 2 commits into
mainfrom
feature/repo-map

Conversation

@tjdoomer

@tjdoomer tjdoomer commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The biggest feature — a codebase-aware navigation tool that pre-digests the project for the model.

  • Symbol extraction: regex-based for TS/JS/Python/generic (behind ISymbolExtractor interface for tree-sitter upgrade later)
  • Dependency graph: directed import graph with iterative PageRank (20 iterations, damping 0.85)
  • Ranking: TF-IDF relevance to query (0.6) + PageRank centrality (0.3) + file recency (0.1)
  • Indexing: fdir crawling, content-hash caching, lazy build on first query, auto-rebuild when >20% files change
  • Output: tree-style file→symbol hierarchy within configurable token budget (default 2000)

Zero new dependencies.

New files

  • packages/core/src/indexing/types.ts — shared interfaces
  • packages/core/src/indexing/symbolExtractor.ts — regex extraction
  • packages/core/src/indexing/dependencyGraph.ts — import graph + PageRank
  • packages/core/src/indexing/symbolRanker.ts — TF-IDF + combined scoring
  • packages/core/src/indexing/repoIndex.ts — orchestrator + cache
  • packages/core/src/tools/repoMap.ts — tool entry point

Test plan

  • All 1873 tests pass
  • Type-check clean
  • Full workspace build clean
  • Manual: repo_map query against Delta-code's own codebase

AST extraction, dependency graph, PageRank ranking, and context-aware
truncation for compact codebase navigation. The big differentiator.
Codebase-aware navigation tool that gives the model a ranked "table of
contents" showing the most relevant files and symbols for a given query.

Architecture:
- symbolExtractor.ts: regex-based extraction (ISymbolExtractor interface
  allows tree-sitter swap later)
- dependencyGraph.ts: import graph + iterative PageRank (20 iterations,
  damping 0.85)
- symbolRanker.ts: TF-IDF (0.6) + PageRank (0.3) + recency (0.1)
- repoIndex.ts: orchestrator with fdir crawling, content-hash caching,
  lazy build, auto-rebuild on >20% file changes
- repoMap.ts: tool entry point (singleton index per session)

Zero new dependencies — reuses fdir, crypto, fs from existing deps.
The ISymbolExtractor interface is the upgrade seam for tree-sitter.

All 1873 tests pass. Full workspace build clean.
@tjdoomer
tjdoomer merged commit e27e0da into main Apr 2, 2026
@coderabbitai

coderabbitai Bot commented Apr 2, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@tjdoomer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 48 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 48 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7b7d7274-937e-4be9-9146-49ab13fcb6c0

📥 Commits

Reviewing files that changed from the base of the PR and between 10c546c and 56fcd58.

📒 Files selected for processing (8)
  • docs/roadmap/08-repo-map.md
  • packages/core/src/config/config.ts
  • packages/core/src/indexing/dependencyGraph.ts
  • packages/core/src/indexing/repoIndex.ts
  • packages/core/src/indexing/symbolExtractor.ts
  • packages/core/src/indexing/symbolRanker.ts
  • packages/core/src/indexing/types.ts
  • packages/core/src/tools/repoMap.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/repo-map

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants