feat: add tilth_deps — file-level dependency analysis#19
Merged
Conversation
Closed
New MCP tool for blast-radius checks before breaking changes. Shows what a file imports (local + external) and what other files call its exports, with symbol-level detail. One call replaces 5-10 separate callers searches. - Add src/search/deps.rs with analyze_deps() and format_deps() - Wire tilth_deps into MCP dispatch and tool definitions - Make is_external, is_import_line, find_callers_batch pub(crate) - Filter stdlib imports and invalid module paths from externals - Budget-aware truncation (Used by → externals → local symbols) - Test file grouping (separate "Used by (tests)" section) - Barrel file detection (cap at 25 symbols with note) - Bump version to 0.4.8 Closes #17 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Track total_dependents before MAX_DEPENDENTS truncation - Header now shows real total, not truncated count - Show "... and N more dependents" when list is capped - Fix budget Level 3: strip symbols from local deps (was re-joining full lines) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d27f882 to
acecf9e
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Format used-by section as `path:line Type.method → symbol` instead of bare function names without location. Carries CallerMatch.line through Dependent and resolves enclosing type (class, impl, struct) in find_enclosing_function. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
New MCP tool
tilth_depsfor blast-radius checks before breaking changes. One call shows what a file imports and what imports it, replacing 5-10 separatetilth_search kind:callersqueries.path:line Type.method → symbolformatCloses #17
Changes
src/search/deps.rsanalyze_deps()+format_deps()with line numbers in used-bysrc/mcp.rstilth_depstool + dispatch + instructionssrc/search/mod.rspub mod depssrc/read/imports.rsis_external,is_import_linepub(crate)src/search/callers.rsfind_callers_batchpub(crate), qualify caller names with enclosing typeCargo.toml/npm/package.jsonExample output
Test plan
cargo clippy— zero warningscargo test— all tests passtests.test_basic_membership)src/cache.rs:25)🤖 Generated with Claude Code