Skip to content

feat: optimizer graduation slice A — GEPA pool, two-model split, dual gate (1.6.0-rc.1)#73

Merged
Ryfter merged 8 commits into
masterfrom
feature/optimizer-graduation-a
Jul 2, 2026
Merged

feat: optimizer graduation slice A — GEPA pool, two-model split, dual gate (1.6.0-rc.1)#73
Ryfter merged 8 commits into
masterfrom
feature/optimizer-graduation-a

Conversation

@Ryfter

@Ryfter Ryfter commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Optimizer graduation — Slice A (GEPA loop)

Graduates /baton:optimize-prompt from single-shot reflect-and-propose (d069/d070) to a real GEPA loop, per spec docs/superpowers/specs/2026-07-01-optimizer-graduation-design.md (decision d071).

What's new

  • scripts/prompt-pool-lib.ps1 — box-private candidate pool ($BATON_HOME/prompts/pool/): lineage, status (champion/candidate/retired), offline scores, and live cost-to-acceptance fields reserved at zero for Slice B (shadow A/B) so it lands without a migration.
  • Two-model split — cheap reflection model diagnoses gate-failed runs (Build-DiagnosisPrompt), stronger mutation model rewrites (Build-MutationPrompt); tiers ride the existing Select-Capability routing (reflect defaults one tier below mutate).
  • Minibatch evaluation — plan-only head-to-head vs the champion over historical polish/reject runs, judged against the recorded gate findings; position-swapped to cancel judge bias; ties excluded; all-ties = no evidence = fail.
  • Dual gate — child must strictly beat its parent AND be Pareto-non-dominated (judge win-rate vs prompt tokens); placeholder loss and the 2× length cap retire a mutation before any evaluation spend. Retired candidates stay in the pool as reflection fuel.
  • Human --apply unchanged (d070) — survivors are proposed as conductor-planner.candidate.txt; --apply backs up the live prompt, promotes to champion, marks stale scores for re-eval.
  • CLI: -Generations N, -ReflectTier T, -Pool report. Bootstrap deploys the new lib (pool itself is runtime state, never seeded). Plugin 1.6.0-rc.1.

Verification

  • 4 suites green: prompt-pool (29), optimize-prompt (O+M+E), bootstrap, conductor.
  • Final whole-branch review (Opus): Ready to merge — 0 Critical, 0 Important, 4 Minor (1 fixed in 2129005; others cosmetic/v1-inherited/by-design, listed in .superpowers/sdd/final-review-report.md).

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 2, 2026 04:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR graduates /baton:optimize-prompt from the v1 single-shot “reflect + propose” flow to a persistent GEPA-style evolution loop with a box-private prompt candidate pool, two-model reflect/mutate split, minibatch offline evaluation, and a dual acceptance gate (plus corresponding tests, CLI flags, and documentation). It also updates bootstrap deployment wiring and bumps the plugin version to 1.6.0-rc.1.

Changes:

  • Add a prompt candidate pool library (prompt-pool-lib.ps1) with Pareto-front selection and dual-gate logic, plus a new dedicated test suite.
  • Replace the optimizer’s single-shot path with Invoke-PromptEvolution (reflection + mutation + minibatch judge + dual gate), and extend tests accordingly.
  • Expand the /baton:optimize-prompt CLI with -Generations, -ReflectTier, and -Pool, and update bootstrap/docs/version to match.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/prompt-pool-lib.ps1 New pool state + Pareto/selection + dual-gate logic for optimizer evolution.
scripts/test-prompt-pool-lib.ps1 New hermetic test suite covering pool behaviors and gate math.
scripts/optimize-prompt-lib.ps1 Adds minibatch evaluator + two-model prompts and replaces optimizer with multi-generation evolution loop.
scripts/test-optimize-prompt-lib.ps1 Updates tests to cover minibatch evaluation and evolution (including apply/retire paths).
scripts/fleet-optimize-prompt.ps1 CLI updates: pool report mode and evolution flags; updated output/reporting behavior.
scripts/bootstrap.ps1 Ensures prompt-pool-lib.ps1 is deployed by bootstrap.
scripts/test-bootstrap.ps1 Adds assertion that bootstrap would deploy prompt-pool-lib.ps1.
docs/superpowers/specs/2026-07-01-optimizer-graduation-design.md New design spec for Slice A (and schema reserved for Slice B).
docs/superpowers/plans/2026-07-01-optimizer-graduation-slice-a.md New implementation plan detailing Slice A changes and constraints.
commands/optimize-prompt.md Updates the command doc to reflect evolution loop, pool, and new flags.
docs/COMMANDS.md Updates /baton:optimize-prompt docs and cheat-sheet entry for the new behavior/flags.
.claude-plugin/plugin.json Version bump to 1.6.0-rc.1.

Comment on lines 315 to +318
$runs = Get-HistoricalRuns -MaxRuns $MaxRuns
if (@($runs).Count -eq 0) {
Write-Host "No historical runs requiring polish or reject found."
return @{ success = $false; applied = $false; candidate_path = $null; reason = 'no historical runs requiring polish or reject' }
return (& $fail 'no historical runs requiring polish or reject' @())
Comment on lines +313 to 314
$pool = $loaded.pool

@Ryfter
Ryfter merged commit a4578ad into master Jul 2, 2026
1 check passed
@Ryfter
Ryfter deleted the feature/optimizer-graduation-a branch July 2, 2026 08:12
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