Summary
| Severity |
Count |
| 🚨 BLOCKER |
14 |
| ⚠️ WARNING |
20+ |
| i️ INFO |
0 |
🚨 BLOCKER Violations
These violations indicate serious structural problems that require prompt attention.
1. maintenance_workflow.go — 1,347 lines (NEW in #26382)
File: pkg/workflow/maintenance_workflow.go
Commit: 31ef7c6 — feat: auto-generate side-repo maintenance workflow for SideRepoOps pattern
Issue: File introduced in this commit immediately exceeds the 1,000-line BLOCKER threshold at 1,347 lines.
Why it matters: A 1,347-line file covering multiple concerns (maintenance cron logic, SideRepoOps targets, YAML generation, CLI step generation) is hard to navigate, review, and test in isolation.
Suggested fix:
- Extract
generateSideRepoMaintenanceWorkflow and related types into pkg/workflow/side_repo_maintenance.go
- Move cron-generation helpers (
generateMaintenanceCron, generateSideRepoMaintenanceCron) to pkg/workflow/maintenance_cron.go
- Keep
GenerateMaintenanceWorkflow as the public orchestrator in a trimmed maintenance_workflow.go (<200 lines)
2. compiler_orchestrator_workflow.go — 1,125 lines
File: pkg/workflow/compiler_orchestrator_workflow.go
Commit: 31ef7c6
Issue: 1,125-line file combining workflow parsing, configuration extraction, and import merging.
Why it matters: Mixing parsing, extraction, and compilation concerns in one file makes it difficult to isolate changes and write focused tests.
Suggested fix:
- Move
ParseWorkflowFile and its 205-line body into pkg/workflow/workflow_parser.go
- Extract
extractAdditionalConfigurations and buildInitialWorkflowData into pkg/workflow/workflow_builder.go
- The orchestrator file should contain only the top-level wiring (<200 lines)
3. logs_orchestrator.go — 1,077 lines
File: pkg/cli/logs_orchestrator.go
Commit: 31ef7c6
Issue: 1,077-line file with a single DownloadWorkflowLogs function spanning 563 lines (7x the 80-line threshold).
Why it matters: A 563-line function is effectively untestable as a unit and hides multiple logical phases (filtering, downloading, artifact handling, metrics).
Suggested fix:
- Split
DownloadWorkflowLogs into phase functions: filterWorkflowRuns, downloadAndStage, postProcessArtifacts
- Extract
downloadRunArtifactsConcurrent (395 lines) into pkg/cli/logs_download.go (a file that already exists for this purpose)
- Target: no function in
logs_orchestrator.go should exceed 100 lines
4–11. JavaScript/CJS files exceeding 1,000 lines
| File |
Lines |
actions/setup/js/log_parser_shared.cjs |
1,703 |
actions/setup/js/create_pull_request.cjs |
1,678 |
actions/setup/js/handle_agent_failure.cjs |
1,572 |
actions/setup/js/update_project.cjs |
1,451 |
actions/setup/js/safe_output_handler_manager.cjs |
1,301 |
actions/setup/js/sanitize_content_core.cjs |
1,171 |
actions/setup/js/runtime_import.cjs |
1,022 |
actions/setup/js/safe_outputs_handlers.cjs |
1,007 |
Why it matters: Large CJS files in actions/setup/js/ are hard to unit-test in isolation and tend to accumulate cross-cutting concerns.
Suggested fix (per file):
log_parser_shared.cjs: Split into log_parser_core.cjs (parsing primitives) + log_parser_formatters.cjs (output formatting)
create_pull_request.cjs: Extract PR diff logic into pr_diff_helpers.cjs; keep main flow <400 lines
handle_agent_failure.cjs: Separate failure classification (agent_failure_classifier.cjs) from notification logic
safe_output_handler_manager.cjs + safe_outputs_handlers.cjs: These two large files likely share logic; consolidate shared types into safe_output_types.cjs
⚠️ WARNING Violations — Function Size
Functions exceeding 80 lines (default threshold).
| Function |
File |
Lines |
GenerateMaintenanceWorkflow |
pkg/workflow/maintenance_workflow.go |
639 |
DownloadWorkflowLogs |
pkg/cli/logs_orchestrator.go |
563 |
downloadRunArtifactsConcurrent |
pkg/cli/logs_orchestrator.go |
395 |
generateSideRepoMaintenanceWorkflow |
pkg/workflow/maintenance_workflow.go |
325 |
ParseWorkflowFile |
pkg/workflow/compiler_orchestrator_workflow.go |
205 |
extractAdditionalConfigurations |
pkg/workflow/compiler_orchestrator_workflow.go |
140 |
buildInitialWorkflowData |
pkg/workflow/compiler_orchestrator_workflow.go |
123 |
The top two (GenerateMaintenanceWorkflow at 639 lines and DownloadWorkflowLogs at 563 lines) are especially critical — they should be treated as BLOCKERs.
Suggested fix for GenerateMaintenanceWorkflow:
The function currently handles: detecting target repos, generating cron schedules, building YAML job trees, writing files — all in one body. Decompose into:
generateMaintenanceYAML(targets) → YAML string
writeMaintenanceFile(path, yaml) → error
orchestrateMaintenanceGeneration(data, opts) → error ← new thin shell
```
**Suggested fix for `DownloadWorkflowLogs`**:
This function has a long parameter list (21 parameters!) and multiple phases. Consider introducing a `DownloadConfig` struct to group parameters, and break execution into:
```
resolveWorkflowRuns(cfg) → []WorkflowRun
downloadRuns(ctx, runs, cfg) → []DownloadResult
postProcessRuns(results, cfg) → error
⚠️ WARNING Violations — File Size (500–1000 lines)
79 Go files exceed the 500-line WARNING threshold. Highest-priority pre-existing cases:
| File |
Lines |
pkg/workflow/cache.go |
973 |
pkg/parser/remote_fetch.go |
928 |
pkg/workflow/compiler_yaml.go |
911 |
pkg/workflow/mcp_setup_generator.go |
897 |
cmd/gh-aw/main.go |
895 |
pkg/cli/logs_download.go |
891 |
pkg/cli/audit.go |
873 |
Configuration
Thresholds used (defaults — no .architecture.yml found):
- File size BLOCKER: 1,000 lines
- File size WARNING: 500 lines
- Function size: 80 lines
- Max public exports: 10
💡 To customize thresholds, add a .architecture.yml file to the repository root.
Action Checklist
🏛️ Generated by Architecture Guardian — Run ID: 24461030372
🏛️ Architecture report by Architecture Guardian · ● 940.2K · ◷
Summary
31ef7c6— feat: auto-generate side-repo maintenance workflow for SideRepoOps pattern (feat: auto-generate side-repo maintenance workflow for SideRepoOps pattern #26382)🚨 BLOCKER Violations
1.
maintenance_workflow.go— 1,347 lines (NEW in #26382)File:
pkg/workflow/maintenance_workflow.goCommit:
31ef7c6— feat: auto-generate side-repo maintenance workflow for SideRepoOps patternIssue: File introduced in this commit immediately exceeds the 1,000-line BLOCKER threshold at 1,347 lines.
Why it matters: A 1,347-line file covering multiple concerns (maintenance cron logic, SideRepoOps targets, YAML generation, CLI step generation) is hard to navigate, review, and test in isolation.
Suggested fix:
generateSideRepoMaintenanceWorkflowand related types intopkg/workflow/side_repo_maintenance.gogenerateMaintenanceCron,generateSideRepoMaintenanceCron) topkg/workflow/maintenance_cron.goGenerateMaintenanceWorkflowas the public orchestrator in a trimmedmaintenance_workflow.go(<200 lines)2.
compiler_orchestrator_workflow.go— 1,125 linesFile:
pkg/workflow/compiler_orchestrator_workflow.goCommit:
31ef7c6Issue: 1,125-line file combining workflow parsing, configuration extraction, and import merging.
Why it matters: Mixing parsing, extraction, and compilation concerns in one file makes it difficult to isolate changes and write focused tests.
Suggested fix:
ParseWorkflowFileand its 205-line body intopkg/workflow/workflow_parser.goextractAdditionalConfigurationsandbuildInitialWorkflowDataintopkg/workflow/workflow_builder.go3.
logs_orchestrator.go— 1,077 linesFile:
pkg/cli/logs_orchestrator.goCommit:
31ef7c6Issue: 1,077-line file with a single
DownloadWorkflowLogsfunction spanning 563 lines (7x the 80-line threshold).Why it matters: A 563-line function is effectively untestable as a unit and hides multiple logical phases (filtering, downloading, artifact handling, metrics).
Suggested fix:
DownloadWorkflowLogsinto phase functions:filterWorkflowRuns,downloadAndStage,postProcessArtifactsdownloadRunArtifactsConcurrent(395 lines) intopkg/cli/logs_download.go(a file that already exists for this purpose)logs_orchestrator.goshould exceed 100 lines4–11. JavaScript/CJS files exceeding 1,000 lines
actions/setup/js/log_parser_shared.cjsactions/setup/js/create_pull_request.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.cjsWhy it matters: Large CJS files in
actions/setup/js/are hard to unit-test in isolation and tend to accumulate cross-cutting concerns.Suggested fix (per file):
log_parser_shared.cjs: Split intolog_parser_core.cjs(parsing primitives) +log_parser_formatters.cjs(output formatting)create_pull_request.cjs: Extract PR diff logic intopr_diff_helpers.cjs; keep main flow <400 lineshandle_agent_failure.cjs: Separate failure classification (agent_failure_classifier.cjs) from notification logicsafe_output_handler_manager.cjs+safe_outputs_handlers.cjs: These two large files likely share logic; consolidate shared types intosafe_output_types.cjsGenerateMaintenanceWorkflowpkg/workflow/maintenance_workflow.goDownloadWorkflowLogspkg/cli/logs_orchestrator.godownloadRunArtifactsConcurrentpkg/cli/logs_orchestrator.gogenerateSideRepoMaintenanceWorkflowpkg/workflow/maintenance_workflow.goParseWorkflowFilepkg/workflow/compiler_orchestrator_workflow.goextractAdditionalConfigurationspkg/workflow/compiler_orchestrator_workflow.gobuildInitialWorkflowDatapkg/workflow/compiler_orchestrator_workflow.goThe top two (
GenerateMaintenanceWorkflowat 639 lines andDownloadWorkflowLogsat 563 lines) are especially critical — they should be treated as BLOCKERs.Suggested fix for
GenerateMaintenanceWorkflow:The function currently handles: detecting target repos, generating cron schedules, building YAML job trees, writing files — all in one body. Decompose into:
79 Go files exceed the 500-line WARNING threshold. Highest-priority pre-existing cases:
pkg/workflow/cache.gopkg/parser/remote_fetch.gopkg/workflow/compiler_yaml.gopkg/workflow/mcp_setup_generator.gocmd/gh-aw/main.gopkg/cli/logs_download.gopkg/cli/audit.goConfiguration
Thresholds used (defaults — no
.architecture.ymlfound):Action Checklist
pkg/workflow/maintenance_workflow.go(1,347 lines, new in feat: auto-generate side-repo maintenance workflow for SideRepoOps pattern #26382) — highest priorityGenerateMaintenanceWorkflow(639 lines) into focused sub-functionsgenerateSideRepoMaintenanceWorkflow(325 lines) into focused sub-functionspkg/workflow/compiler_orchestrator_workflow.go(1,125 lines)pkg/cli/logs_orchestrator.go(1,077 lines) — introduceDownloadConfigstruct