feat: add MCP trace tools#176
Merged
BartWaardenburg merged 2 commits intofallow-rs:mainfrom Apr 24, 2026
Merged
Conversation
74b6ea1 to
8f9b758
Compare
8 tasks
BartWaardenburg
added a commit
that referenced
this pull request
Apr 25, 2026
`fallow dead-code --trace-dependency PACKAGE` and the MCP `trace_dependency` tool reported `is_used=false, import_count=0` for packages invoked only via package.json scripts (microbundle, vitest, eslint) and CI configs (.github/workflows/*.yml, .gitlab-ci.yml). The unused-deps detector already ignores those because it cross-references `script_used_packages` produced by the script analyzer; the trace path bypassed that data, so the two surfaces disagreed. An agent reading the trace would conclude the dep is safe to remove and break the build. Thread `script_used_packages` from `AnalysisOutput` through to `trace_dependency` and add `used_in_scripts: bool` to `DependencyTrace`. `is_used` is now `import_count > 0 || used_in_scripts`, matching the unused-deps detector's view. Human format adds a 'Referenced from package.json scripts or CI configs' footer when the flag is set; MCP tool description mentions the new field; rules doc updated. Verified end-to-end on benchmarks/fixtures/real-world/preact via MCP stdio: microbundle now reports `is_used=true, used_in_scripts=true`, mobx still `is_used=false`, preact (real import) still `is_used=true, import_count=191`. Surfaced during the post-merge dogfood of PR #176 / #177.
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.
What
Why
Validation
cargo build -p fallow-cli -p fallow-mcpcargo test -p fallow-mcpcargo clippy -p fallow-mcp --tests -- -D warningscargo fmt --all -- --check