Bug
In evolution/skills/evolve_skill.py step 7, the evolved skill is validated with the bare body (no YAML frontmatter):
evolved_constraints = validator.validate_all(evolved_body, "skill", baseline_text=skill["body"])
But ConstraintValidator._check_skill_structure requires the text to start with --- and contain name: / description: — which only exist in the reassembled full skill (evolved_full), not the bare body. Result: every evolved skill fails skill_structure, even when the reassembled file (frontmatter + body) is perfectly valid.
Repro
python -m evolution.skills.evolve_skill --skill lucky-agents --iterations 3 --eval-source synthetic
- Observe:
✗ skill_structure: Skill missing: YAML frontmatter (---), name field, description field
- The saved
output/<skill>/evolved_FAILED.md actually HAS valid frontmatter — because it was reassembled before saving, but validated before reassembly.
Fix
Validate the reassembled full skill instead (same text that gets saved/deployed):
evolved_constraints = validator.validate_all(evolved_full, "skill", baseline_text=skill["raw"])
Also the baseline check in step 3 has the same latent issue (validate_all(skill["body"], "skill")), though it only warns.
Verified: with this fix, a 10-iteration run passes all 4 constraints (size_limit, growth_limit, non_empty, skill_structure).
Environment
- Windows 10, Python 3.11, dspy 3.3.0, gepa 0.1.1
- Tested with DeepSeek as the LLM provider (openai/deepseek-chat) — the bug is provider-independent since it's a pure string-shape issue.
Bug
In
evolution/skills/evolve_skill.pystep 7, the evolved skill is validated with the bare body (no YAML frontmatter):But
ConstraintValidator._check_skill_structurerequires the text to start with---and containname:/description:— which only exist in the reassembled full skill (evolved_full), not the bare body. Result: every evolved skill fails skill_structure, even when the reassembled file (frontmatter + body) is perfectly valid.Repro
python -m evolution.skills.evolve_skill --skill lucky-agents --iterations 3 --eval-source synthetic✗ skill_structure: Skill missing: YAML frontmatter (---), name field, description fieldoutput/<skill>/evolved_FAILED.mdactually HAS valid frontmatter — because it was reassembled before saving, but validated before reassembly.Fix
Validate the reassembled full skill instead (same text that gets saved/deployed):
Also the baseline check in step 3 has the same latent issue (
validate_all(skill["body"], "skill")), though it only warns.Verified: with this fix, a 10-iteration run passes all 4 constraints (
size_limit,growth_limit,non_empty,skill_structure).Environment