You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good news first: this codebase already has strong type-consolidation discipline. I scanned 1,383 non-test .go files under pkg/ (≈1,406 top-level type declarations) for duplicated types, and nearly every apparent "duplicate" turned out to already be intentionally resolved — most cross-package name collisions (ActionPin, ActionYAMLInput, ActionPinsData, ContainerPin, SHAResolver, InputDefinition, SanitizeOptions, LogMetrics, ToolCallInfo) are type X = otherpkg.X aliases, and the ValidationError "duplicate" is actually a deliberate shared-interface pattern (pkg/validationerror) that parser.ValidationError and workflow.WorkflowValidationError both implement by embedding a common Payload. Only two name-alike pairs remain as loose ends, and both turn out to have little-to-no real field overlap — likely coincidental naming rather than duplication.
On the untyped-usage side, interface{}/any usage is already rare and mostly legitimate (JSON/YAML interop, or dead code behind build tags). After filtering out ~19,800 false-positive matches of the English word "any" in comments/strings, only 3 genuine any-as-type usages and 2 interface{} usages remain worth a look. The most actionable opportunity is a small cluster of untyped numeric constants (timeouts expressed as bare int in hours/minutes/seconds) that would benefit from named unit types — cheap wins that prevent unit-confusion bugs.
Full Analysis Report
Duplicated Type Definitions
Summary Statistics
Total files analyzed: 1,383
Total types analyzed: ~1,406
Clusters flagged by initial pass: 12
Already resolved via type alias (not a problem): 9
Intentional shared-interface design (not a problem): 1
Near-duplicate names, low real overlap (low priority): 2
Already consolidated — no action needed
These name collisions are not duplication bugs; they're type X = otherpkg.X aliases that let pkg/workflow and pkg/cli reference shared types from pkg/actionpins and pkg/types without an extra import, confirmed by reading the alias declarations directly:
pkg/validationerror.ValidationError is a documented interface (error + ValidationField/Value/Reason/Suggestion); pkg/parser.ValidationError and pkg/workflow.WorkflowValidationError both implement it by embedding validationerror.Payload. The package doc comment explicitly says this is by design so errors.As can uniformly detect structured validation errors regardless of producing package. No action needed.
Near-duplicate names with low real overlap (low priority)
JobInfo (pkg/cli/logs_models.go, 23 fields) vs JobData (pkg/cli/audit_report.go, 5 fields) — same package, Info/Data naming pattern, but only 3 of 23 fields actually match (Name, Status, Conclusion) — ~13% overlap. JobInfo mirrors the raw GitHub Actions Jobs API response; JobData is a slimmed-down report-rendering DTO. Likely intentional separation of concerns, not a duplicate to merge — but worth a short doc comment on each explaining why both exist, since the names invite confusion.
ExperimentInfo (pkg/cli/experiments_state.go) vs ExperimentData (pkg/cli/audit_report_experiments.go) — 0% field overlap (WorkflowID/Branch/Experiments/TotalRuns/LastRun vs Assignments/CumulativeCounts). This looks like a pure naming coincidence rather than duplication — recommend renaming one (e.g. ExperimentSummary / ExperimentAssignmentCounts) purely for readability, not correctness.
Untyped Usages
Summary Statistics
Raw interface{} matches (non-test): ~33 across 7 files (most in pkg/linters/**/testdata fixtures or already-typed contexts) → 2 genuine findings
Raw any matches (non-test): ~19,808 across 1,582 files (overwhelmingly the English word in comments/docs) → 3 genuine type-usage findings
Untyped constants worth typing: 6
Category 1: interface{} / any findings
#
Location
Issue
Suggested fix
Impact
1
pkg/console/layout_wasm.go:16
func LayoutEmphasisBox(content string, color any) string — parameter unused, zero callers anywhere in pkg
Delete the dead parameter, or give it a concrete Color-like type if intended for future use
Dead code in a js/wasm-tagged stub; zero functional risk
2
pkg/console/console_types.go:50
FormField.Value any — but FormField/RunForm appear unused by the real (non-wasm) form implementation (pkg/console/prompt_form.go uses huh/v2 directly)
Delete FormField/RunForm if truly vestigial, or replace any with a discriminated union keyed by Type
Low risk — likely dead API surface
3
pkg/cli/mcp_tools_privileged.go:458
auditArgs.RunID any / RunIDOrURL any — jsonschema docs say these only ever accept string-or-number
Introduce a small StringOrInt type with custom UnmarshalJSON shared across "run ID or URL" MCP args
Low-medium — works today, but a shared type would remove repeated ad-hoc type switches
const defaultCacheIntegrityLevel = "none" — duplicates the existing GitHubIntegrityLevel enum value GitHubIntegrityNone declared in pkg/workflow/tools_types.go:300
const defaultCacheIntegrityLevel GitHubIntegrityLevel = GitHubIntegrityNone; change cacheIntegrityLevel() to return GitHubIntegrityLevel instead of string
2
pkg/cli/run_workflow_execution.go:25
const workflowCompletionWaitTimeoutMinutes = 6 * 60 (passed as bare int to WaitForWorkflowCompletion(..., timeoutMinutes int, ...))
type Minutes int (or use time.Duration at the call site) so callers can't pass seconds/hours by mistake
3
pkg/workflow/publish_code_coverage.go:18
const defaultCodeCoverageWaitForProcessingTimeout = 160 (seconds, per comment only)
type Seconds int
4
pkg/workflow/maintenance_workflow.go:128
const defaultNoOpIssueExpirationHours = 24 * 30, compared/aggregated with other bare-int *Hours constants in the same function
const DefaultActionFailureIssueExpiresHours = 24 * 7 (exported, referenced across files/tests)
Same type Hours int
6
pkg/constants/job_constants.go:310-311
DefaultRateLimitWindow = 60 (minutes, per comment; also user-configurable from workflow frontmatter as a plain int)
type Minutes int for the window; DefaultRateLimitMax is a plain count and is fine as-is
The highest-confidence item is #1 — it's a plain duplicate of an already-existing typed enum value in the same package, so a future edit could typo "None" here without the compiler catching it, unlike every other integrity-level call site which already uses GitHubIntegrityNone.
Recommendations, prioritized
Priority 1 — quick, safe win: Fix pkg/workflow/cache_integrity.go:17 to reuse GitHubIntegrityNone instead of a bare string literal. Single-file change, ~15 minutes.
Priority 2 — unit-safety cleanup: Introduce type Hours int / type Minutes int / type Seconds int in an appropriate shared location (e.g. pkg/workflow or a small pkg/timeutil) and apply to the 5 remaining untyped-constant findings above. Each is independent and low-risk; ~2-3 hours total including tests.
Priority 3 — cosmetic / optional: Rename ExperimentInfo/ExperimentData to less confusable names, and add doc comments clarifying why JobInfo and JobData are intentionally separate. No functional change.
Priority 4 — cleanup, if confirmed dead: Remove pkg/console/layout_wasm.go's unused color any parameter and the unused FormField/RunForm in pkg/console/console_types.go/form_wasm.go, or wire them up properly if they're meant to be used.
Not recommended: consolidating the 9 already-aliased types (ActionPin family, InputDefinition, SanitizeOptions, LogMetrics, ToolCallInfo) or touching ValidationError — both are already the correct pattern.
Analysis Metadata
Total Go files analyzed: 1,383 (non-test, under pkg/)
Total type definitions surveyed: ~1,406
Duplicate clusters flagged / confirmed real: 12 flagged, 2 low-priority near-duplicates confirmed, 10 resolved as intentional (aliases or shared-interface design)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
🔤 Typist — Go Type Consistency Analysis
Analysis of repository: github/gh-aw
Executive Summary
Good news first: this codebase already has strong type-consolidation discipline. I scanned 1,383 non-test
.gofiles underpkg/(≈1,406 top-level type declarations) for duplicated types, and nearly every apparent "duplicate" turned out to already be intentionally resolved — most cross-package name collisions (ActionPin,ActionYAMLInput,ActionPinsData,ContainerPin,SHAResolver,InputDefinition,SanitizeOptions,LogMetrics,ToolCallInfo) aretype X = otherpkg.Xaliases, and theValidationError"duplicate" is actually a deliberate shared-interface pattern (pkg/validationerror) thatparser.ValidationErrorandworkflow.WorkflowValidationErrorboth implement by embedding a commonPayload. Only two name-alike pairs remain as loose ends, and both turn out to have little-to-no real field overlap — likely coincidental naming rather than duplication.On the untyped-usage side,
interface{}/anyusage is already rare and mostly legitimate (JSON/YAML interop, or dead code behind build tags). After filtering out ~19,800 false-positive matches of the English word "any" in comments/strings, only 3 genuineany-as-type usages and 2interface{}usages remain worth a look. The most actionable opportunity is a small cluster of untyped numeric constants (timeouts expressed as bareintin hours/minutes/seconds) that would benefit from named unit types — cheap wins that prevent unit-confusion bugs.Full Analysis Report
Duplicated Type Definitions
Summary Statistics
Already consolidated — no action needed
These name collisions are not duplication bugs; they're
type X = otherpkg.Xaliases that letpkg/workflowandpkg/clireference shared types frompkg/actionpinsandpkg/typeswithout an extra import, confirmed by reading the alias declarations directly:ActionYAMLInput,ActionPin,ActionPinsData,ContainerPin,SHAResolverpkg/actionpinspkg/workflow/action_pins.goInputDefinitionpkg/typespkg/workflow/inputs.goSanitizeOptionspkg/stringutilpkg/workflow/strings.goLogMetrics,ToolCallInfopkg/workflowpkg/cli/logs_models.goRecommendation: none — this is the pattern the team should keep using when a type needs to be shared across packages.
ValidationError— intentional shared-interface patternpkg/validationerror.ValidationErroris a documented interface (error+ValidationField/Value/Reason/Suggestion);pkg/parser.ValidationErrorandpkg/workflow.WorkflowValidationErrorboth implement it by embeddingvalidationerror.Payload. The package doc comment explicitly says this is by design soerrors.Ascan uniformly detect structured validation errors regardless of producing package. No action needed.Near-duplicate names with low real overlap (low priority)
JobInfo(pkg/cli/logs_models.go, 23 fields) vsJobData(pkg/cli/audit_report.go, 5 fields) — same package,Info/Datanaming pattern, but only 3 of 23 fields actually match (Name,Status,Conclusion) — ~13% overlap.JobInfomirrors the raw GitHub Actions Jobs API response;JobDatais a slimmed-down report-rendering DTO. Likely intentional separation of concerns, not a duplicate to merge — but worth a short doc comment on each explaining why both exist, since the names invite confusion.ExperimentInfo(pkg/cli/experiments_state.go) vsExperimentData(pkg/cli/audit_report_experiments.go) — 0% field overlap (WorkflowID/Branch/Experiments/TotalRuns/LastRunvsAssignments/CumulativeCounts). This looks like a pure naming coincidence rather than duplication — recommend renaming one (e.g.ExperimentSummary/ExperimentAssignmentCounts) purely for readability, not correctness.Untyped Usages
Summary Statistics
interface{}matches (non-test): ~33 across 7 files (most inpkg/linters/**/testdatafixtures or already-typed contexts) → 2 genuine findingsanymatches (non-test): ~19,808 across 1,582 files (overwhelmingly the English word in comments/docs) → 3 genuine type-usage findingsCategory 1:
interface{}/anyfindingspkg/console/layout_wasm.go:16func LayoutEmphasisBox(content string, color any) string— parameter unused, zero callers anywhere inpkgColor-like type if intended for future usejs/wasm-tagged stub; zero functional riskpkg/console/console_types.go:50FormField.Value any— butFormField/RunFormappear unused by the real (non-wasm) form implementation (pkg/console/prompt_form.gouseshuh/v2directly)FormField/RunFormif truly vestigial, or replaceanywith a discriminated union keyed byTypepkg/cli/mcp_tools_privileged.go:458auditArgs.RunID any/RunIDOrURL any— jsonschema docs say these only ever accept string-or-numberStringOrInttype with customUnmarshalJSONshared across "run ID or URL" MCP argsCategory 2: Untyped numeric constants (unit-confusion risk)
pkg/workflow/cache_integrity.go:17const defaultCacheIntegrityLevel = "none"— duplicates the existingGitHubIntegrityLevelenum valueGitHubIntegrityNonedeclared inpkg/workflow/tools_types.go:300const defaultCacheIntegrityLevel GitHubIntegrityLevel = GitHubIntegrityNone; changecacheIntegrityLevel()to returnGitHubIntegrityLevelinstead ofstringpkg/cli/run_workflow_execution.go:25const workflowCompletionWaitTimeoutMinutes = 6 * 60(passed as bareinttoWaitForWorkflowCompletion(..., timeoutMinutes int, ...))type Minutes int(or usetime.Durationat the call site) so callers can't pass seconds/hours by mistakepkg/workflow/publish_code_coverage.go:18const defaultCodeCoverageWaitForProcessingTimeout = 160(seconds, per comment only)type Seconds intpkg/workflow/maintenance_workflow.go:128const defaultNoOpIssueExpirationHours = 24 * 30, compared/aggregated with other bare-int*Hoursconstants in the same functiontype Hours intfor this and finding #5pkg/workflow/repo_config.go:63const DefaultActionFailureIssueExpiresHours = 24 * 7(exported, referenced across files/tests)type Hours intpkg/constants/job_constants.go:310-311DefaultRateLimitWindow = 60(minutes, per comment; also user-configurable from workflow frontmatter as a plain int)type Minutes intfor the window;DefaultRateLimitMaxis a plain count and is fine as-isThe highest-confidence item is #1 — it's a plain duplicate of an already-existing typed enum value in the same package, so a future edit could typo
"None"here without the compiler catching it, unlike every other integrity-level call site which already usesGitHubIntegrityNone.Recommendations, prioritized
Priority 1 — quick, safe win: Fix
pkg/workflow/cache_integrity.go:17to reuseGitHubIntegrityNoneinstead of a bare string literal. Single-file change, ~15 minutes.Priority 2 — unit-safety cleanup: Introduce
type Hours int/type Minutes int/type Seconds intin an appropriate shared location (e.g.pkg/workflowor a smallpkg/timeutil) and apply to the 5 remaining untyped-constant findings above. Each is independent and low-risk; ~2-3 hours total including tests.Priority 3 — cosmetic / optional: Rename
ExperimentInfo/ExperimentDatato less confusable names, and add doc comments clarifying whyJobInfoandJobDataare intentionally separate. No functional change.Priority 4 — cleanup, if confirmed dead: Remove
pkg/console/layout_wasm.go's unusedcolor anyparameter and the unusedFormField/RunForminpkg/console/console_types.go/form_wasm.go, or wire them up properly if they're meant to be used.Not recommended: consolidating the 9 already-aliased types (
ActionPinfamily,InputDefinition,SanitizeOptions,LogMetrics,ToolCallInfo) or touchingValidationError— both are already the correct pattern.Analysis Metadata
pkg/)interface{}, 3any, 6 untyped constants)get_symbols_overview) + targeted grep, manually verified against actual call sitesAll reactions