Skip to content

Validate the reassembled skill, not the bare body - #161

Open
pradeeps319 wants to merge 1 commit into
NousResearch:mainfrom
pradeeps319:fix/validate-reassembled-skill
Open

Validate the reassembled skill, not the bare body#161
pradeeps319 wants to merge 1 commit into
NousResearch:mainfrom
pradeeps319:fix/validate-reassembled-skill

Conversation

@pradeeps319

Copy link
Copy Markdown

Problem

No evolved skill can ever be deployed.

evolve_skill.py validates the evolved result against evolved_body, which has no YAML frontmatter. But _check_skill_structure (constraints.py:150) requires the text to start with --- and contain name: and description:. That constraint fails unconditionally, and a failing constraint blocks deployment — so the run always ends at evolved_FAILED.md.

evolved_full is built on the immediately preceding line for exactly this purpose, then never used.

Phase 1 (skill files) is the only implemented phase, so this means the tool cannot currently produce a deployable artifact at all.

Observed

A real run improved the valset score from 0.862 to 1.0, then threw the result away:

Validating evolved skill
  ✓ size_limit: Size OK: 13216/15000 chars
  ✓ growth_limit: Growth OK: +0.0% (max +20.0%)
  ✓ non_empty: Artifact is non-empty
  ✗ skill_structure: Skill missing: YAML frontmatter (---), name field, description field
✗ Evolved skill FAILED constraints — not deploying
  Saved failed variant to output/github-code-review/evolved_FAILED.md

Running the same four constraints against the reassembled file passes all four:

PASS  size_limit - Size OK: 13856/15000 chars
PASS  growth_limit - Growth OK: +2.4% (max +20.0%)
PASS  non_empty - Artifact is non-empty
PASS  skill_structure - Skill has valid frontmatter (name + description)

Fix

One line: validate evolved_full instead of evolved_body. Existing suite passes unchanged (145 passed).

Related

The baseline check at line 121 has the same shape — it validates skill["body"], which is why every run prints a spurious skill_structure violation for the unmodified skill and then continues with "proceeding anyway". I left that alone since it only affects a warning rather than blocking deployment, but it shares the root cause and you may want to fix both together.

Separately, #159 fixes the DSPy >= 3.1 incompatibilities that cause dspy.GEPA() to be silently swapped for MIPROv2. These two are independent, but you need both before an evolution run does what the README describes end to end.

🤖 Generated with Claude Code

The evolved skill is validated against `evolved_body`, which has no YAML
frontmatter — but `_check_skill_structure` requires the text to start with
`---` and contain `name:` and `description:`. That constraint therefore fails
unconditionally, and since a failing constraint blocks deployment, no evolved
skill can ever be written back. Phase 1 is the only implemented phase, so in
practice the tool cannot currently produce a deployable artifact.

`evolved_full` is already built on the preceding line for exactly this purpose
and then never used.

Observed on a real run: GEPA improved the valset score from 0.862 to 1.0, and
the result was discarded with

    ✗ skill_structure: Skill missing: YAML frontmatter (---), name field,
      description field
    ✗ Evolved skill FAILED constraints — not deploying

Re-running the same four constraints against the reassembled file passes all
four (size 13856/15000, growth +2.4%, non-empty, valid frontmatter).

The baseline check on line 121 has the same shape — it validates
`skill["body"]`, which is why every run prints a spurious skill_structure
violation for the unmodified skill and then says "proceeding anyway". Left
alone here since it only affects a warning, but it has the same root cause.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@TurtleMcTurtle

Copy link
Copy Markdown

Review: PR #161 — Validate reassembled skill, not bare body

This is a clean, focused, correct fix for a real bug.

The bug: evolve_skill.py validates evolved_body (bare markdown without frontmatter) against constraints that include skill_structure which requires YAML frontmatter. This means the constraint check fails unconditionally on every evolved skill — no evolved skill can ever pass validation and deploy.

The fix: Change validator.validate_all(evolved_body, ...)validator.validate_all(evolved_full, ...) where evolved_full includes the reassembled frontmatter.

Status in other PRs:

Suggestion: This is a one-line fix that's correct and independent. If #155 isn't merged soon, this could go in on its own. If #155 is the base PR, this is already covered there.

@pradeeps319

pradeeps319 commented Aug 4, 2026 via email

Copy link
Copy Markdown
Author

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.

2 participants