fix: quote YAML colon in humanaios-findings-scan/SKILL.md; harden validate_skills against parse crashes#89
Conversation
…KILL.md; harden validate_skills to report-and-continue on YAML parse errors
There was a problem hiding this comment.
Pull request overview
This PR prevents validate_skills from aborting on a single malformed SKILL.md YAML frontmatter by (1) fixing an invalid YAML description in humanaios-findings-scan/SKILL.md, and (2) hardening the validator to convert PyYAML parse exceptions into a typed error that callers can handle while continuing the scan.
Changes:
- Quote/structure the
humanaios-findings-scanYAMLdescriptionusing a folded block scalar to avoid:parsing ambiguity. - Introduce
FrontmatterParseErrorand wrapyaml.safe_loadso parse failures become labeled, human-readable errors. - Update all scan/check functions to catch
FrontmatterParseErrorso validation continues (andvalidate_allstill fails the run with aggregated errors).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tools/validate_skills.py | Converts YAML parse crashes into typed, reportable errors and keeps scans running across bad files. |
| tools/skills/humanaios-findings-scan/SKILL.md | Fixes YAML frontmatter parsing by moving description to a folded block scalar. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot resolve the merge conflicts in this pull request |
Resolved by merging |
tools/skills/humanaios-findings-scan/SKILL.mdhad a bare:sequence inside an unquoted YAMLdescriptionvalue, causingyaml.safe_loadto throw aScannerErrorand abort the entirevalidate_skillsscan. Additionally,validate_skillspropagated anyyaml.YAMLErroruncaught, so a single bad file killed all subsequent checks.Changes
tools/skills/humanaios-findings-scan/SKILL.md— wrapdescriptionin a>-folded block scalar; the offending): findingscolon-space sequence is now unambiguous to the YAML parser.tools/validate_skills.pyFrontmatterParseErrorexception class.extract_frontmatternow catchesyaml.YAMLErrorand re-raises asFrontmatterParseErrorwith a human-readable message instead of propagating the raw exception.validate_all,check_deprecated_successors,check_governance_zone,check_meta_exempt,require_deprecated) wrapextract_frontmatterintry/except FrontmatterParseError. Invalidate_allthe error is appended to the error list (preserving nonzero exit); in the--checkfunctions the bad file is skipped and the scan continues.Post-fix,
validate_skillsscans all files, reports every bad file (including the pre-existinghumanaios-realtime-driftparse error now surfaced), and exits nonzero — no traceback.