fix(spec): improve YAML validation error messages for skills, repos, and agents#100
Merged
Merged
Conversation
albertodebortoli
force-pushed
the
skill-versioning
branch
from
July 22, 2026 10:57
74fda3a to
1d5aa36
Compare
…and agents Type-mismatch errors leaked Yams' internal node-shape names (Mapping, Sequence, Scalar) instead of user-facing wording, and custom decoding errors thrown from within init(from:) (e.g. Skill.SkillDecodingError) got swallowed into a generic fallback message because Yams wraps any error escaping a custom initializer as dataCorrupted.
albertodebortoli
force-pushed
the
yaml-format-error-reporting
branch
from
July 22, 2026 12:19
7649464 to
2b4b53a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Mapping,Sequence,Scalar) into the user-facing message (e.g.Type mismatch at 'repos': expected Mapping.). These are now translated to plain wording (a mapping (key: value pairs),a list,a single value (text, number, or boolean)).init(from:)(e.g.Skill.SkillDecodingError.missingVersion, raised when neither the skill nor its repo alias specifies a version) were being swallowed into a generic fallback message, because Yams wraps any error escaping a custom initializer asDecodingError.dataCorrupted. The unwrap logic now recurses into any underlying error, not justDecodingErrors, so the specific message surfaces correctly.Type of Change
How Has This Been Tested?
SpecLoaderTests.swiftcovering: skill missingrepository, repo missingurl, wrong container shapes forrepos/skills/agentsentries, and missingversionon both skill and repo alias)swift test— 547 tests passingChecklist
Breaking Changes?