Optimizer Slice B: live shadow A/B — promote/retire in dollars (v1.7.0-rc.1)#74
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…live accrual, dollars verdict
…/when/who on the record)
…dict accrual + auto-retire in Complete-Run
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Implements “Optimizer Slice B” live shadow A/B for the Conductor planner prompt: real /baton:go runs alternate champion vs challenger, accrue realized/rework dollars plus gate verdicts per variant, and use cost-per-accepted-outcome to recommend promotion or auto-retire losing challengers (with a persisted --shadow on|off kill switch and retirement provenance fields).
Changes:
- Added prompt-pool Slice B primitives: single retirement door with provenance, shadow assignment, live accrual, and dollars-based verdict.
- Wired shadow assignment into planning and live accrual/auto-retire into
Complete-Run, plus CLI support and expanded pool reporting. - Added comprehensive hermetic PowerShell test coverage and updated docs/specs/version to
1.7.0-rc.1.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/prompt-pool-lib.ps1 | Adds Slice B pool schema fields + retirement door + shadow selection + live accrual + dollars verdict. |
| scripts/conductor-lib.ps1 | Wires shadow assignment into plan prompt building and accrues live results + auto-retire after reporting. |
| scripts/optimize-prompt-lib.ps1 | Refactors all retirement paths to go through Set-CandidateRetired with provenance. |
| scripts/fleet-optimize-prompt.ps1 | Adds `-Shadow on |
| scripts/test-prompt-pool-lib.ps1 | Adds unit tests P30–P55a for all new pool Slice B primitives. |
| scripts/test-optimize-prompt-lib.ps1 | Adds E14/E15 tests for retirement provenance stamping. |
| scripts/test-conductor-lib.ps1 | Adds SB1–SB10 tests for shadow assignment, accrual, fail-open, and auto-retire behavior. |
| docs/superpowers/specs/2026-07-02-optimizer-slice-b-live-shadow-ab-design.md | Design spec for Slice B shadow A/B behavior and constraints. |
| docs/superpowers/plans/2026-07-02-optimizer-slice-b-live-shadow-ab.md | Implementation plan capturing task breakdown and required interfaces. |
| docs/COMMANDS.md | Documents Slice B shadow lifecycle and adds `--shadow on |
| commands/optimize-prompt.md | Updates command invocation + documents live shadow A/B lifecycle and kill switch. |
| commands/go.md | Notes that runs may include a shadow event when a challenger is live. |
| .claude-plugin/plugin.json | Bumps plugin version to 1.7.0-rc.1. |
Comment on lines
+345
to
+353
| if ($sv.role -eq 'challenger') { $shadowTemplate = [string]$sv.template } | ||
| try { | ||
| @{ variant_id = [string]$sv.variant_id; role = [string]$sv.role | ||
| challenger_id = [string]$sv.challenger_id | ||
| assigned = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ') } | | ||
| ConvertTo-Json | Set-Content -LiteralPath (Join-Path $RunDir 'shadow.json') -Encoding utf8NoBOM | ||
| $vsOther = if ($sv.role -eq 'challenger') { 'champion' } else { "challenger $($sv.challenger_id)" } | ||
| Add-RunEvent -RunDir $RunDir -EventObj (New-RunEvent -Kind 'shadow' -Message "prompt variant $($sv.variant_id) ($($sv.role)) — live A/B vs $vsOther") | ||
| } catch { $shadowTemplate = $null } |
Comment on lines
+434
to
+435
| $poolLoaded = Get-PromptPool | ||
| if (($null -ne $assign) -and $assign.variant_id -and $poolLoaded.ok) { |
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.
What
Closes the GEPA loop with live evidence (spec:
docs/superpowers/specs/2026-07-02-optimizer-slice-b-live-shadow-ab-design.md, decision d072). A gate-surviving candidate becomes the challenger: real/baton:goruns alternate champion/challenger (fewer live runs takes the run), CostResolver-metered realized cost + acceptance verdicts accrue per variant, and the pool answers promote/retire on cost per accepted outcome — rework dollars included by construction.Invoke-PlanPhase+Resolve-ShadowVariant): fail-open — no pool / no challenger /--shadow off/ unreadable challenger text → today's behavior exactly. Assignment logged as ashadowevent +shadow.json.Complete-Run, after the report, fail-open):live.*counters + realized/rework dollars; at ≥5 gated runs per variant a challenger losing in dollars is auto-retired, a winner gets a PROMOTE recommendation — deployment stays human--apply(d070 unchanged).Set-CandidateRetired): every retirement — mechanical, gate failure, superseded, live A/B loss — now records why, when (retired_at), and what beat it (retired_by).--shadow on|offkill switch (persisted; absent = on);--poolgrows live columns + a shadow-verdict footer.Verification
1bf27cc), M1/M2 documented + deferred (informational event repetition; self-healing attribution edge).ConvertFrom-JsonDateTime auto-parse would have corruptedretired_atround-trips (fixed inGet-PromptPool); challenger text now validated before role selection so a dead challenger can't skew alternation.🤖 Generated with Claude Code