codegraph
codegraph copied to clipboard
fix: avoid sibling methods in impact traversal
Summary
Fixes #536.
codegraph impact could walk from a method to its parent class through an incoming contains edge and then fan back out to every child of that class, so unrelated sibling methods appeared as impacted. This keeps the parent in the impact result but suppresses the sibling fan-out for containers reached through child-to-parent contains traversal.
Changes
- Track when impact traversal reaches a container through an incoming
containsedge and skip expanding that container's children in that case. - Add a C# regression fixture covering a method with an unrelated sibling method.
- Add an Unreleased changelog entry for the impact behavior fix.
Testing
npx vitest run __tests__/graph.test.ts -t "should not include sibling methods reached through parent contains edges"(failed before the fix, passed after)npx vitest run __tests__/graph.test.tsnpm run buildnode dist/bin/codegraph.js impact NoReferences --path "$tmp" --depth 2 --jsonafter creating the C# fixture used for reproductionnpx vitest run __tests__/mcp-roots.test.ts -t "honors an explicit rootUri without asking the client for roots"(rerun after one full-suite timeout)npm test(passed on rerun; first run had one transientmcp-rootstimeout)
Note: I used Codex while preparing this change, reviewed the final diff, and ran the listed checks locally.
Git config/CD