[repository-quality] Compiler Error Hint Rendering Gap #37838
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Repository Quality Improvement Agent. A newer discussion is available at Discussion #38123. |
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.
-
Analysis Date: 2026-06-08
Focus Area: Compiler Error Hint Rendering Gap
Strategy Type: Custom
Custom Area: Yes — gh-aw is a markdown-to-YAML compiler; diagnostic quality is user-facing and directly impacts developer experience. A well-implemented
Hintrendering pipeline exists but is completely bypassed at all 66 production call sites.Executive Summary
pkg/consoledefines aCompilerError.Hintfield that renders as a cyan-styledhint:line in the terminal, modelled after Rust/Go compiler diagnostics. Tests confirm it works correctly. But analysis shows that zero production call sites ever set this field — everyformatCompilerError*helper ignoresHintentirely.Meanwhile, 71 of 72
NewValidationErrorcalls supply a non-emptySuggestionstring. These suggestions currently reach users as unformatted plain text appended to the error body (\nSuggestion: use ...) viaWorkflowValidationError.Error(). The styledhint:rendering path is dead code in production.The schema compiler (
pkg/parser/schema_compiler.go) has the same problem:generateSchemaBasedSuggestionsreturns fix guidance that is concatenated into the message string with a.separator instead of flowing through theHintchannel.🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Improvement Tasks
Task 1: Add
hintparameter toformatCompilerErrorWithPositionandformatCompilerErrorWithContextPriority: High
Estimated Effort: Small
Focus Area: Compiler Error Hint Rendering
Description:
formatCompilerErrorWithPosition(9 call sites) andformatCompilerErrorWithContext(3 call sites) constructconsole.CompilerErrorbut never populate theHintfield. Add ahint stringparameter to both functions so callers can pass fix guidance through. Update all 12 call sites to pass an empty string""as the new parameter (no behaviour change yet — subsequent tasks wire in real hints).Acceptance Criteria:
formatCompilerErrorWithPositionsignature updated to includehint stringparameterformatCompilerErrorWithContextsignature updated to includehint stringparameterconsole.CompilerError{..., Hint: hint}populated in both functions""as hint (preserving current behaviour)pkg/workflow/compiler_error_formatter_test.gohas a test verifying a non-empty hint appears in the formatted outputmake fmtandmake buildpassCode Region:
pkg/workflow/compiler_error_formatter.goTask 2: Bridge
WorkflowValidationError.SuggestiontoCompilerError.HintinformatCompilerErrorPriority: High
Estimated Effort: Medium
Focus Area: Compiler Error Hint Rendering
Description:
formatCompilerErroralready useserrors.As(cause, &vErr)to promote source position fromWorkflowValidationError. Extend this to also extractvErr.Suggestionand pass it as the newhintparameter (from Task 1) toformatCompilerErrorWithPosition. Do the same for*ConfigurationErrorand*OperationError. Then remove\nSuggestion: ...from the threeError()methods inworkflow_errors.goto prevent double-rendering — the suggestion now surfaces exclusively as a styledhint:line.Acceptance Criteria:
formatCompilerErrorextractsSuggestionfrom*WorkflowValidationError,*ConfigurationError,*OperationErrorviaerrors.Asand passes it ashintWorkflowValidationError.Error()no longer appends\nSuggestion: ...to its stringConfigurationError.Error()andOperationError.Error()likewise no longer append suggestionpkg/workflow/compiler_error_formatter_test.goverifies that aWorkflowValidationErrorwithSuggestion: "try foo"produces"hint: try foo"in the final compiler error, and that"Suggestion:"does NOT appear in the outputmake fmt && go test ./pkg/workflow/...passCode Region:
pkg/workflow/compiler_error_formatter.go,pkg/workflow/workflow_errors.goTask 3: Promote schema suggestion strings to
CompilerError.Hintinschema_compiler.goPriority: Medium
Estimated Effort: Small
Focus Area: Compiler Error Hint Rendering
Description: In
pkg/parser/schema_compiler.go,buildFallbackSchemaValidationErrorand the main validation path callgenerateSchemaBasedSuggestions/appendKnownFieldValidValuesHintand concatenate the result to the message string with a.separator. The localformatCompilerErrorWithLocationfunction has no hint parameter. Add ahint stringparameter to it, and update callers to pass suggestion text as hint rather than appending it to the message.Acceptance Criteria:
formatCompilerErrorWithLocationinpkg/parser/schema_compiler.gogains ahint stringparameter and setsHint: hintonconsole.CompilerErrorbuildFallbackSchemaValidationErrorpassessuggestionsas hint, not appended tomessagepathInfobranch) passes suggestion string as hinthint:line vs inline)make fmt && go test ./pkg/parser/...passCode Region:
pkg/parser/schema_compiler.goTask 4: Add end-to-end tests for the Suggestion-to-Hint rendering path
Priority: Medium
Estimated Effort: Small
Focus Area: Compiler Error Hint Rendering
Description: The
pkg/console/golden_test.gotests hint rendering with a staticCompilerError{Hint: "..."}literal, but no test exercises the production chain:NewValidationError→formatCompilerError→ styledhint:output. Add table-driven tests topkg/workflow/compiler_error_formatter_test.gocovering the full path and guarding against double-rendering regression.Acceptance Criteria:
"hint:"line"hint:"lineConfigurationErrorwith Suggestion → formatted output contains"hint:"line"Suggestion:"//go:build !integrationpresent on test filego test ./pkg/workflow/... -run TestFormatCompilerErrorpassesCode Region:
pkg/workflow/compiler_error_formatter_test.go📊 Historical Context
🎯 Recommendations
Immediate Actions (This Week)
hintparameter to formatters) — Priority: High — pure refactor, zero user-visible change, unblocks Tasks 2–3Short-term Actions (This Month)
Long-term Actions (This Quarter)
formatCompilerErrorcalls that passnilcause with no position — consider frontmatter field-line lookup to promote position accuracy📈 Success Metrics
CompilerError.Hintset in production: 0 → ≥ 71 (one per NewValidationError call with Suggestion)"Suggestion:"occurrences in terminal output: present (unformatted) → 0WorkflowValidationError.Error()includes suggestion in string: Yes → NoNext Steps
References: §27143661020
Generated by Repository Quality Improvement Agent
Next analysis: 2026-06-09 — Focus area selected by diversity algorithm
Beta Was this translation helpful? Give feedback.
All reactions