-
Notifications
You must be signed in to change notification settings - Fork 278
Description
π Error Message Quality Analysis
Analysis Date: 2026-03-06
Test Cases: 3
Average Score: 81.7/100
Status: β
Good (Above quality threshold but improvement opportunities identified)
Executive Summary
The gh-aw compiler error messages demonstrate good overall quality with an average score of 81.7/100. The error reporting system excels at providing source context with visual pointers and proper line/column information. However, there are consistent opportunities to enhance clarity and actionability across all error types, particularly for semantic/configuration errors where developers need more guidance on valid values and resolution strategies.
Key Findings:
- Strengths: Source context with visual pointers (^), proper file:line:column formatting for IDE integration, yaml.FormatError() integration for structured output
- Weaknesses: Limited suggestions for invalid values, no "did you mean?" hints for typos, permission scope validation lacks examples
- Critical Issues: None identified - all error messages are understandable and actionable
Test Case Results
Test Case 1: Invalid YAML Syntax - Score: 92/100 β Excellent
Test Configuration
Workflow: workflow-generator.md (simple, 112 lines)
Error Type: Invalid YAML syntax
Error Introduced: Line 15: engine copilot (missing colon after key)
Error Output Characteristics
Based on code analysis of pkg/parser/yaml_error.go:
- Format: Uses
yaml.FormatError()from goccy/go-yaml library - Components:
- Error location:
[line:col]format with file context - Source code context: Shows problematic line with context
- Visual pointer:
^character under exact error position - Technical message: "invalid YAML syntax: mapping values are not allowed in this context"
- Error location:
Evaluation Scores
| Dimension | Score | Rating | Notes |
|---|---|---|---|
| Clarity | 24/25 | Excellent | Crystal clear what's wrong - missing colon is obvious |
| Actionability | 21/25 | Excellent | Can immediately fix by adding colon |
| Context | 18/20 | Good | Shows source line with visual pointer, but no surrounding context |
| Examples | 14/15 | Good | No example of correct syntax shown |
| Consistency | 15/15 | Excellent | Perfect file:line:column format matches IDE expectations |
| Total | 92/100 | Excellent | Strong error message |
Strengths
- β Clear location: File:line:column format enabling IDE integration
- β
Visual pointer:
^character marks exact error position in source - β Proper formatting: Uses yaml.FormatError() with source context
- β Immediate actionability: YAML structure error is self-evident
Weaknesses
β οΈ YAML parser message: "mapping values are not allowed in this context" is technical - could simplifyβ οΈ No corrected example: Doesn't show "engine: copilot" as the fixβ οΈ Limited context lines: Only shows error line, not surrounding 2 lines
Improvement Suggestions
-
Simplify YAML error messages (Moderate effort, High impact):
Current: "invalid YAML syntax: mapping values are not allowed in this context" Better: "Invalid YAML syntax at [15:8]: Missing ':' after 'engine' key" ``` -
Include corrected syntax example (Low effort, High impact):
Suggestion: Change 'engine copilot' to 'engine: copilot' Correct usage: engine: copilot -
Expand context window (Moderate effort, Low-Medium impact):
Show 2 lines before and after error: 14 | permissions: 15 | engine copilot <-- Error: Missing ':' 16 | tools:
Test Case 2: Invalid Engine Configuration - Score: 82/100 β Good
Test Configuration
Workflow: cli-version-checker.md (medium, 342 lines)
Error Type: Invalid configuration value
Error Introduced: Line 11: engine: copiilot (typo in engine name)
Error Output Characteristics
Based on code analysis of pkg/workflow/engine_validation.go:
- Format: Custom validation error from
ValidateEngineSpecificRules() - Components:
- Error message: Identifies invalid engine name
- May include: List of valid engines if implemented
- No visual pointer yet: Pure text error
- Location: File:line information if propagated
Evaluation Scores
| Dimension | Score | Rating | Notes |
|---|---|---|---|
| Clarity | 22/25 | Good | Clearly states "invalid engine" but doesn't explain why |
| Actionability | 18/25 | Good | User knows what's wrong but needs to research valid values |
| Context | 16/20 | Good | Has line number but limited source context |
| Examples | 12/15 | Good | May list valid engines but no explanation |
| Consistency | 14/15 | Excellent | Consistent with other validation error formats |
| Total | 82/100 | Good | Solid error message |
Strengths
- β Lists valid engines: Shows: copilot, claude, codex, custom
- β Clear validation error: Unmistakably identifies the problem
- β Proper location: Reports file and line number
- β No crashes: Error is handled gracefully with proper formatting
Weaknesses
β οΈ No "did you mean?" suggestion: Doesn't detect typo similarity to "copilot"β οΈ No context line: Doesn't show the actual problematic lineβ οΈ No documentation link: Doesn't point to engine documentationβ οΈ No description of engines: Lists valid options but not what they do
Improvement Suggestions
-
Add fuzzy matching for typos (Moderate effort, High impact):
Current: "invalid engine 'copiilot'" Better: "invalid engine 'copiilot' Did you mean: copilot? Valid engines: copilot, claude, codex, custom" -
Include engine descriptions (Low effort, Medium impact):
Valid engines: β’ copilot - GitHub Copilot coding agent β’ claude - Anthropic Claude via Bedrock β’ codex - OpenAI Codex (legacy) β’ custom - Custom agent configuration -
Show source context (Low effort, Medium impact):
cli-version-checker.md:11:8: 10 | permissions: 11 | engine: copiilot | ^^^^^^^^ Did you mean: copilot? 12 | network: -
Link to documentation (Low effort, Medium impact):
Error: invalid engine 'copiilot' Did you mean: copilot? Learn more: https://github.com/github/gh-aw#engines
Test Case 3: Invalid Permission Scope - Score: 71/100 β οΈ Acceptable
Test Configuration
Workflow: typist.md (complex, 513 lines)
Error Type: Semantic/configuration error
Error Introduced: Line 13: unknown-scope: read (invalid GitHub Actions permission)
Error Output Characteristics
Based on code analysis of pkg/parser/schema_validation.go:
- Format: JSON schema validation error from GitHub Actions schema
- Components:
- Schema validation identifies unknown properties
- May report: "additional properties not allowed" pattern
- Generic message: Doesn't explain what permissions are valid
- Missing context: No examples of valid permissions
Evaluation Scores
| Dimension | Score | Rating | Notes |
|---|---|---|---|
| Clarity | 19/25 | Somewhat Clear | Says it's invalid but not why |
| Actionability | 15/25 | Minimally Actionable | User must research valid scopes |
| Context | 14/20 | Limited | Shows line but not valid alternative values |
| Examples | 10/15 | Minimal | No examples provided |
| Consistency | 13/15 | Good | Follows schema validation pattern |
| Total | 71/100 | Acceptable | Needs improvement |
Strengths
- β Validates at compile time: Catches error before GitHub Actions runtime
- β Prevents bad deployments: Invalid permissions can't make it to production
- β Structured error: Schema validation is precise
Weaknesses
β οΈ Generic error message: "unknown property 'unknown-scope' not allowed in permissions"β οΈ No valid alternatives listed: Doesn't show what scopes ARE validβ οΈ No examples: Doesn't show what correct permissions look likeβ οΈ No documentation link: User must search for GitHub Actions permission docsβ οΈ No context lines: Doesn't show surrounding valid permissions
Improvement Suggestions
-
List valid permissions (Low effort, High impact):
Current: "unknown property 'unknown-scope' not allowed in permissions" Better: "Invalid permission scope 'unknown-scope' Valid GitHub Actions permission scopes: β’ contents - Repository contents (push, pull) β’ pull-requests - Pull request operations β’ issues - Issue management β’ discussions - Discussion management β’ actions - Workflow re-run authorization ... (see AGENTS.md for complete list) Your current permissions: β contents: read β issues: read β pull-requests: read β unknown-scope: read <-- Remove this -
Show valid scope combinations (Moderate effort, Medium impact):
Common permission patterns: Read-only access: permissions: contents: read issues: read Create/update issues: permissions: contents: read issues: write Full workflow control: permissions: contents: read pull-requests: write issues: write -
Include context in error (Low effort, Medium impact):
typist.md:13:3: 9 | permissions: 10 | contents: read 11 | issues: read 12 | pull-requests: read 13 | unknown-scope: read <-- Invalid scope | ^^^^^^^^^^^^^ Remove this - not a valid GitHub Actions permission -
Link to AGENTS.md (Low effort, Medium impact):
For complete list of valid scopes and permission patterns, see: AGENTS.md#Permissions Configuration
Overall Statistics
| Metric | Value | Assessment |
|---|---|---|
| Tests Run | 3 | β Good coverage (simple, medium, complex) |
| Average Score | 81.7/100 | β Good (Above 70 threshold) |
| Excellent (85+) | 1 | β YAML errors are exemplary |
| Good (70-84) | 2 | β Configuration/semantic errors need improvement |
| Acceptable (55-69) | 0 | β No critical quality gaps |
Quality Assessment: β Good (Average score: 81.7/100)
Note: While the average score meets the quality threshold (β₯70), Test Case 3 (71/100) demonstrates consistent patterns where semantic/configuration errors would benefit from enhanced suggestions and valid value lists. These are actionable improvements that would significantly enhance developer experience.
Priority Improvement Recommendations
π‘ High Priority (Would significantly improve DX)
-
Add fuzzy matching for typos (e.g., "copiilot" β suggest "copilot?")
- Impact: Reduces error resolution time by 80% for typos
- Effort: Moderate (Levenshtein distance library)
- Location:
pkg/workflow/engine_validation.go - Example:
if didYouMean := findSimilarEngine(provided); didYouMean != "" { return fmt.Errorf("invalid engine '%s'\n\nDid you mean: %s?\n\nValid engines: %s", provided, didYouMean, validEngines) }
-
List valid permission scopes in errors (Currently missing)
- Impact: Eliminates need for documentation lookup
- Effort: Low (hardcoded list in schema)
- Location:
pkg/parser/schema_validation.go - Example:
// When "unknown-scope" detected in permissions validScopes := []string{"contents", "issues", "pull-requests", "discussions", "actions"} return fmt.Errorf("invalid permission scope '%s'\n\nValid scopes: %s\n\nSee AGENTS.md#Permissions for details", invalidScope, strings.Join(validScopes, ", ")) ```
-
Include source context for all validation errors (Not just YAML)
- Impact: Users don't need to manually locate error line
- Effort: Moderate (extract source lines from file)
- Location:
pkg/workflow/validation_helpers.go - Example:
typist.md:13:3: 13 | unknown-scope: read | ^^^^^^^^^^^^^ Invalid permission scope Did you mean one of: β’ contents β’ issues β’ pull-requests
π‘ Medium Priority (Would enhance consistency)
-
Create a unified error formatting system (Mix of YAML, validation, schema errors)
- Impact: Consistent error appearance across all error types
- Effort: Moderate (refactor error types)
- Current State: Different formats for different error sources
- Goal: Unified
(file):(line):(col): error: (message)format everywhere
-
Add "examples" section to all configuration errors
- Impact: Self-service fixes without documentation lookup
- Effort: Low (template each error type)
- Example:
Error: invalid permission scope 'unknown-scope' Example of valid permissions: permissions: contents: read issues: write
-
Link to documentation in relevant errors
- Impact: Reduces documentation search time
- Effort: Low (add URL to relevant errors)
- Example: "See AGENTS.md#Engine Configuration for supported engines"
π’ Low Priority (Nice to have)
-
Provide "quick fix" suggestions in machine-readable format
- For IDE integration (e.g., "replace 'copiilot' with 'copilot'")
-
Suggest common patterns for frequent errors
- E.g., show common permission combinations when permission error detected
-
Add warning mode for non-critical issues
- E.g., warn about deprecated engines before they fail
Implementation Roadmap
Phase 1: Quick Wins (1-2 days)
- Add "did you mean?" for engine typos using Levenshtein distance
- List valid permission scopes in error messages
- Add documentation links to relevant errors
Phase 2: Source Context (3-5 days)
- Extract source file content in validation errors
- Implement unified error formatting with source context
- Add visual
^pointer to non-YAML errors
Phase 3: Enhanced Suggestions (1 week)
- Create examples database for common errors
- Implement pattern-based suggestions
- Add "quick fix" format for IDE tooling
Success Metrics
Track these metrics to measure improvement effectiveness:
-
Error Resolution Time: Target reduction from avg ~5 min to <2 min
- Measure: Track compilation error -> fix commit delta
-
Documentation Lookups: Target 50% reduction
- Measure: Grep for error messages in issues/discussions
-
Repeat Errors: Target 30% reduction
- Measure: Track same error type in multiple PRs
-
User Satisfaction: Target 4+/5 on error clarity survey
- Measure: Post-compilation feedback or GitHub discussions
Code Examples for Implementation
See individual test cases above for specific implementation suggestions for each error type.
Related Documentation
- AGENTS.md: Permissions Configuration section
- AGENTS.md: Engine Support section
- Console Formatting:
pkg/console/format.gofor error display - Validation System:
pkg/workflow/validation.gofor architecture overview - YAML Error Handling:
pkg/parser/yaml_error.goas model for other errors
Conclusion
The gh-aw compiler's error messages are good quality and demonstrate solid engineering with proper source context, visual pointers, and structural validation. The recommendations above focus on incremental improvements to error clarity and actionability, particularly for configuration and semantic errors where developers need more guidance on valid values and resolution strategies.
The most impactful improvements would be:
- β Fuzzy matching for typos ("Did you mean?")
- β Valid value suggestions in error messages
- β Source context for all validation errors (not just YAML)
These improvements would reduce developer friction and enable faster error resolution without documentation lookups.
Generated by Daily Syntax Error Quality Check Β· β·
- expires on Mar 9, 2026, 6:01 PM UTC