fix: GEPA max_steps + validation artifact check#46
Open
zjdc49zctq-glitch wants to merge 3 commits into
Open
Conversation
added 3 commits
May 2, 2026 22:25
…l artifact - DSPy 3.2.0 removed max_steps param from GEPA, use max_metric_calls - Constraint validation was checking evolved_body (no frontmatter) so skill_structure check (looking for --- markers) always failed - Now validates the full reassembled artifact (frontmatter + body) so skill_structure check passes correctly - Also fixes baseline constraint validation to use full artifact
…ring trailing LLM reasoning - Change re.search(r'\[.*\]') to r'\[.*?\]' (non-greedy) to stop at first complete JSON array instead of last ] in the entire response - Add markdown code fence stripping as secondary fallback - Expand error message to show 500 chars of LLM output for debugging
…ested arrays Previous regex-based approaches failed on deeply nested JSON because .* or .*? would stop at inner ] boundaries. Now uses a proper bracket- counting parser that tracks depth and string context to find the outermost complete JSON array.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two bug fixes in
evolution/skills/evolve_skill.py:1. GEPA
max_steps→max_metric_callsDSPy 3.2.0 removed the
max_stepsparameter from GEPA. Currently the code falls back to MIPROv2 since GEPA init fails, but GEPA would never run even if it became available in future DSPy versions.Fix: Use
max_metric_callsinstead ofmax_steps.2. Constraint validation checked wrong artifact
validate_all()was called onevolved_body(markdown body only, no frontmatter), so theskill_structurecheck — which looks for---frontmatter markers — always failed, even for valid skills.The same issue existed for baseline constraint validation (
skill["body"]vsskill["raw"]).Fix: Validate the full reassembled artifact (
evolved_full/skill["raw"]) soskill_structurecan find the frontmatter markers.Verification
Both fixes confirmed working with
--iterations 3on theobsidianskill:✓ skill_structurenow passes (was always failing before)