Description
pkg/workflow/run_phase.go:7-10 declares workflow run-phase constants as untyped string literals (runPhaseAgent = "agent", runPhaseDetection = "detection", runPhaseEvals = "evals"), returned from workflowRunPhase() as a bare string. The value is compared via == at 10+ call sites across 5 engine files (claude_engine.go, codex_engine.go, copilot_engine_execution.go, gemini_engine.go, pi_engine.go). Because the type is untyped string, a typo'd literal compiles silently and linters can't flag an exhaustiveness gap when a new phase is added.
Fix
Introduce type RunPhase string with the three constants typed as RunPhase, and change workflowRunPhase()'s return type to RunPhase.
Expected Impact
Compile-time safety against typo'd phase literals; enables exhaustiveness linting across the 5 engine files when a new run phase is added.
Suggested Agent
General coding agent — small, mechanical type change plus updating the 5 call-site comparisons.
Estimated Effort
Quick (< 1 hour)
Data Source
DeepReport Intelligence Briefing (2026-10-06, incremental cycle) — sourced from Typist: Go Type Consistency Analysis discussion #66107, live-verified against current pkg/workflow/run_phase.go.
Generated by 🔬 Deep Report · claude · agent · 207.7 AIC · ⌖ 7.97 AIC · ⊞ 7.1K · ◷
Description
pkg/workflow/run_phase.go:7-10declares workflow run-phase constants as untyped string literals (runPhaseAgent = "agent",runPhaseDetection = "detection",runPhaseEvals = "evals"), returned fromworkflowRunPhase()as a barestring. The value is compared via==at 10+ call sites across 5 engine files (claude_engine.go,codex_engine.go,copilot_engine_execution.go,gemini_engine.go,pi_engine.go). Because the type is untypedstring, a typo'd literal compiles silently and linters can't flag an exhaustiveness gap when a new phase is added.Fix
Introduce
type RunPhase stringwith the three constants typed asRunPhase, and changeworkflowRunPhase()'s return type toRunPhase.Expected Impact
Compile-time safety against typo'd phase literals; enables exhaustiveness linting across the 5 engine files when a new run phase is added.
Suggested Agent
General coding agent — small, mechanical type change plus updating the 5 call-site comparisons.
Estimated Effort
Quick (< 1 hour)
Data Source
DeepReport Intelligence Briefing (2026-10-06, incremental cycle) — sourced from Typist: Go Type Consistency Analysis discussion #66107, live-verified against current
pkg/workflow/run_phase.go.