-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
automationcode-qualitycookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!refactoringtask-mining
Description
Description
The codebase contains 225 untyped constants that lack explicit type declarations. Adding semantic type aliases (like type FilePath string, type Label string) would improve type safety, code clarity, and prevent mixing different string categories.
Identified by
Typist Report - Go Type Consistency Analysis #12725
Current Issues
Untyped Constants Examples:
// pkg/workflow/bundler_file_mode.go
const ScriptsBasePath = "/opt/gh-aw/actions" // No type
const SetupActionDestination = "/opt/gh-aw/actions" // No type
// pkg/constants/constants.go
const AgenticCampaignLabel = "agentic-campaign" // No type
const CampaignLabelPrefix = "z_campaign_" // No type
const SafeOutputArtifactName = "safe-output" // No typeSuggested Changes
Define semantic type aliases and apply to constants:
// Define semantic types
type FilePath string
type Label string
type ArtifactName string
type FileName string
type DomainName string
// Apply to constants
const ScriptsBasePath FilePath = "/opt/gh-aw/actions"
const AgenticCampaignLabel Label = "agentic-campaign"
const SafeOutputArtifactName ArtifactName = "safe-output"Target Categories
Based on analysis, these categories contain untyped constants:
- Path constants (~50) →
type FilePath string - Label constants (~30) →
type Label string - Artifact name constants (~20) →
type ArtifactName string - Domain/URL constants (~40) →
type DomainName string - Container image constants (~15) →
type ContainerImage string - Other identifiers (~70) → Various semantic types
Files Affected
pkg/constants/constants.go- Primary file with most constantspkg/workflow/bundler_file_mode.gopkg/workflow/safe_inputs_parser.gopkg/workflow/engine_output.gopkg/workflow/copilot_engine.go- Other files with constants
Good Pattern to Follow
The codebase already has correctly typed constants:
// pkg/constants/constants.go - Already properly typed! ✅
const DefaultAgenticWorkflowTimeout = 20 * time.Minute
const DefaultToolTimeout = 60 * time.Second
const DefaultMCPStartupTimeout = 120 * time.SecondApply this same pattern (explicit types) to string constants.
Success Criteria
- All 225 untyped constants have explicit type declarations
- Semantic type aliases defined (FilePath, Label, ArtifactName, etc.)
- Function signatures updated to use semantic types where appropriate
- Type safety prevents mixing different string categories
- All tests pass after changes
Benefits
- Type Safety: Can't accidentally pass wrong type (FilePath vs Label)
- Semantic Clarity: Code is self-documenting (it's a file path, not just a string)
- Validation: Easier to add validation functions on types
- Consistency: Matches existing pattern for time.Duration constants
Estimated Effort
6-8 hours (systematic refactoring across multiple files)
Priority
Medium - Code quality improvement with clear benefits
References
- Typist Report Discussion #12725
- See report for complete list of untyped constants and analysis
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 13, 2026, 5:15 PM UTC
Metadata
Metadata
Assignees
Labels
automationcode-qualitycookieIssue Monster Loves Cookies!Issue Monster Loves Cookies!refactoringtask-mining