Description
When evolve_skill.py runs constraint validation (step 7), it passes evolved_body (markdown body only, no frontmatter) to validator.validate_all(). The _check_skill_structure check looks for --- at the start of the text, so it always fails even when the skill file is perfectly valid.
Root cause
File: evolution/skills/evolve_skill.py, line ~189
# BUG: passes evolved_body (no frontmatter) instead of evolved_full
evolved_constraints = validator.validate_all(evolved_body, "skill", baseline_text=skill["body"])
reassemble_skill() correctly builds evolved_full with frontmatter prepended, but that variable is never passed to the validator.
Fix
# FIX: pass evolved_full (with frontmatter) instead of evolved_body
evolved_constraints = validator.validate_all(evolved_full, "skill", baseline_text=skill["body"])
Reproduction
Run evolution on any skill (e.g. dogfood):
python3 -m evolution.skills.evolve_skill \
--skill dogfood \
--hermes-repo ~/.hermes \
--iterations 1 \
--eval-source synthetic \
--optimizer-model minimax/MiniMax-M2.7 \
--eval-model minimax/MiniMax-M2.7
Expected: ✓ skill_structure: Skill has valid frontmatter (name + description)
Actual: ✗ skill_structure: Skill missing: YAML frontmatter (---), name field, description field
The evolved skill file is saved to output/{skill}/evolved_FAILED.md and the metrics.json is never written (because the function returns early).
Affected versions
Confirmed on: hermes-agent-self-evolution 0.1.0
Description
When
evolve_skill.pyruns constraint validation (step 7), it passesevolved_body(markdown body only, no frontmatter) tovalidator.validate_all(). The_check_skill_structurecheck looks for---at the start of the text, so it always fails even when the skill file is perfectly valid.Root cause
File:
evolution/skills/evolve_skill.py, line ~189reassemble_skill()correctly buildsevolved_fullwith frontmatter prepended, but that variable is never passed to the validator.Fix
Reproduction
Run evolution on any skill (e.g.
dogfood):python3 -m evolution.skills.evolve_skill \ --skill dogfood \ --hermes-repo ~/.hermes \ --iterations 1 \ --eval-source synthetic \ --optimizer-model minimax/MiniMax-M2.7 \ --eval-model minimax/MiniMax-M2.7Expected:
✓ skill_structure: Skill has valid frontmatter (name + description)Actual:
✗ skill_structure: Skill missing: YAML frontmatter (---), name field, description fieldThe evolved skill file is saved to
output/{skill}/evolved_FAILED.mdand the metrics.json is never written (because the function returns early).Affected versions
Confirmed on:
hermes-agent-self-evolution 0.1.0