fix: avoid sibling methods in impact traversal#598
Open
sjh9714 wants to merge 7 commits into
Open
Conversation
…+ cold-start handshake (colbymchenry#580) Trace endpoint relevance (overloaded names resolve to the real implementation instead of an empty protocol/delegate stub), Swift closure-collection synthesizer, multi-phase god-file explore rendering, and serve --mcp cold-start handshake sped ~811ms→~90ms (proxy answers initialize/tools-list locally). Full suite green (1090 pass).
…olbymchenry#603) The 0.9.x thin-installer turned @colbymchenry/codegraph into a bin-only shim: require("@colbymchenry/codegraph") threw MODULE_NOT_FOUND and no types shipped, breaking embedded library consumers (e.g. Electron apps) upgrading from 0.8.0. Restore programmatic use without re-bloating the thin shim or duplicating the ~49 MB of grammars the per-platform bundle already carries: - main -> npm-sdk.js re-exports the installed per-platform bundle's compiled library (lib/dist/index.js) at runtime, reusing that bundle's own deps; it falls back to a self-healed cache bundle, else throws an actionable error. - types -> ship the .d.ts tree only (~590 KB) in the main package, built from the same release so it can never skew from the runtime it re-exports. - exports map resolves the `types` condition (nodenext) and the default entry. - DatabaseConnection + QueryBuilder are now top-level exports, so embedded callers get the building blocks from the package entry instead of deep dist/ imports (which the shim no longer ships). The CLI/MCP `bin` keeps execing the bundled Node; only library consumers run on their own runtime, which must be Node 22.5+ for the built-in node:sqlite. Validated end-to-end: built a real darwin-arm64 bundle, packed the npm packages, installed them into a throwaway consumer, and confirmed require() plus a full init/indexAll/searchNodes round-trip and the low-level DatabaseConnection/QueryBuilder path all work on the host Node; types resolve under both nodenext and classic node resolution; and the CLI shim still launches. New hermetic tests cover npm-sdk resolution, cache fallback, and the missing-bundle error. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cuts the 0.9.8 release, which carries the restored embedded/programmatic SDK API (colbymchenry#354) along with the rest of the [Unreleased] changelog. The Release workflow promotes [Unreleased] -> [0.9.8] and appends the link reference; only the version fields are bumped here. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
[skip ci] Auto-generated by Release workflow.
… fix-impact-sibling-traversal
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
Fixes #536.
codegraph impactcould walk from a method to its parent class through an incomingcontainsedge 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-parentcontainstraversal.Changes
containsedge and skip expanding that container's children in that case.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.