Summary
Refactor workflow compilation engine in pkg/workflow/ to eliminate ~600 lint findings related to excessive function line length (>60 lines) and parameter counts (>8). This is the largest subsystem with the most complex compilation logic.
Affected Packages
- pkg/workflow/ - ~100+ functions with excessive line length (63-486 lines), concentrated in compiler and engine modules
Critical Long Functions (Priority Order - Largest First)
pkg/workflow/compiler_pre_activation_job.go:20 - buildPreActivationJob is 486 lines
pkg/workflow/compiler_main_job.go:26 - buildMainJob is 333 lines
pkg/workflow/claude_tools.go:168 - computeAllowedClaudeToolsString is 360 lines
pkg/workflow/copilot_engine_execution.go:41 - GetExecutionSteps is 470 lines
pkg/workflow/compiler_orchestrator_engine.go:35 - setupEngineAndImports is 391 lines
pkg/workflow/compiler_orchestrator_tools.go:50 - processToolsAndMarkdown is 322 lines
pkg/workflow/compiler_orchestrator_workflow.go:15 - ParseWorkflowFile is 295 lines
pkg/workflow/codex_engine.go:146 - GetExecutionSteps is 286 lines
pkg/workflow/compiler_validators.go:86 - validateToolConfiguration is 328 lines
pkg/workflow/claude_engine.go:119 - GetExecutionSteps is 372 lines
And 90+ additional functions ranging 62-100+ lines across compilation modules.
Functions with Parameter Overload
pkg/workflow/compiler_activation_job.go:79 - addActivationInteractionPermissions (10 params)
pkg/workflow/compiler_activation_job.go:112 - addActivationInteractionPermissionsMap (10 params)
pkg/workflow/compiler_activation_job.go:203 - addBroadActivationInteractionPermissions (9 params)
pkg/workflow/compiler_safe_outputs_job.go:382 - buildSafeOutputsJobFromParts (9 params)
pkg/workflow/maintenance_workflow.go:120 - GenerateMaintenanceWorkflow (9 params)
pkg/workflow/maintenance_workflow_yaml.go:16 - buildMaintenanceWorkflowYAML (12 params)
pkg/workflow/mcp_rendering.go:94 - renderStandardJSONMCPConfig (9 params)
pkg/workflow/mcp_setup_generator.go:585 - writeMCPGatewayExports (12 params)
- And 14+ more in workflow module
Remediation Strategy
Phase 1: Engine Implementations (Highest Impact)
Phase 2: Compiler Main Functions (Build Pipeline)
Phase 3: Utility Functions & Parameter Cleanup
Validation
Important Notes
- Workflow compilation is critical path; changes require thorough testing
- Engine implementations must preserve behavior across all configurations
- Maintain existing error messages and validation order
- Extract helpers should have single responsibility (build section, generate step, validate config, etc.)
- Use descriptive names for extracted functions (e.g.,
buildAgentRunSteps, generateSetupSteps)
- Test with different workflow complexity levels (simple, with MCP, with safe-outputs, etc.)
Success Criteria
✅ All lint findings in pkg/workflow/ resolved
✅ All workflow tests pass
✅ Workflow compilation produces correct YAML
✅ All engine implementations work correctly
✅ No regressions in workflow behavior
Generated by 🧌 LintMonster · ● 573.9K · ◷
Summary
Refactor workflow compilation engine in
pkg/workflow/to eliminate ~600 lint findings related to excessive function line length (>60 lines) and parameter counts (>8). This is the largest subsystem with the most complex compilation logic.Affected Packages
Critical Long Functions (Priority Order - Largest First)
pkg/workflow/compiler_pre_activation_job.go:20-buildPreActivationJobis 486 linespkg/workflow/compiler_main_job.go:26-buildMainJobis 333 linespkg/workflow/claude_tools.go:168-computeAllowedClaudeToolsStringis 360 linespkg/workflow/copilot_engine_execution.go:41-GetExecutionStepsis 470 linespkg/workflow/compiler_orchestrator_engine.go:35-setupEngineAndImportsis 391 linespkg/workflow/compiler_orchestrator_tools.go:50-processToolsAndMarkdownis 322 linespkg/workflow/compiler_orchestrator_workflow.go:15-ParseWorkflowFileis 295 linespkg/workflow/codex_engine.go:146-GetExecutionStepsis 286 linespkg/workflow/compiler_validators.go:86-validateToolConfigurationis 328 linespkg/workflow/claude_engine.go:119-GetExecutionStepsis 372 linesAnd 90+ additional functions ranging 62-100+ lines across compilation modules.
Functions with Parameter Overload
pkg/workflow/compiler_activation_job.go:79-addActivationInteractionPermissions(10 params)pkg/workflow/compiler_activation_job.go:112-addActivationInteractionPermissionsMap(10 params)pkg/workflow/compiler_activation_job.go:203-addBroadActivationInteractionPermissions(9 params)pkg/workflow/compiler_safe_outputs_job.go:382-buildSafeOutputsJobFromParts(9 params)pkg/workflow/maintenance_workflow.go:120-GenerateMaintenanceWorkflow(9 params)pkg/workflow/maintenance_workflow_yaml.go:16-buildMaintenanceWorkflowYAML(12 params)pkg/workflow/mcp_rendering.go:94-renderStandardJSONMCPConfig(9 params)pkg/workflow/mcp_setup_generator.go:585-writeMCPGatewayExports(12 params)Remediation Strategy
Phase 1: Engine Implementations (Highest Impact)
GetExecutionStepsfunctions (Claude, Copilot, Codex engines):claude_engine.goandcopilot_engine_execution.gofirstPhase 2: Compiler Main Functions (Build Pipeline)
buildMainJob,buildPreActivationJob:ParseWorkflowFile,setupEngineAndImports):Phase 3: Utility Functions & Parameter Cleanup
XOptionsstructs for parameter groupsValidation
make golint-customand confirm zero errors inpkg/workflow/go test -v ./pkg/workflow/..../gh-aw compile <sample-workflows>make agent-report-progress(build + fmt + lint + test-unit) before commitImportant Notes
buildAgentRunSteps,generateSetupSteps)Success Criteria
✅ All lint findings in
pkg/workflow/resolved✅ All workflow tests pass
✅ Workflow compilation produces correct YAML
✅ All engine implementations work correctly
✅ No regressions in workflow behavior