-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
Description
Description
The FileTracker name is used for both an interface and a struct in different packages, creating confusion and potential import conflicts. This was identified in the Typist - Go Type Consistency Analysis (#11485).
Current Situation:
- Interface:
pkg/workflow/compiler_types.go:12-14- Minimal contract withTrackCreated(string)method - Struct:
pkg/cli/file_tracker.go:16-21- Full-featured implementation with rollback capabilities
These serve completely different purposes and should have distinct names.
Suggested Changes
Option 1: Rename the interface (Recommended):
// pkg/workflow/compiler_types.go
type FileCreationTracker interface {
TrackCreated(filePath string)
}Option 2: Rename the struct:
// pkg/cli/file_tracker.go
type FileSystemTracker struct {
CreatedFiles []string
ModifiedFiles []string
OriginalContent map[string][]byte
gitRoot string
}Files Affected
pkg/workflow/compiler_types.go(interface definition)pkg/cli/file_tracker.go(struct definition)- All files referencing the interface (need to update imports/usage)
Success Criteria
- One type renamed to eliminate name collision
- All references updated to use new name
- No import conflicts remain
- All existing tests pass
- Clear semantic distinction between the two types
Source
Extracted from Typist - Go Type Consistency Analysis discussion #11485
The analysis concluded "Good Type Discipline" overall, with this being the only critical name collision found across 397 type definitions.
Priority
High - Eliminates confusion and potential import conflicts. Estimated effort: 1-2 hours.
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 14, 2026, 1:35 AM UTC