Summary
| Severity |
Count |
| 🚨 BLOCKER |
13 |
| ⚠️ WARNING |
86 |
| i️ INFO |
— |
🚨 BLOCKER Violations
These violations indicate serious structural problems that require prompt attention.
Go files exceeding 1,000 lines
File: pkg/cli/gateway_logs.go — 1,332 lines
Commit: c144ee3 — test: add regression coverage for .github/agents/
Issue: File is 33% above the 1000-line blocker threshold, and contains 6 functions over 80 lines (parseRPCMessages 205 lines, extractMCPToolUsageData 188 lines, renderGatewayMetricsTable 166 lines, buildToolCallsFromRPCMessages 142 lines, processGatewayLogEntry 130 lines, guardPolicyReasonFromCode 122 lines).
Why it matters: Gateway log parsing and metrics rendering are distinct concerns crammed into one file, making it hard to review, test, and evolve independently.
Suggested fix: Split into three files:
pkg/cli/gateway_logs_parser.go — RPC message parsing (parseRPCMessages, processGatewayLogEntry, buildToolCallsFromRPCMessages)
pkg/cli/gateway_logs_renderer.go — table/metrics rendering (renderGatewayMetricsTable, guardPolicyReasonFromCode, displayAggregatedGatewayMetrics)
pkg/cli/gateway_logs_extractor.go — high-level extraction (extractMCPToolUsageData, buildGuardPolicySummary)
File: pkg/workflow/compiler_safe_outputs_config.go — 1,035 lines
Commit: c144ee3
Issue: The Build() method on handlerConfigBuilder spans 787 lines (lines 140–926) — a single function nearly as large as the entire blocker threshold. This is a critical structural problem.
Why it matters: A 787-line function is impossible to review meaningfully, contains many implicit code paths, and makes testing individual cases extremely difficult.
Suggested fix: Decompose Build() into domain-specific builder helpers:
buildCoreConfig() — base handler settings
buildAuthConfig() — authentication-related fields
buildOutputConfig() — output handler configuration
buildEngineConfig() — engine-specific config sections
Each should be ≤80 lines and testable in isolation.
File: pkg/cli/audit_report_render.go — 1,139 lines
Commit: c144ee3
Issue: Render functions for many different report domains are co-located in one file.
Why it matters: Each render domain (policy, performance, tokens, tools) changes for different reasons, creating merge conflicts.
Suggested fix: Extract into pkg/cli/audit_render_policy.go, pkg/cli/audit_render_performance.go, pkg/cli/audit_render_tokens.go, following the pattern used by audit_diff_render.go.
File: pkg/cli/logs_orchestrator.go — 1,074 lines
File: pkg/cli/logs_report.go — 1,065 lines
File: pkg/workflow/compiler_orchestrator_workflow.go — 1,062 lines
These three files are marginally over the blocker threshold. The orchestrator files in pkg/cli/ share a domain and could be reduced by extracting their pipeline helper functions (processOnSectionAndFilters 81 lines, processAndMergeSteps 89 lines) into a compiler_orchestrator_helpers.go file.
JavaScript/CJS files exceeding 1,000 lines
| File |
Lines |
Key Large Functions |
actions/setup/js/log_parser_shared.cjs |
1,703 |
generatePlainTextSummary (211), generateCopilotCliStyleSummary (201), generateConversationMarkdown (166), formatToolUse (153) |
actions/setup/js/create_pull_request.cjs |
1,666 |
main function and helpers |
actions/setup/js/handle_agent_failure.cjs |
1,494 |
Context builders |
actions/setup/js/update_project.cjs |
1,451 |
Project update flows |
actions/setup/js/safe_output_handler_manager.cjs |
1,258 |
Handler management |
actions/setup/js/sanitize_content_core.cjs |
1,171 |
Sanitization pipelines |
actions/setup/js/runtime_import.cjs |
1,019 |
Runtime import logic |
Suggested fixes:
log_parser_shared.cjs: Split into log_parser_markdown.cjs (markdown generation), log_parser_text.cjs (plain text summary), log_parser_tool_formatting.cjs (tool call formatting). The generatePlainTextSummary and generateCopilotCliStyleSummary functions alone total 412 lines.
create_pull_request.cjs: Extract fallback/error handling into create_pull_request_fallback.cjs and label/limit enforcement into create_pull_request_limits.cjs.
handle_agent_failure.cjs: Extract context builder functions into agent_failure_context_builders.cjs.
⚠️ WARNING Violations
These violations should be addressed soon to prevent further structural debt.
Go files (500–1000 lines) — 71 files total
Top offenders:
| File |
Lines |
pkg/workflow/cache.go |
973 |
pkg/workflow/frontmatter_types.go |
957 |
pkg/parser/remote_fetch.go |
928 |
pkg/cli/logs_download.go |
890 |
pkg/workflow/compiler_yaml.go |
886 |
cmd/gh-aw/main.go |
885 |
pkg/workflow/frontmatter_extraction_yaml.go |
868 |
pkg/workflow/compiler_yaml_main_job.go |
867 |
pkg/workflow/mcp_setup_generator.go |
856 |
pkg/workflow/compiler_jobs.go |
836 |
pkg/cli/audit.go |
834 |
pkg/workflow/domains.go |
820 |
pkg/parser/schema_suggestions.go |
814 |
Notable: cmd/gh-aw/main.go at 885 lines is a concern — CLI entry points should be thin; command registration logic should be delegated to subpackages.
JavaScript/CJS files (500–1000 lines) — 15 files
| File |
Lines |
actions/setup/js/parse_copilot_log.cjs |
914 |
actions/setup/js/safe_outputs_handlers.cjs |
904 |
actions/setup/js/mcp_server_core.cjs |
835 |
actions/setup/js/create_issue.cjs |
803 |
actions/setup/js/send_otlp_span.cjs |
794 |
actions/setup/js/validate_secrets.cjs |
776 |
actions/setup/js/add_comment.cjs |
702 |
actions/setup/js/assign_agent_helpers.cjs |
641 |
Configuration
Thresholds (defaults — no .architecture.yml found):
- File size BLOCKER: 1,000 lines
- File size WARNING: 500 lines
- Function size: 80 lines
- Max public exports: 10
Action Checklist
🏛️ To configure thresholds, add a .architecture.yml file to the repository root.
🏛️ Architecture report by Architecture Guardian · ● 1.1M · ◷
Summary
c144ee3— test: add regression coverage for.github/agents/root-relative import path (test: add regression coverage for.github/agents/root-relative import path #25636)🚨 BLOCKER Violations
Go files exceeding 1,000 lines
File:
pkg/cli/gateway_logs.go— 1,332 linesCommit:
c144ee3— test: add regression coverage for.github/agents/Issue: File is 33% above the 1000-line blocker threshold, and contains 6 functions over 80 lines (
parseRPCMessages205 lines,extractMCPToolUsageData188 lines,renderGatewayMetricsTable166 lines,buildToolCallsFromRPCMessages142 lines,processGatewayLogEntry130 lines,guardPolicyReasonFromCode122 lines).Why it matters: Gateway log parsing and metrics rendering are distinct concerns crammed into one file, making it hard to review, test, and evolve independently.
Suggested fix: Split into three files:
pkg/cli/gateway_logs_parser.go— RPC message parsing (parseRPCMessages,processGatewayLogEntry,buildToolCallsFromRPCMessages)pkg/cli/gateway_logs_renderer.go— table/metrics rendering (renderGatewayMetricsTable,guardPolicyReasonFromCode,displayAggregatedGatewayMetrics)pkg/cli/gateway_logs_extractor.go— high-level extraction (extractMCPToolUsageData,buildGuardPolicySummary)File:
pkg/workflow/compiler_safe_outputs_config.go— 1,035 linesCommit:
c144ee3Issue: The
Build()method onhandlerConfigBuilderspans 787 lines (lines 140–926) — a single function nearly as large as the entire blocker threshold. This is a critical structural problem.Why it matters: A 787-line function is impossible to review meaningfully, contains many implicit code paths, and makes testing individual cases extremely difficult.
Suggested fix: Decompose
Build()into domain-specific builder helpers:buildCoreConfig()— base handler settingsbuildAuthConfig()— authentication-related fieldsbuildOutputConfig()— output handler configurationbuildEngineConfig()— engine-specific config sectionsEach should be ≤80 lines and testable in isolation.
File:
pkg/cli/audit_report_render.go— 1,139 linesCommit:
c144ee3Issue: Render functions for many different report domains are co-located in one file.
Why it matters: Each render domain (policy, performance, tokens, tools) changes for different reasons, creating merge conflicts.
Suggested fix: Extract into
pkg/cli/audit_render_policy.go,pkg/cli/audit_render_performance.go,pkg/cli/audit_render_tokens.go, following the pattern used byaudit_diff_render.go.File:
pkg/cli/logs_orchestrator.go— 1,074 linesFile:
pkg/cli/logs_report.go— 1,065 linesFile:
pkg/workflow/compiler_orchestrator_workflow.go— 1,062 linesThese three files are marginally over the blocker threshold. The orchestrator files in
pkg/cli/share a domain and could be reduced by extracting their pipeline helper functions (processOnSectionAndFilters81 lines,processAndMergeSteps89 lines) into acompiler_orchestrator_helpers.gofile.JavaScript/CJS files exceeding 1,000 lines
actions/setup/js/log_parser_shared.cjsgeneratePlainTextSummary(211),generateCopilotCliStyleSummary(201),generateConversationMarkdown(166),formatToolUse(153)actions/setup/js/create_pull_request.cjsmainfunction and helpersactions/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.cjsSuggested fixes:
log_parser_shared.cjs: Split intolog_parser_markdown.cjs(markdown generation),log_parser_text.cjs(plain text summary),log_parser_tool_formatting.cjs(tool call formatting). ThegeneratePlainTextSummaryandgenerateCopilotCliStyleSummaryfunctions alone total 412 lines.create_pull_request.cjs: Extract fallback/error handling intocreate_pull_request_fallback.cjsand label/limit enforcement intocreate_pull_request_limits.cjs.handle_agent_failure.cjs: Extract context builder functions intoagent_failure_context_builders.cjs.Go files (500–1000 lines) — 71 files total
Top offenders:
pkg/workflow/cache.gopkg/workflow/frontmatter_types.gopkg/parser/remote_fetch.gopkg/cli/logs_download.gopkg/workflow/compiler_yaml.gocmd/gh-aw/main.gopkg/workflow/frontmatter_extraction_yaml.gopkg/workflow/compiler_yaml_main_job.gopkg/workflow/mcp_setup_generator.gopkg/workflow/compiler_jobs.gopkg/cli/audit.gopkg/workflow/domains.gopkg/parser/schema_suggestions.goNotable:
cmd/gh-aw/main.goat 885 lines is a concern — CLI entry points should be thin; command registration logic should be delegated to subpackages.JavaScript/CJS files (500–1000 lines) — 15 files
actions/setup/js/parse_copilot_log.cjsactions/setup/js/safe_outputs_handlers.cjsactions/setup/js/mcp_server_core.cjsactions/setup/js/create_issue.cjsactions/setup/js/send_otlp_span.cjsactions/setup/js/validate_secrets.cjsactions/setup/js/add_comment.cjsactions/setup/js/assign_agent_helpers.cjsConfiguration
Thresholds (defaults — no
.architecture.ymlfound):Action Checklist
Build()inpkg/workflow/compiler_safe_outputs_config.go(787-line function)pkg/cli/gateway_logs.gointo parser/renderer/extractorpkg/cli/audit_report_render.goby render domainactions/setup/js/log_parser_shared.cjs(1,703 lines, 4 functions >80 lines)actions/setup/js/create_pull_request.cjs(1,666 lines).architecture.ymlto customize thresholds if defaults are too strict