Skip to content

fix: validate assembled skill (evolved_full) not raw body (evolved_body)#50

Open
zuquanzhi wants to merge 1 commit intoNousResearch:mainfrom
zuquanzhi:fix/validator-use-assembled-skill
Open

fix: validate assembled skill (evolved_full) not raw body (evolved_body)#50
zuquanzhi wants to merge 1 commit intoNousResearch:mainfrom
zuquanzhi:fix/validator-use-assembled-skill

Conversation

@zuquanzhi
Copy link
Copy Markdown

Problem

evolve_skill.py line 189 validates evolved_body (raw DSPy output without YAML frontmatter) against the skill_structure constraint. The constraint checks for ---, name:, and description: — which only exist in the reassembled skill with frontmatter.

This causes a false negative: the evolution completes successfully and produces valid output, but the validator rejects it with:

✗ skill_structure: Skill missing: YAML frontmatter (---), name field, description field

Fix

One-line change: pass evolved_full (reassembled with frontmatter on line 185) instead of evolved_body.

-    evolved_constraints = validator.validate_all(evolved_body, "skill", baseline_text=skill["body"])
+    evolved_constraints = validator.validate_all(evolved_full, "skill", baseline_text=skill["body"])

Verification

  • Dry-run passes
  • The evolved_full already contains valid YAML frontmatter (line 185: reassemble_skill(skill["frontmatter"], evolved_body))

The validator checks for YAML frontmatter (---, name:, description:)
but was passed evolved_body (plain markdown without frontmatter).
Changed to evolved_full which is reassembled with skill frontmatter.

Fixes false negative on skill_structure constraint check.
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.

1 participant