Skip to content

fix: quote YAML colon in humanaios-findings-scan/SKILL.md; harden validate_skills against parse crashes#89

Merged
humanaios-ui merged 7 commits into
mainfrom
copilot/fix-broken-humanaios-findings-scan-skill-md
Jul 8, 2026
Merged

fix: quote YAML colon in humanaios-findings-scan/SKILL.md; harden validate_skills against parse crashes#89
humanaios-ui merged 7 commits into
mainfrom
copilot/fix-broken-humanaios-findings-scan-skill-md

Conversation

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

tools/skills/humanaios-findings-scan/SKILL.md had a bare : sequence inside an unquoted YAML description value, causing yaml.safe_load to throw a ScannerError and abort the entire validate_skills scan. Additionally, validate_skills propagated any yaml.YAMLError uncaught, so a single bad file killed all subsequent checks.

Changes

  • tools/skills/humanaios-findings-scan/SKILL.md — wrap description in a >- folded block scalar; the offending ): findings colon-space sequence is now unambiguous to the YAML parser.

  • tools/validate_skills.py

    • Add FrontmatterParseError exception class.
    • extract_frontmatter now catches yaml.YAMLError and re-raises as FrontmatterParseError with a human-readable message instead of propagating the raw exception.
    • All five scanning functions (validate_all, check_deprecated_successors, check_governance_zone, check_meta_exempt, require_deprecated) wrap extract_frontmatter in try/except FrontmatterParseError. In validate_all the error is appended to the error list (preserving nonzero exit); in the --check functions the bad file is skipped and the scan continues.
# Before: yaml.YAMLError escapes and aborts the loop
def extract_frontmatter(md_path):
    ...
    return yaml.safe_load(match.group(1))  # raises on bad YAML

# After: raises a typed, labelled exception; callers decide how to handle
class FrontmatterParseError(Exception): ...

def extract_frontmatter(md_path):
    ...
    try:
        return yaml.safe_load(match.group(1))
    except yaml.YAMLError as exc:
        raise FrontmatterParseError(
            f"YAML PARSE ERROR [{md_path.parent.name}]: {exc}"
        ) from exc

Post-fix, validate_skills scans all files, reports every bad file (including the pre-existing humanaios-realtime-drift parse error now surfaced), and exits nonzero — no traceback.

Copilot AI requested review from Copilot and removed request for Copilot July 7, 2026 23:00
Copilot AI linked an issue Jul 7, 2026 that may be closed by this pull request
…KILL.md; harden validate_skills to report-and-continue on YAML parse errors
Copilot AI requested review from Copilot and removed request for Copilot July 7, 2026 23:18
Copilot AI changed the title [WIP] Fix broken humanaios-findings-scan/SKILL.md and harden validate_skills fix: quote YAML colon in humanaios-findings-scan/SKILL.md; harden validate_skills against parse crashes Jul 7, 2026
Copilot AI requested a review from humanaios-ui July 7, 2026 23:19
Copilot AI review requested due to automatic review settings July 7, 2026 23:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-scan YAML description using a folded block scalar to avoid : parsing ambiguity.
  • Introduce FrontmatterParseError and wrap yaml.safe_load so parse failures become labeled, human-readable errors.
  • Update all scan/check functions to catch FrontmatterParseError so validation continues (and validate_all still 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.

Comment thread tools/validate_skills.py
@humanaios-ui humanaios-ui marked this pull request as ready for review July 8, 2026 00:08
humanaios-ui and others added 2 commits July 7, 2026 19:08
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI requested a review from humanaios-ui July 8, 2026 01:17
@humanaios-ui

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved by merging origin/main into this branch and fixing the conflict in tools/seed_org_defaults.py. Included in commit 6359537.

@humanaios-ui humanaios-ui merged commit 982b034 into main Jul 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix broken humanaios-findings-scan/SKILL.md + harden validate_skills

3 participants