Translate YAML/schema jargon into actionable error messages#16907
Translate YAML/schema jargon into actionable error messages#16907
Conversation
…neOf errors
- Add translateYAMLMessage() in frontmatter_error.go to convert raw goccy/go-yaml
messages ('non-map value is specified') to plain English user-friendly messages
- Add cleanOneOfMessage(), isTypeConflictLine(), stripAtPathPrefix() in schema_errors.go
to filter 'got string, want object' branches from oneOf validation errors
- Apply cleanOneOfMessage() in schema_compiler.go precise location case
- Add tests for new functions in schema_errors_test.go and yaml_message_translation_test.go
Fixes #syntax-error-quality: compiler error messages need clearer language"
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request improves compiler error message quality by translating raw YAML parser and JSON schema validation jargon into plain, actionable English. The goal is to increase error message quality scores from an average of 56.7/100 to above the 70-point threshold.
Changes:
- Added YAML syntax error translation that converts raw goccy/go-yaml messages (e.g., "non-map value is specified") into user-friendly guidance (e.g., "Invalid YAML syntax: expected 'key: value' format")
- Implemented oneOf error cleanup that removes confusing schema jargon like "'oneOf' failed, none matched" and filters out misleading type-mismatch lines from irrelevant schema branches
- Applied error message cleanup consistently across both precise-location and fallback error paths
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/yaml_message_translation_test.go | Comprehensive tests for YAML error message translation, covering various error patterns and edge cases |
| pkg/workflow/frontmatter_error.go | Implements YAML error translation table and applies it during frontmatter error creation |
| pkg/parser/schema_errors_test.go | Tests for oneOf cleanup logic, type conflict detection, and path prefix stripping |
| pkg/parser/schema_errors.go | Core implementation of oneOf message cleanup, type conflict detection, and path prefix stripping utilities |
| pkg/parser/schema_compiler.go | Integrates oneOf cleanup into the precise-location error path for schema validation errors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ge instead of 'oneOf' The cleanOneOfMessage() function now produces a more user-friendly error for steps without 'uses' or 'run': "'0': missing property 'uses'; '0': missing property 'run'" instead of the raw "'oneOf' failed, none matched". Update test expectation from "oneOf" to "missing property" to match the improved message. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in ca6cd19. The Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
pkg/workflow/frontmatter_error.gocleanOneOfMessagefunction inpkg/parser/schema_errors.goto filter "got string, want object" branches and simplify oneOf errorspkg/parser/schema_compiler.gofor both precise location and fallback error pathspkg/workflow/yaml_message_translation_test.gopkg/parser/schema_errors_test.goTestStepValidationintegration test to check for improved "missing property" messageOriginal prompt
This section details on the original issue you should resolve
<issue_title>[syntax-error-quality] Compiler error messages need clearer language and actionable guidance</issue_title>
<issue_description>### 📊 Error Message Quality Analysis
Analysis Date: 2026-02-19⚠️ Needs Improvement
Test Cases: 3
Average Score: 56.7/100
Status:
Executive Summary
Three compiler error scenarios were tested across different error categories: a YAML syntax error (missing colon), an invalid engine name typo, and an invalid permission value. All three fell in the "Acceptable" range (55–58/100), averaging 56.7/100 — below the 70-point quality threshold.
The compiler's structural presentation (file:line:column format, source code context with
>marker) is solid. The primary weaknesses are: raw parser/schema jargon leaking through to users ("non-map value is specified", "oneOf failed, none matched"), the absence of "did you mean?" suggestions for typos, no examples of correct syntax, and some errors pointing to parent fields rather than the specific offending line.Key Findings:
file:line:colformat; good source context with>marker and^pointer; valid-values lists for enum fieldsTest Case Results
Test Case 1: Missing colon in frontmatter key (workflow-generator.md) — Score: 55/100⚠️
Test Configuration
Workflow:
workflow-generator.md(108 lines, simple)Error Category: A — Frontmatter YAML Syntax
Error Introduced: Removed
:fromengine: copilot→engine copilot(line 15)Compiler Output