The validateWorkflowData function in pkg/workflow/compiler.go is 387 lines and handles at least 10 distinct validation concerns: expression safety, runtime-import files, feature flags, action-mode, permissions, MCP tools, safe outputs, GitHub tools, expressions, and template validation. This is the primary reason compiler.go scores 75/100 in the Daily Compiler Quality Report (2026-04-22, #27906).
Description: Decompose validateWorkflowData into at least 4 focused validators:
validateExpressions() — expression safety checks
validateFeatures() — feature flags and action-mode validation
validatePermissions() — permissions and MCP tool constraints
validateToolConfiguration() — safe outputs, GitHub tools, template validation
Each sub-validator becomes independently testable. Also add fmt.Errorf wrapping to the 5 bare return err calls in compiler.go (lines 69, 150, 334, 769, 783).
Expected Impact: Improves compiler.go score from 75/100 toward 85/100. Each validator is testable in isolation, reducing regression risk when modifying validation logic. Aligns with compiler_jobs.go's pattern which scores 81/100 with well-decomposed functions.
Suggested Agent: Sergo (Serena Go Expert) or any agent with Serena LSP + test runner access. Already identified as a recommendation in #27906.
Estimated Effort: Medium (2–3 hours — refactor + test suite verification)
Data Source: DeepReport Intelligence Briefing 2026-04-23, Daily Compiler Quality Report #27906
Generated by DeepReport - Intelligence Gathering Agent · ● 494.2K · ◷
The
validateWorkflowDatafunction inpkg/workflow/compiler.gois 387 lines and handles at least 10 distinct validation concerns: expression safety, runtime-import files, feature flags, action-mode, permissions, MCP tools, safe outputs, GitHub tools, expressions, and template validation. This is the primary reasoncompiler.goscores 75/100 in the Daily Compiler Quality Report (2026-04-22, #27906).Description: Decompose
validateWorkflowDatainto at least 4 focused validators:validateExpressions()— expression safety checksvalidateFeatures()— feature flags and action-mode validationvalidatePermissions()— permissions and MCP tool constraintsvalidateToolConfiguration()— safe outputs, GitHub tools, template validationEach sub-validator becomes independently testable. Also add
fmt.Errorfwrapping to the 5 barereturn errcalls incompiler.go(lines 69, 150, 334, 769, 783).Expected Impact: Improves
compiler.goscore from 75/100 toward 85/100. Each validator is testable in isolation, reducing regression risk when modifying validation logic. Aligns withcompiler_jobs.go's pattern which scores 81/100 with well-decomposed functions.Suggested Agent: Sergo (Serena Go Expert) or any agent with Serena LSP + test runner access. Already identified as a recommendation in #27906.
Estimated Effort: Medium (2–3 hours — refactor + test suite verification)
Data Source: DeepReport Intelligence Briefing 2026-04-23, Daily Compiler Quality Report #27906