feat(metrics): split unresolved edges into external vs unresolved-local#50
Merged
Conversation
codegraph PR reviewDiff vs main · severity ≤
|
The `unresolved_edges` count conflated two very different things: 1. External imports — `fastapi`, `os`, `react`. Static analysis without a venv/site-packages parse can't resolve these and isn't supposed to. These are expected, not errors. 2. Local-unresolved — target's root module IS in the repo but the specific symbol couldn't be matched (rename drift, dynamic import, missed binding). These are the actionable ones. `compute_metrics` now classifies each unresolved edge by checking whether the target's root module appears as a MODULE node's qualname-root in the graph. New fields: `external_edges`, `unresolved_local_edges`. The `unresolved_edges` total is kept as the sum for back-compat. Surfaced + exposed in the markdown report and the MCP `metrics` tool. v0.1.2 backlog item #2.
7f2b57f to
e07a63c
Compare
codegraph PR reviewDiff vs main · severity ≤
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
v0.1.2 backlog item #2. Surfaced when a user added polycodegraph to a FastAPI project and saw "1,423 unresolved edges," almost all of which were external imports.
Test plan
🤖 Generated with Claude Code