Repository Quality Report: Error Context Coverage in Compilation Pipeline (2026-03-25) #22907
Replies: 1 comment
-
|
💥 WHOOSH! 🦸 The smoke test agent swoops in from the shadows of the CI pipeline! KA-POW! 💥 Agent Claude has arrived and the smoke tests are NOMINAL!
⚡ ZZZAP! All systems green. The agentic workflows live to automate another day! — Smoke Test Agent, Run 23548639645 🤖
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report - Error Context Coverage
Analysis Date: 2026-03-25
Focus Area: Error Context Coverage in Compilation Pipeline
Strategy Type: Custom
Custom Area: Yes — gh-aw is fundamentally a compiler/transformer. Error messages are the primary user-facing feedback mechanism. When a user's workflow markdown fails to compile, the quality of that error message determines whether they can self-serve the fix or need to file an issue.
Executive Summary
Analysis of error handling patterns across
pkg/workflow/,pkg/cli/,pkg/parser/, andcmd/reveals that the codebase has a well-designed structured error system —WorkflowValidationError,OperationError,ConfigurationError,wrappedCompilerError, etc. — all withSuggestionfields. However, there are 227 barereturn errcalls (out of ~874 error returns, or ~26%) that propagate errors without adding positional context. Most occur in orchestration functions that delegate to well-typed callees, making this a targeted, high-value improvement rather than a systemic failure.The test-to-source ratio is excellent (220%), the schema covers all frontmatter fields (49 properties in
main_workflow_schema.json), and console formatting is used consistently. The primary gap is in the middle layer of the compilation stack — orchestration functions that catch and forward errors without wrapping them in caller context.Full Analysis Report
Focus Area: Error Context Coverage in Compilation Pipeline
Current State Assessment
Metrics Collected:
fmt.Errorf("%w"))return err(no context added)SuggestionfieldFormatErrorMessage)Findings
Strengths
WorkflowValidationError,OperationError,ConfigurationError,SharedWorkflowError,GitHubToolsetValidationError,wrappedCompilerError,CompilerErrorSuggestionfield for user guidanceErrorCollectorwith fail-fast and collect-all modes enables multi-error reportingformatCompilerErrorWithPositionprovides IDE-navigable error output with file/line/columnisFormattedCompilerErrorprevents double-wrapping in the compiler pipelineschema_suggestions.gofor schema-guided hintsAreas for Improvement
compiler_orchestrator_workflow.gohas 11 barereturn errin orchestration functions — these are the highest-traffic compilation pathsmcp_config_validation.gohas 4 barereturn errcalls — MCP config errors are common user frictiontools_validation.gohas 3 barereturn errcalls — tool validation is a frequent compile-time failurecodex_mcp.go,schema_validation.go,concurrency_validation.goeach have 2+ bare returnscmd/gh-aw/main.gois 860 lines — the CLI entry point has grown beyond the recommended 300-line soft limitDetailed Analysis
The orchestration pattern in
compiler_orchestrator_workflow.gois the most interesting case. Functions likeprocessAdditionalConfigurationsandprocessOnSectionAndFiltersare composed entirely ofif err := subFunc(...); err != nil { return err }chains. Because eachsubFuncis expected to emit awrappedCompilerError, the bare propagation is often intentional. However, when a sub-function doesn't emit a structured error (e.g., JSON marshal/unmarshal, I/O errors), the bare propagation surfaces a raw Go error message to the user.The distinction between "safe to propagate" and "should wrap" bare returns is the key improvement opportunity.
🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: The following tasks are designed for GitHub Copilot coding agent execution. Each section is an independent work item.
Improvement Tasks
Task 1: Add Error Context to
compiler_orchestrator_workflow.goBare ReturnsPriority: High
Estimated Effort: Small
Focus Area: Error Context Coverage
Description:
compiler_orchestrator_workflow.gocontains 11 barereturn errstatements in two orchestration functions:processAdditionalConfigurations(lines ~709–720) andprocessOnSectionAndFilters(lines ~831–876). When sub-functions emit raw Go errors (I/O errors, JSON errors), they propagate with no caller context. Wrap bare returns that could receive non-compiler errors withfmt.Errorf("...: %w", err).Acceptance Criteria:
return errinprocessAdditionalConfigurationsandprocessOnSectionAndFiltersare either wrapped withfmt.Errorfcontext or documented with a comment explaining why bare propagation is safe (e.g.,// error is already a wrappedCompilerError)go test ./pkg/workflow/...)make fmtpasses with no changesCode Region:
pkg/workflow/compiler_orchestrator_workflow.goTask 2: Add Error Context to
mcp_config_validation.goBare ReturnsPriority: High
Estimated Effort: Small
Focus Area: Error Context Coverage
Description:
mcp_config_validation.gohas 4 barereturn errat lines ~105, 250, 254, 263. MCP server configuration errors are one of the most common sources of compilation failures, and users need context about which MCP server block caused the error.Acceptance Criteria:
return errinmcp_config_validation.goare wrapped with context that includes the MCP server name or config keyfmt.Errorf("MCP server %q: %w", serverName, err)make fmt && go test ./pkg/workflow/...passesCode Region:
pkg/workflow/mcp_config_validation.goIf the server name is not available at the return site, pass it as a parameter or capture it from the enclosing scope. Run
make fmt && go test ./pkg/workflow/...to validate.Use the appropriate tool name for each return site. Run
make fmt && go test ./pkg/workflow/...to validate.If any sub-function can return a raw (non-compiler) error, note it inline. Run
make fmtto validate.Beta Was this translation helpful? Give feedback.
All reactions