Skip to content

fix(frontmatter): isolate root identity and hub index tags - #901

Merged
runkids merged 3 commits into
runkids:mainfrom
salmonumbrella:feat/issue-894-nov14
Nov 14, 2026
Merged

runkids merged 3 commits into
runkids:mainfrom
salmonumbrella:feat/issue-894-nov14

Conversation

@salmonumbrella

@salmonumbrella salmonumbrella commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

#894

What changed

  • Keep legacy frontmatter readers in utils, search, hub indexing, and audit scoped to root fields. Nested name and description no longer replace root values or fill in a missing root description. Hub indexing also reads scalar tags only at the root; metadata.tags cannot supply or replace index tags.
  • Add regression tests and fuzz coverage for nested fields, plus global/project integration coverage for sync, list, hub indexing, and audit. Tests also cover existing structured metadata preservation, unchanged SKILL.md bytes, and the separation between metadata.type and the hub's installation source type.
  • Update skill-format docs in English, Japanese, Korean, Simplified Chinese, and Traditional Chinese to explain nested metadata and recommend it for custom fields.

Why

The complete-map parser already preserves nested metadata, including generated, sources, and unknown keys. Some legacy readers instead scan individual lines and could mistake fields inside metadata for root fields. That could put a nested description or nested tags in the hub index, or trigger audit findings from metadata rather than the root description.

fix-frontmatter-isolate-root-identity-and-hub-index-tags.mp4

Usage

No usage change. Keep custom fields under metadata; root name and description identify the skill. Native clients retain their own metadata restrictions.

Validation

Passed in a devcontainer built from the repository Dockerfile:

  • Focused checks in internal/utils, internal/hub, internal/audit, and internal/search, including frontmatter entry points and early-stop behavior.
  • Selected CLI integration tests, including synthetic global/project sync, list, hub index, and audit flows.
  • Bounded Go fuzz run for nested metadata isolation.
  • fmt-check, go vet, and CLI build.
  • Website production build for en, ja, ko, zh-Hans, and zh-Hant.

Also passed: ai-context check and git diff --check. Full make check and broad race/platform checks have not run locally; hosted CI for the final head passed unit tests, Linux/macOS integration, Windows, offline Docker, redteam, and Nix checks (7 successful, 2 conditionally skipped, none pending).

Automated Codex review could not complete because the account's review quota was exhausted.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

The make check box remains unchecked because validation was limited to the checks listed above.

Closes #894

Preserve root indentation in the tolerant identity readers so nested name
and description fields cannot shadow a skill or create audit claims. Keep
each reader's locator, scalar conversion and streaming policies intact.

Prove existing structured provenance preservation and the namespace fix
with regressions, bounded fuzzing, and global/project CLI integration.
Document nested metadata and native-client compatibility in all format
page locales.

Fixes runkids#894
Use one root-line predicate for the tolerant identity readers and
ParseSkillName so their metadata namespace boundary has one owner.
Keep each caller's whitespace policy, locator, scalar handling and
early-stop behavior intact.

Retain the existing namespace regressions, fuzz invariant and CLI flow
coverage without adding a duplicate helper test harness.
Apply the shared root-line predicate to the hub index scalar tag reader so
custom metadata tags cannot replace root tags or create absent root tags.
Extend the existing namespace table rows to assert exact index tags while
preserving the separate structured-list metadata precedence policy.
@salmonumbrella salmonumbrella changed the title fix(frontmatter): keep nested metadata out of root fields fix(frontmatter): isolate root identity and hub index tags Nov 14, 2026
@salmonumbrella

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T10:21:50.630097Z b686051 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@salmonumbrella
salmonumbrella marked this pull request as ready for review November 14, 2026 10:16
@runkids
runkids merged commit 990732b into runkids:main Nov 14, 2026
9 checks passed
runkids added a commit that referenced this pull request Nov 14, 2026
…field docs (#908)

Follow-up to #901.

IsRootFrontmatterLine took the caller's trimmed line only to test for blank
and comment lines, and its callers disagreed on how they trimmed it
(ParseSkillName trimmed spaces and tabs on the left, the rest trimmed all
whitespace). The helper now trims the raw line itself, so there is one
definition of a blank line and one argument fewer to get wrong.

Two tests added in #901 covered behaviour that change did not touch. The
ParseFrontmatterFields row is removed, and the ParseFrontmatterMap test is
reduced to the one case that guards what the skill format page promises:
nested metadata mappings and lists are kept.

Docs: the skill format page now recommends metadata for custom fields, but
the "Version tracking" example in creating-skills still showed top-level
version and author. It now matches. The sentence saying sync preserves
existing last_edited values is shortened, because skillshare has no such
field and the wording suggested it does. Both edits are applied to en, ja,
ko, zh-Hans and zh-Hant.
runkids added a commit that referenced this pull request Nov 14, 2026
The index and the draft builder read a skill's tags with different readers,
so the same SKILL.md could publish different tags depending on the path:

- The index accepted only the comma form (tags: git, workflow). A YAML list
  became "[git" and "review]", and a block list produced nothing.
- Drafts accepted only a YAML list, so the documented comma form produced no
  tags, and metadata.tags replaced the root field. After #901 the index
  ignores metadata, which made the two disagree there as well.

Both now call readSkillTags. It reads the root field only, in either form:
a list comes from the decoded frontmatter, and the comma form from the
existing line scan. The scan also unwraps a one-line list, so a skill whose
frontmatter YAML rejects on another line (for example an unquoted colon in
the description) no longer publishes bracketed fragments.

Tags under metadata are custom data and are not read by either path. The
skill format page says so in all five locales.
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.

Preserve nested OKF fields under SKILL.md metadata

2 participants