Skip to content

fix: accept UTF-8 BOM in SKILL.md frontmatter - #99

Open
mimran-khan wants to merge 6 commits into
NVIDIA:mainfrom
mimran-khan:fix/utf8-bom-frontmatter
Open

fix: accept UTF-8 BOM in SKILL.md frontmatter#99
mimran-khan wants to merge 6 commits into
NVIDIA:mainfrom
mimran-khan:fix/utf8-bom-frontmatter

Conversation

@mimran-khan

Copy link
Copy Markdown
Contributor

Summary

A valid SKILL.md that only differs by a UTF-8 BOM failed schema with HIGH frontmatter_format, while the unicode check called that BOM benign.

I read manifests with utf-8-sig (same as plugin JSON) and allow an optional BOM before the opening ---. Fixes #91.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes
  • Ran make lint
  • Ran make test
  • Ran make build
  • Did not add credentials, private datasets, or proprietary benchmark content

Release Impact

  • Updated CHANGELOG.md

Schema read utf-8 and anchored frontmatter at ^---, so a Notepad BOM
made a valid skill fail HIGH while unicode called the same BOM benign.
Read utf-8-sig and allow an optional BOM before the opening fence.

Fixes NVIDIA#91

Signed-off-by: mimran-khan <mohammed_imran.khan@outlook.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The focused parser/schema suites pass (46 tests), with Ruff and diff checks clean. One Tier 1 consumer still fails to parse the newly accepted BOM form, leaving inconsistent results; details are inline. The shared Gitleaks failure is unrelated branch history.

Comment thread src/skillevaluator/validators/frontmatter_parser.py
Schema already accepted a BOM-prefixed SKILL.md, but quality still
matched ^--- and skipped XML-tag checks. Read utf-8-sig and reuse the
shared FRONTMATTER_PATTERN.

Fixes NVIDIA#91

Signed-off-by: mimran-khan <mohammed_imran.khan@outlook.com>
# Conflicts:
#	CHANGELOG.md
@mimran-khan

Copy link
Copy Markdown
Contributor Author

Merged main. BOM handling in the quality parser should be covered now. Ready for re-review.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed the current head. BOM-prefixed frontmatter is now handled consistently by schema and quality parsing, so the original quality-gate mismatch is fixed. The focused frontmatter, schema, and quality suite passed (181 tests), with Ruff and diff checks clean. Approved. GitHub currently reports a CHANGELOG-only merge conflict, so the branch still needs an update before it can merge.

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.

[BUG]: UTF-8 BOM makes a valid SKILL.md fail schema while unicode calls the BOM benign

3 participants