Summary
- Analysis Period: Last 24 hours
- Commit Analyzed:
61253db — [dead-code] chore: remove dead functions — 4 functions removed (#27567)
- Files Analyzed: ~750 Go + ~80 CJS source files
- Total Violations: 22
- Date: 2026-04-21
| Severity |
Count |
| 🚨 BLOCKER |
0 |
| ⚠️ WARNING |
19 |
| i️ INFO |
3 |
⚠️ WARNING Violations
These violations should be addressed soon to prevent further structural debt.
File Size Warnings (> 1000 lines)
Go Files:
| File |
Lines |
pkg/workflow/domains.go |
1,015 |
pkg/workflow/cache.go |
1,002 |
CJS Files:
| File |
Lines |
actions/setup/js/create_pull_request.cjs |
1,765 |
actions/setup/js/log_parser_shared.cjs |
1,703 |
actions/setup/js/handle_agent_failure.cjs |
1,590 |
actions/setup/js/update_project.cjs |
1,451 |
actions/setup/js/safe_output_handler_manager.cjs |
1,322 |
actions/setup/js/sanitize_content_core.cjs |
1,224 |
actions/setup/js/runtime_import.cjs |
1,022 |
actions/setup/js/safe_outputs_handlers.cjs |
1,009 |
Suggested fixes:
create_pull_request.cjs (1,765 lines): Extract PR branch management, conflict resolution, and review/assignee logic into separate files (create_pull_request_branch.cjs, create_pull_request_review.cjs).
log_parser_shared.cjs (1,703 lines): The generatePatchPreview function (~1,650 lines) dominates the file. Split patch rendering logic into log_parser_patch.cjs and conversation/summary rendering into log_parser_format.cjs.
handle_agent_failure.cjs (1,590 lines): Extract failure context builders (buildCodePushFailureContext, buildEngineFailureContext) into handle_agent_failure_context.cjs.
safe_output_handler_manager.cjs (1,322 lines): Move buildEngineFailureContext (~850 lines) to a dedicated engine_failure_context.cjs.
pkg/workflow/domains.go (1,015 lines): Group domain lists by category (runtime domains, GitHub domains, tool-specific domains) into separate files domains_runtimes.go, domains_tools.go.
pkg/workflow/cache.go (1,002 lines): The file mixes cache-memory config parsing and step generation. Extract step generation into cache_steps.go.
Function Size Warnings (> 200 lines)
Go Functions:
| Function |
File |
Est. Lines |
generateMCPSetup |
pkg/workflow/mcp_setup_generator.go |
~849 |
generateMainJobSteps |
pkg/workflow/compiler_yaml_main_job.go |
~619 |
validateEngine |
cmd/gh-aw/main.go |
~413 |
init |
cmd/gh-aw/main.go |
~405 |
AuditWorkflowRun |
pkg/cli/audit.go |
~356 |
buildCustomJobs |
pkg/workflow/compiler_jobs.go |
~344 |
generatePrompt |
pkg/workflow/compiler_yaml.go |
~236 |
CJS Functions:
| Function |
File |
Est. Lines |
generatePatchPreview |
log_parser_shared.cjs |
~1,650 |
buildEngineFailureContext |
safe_output_handler_manager.cjs |
~851 |
getContentToCheck |
safe_output_handler_manager.cjs |
~504 |
getActionFailureIssueExpiresHours |
handle_agent_failure.cjs |
~272 |
generatePlainTextSummary |
log_parser_shared.cjs |
~211 |
generateCopilotCliStyleSummary |
log_parser_shared.cjs |
~201 |
Suggested fixes:
-
generateMCPSetup (~849 lines) in mcp_setup_generator.go: This function handles multiple engine-specific MCP configurations. Extract engine-specific sections into dedicated helpers: generateCopilotMCPSetup(), generateClaudeMCPSetup(), etc. Each engine's setup should be an independently testable function.
-
generateMainJobSteps (~619 lines) in compiler_yaml_main_job.go: This function chains many step-generation calls. Split into phase-based helpers: generateSetupPhaseSteps(), generateAgentPhaseSteps(), generateCleanupPhaseSteps().
-
validateEngine (~413 lines) in cmd/gh-aw/main.go: This function contains engine-specific validation for every supported engine. Move to pkg/workflow/engine_validator.go and split per engine: validateCopilotEngine(), validateClaudeEngine(), etc.
-
init (~405 lines) in cmd/gh-aw/main.go: The init() function is registering all CLI commands and flags. Move command registration logic to pkg/cli/root.go and call a RegisterCommands() function from init().
-
AuditWorkflowRun (~356 lines) in pkg/cli/audit.go: This orchestrates download, parsing, and rendering. Extract downloadAuditArtifacts(), parseAuditResults(), and renderAuditResults() as separate functions.
-
generatePatchPreview (~1,650 lines) in log_parser_shared.cjs: This is by far the largest function in the JS codebase. It likely contains long switch/if chains for handling different diff types. Decompose into renderAddedLines(), renderRemovedLines(), renderContextLines(), renderHunkHeader(), and a PatchRenderer class.
i️ INFO Violations
Informational findings. Consider addressing in future refactoring.
pkg/constants/constants.go: 40 exported identifiers — This file is a "constants dump". Consider grouping constants into domain-specific files: constants_engines.go, constants_versions.go, constants_features.go.
pkg/workflow/domains.go: 24 exported identifiers — Already flagged for file size. Splitting will naturally reduce the export count per file.
pkg/workflow/compiler_types.go: 20 exported identifiers — The types file contains a large number of exported types. Consider splitting by concern: compiler_types_engine.go, compiler_types_job.go.
Configuration
Thresholds from .architecture.yml:
- File size BLOCKER: 2,000 lines
- File size WARNING: 1,000 lines
- Function size WARNING: 200 lines
- Max public exports INFO: 10
Action Checklist
🏛️ Thresholds configured via .architecture.yml in the repository root.
🏛️ Architecture report by Architecture Guardian · ● 1.6M · ◷
Summary
61253db—[dead-code] chore: remove dead functions — 4 functions removed (#27567)File Size Warnings (> 1000 lines)
Go Files:
pkg/workflow/domains.gopkg/workflow/cache.goCJS Files:
actions/setup/js/create_pull_request.cjsactions/setup/js/log_parser_shared.cjsactions/setup/js/handle_agent_failure.cjsactions/setup/js/update_project.cjsactions/setup/js/safe_output_handler_manager.cjsactions/setup/js/sanitize_content_core.cjsactions/setup/js/runtime_import.cjsactions/setup/js/safe_outputs_handlers.cjsSuggested fixes:
create_pull_request.cjs(1,765 lines): Extract PR branch management, conflict resolution, and review/assignee logic into separate files (create_pull_request_branch.cjs,create_pull_request_review.cjs).log_parser_shared.cjs(1,703 lines): ThegeneratePatchPreviewfunction (~1,650 lines) dominates the file. Split patch rendering logic intolog_parser_patch.cjsand conversation/summary rendering intolog_parser_format.cjs.handle_agent_failure.cjs(1,590 lines): Extract failure context builders (buildCodePushFailureContext,buildEngineFailureContext) intohandle_agent_failure_context.cjs.safe_output_handler_manager.cjs(1,322 lines): MovebuildEngineFailureContext(~850 lines) to a dedicatedengine_failure_context.cjs.pkg/workflow/domains.go(1,015 lines): Group domain lists by category (runtime domains, GitHub domains, tool-specific domains) into separate filesdomains_runtimes.go,domains_tools.go.pkg/workflow/cache.go(1,002 lines): The file mixes cache-memory config parsing and step generation. Extract step generation intocache_steps.go.Function Size Warnings (> 200 lines)
Go Functions:
generateMCPSetuppkg/workflow/mcp_setup_generator.gogenerateMainJobStepspkg/workflow/compiler_yaml_main_job.govalidateEnginecmd/gh-aw/main.goinitcmd/gh-aw/main.goAuditWorkflowRunpkg/cli/audit.gobuildCustomJobspkg/workflow/compiler_jobs.gogeneratePromptpkg/workflow/compiler_yaml.goCJS Functions:
generatePatchPreviewlog_parser_shared.cjsbuildEngineFailureContextsafe_output_handler_manager.cjsgetContentToChecksafe_output_handler_manager.cjsgetActionFailureIssueExpiresHourshandle_agent_failure.cjsgeneratePlainTextSummarylog_parser_shared.cjsgenerateCopilotCliStyleSummarylog_parser_shared.cjsSuggested fixes:
generateMCPSetup(~849 lines) inmcp_setup_generator.go: This function handles multiple engine-specific MCP configurations. Extract engine-specific sections into dedicated helpers:generateCopilotMCPSetup(),generateClaudeMCPSetup(), etc. Each engine's setup should be an independently testable function.generateMainJobSteps(~619 lines) incompiler_yaml_main_job.go: This function chains many step-generation calls. Split into phase-based helpers:generateSetupPhaseSteps(),generateAgentPhaseSteps(),generateCleanupPhaseSteps().validateEngine(~413 lines) incmd/gh-aw/main.go: This function contains engine-specific validation for every supported engine. Move topkg/workflow/engine_validator.goand split per engine:validateCopilotEngine(),validateClaudeEngine(), etc.init(~405 lines) incmd/gh-aw/main.go: Theinit()function is registering all CLI commands and flags. Move command registration logic topkg/cli/root.goand call aRegisterCommands()function frominit().AuditWorkflowRun(~356 lines) inpkg/cli/audit.go: This orchestrates download, parsing, and rendering. ExtractdownloadAuditArtifacts(),parseAuditResults(), andrenderAuditResults()as separate functions.generatePatchPreview(~1,650 lines) inlog_parser_shared.cjs: This is by far the largest function in the JS codebase. It likely contains long switch/if chains for handling different diff types. Decompose intorenderAddedLines(),renderRemovedLines(),renderContextLines(),renderHunkHeader(), and aPatchRendererclass.i️ INFO Violations
pkg/constants/constants.go: 40 exported identifiers — This file is a "constants dump". Consider grouping constants into domain-specific files:constants_engines.go,constants_versions.go,constants_features.go.pkg/workflow/domains.go: 24 exported identifiers — Already flagged for file size. Splitting will naturally reduce the export count per file.pkg/workflow/compiler_types.go: 20 exported identifiers — The types file contains a large number of exported types. Consider splitting by concern:compiler_types_engine.go,compiler_types_job.go.Configuration
Thresholds from
.architecture.yml:Action Checklist
generatePatchPreviewinlog_parser_shared.cjs(~1,650 lines) — highest priority function violationlog_parser_shared.cjs(1,703 lines) into rendering sub-modulesgenerateMCPSetupinmcp_setup_generator.go(~849 lines)generateMainJobStepsincompiler_yaml_main_job.go(~619 lines)create_pull_request.cjs(1,765 lines)init()/validateEngine()logic fromcmd/gh-aw/main.gopkg/constants/constants.go(40 exports) into domain-specific files