Repository navigation
Go imports resolve through go.mod, not the file-stem search; client_golang as 2nd Go corpus repo (Part of #3798) - #6571
Conversation
…olang as 2nd Go corpus repo (Part of #3798) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
PR #6571 @ fa9aab9: 1 failed check(s) == shard 3 (1667394 LOC) (failure) -- real |
|
No description provided. |
|
PR #6571 @ 2fd82a4: 1 failed check(s) == shard 3 (1667394 LOC) (failure) -- real |
…n unchanged origin/main) (Part of #3798) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
PR #6571 @ dd94b35: 1 failed check(s) == graph-accuracy-audit (failure) -- real |
…#3798) The Go call-graph gate scores every Go repo of import_graph_corpus.json, so the new client_golang entry reached it; its go.mod needs Go 1.26 and the gate pins 1.24 (GOTOOLCHAIN=local), so go_callgraph failed. An entry with "callgraph": false is now an import-graph repo only; call-go stays on cobra. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
CI shepherd: the head of this PR (0b56731) is not the one a maintainer labelled |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
1 similar comment
|
No description provided. |
|
No description provided. |
1 similar comment
|
No description provided. |
…rt of #3798) call_graph_resolution.py scores every Rust repo in the import-graph corpus, so pinning ripgrep for imports also pulled it into call-rust, whose baseline is serde-rs/json alone (precision 93.8 -> 87.0, recall 60.1 -> 27.8 on CI). Mark it "callgraph": false, the opt-out #6571 added for client_golang. The engine's use-group change leaves serde's extracted imports identical (0 of 71 files differ), so the drop was the corpus, not the engine. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…[bin]] path (Part of #3798) (#6603) * import graph: pin ripgrep as Rust's second repo; expand a Rust unprefixed use group, honour [[bin]] path (Part of #3798) Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * import graph corpus: keep ripgrep out of the Rust call-graph gate (Part of #3798) call_graph_resolution.py scores every Rust repo in the import-graph corpus, so pinning ripgrep for imports also pulled it into call-rust, whose baseline is serde-rs/json alone (precision 93.8 -> 87.0, recall 60.1 -> 27.8 on CI). Mark it "callgraph": false, the opt-out #6571 added for client_golang. The engine's use-group change leaves serde's extracted imports identical (0 of 71 files differ), so the drop was the corpus, not the engine. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Part of #3798. Checklist: partial -- Go second repo done (
prometheus/client_golang); Perl second repo and the new-language families remain.What
Engine bug: a Go import path went through the file-stem name search, so
net/httplinked to anyhttp.go(client_golang'spromhttp/http.go), and an import of a package in a nested module drew no edge. Newgitgalaxy/core/go_modules.py(modelled onrust_modules.py) resolves it the way Go does: longestgo.modmodule-path prefix, then the package directory under that module's directory. A path in no scanned module (stdlib, external) draws no edge.go.modis read from disk in directories that hold or sit above a scanned.gofile;vendor/andtestdata/modules are skipped. Wired by a new language flagimports_follow_go_modules(go.py) and a branch innetwork_risk_sensor._resolve_target_unguarded.A package is a directory, so the edge goes to one representative non-test file (
<dir>.go, elsedoc.go, else first by name). Every file of the directory is a correct target, so this never invents a dependency. (My plan was to refuse multi-file directories; that gave recall 23.1%, so it was dropped.)Corpus:
prometheus/client_golang(pinned95ea5b86) added as the second Go repo; baseline and ledger regenerated (--fetch --regenerate --ledger).Result, Go (2 repos, 121 imports): before the fix P 61.6% / R 37.2% on client_golang; now P 99.2%, R 100.0%, 1 FP. Hub overlap@10 0.50 and Spearman -0.70 (cobra alone was 1.00): the harness truth gives an edge to every file of a package and the engine one, so hub ranks differ by construction.
The 1 FP is an extraction false positive, not resolution:
cobra/cobra_test.goline 265 has"github.com/spf13/cobra"inside a raw-string template, which the Go_dependency_capturereads as an import.Call-graph gate:
call_graph_resolution.py goscores every Go repo ofimport_graph_corpus.json, and client_golang'sgo.modneeds Go 1.26 while the gate pins 1.24 (GOTOOLCHAIN=local), socall-gofailed. The entry now has"callgraph": false(honoured incallgraph_refs.corpus_repos, with a test), so client_golang is in the import-graph corpus only andcall-gostays on cobra with an unchanged baseline.tests/golden_doom_rosetta/eternity.json.gz: re-blessed for main's drift (eternitygives the same four call-graph moves on an unchangedorigin/main; not caused by this PR).Class / Sibling gaps
Class: Go import tokens resolved by file stem instead of go.mod module path + directory. Handled here, each with a test: stdlib and external paths (no edge, even with a same-stem file), in-module imports, the module-root package, nested modules (longest prefix wins), aliased / dot / blank imports, several-file directories,
_test.goas non-target, vendored modules, and no scan root (no edge).Sibling gaps: (1)
go.workandreplace ../localdirectives are not read (no burned-estate program needs them; scope: sweep). (2) The Goimportcapture reads a quoted path line inside a raw-string template as an import (cobra_test.go:265; scope: core). (3) Perl second repo (Plack):uselines in POD are counted. (4) No extractor yet: Elixir, Erlang, OCaml, Julia, R, Nim, HCL. None needs a burned-estate program.Golden re-bless
Both golden masters re-blessed (
golden-lock.sh crucible_check.py --update --yes). The drift is Go edges only:network_macroarticulation points 201 -> 215, modularity 0.8478 -> 0.8475, avg path length 1.8092 -> 1.8017, assortativity -0.1231 -> -0.0897, and per-file artifact hashes of Go files (go/, dockerfile/moby/, kubernetes).Gates
pr_gates --ratchets9/9 pass (0 skipped);pr_gates --fast7/7;audit_check.pyall clear;test_go_module_resolution_3798.py(5 tests) passes as plainpytestfrom/tmp;tests/core_engine, Go extraction tests andtest_import_graph_accuracy.pypass (399). No workflow change.Lessons for agents
tests/import_graph_corpus.jsonis also scored bycall_graph_resolution.pyfor that language (the reference tool must build it). Check its toolchain need (e.g.go.modgoline vs the workflow'ssetup-gopin) or mark it"callgraph": false.🤖 Generated with Claude Code