Skip to content

Bug: skill_structure validator always fails — passes evolved_body without frontmatter #93

Description

@FRED-DL

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions