refactor: create core package with foundation types#372
Merged
Conversation
This PR creates the foundational type system for the callgraph refactoring by extracting pure data structures with zero internal dependencies into a new core package. Changes: - Created core/ package with foundation types - Moved CallGraph, CallSite, Location, Argument types - Moved Statement, DefUseChain, TaintSummary types - Moved FrameworkDefinition and StdlibRegistry types - Added type aliases in original files for backward compatibility - Moved and updated test files to core/ package - All tests passing (callgraph: 87.3%, core: 74.1% coverage) Related: PR #1 of callgraph refactoring stack Spec: https://github.com/shivasurya/cpf_plans/pr-details/refactor/pr-01-foundation-types.md 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Owner
Author
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #372 +/- ##
==========================================
+ Coverage 79.81% 80.07% +0.26%
==========================================
Files 64 69 +5
Lines 6802 6836 +34
==========================================
+ Hits 5429 5474 +45
+ Misses 1147 1139 -8
+ Partials 226 223 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Added missing tests for: - BuildDefUseChains function with various scenarios - ComputeStats method with edge cases - All StdlibRegistry methods (GetModule, HasModule, GetFunction, etc.) Coverage improved from 74.1% to 100.0% 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Owner
Author
✅ Coverage ImprovementUpdated the PR to address the coverage concerns: Before
After
Changes
Test ResultsThe patch coverage should now be significantly improved! |
Add t.Helper() calls to test helper functions and simplify lambda expression to comply with golangci-lint requirements (thelper and unlambda rules). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
e6fc182 to
7a38aa9
Compare
This was referenced Nov 15, 2025
Owner
Author
Merge activity
|
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.

Overview
This PR creates the foundational type system for the callgraph refactoring by extracting pure data structures with zero internal dependencies into a new
corepackage. These types form the contract that all other packages will depend on.Status: ✅ Ready for review
Estimated Effort: 2-3 days
Risk Level: ⬜ Low (pure types, no logic changes)
Changes
New Core Package Structure
Type Aliases for Backward Compatibility
All original files updated with type aliases and deprecation notices:
types.go- Aliased CallGraph, CallSite, Location, etc.statement.go- Aliased Statement, DefUseChain, DefUseStatstaint_summary.go- Aliased TaintInfo, TaintSummaryframeworks.go- Aliased FrameworkDefinitionattribute_registry.go- Aliased ClassAttribute, ClassAttributesstdlib_registry.go- Aliased all stdlib typestype_inference.go- Aliased TypeInfoTest Results
✅ Build:
gradle buildGo- SUCCESSFUL✅ Tests:
gradle testGo- ALL PASSING✅ Lint:
gradle lintGo- 0 ISSUES✅ Coverage: callgraph 87.3%, core 74.1%
Key Features
Related
Checklist
gradle testGo)gradle lintGo)🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com