fix(scanner): Resolve Rust use trees - #124
Conversation
Resolve grouped Rust use trees (use crate::{a, b}) into per-path dependency
references, including aliased imports.
Co-Authored-By: GPT-5.6 Sol <codex@openai.com>
|
Reviewed and approved on the merits — but #126 just landed and this is now What I verified, by dumping the full resolved edge set from Net on the fixture: +6 true edges, −2 false edges, 0 new false edges. One thing worth folding in while you rebase (~3 lines): the claim that malformed trees "remain conservative" isn't quite true today. The gate at use crate::{/* note */ alpha::Thing, beta}; // -> lib.rs (should be alpha.rs + beta.rs)
use crate::{}; // -> lib.rs (a no-op import inventing an edge)Setting a kind that resolves to nothing when expansion fails on a brace-bearing path would make the PR's own claim true and delete two false edges. Not blocking, for later: Suggested order for the remaining three: this one next (only the rebase), then #127 (needs the |
What does this PR do?
Resolve local
crate,self, andsuperuse trees, including nested groups, aliases,self, and glob module imports. External imports retain the existing scanner path, while malformed and generated routes remain conservative.Type of change
Checklist
go build && ./codemap .CONTRIBUTING.md; this does not add a new language.Additional notes
Focused parser/extraction/resolution tests,
go vet ./..., and the full race/coverage suite are GREEN.On GitButler's 978-file Rust corpus, the change adds 588 specific local-module edges and removes 75 false crate/test-root fallback edges. Existing external imports and leading hub counts are preserved.
This branch targets until that prerequisite lands.
Developed with carefully directed, manually reviewed AI assistance.