Repository navigation
Call-graph reference: Go via golang.org/x/tools VTA on cobra (Part of #3782) - #6397
Merged
Merged
Conversation
…3782) Adds the go_callgraph helper, the callgraph_refs.REFERENCES["go"] entry and adapter, a fixture test, the cobra baseline and the graph_accuracy.md section. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nd Go references) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 24, 2026 07:19
squid-protocol
enabled auto-merge (squash)
October 24, 2026 07:20
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #3782 (epic #3772). Go call-graph reference on spf13/cobra, same pattern as the JS entry in #6392.
What changed
tests/tools/go_callgraph/(main.go,go.mod,go.sum): type-checks the repo (tests included), builds SSA, emits thecallgraph_refscontract from thegolang.org/x/tools0.37.0 VTA graph over a CHA seed.tests/tools/callgraph_refs.py:go_contract,_go_version(needs Go 1.24+ on PATH),REFERENCES["go"].tests/tools/test_call_graph_resolution_gate.py: fixture test (functions, pointer-receiver method, interface call, closure, generic, cross-package call, stdlib external); skips without Go.tests/call_graph_resolution_go_baseline.json(generated) and thedocs/graph_accuracy.mdrow + section.Numbers (cobra @ pinned commit)
confident precision 99.3% (1,367 judged), recall 82.9% (1,636 reference edges), resolution recall 89.1%; 123 confident links land on a name the checker resolves to the standard library (strict precision 91.1%). Without
_test.goin the reference 1,019 engine ends were unmapped; with them 2, so tests are included.Class / Sibling gaps
Class: a language with a corpus repo in
tests/import_graph_corpus.jsonbut no registered compiler call-graph reference. Handled here: go. Gaps (not done, need their own tool/adapter): c (hiredis, libuv), cpp (fmt), lua, php (guzzle), and any other corpus language without aREFERENCESentry; javascript is #6392. CI gap:graph-accuracy-audit.ymlhas no Go setup step nor agogate line (workflows untouched here), so the baseline is not CI-enforced yet.Gates
pr_gates --fast7/7.--ratchets9 pass, 0 fail, 0 skipped. No engine change, no golden bless.Cross-repo
None. #6392 touches the same three shared files; whichever merges second merges main (hunks are adjacent, not overlapping).
Lessons for agents
ssa.Function.Origin()is nil for a non-generic function: don't treat nil as "no function".InstantiateGenericsan instance isSyntheticwith a nilParent: skip wrappers only whenOrigin() == niltoo._test.goleaves most engine links unmapped; include tests if the engine scans them.🤖 Generated with Claude Code