Skip to content

fix: avoid sibling methods in impact traversal#598

Open
sjh9714 wants to merge 7 commits into
colbymchenry:mainfrom
sjh9714:fix-impact-sibling-traversal
Open

fix: avoid sibling methods in impact traversal#598
sjh9714 wants to merge 7 commits into
colbymchenry:mainfrom
sjh9714:fix-impact-sibling-traversal

Conversation

@sjh9714
Copy link
Copy Markdown

@sjh9714 sjh9714 commented May 31, 2026

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 contains edge 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.ts
  • npm run build
  • node dist/bin/codegraph.js impact NoReferences --path "$tmp" --depth 2 --json after creating the C# fixture used for reproduction
  • npx 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 transient mcp-roots timeout)

Note: I used Codex while preparing this change, reviewed the final diff, and ran the listed checks locally.

sjh9714 and others added 7 commits June 1, 2026 03:43
…+ 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.
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.

Siblings shouldn't be included in impact by default

2 participants