fix(scanner): Resolve Rust use trees - #124
Conversation
|
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 |
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>
7905541 to
8661d91
Compare
RebasedThe astgrep conflict was resolved as a union of all three rule IDs, so nothing was silently disabled. Compliance
Where I didn't fully comply
Other changes the review forced (not in your suggestions)
|
8661d91 to
b447100
Compare
The termination budget ran concurrently with the scan deadline (both started at marker-read), leaving only the fake ast-grep spawn latency of slack after the deadline fired — loaded macOS CI runners missed it. Budget now spans scan deadline plus termination, matching the elapsed check's own 10s allowance.
What does this PR do?
crate,self, andsuperuse trees into per-path dependency edges: nested groups, aliases,self, glob module imports, andpubre-exports.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 macOS Go 1.26.5. The exact publication branch is also GREEN on Linux Go 1.24.13.On GitButler's 978-file Rust corpus, the change adds 588 specific local-module edges and removes 75 false crate/test-root fallback edges — measured before the review follow-ups (
pubre-exports and conservative brace handling), which shift both numbers. Non-grouped external imports are unchanged;pubre-export hubs now gain edges.Developed with carefully directed, manually reviewed AI assistance.