fix(core): frontmatter keys are read at top level only, never from nested maps - #255
Merged
Merged
Conversation
…sted maps The SKILL.md readers matched name:/description: on trimmed lines, last wins, at any depth. The standard skill frontmatter commonly carries a metadata: block; any of its fields spelled name: or description: silently stole the skill's identity, the frozen index carried the stolen strings, the #250 portability warning evaluated a name the author never wrote, and --check certified the file ok. A description block scalar containing a line starting with name: hit the same path. Keys now match only at the block's top level (no leading indentation), which also excludes block-scalar content, whose lines are always indented past their key. The shared reader fixes templates identically. --spec skills states the rule.
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.
Why
Round-7 contract audit, the round's one P2, reproduced on a built binary.
parse_skill_sourceand the sharedfrontmatter_descriptionsreader matchedname:/description:on TRIMMED lines, last wins, at any depth. The standard skill frontmatter commonly carries ametadata:block; a field of it spelledname:ordescription:silently stole the skill's identity:loaded as
skill 'internal-scratch'with descriptionnot for the index, the frozen index carried the stolen strings, the #250 portability warning evaluated a name the author never wrote, and--checkreportedok. It was the only state found where the verification surface certifies a broken outcome. Adescription:block scalar containing a line that starts withname:hit the same path, because the name loop had no block-scalar awareness.Summary
frontmatter_descriptions, so adescription:nested undermetadata:in a prompt template no longer becomes the popup line.--spec skillsstates the top-level rule, so the text and the binary agree.>header #227).Test Plan
a_nested_frontmatter_key_does_not_override_the_skill_name: the reproduction above; asserts the top-level name and description survive. Red on the old readers.a_block_scalar_line_spelling_name_does_not_become_the_name: adescription: >scalar containingname: ...prose; asserts the name is untouched and the folded description keeps the line. Red on the old readers.a_nested_description_is_not_the_template_description(templates): a nested-only description leaves the popup line empty. Red on the old readers.Greptile Summary
This change limits skill and prompt-template frontmatter metadata to unindented top-level keys. Nested map fields and block-scalar prose can no longer replace the displayed skill name or description.
Runtime checks exercised real skill discovery, template discovery, and template invocation. They confirmed that valid top-level metadata remains available, nested keys are ignored, and valid top-level keys appearing after nested or scalar content are still read. The same harness demonstrated the prior nested-template-description behavior on the parent revision and passed on this revision.
No defects were found.
Confidence Score: 5/5
The metadata parsing change is safe to merge based on exercised discovery and invocation behavior.
The affected behavior was checked with real skill and template fixtures, including nested maps, block-scalar content resembling metadata, nested-only template descriptions, and later valid top-level keys. The current implementation produced the intended results.
Files Needing Attention: No files need follow-up attention.
What T-Rex did
Reviews (1): Last reviewed commit: "fix(core): frontmatter keys are read at ..." | Re-trigger Greptile