feat: Go resolution statistics in resolution-report command#645
Open
shivasurya wants to merge 2 commits intoshiva/pr-04-golang-thirdpartyfrom
Open
feat: Go resolution statistics in resolution-report command#645shivasurya wants to merge 2 commits intoshiva/pr-04-golang-thirdpartyfrom
shivasurya wants to merge 2 commits intoshiva/pr-04-golang-thirdpartyfrom
Conversation
Add Go call graph construction to `pathfinder resolution-report` (same
pipeline as scan.go: BuildGoModuleRegistry → InitGoStdlibLoader →
InitGoThirdPartyLoader → BuildGoCallGraph → MergeCallGraphs).
Classify Go call sites into user-code / stdlib / third-party using
site.IsStdlib (authoritative for single-segment packages like fmt/os)
and site.TypeSource ("thirdparty_local"/"thirdparty_cdn").
New helpers: extractGoModuleName (strips type name from FQN path),
printTopModules (sorts map by count, prints top N), printGoResolutionStatistics
(full Go stats section with module breakdown tables).
Add 9 new tests covering extractGoModuleName edge cases, printTopModules,
printGoResolutionStatistics variants (empty/stdlib/third-party/mixed), and
aggregateResolutionStatistics Go classification paths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Code Pathfinder Security ScanNo security issues detected.
Powered by Code Pathfinder |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## shiva/pr-04-golang-thirdparty #645 +/- ##
=================================================================
+ Coverage 84.24% 84.38% +0.14%
=================================================================
Files 162 162
Lines 23358 23449 +91
=================================================================
+ Hits 19677 19787 +110
+ Misses 2941 2917 -24
- Partials 740 745 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add TestResolutionReportCmd_WithoutGoMod and TestResolutionReportCmd_WithGoMod to exercise the Run function's new Go call graph construction block and printGoResolutionStatistics call path, bringing patch coverage above threshold. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.



Summary
pathfinder resolution-report(same asscan.go):BuildGoModuleRegistry→InitGoStdlibLoader→InitGoThirdPartyLoader→BuildGoCallGraph→MergeCallGraphs, guarded bygo.modexistence checkresolutionStatistics:GoTotalCalls,GoResolvedCalls,GoUnresolvedCalls,GoUserCodeResolved,GoStdlibResolved,GoThirdPartyResolved,GoStdlibByModule,GoThirdPartyByModulesite.IsStdlib(authoritative for single-segment stdlib likefmt/os) andsite.TypeSource("thirdparty_local"/"thirdparty_cdn")extractGoModuleName,printTopModules,printGoResolutionStatisticsaggregateResolutionStatisticsbumped to 100%Why
Without this PR there is no way to measure Go resolution rates. The resolution report is the observability layer for the entire Go third-party resolution feature — it answers whether the 97%+ resolution target from the tech spec is being hit on real projects.
Dependencies
Stacked on PR-04 (
shiva/pr-04-golang-thirdparty).Expected output
Test plan
go build ./cmd/...— zero errorsgo test ./cmd/... -count=1— all passgolangci-lint run ./cmd/...— zero issues🤖 Generated with Claude Code