fix: fail fast on invalid baseline skills#61
Closed
steezkelly wants to merge 1 commit into
Closed
Conversation
Author
|
Closing this split PR in favor of consolidated PR #67. Local integration found review/merge overhead across the stack (notably #61/#64 overlap in evolution/skills/evolve_skill.py), and #67 preserves the combined local test evidence: targeted stack tests 21 passed; full suite 160 passed; GitHub checks were absent on the split PRs. Review #67 instead. |
This was referenced May 9, 2026
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
Partially addresses #33 H3 by making baseline constraint failures a hard gate:
_require_constraints_pass(...)to fail fast on any required constraint failureskill["raw"]) instead of body-only markdown soskill_structuresees frontmatterRoot cause
The pipeline previously logged a warning when the baseline skill failed constraints, then continued optimization anyway. That made improvement metrics unreliable because the candidate was compared against a malformed baseline.
A direct hard-fail would have exposed a second issue: the old baseline validation used
skill["body"], butskill_structurerequires YAML frontmatter. This PR therefore validates the full raw skill file before enforcing the gate.Opposite-perspective review notes
I specifically checked the failure mode that could make this PR harmful:
skill["raw"]for the baseline.Test Plan
pytest tests/skills/test_evolve_skill_constraint_gates.py -qfailed because_require_constraints_passand_validate_baseline_constraintsdid not existpytest tests/skills/test_evolve_skill_constraint_gates.py -qpytest -qgit diff --checkResult: 142 passed, 11 warnings (DSPy deprecation warnings only).
Partially addresses #33 (H3: evolution proceeds despite baseline constraint violations).