Skip to content

feat(tools): add lore_dependents tool for unified reverse-dependency queries#204

Merged
jafreck merged 1 commit intomainfrom
feat/lore-dependents-tool
Mar 14, 2026
Merged

feat(tools): add lore_dependents tool for unified reverse-dependency queries#204
jafreck merged 1 commit intomainfrom
feat/lore-dependents-tool

Conversation

@jafreck
Copy link
Owner

@jafreck jafreck commented Mar 14, 2026

Summary

Implements #178 — adds a new lore_dependents MCP tool that answers "what is affected if I change X?" in a single call.

Changes

New: src/server/tools/dependents.ts

  • Name-based input: takes a symbol name or file path (not numeric IDs), resolves internally
  • Cross-kind aggregation: returns callers, importers, subclasses, and type_references in one response
  • Transitive closure: depth param (1–5) follows dependents N hops deep via frontier expansion
  • Compact mode: compact: true strips provenance fields (line, character, resolution_method) to reduce tokens
  • Branch filtering: optional branch param filters all queries
  • Disambiguation: ≤5 symbol matches aggregates results; >5 returns error with candidates

Modified: src/server/tool-registry.ts

  • Registered lore_dependents in buildToolModules()

New: tests/server/tools/dependents.test.ts

  • 25 tests covering: toolDef shape- 25 tests covering: toolDef shape- 25 tests covering: toolDef shape--fi- 25 tests covering: toolDef shape- 25 tests covering: toolDef shape- 25 tests covering: toolDef shape--fi- 25 tests covele
  • 25 testlor- 25 testlor- 25 testlor- 25 testlor- 25: - 25 testlor- 25 testlor- 25 testlor- 25 testlor- 25: - 25 testlor- 25 testlor- 25 testlor- 25d"- 25 testlor- 25 testlor- 25 testlor- 25 testlor- 25: - 25 testlor- 25 testlor- 25 testlor- 25 testlor- 25: - 25 - 25 testlor- 25 testlor- 25 testlor- 25 testlor- 25: - 25 testlor- 25 testlor- 25 testlor- 25 testl}

Closes #178

…queries (#178)

Add a new lore_dependents MCP tool that returns the full blast radius
of a symbol or file in a single call, aggregating callers, importers,
subclasses, and type references across all edge types.

- Name-based input (symbol name or file path), not numeric IDs
- Cross-kind aggregation in one response
- Transitive closure via depth param (1-5 hops)
- Compact mode to reduce token count
- Branch filtering support
- Disambiguation when multiple symbols match
- 25 tests covering symbol/file queries, multi-hop, compact mode,
  branch filtering, ambiguity, and empty results

Closes #178
@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

❌ Patch coverage is 96.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.23%. Comparing base (4e3123d) to head (3fb3f70).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/server/tools/dependents.ts 95.97% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #204      +/-   ##
==========================================
+ Coverage   88.10%   88.23%   +0.13%     
==========================================
  Files          79       80       +1     
  Lines        8870     9020     +150     
  Branches     2764     2791      +27     
==========================================
+ Hits         7815     7959     +144     
- Misses       1055     1061       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jafreck jafreck merged commit f1e9655 into main Mar 14, 2026
3 checks passed
@jafreck jafreck mentioned this pull request Mar 15, 2026
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