feat(scanner): Add Go parser fallback - #123
Conversation
35fd6b2 to
ff6e0f1
Compare
|
Reviewed in depth. The core mechanism is sound and genuinely well-tested — with ast-grep missing, a Go repo now returns correct edges with honest provenance ( Two things I'd want fixed before it lands. 1. Non-Go languages silently answer "none" instead of failing honestlyIn a repo containing both Go and TypeScript, with ast-grep unavailable, the Go fallback succeeds — which means the graph builds — but it contains no TS edges.
The JSON surface and MCP both stay honest ( 2. The fallback doesn't fire on timeout or failure, only on "not installed"The PR body says the fallback covers when ast-grep "fails or times out". It doesn't. Zero fallback, with parseable Go files sitting right there. Timeout and non-zero exit are the realistic large-repo failures — those are exactly the cases the fallback would earn its keep, and they're the ones it misses. Either widen the gate or narrow the claim in the body. Smaller notes
Merge-order noteThis changes More importantly: with ast-grep unavailable the Go fallback emits no Rust analyses, so all of the Rust resolution work in #124–#127 is inert on that path, and the |
Parse Go source when ast-grep is unavailable.
Route public dependency scans through the Go parser fallback; keep cargo recovery graph-scoped, avoid duplicate cargo loads, and port tests to the post-JordanCoin#105 API.
- Emit coverage in the empty --importers CLI branch; scope the Go note to .go - Fire the Go fallback on degraded ast-grep outcomes (timeout/failure) - Dedup cargo-metadata sources in the --deps graph build - Drop the recovered-edge claim from the deps payload note - Count only dependency-bearing files in the recovery note; skip methods
ff6e0f1 to
05640a9
Compare
RebasedAll six code-review points are addressed in the compliance commit. Compliance
Where I didn't fully comply
|
|
After v4.4.1 what needs to be done to finish this? |
|
Nothing — it's done. Verified against main with the full Rust batch (#124/#127/#141) merged: clean merge, full Generated by Claude Code |
What does this PR do?
cargo metadataruns or duplicate cargo-metadata sources in the--depspayload.Type of change
Checklist
go build && ./codemap .CONTRIBUTING.md; this does not add a new language.Additional notes
The Go fallback counts only dependency-bearing files in its recovery note, skips methods (matching ast-grep's function capture, so the files/functions set doesn't churn across authoritative→fallback transitions), and reports nothing for non-Go files that a partial scan cannot see.
Developed with carefully directed, manually reviewed AI assistance.