Skip to content

feat(core): add change impact analysis - #329

Closed
joesobo wants to merge 2 commits into
mainfrom
codex/change-impact
Closed

feat(core): add change impact analysis#329
joesobo wants to merge 2 commits into
mainfrom
codex/change-impact

Conversation

@joesobo

@joesobo joesobo commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a public read-only Core change-impact report for exact File paths and Symbol IDs
  • add codegraphy impact <node...> as a multi-target adapter boundary for changed File lists
  • return bounded affected Files and Symbols, graph-linked tests, short typed evidence paths, public reexport crossings, Package crossings, freshness, and completeness
  • update CLI help, public documentation, the CodeGraphy agent skill, release contract tests, and the Core changeset

Algorithm and limits

The report expands exact File targets to their indexed Symbols, then performs deterministic breadth-first traversal over incoming typed Relationships. It excludes structural nests Edges from impact evidence.

Ranking is:

  1. shortest incoming typed Relationship path
  2. source File before test File
  3. File path

The CLI uses a maximum depth of 3, visits at most 2,000 Nodes, returns 20 affected Files by default, and accepts at most 100 results. The report states all active limits and any truncation reason.

Test classification uses File paths. Public boundary evidence requires an explicit reexport Relationship. Package boundaries compare nearest indexed package.json roots. These are deterministic graph heuristics, not runtime proof or confidence scores.

The Core report does not read Git state. Its multi-target input is the adapter boundary for a caller that has already resolved a changed File list.

Example

codegraphy impact \
  packages/core/src/graphQuery/model.ts \
  packages/core/src/graphQuery/pathTraversal.ts

Verification

Passing:

  • focused Core tests: 8 files, 43 tests
  • Core lint
  • Core typecheck
  • Core build
  • CodeGraphy skill release contract: 3 tests
  • git diff --check
  • Core coverage/CRAP test run: 349 files, 1,509 tests

Quality work still in progress:

  • the first correctly scoped mutation run for packages/core/src/graphQuery/changeImpact/model.ts scored 74.29%, below the required 90%
  • the same run reported 286 mutation sites, above the 50-site design limit
  • the broad mutation wrapper first selected unrelated model.test.ts files and failed when a write-coordination child process tried to import Stryker's instrumented HTTP module URL; the explicit matching test include avoided that tool interaction

This PR is a draft until the change-impact module is split or the scoped mutation score reaches 90%.

Tradeoffs

  • incoming static Relationships can miss dynamic or unanalyzed consumers
  • a high-fanout hub can produce many legitimate candidates, so output is bounded and reports incompleteness
  • only graph-linked tests appear; path naming supplies the test label
  • stale cached Relationships remain usable evidence, but the report marks them stale after current indexed source hashes change

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codegraphy Ready Ready Preview Jul 30, 2026 4:53pm

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c76e847

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@codegraphy-dev/core Minor
@codegraphy-dev/extension Patch
@codegraphy-dev/tldraw Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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