Feat/gepa phase0 shadow harness - #20
Merged
Merged
Conversation
Phase 0 of the GEPA adoption plan: a dependency-free, no-live-call shadow harness that exercises the full candidate lifecycle so every safety surface is tested before the real optimizer (Phase 1) arrives. - gepa_allowlist: firewall the search space to attacker prompt-profile fields; judge/rubrics/promotion/defense are unreachable by construction. - gepa_candidate: GepaCandidate + GepaEvaluationResult with the authority ladder (gepa-accept != redthread-accept != promoted) kept explicitly separate. - gepa_score: normalize research metrics into a scalar + Pareto vector; control lane is a fail-closed gate, never a reward bonus. - gepa_side_info: redaction layer (the only channel to a future reflection LM); allowlist-by-construction, no transcripts/canaries/secrets; named to avoid the GEPA-ASI vs telemetry-ASI collision. - gepa_shadow: MockProposer + CachedEvaluator + ShadowHarness; snapshots confined to research runtime dir; budget stop; split-overlap validation. - models/baseline: additive ObjectiveResult on ResearchBatchSummary so per-objective scores (already computed in run_objective, previously discarded) survive for Pareto. Existing consumers read composite_score unchanged. Tests: 8 containment gates (allowlist, snapshot confinement, redaction, control-fail rejection, split overlap, budget stop, no promotion/memory writes, ObjectiveResult round-trip). ruff + mypy clean; existing research suites unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replaces the max(composite_score) winner-collapse with a true Pareto frontier over per-objective score vectors (Phase 0's ObjectiveResult plumbing). Specialists that lead different objectives both survive; parent selection samples the frontier weighted by objectives led, per arXiv 2507.19457. Dependency-free and deterministic given a seeded RNG. The control split is never a Pareto axis — it stays a gate, not an objective. Tests: domination, specialist preservation (the core guarantee), dominated-exclusion, leader weighting, seeded-selection determinism, control-axis exclusion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tional)
Scaffolds RedThreadGEPAAdapter against the real gepa 0.1.1 GEPAAdapter protocol
(verified by inspecting the installed source, not guessed):
- gepa pinned as an OPTIONAL dependency group [research-gepa]; imported lazily so
core installs never require it.
- evaluate(batch, candidate, capture_traces): one ResearchObjective per DataInst;
returns per-objective normalized scores + native objective_scores breakdown that
feeds gepa's frontier_type='objective' Pareto selection.
- make_reflective_dataset: gepa's {Inputs, Generated Outputs, Feedback} schema, all
text redacted via gepa_side_info — the only channel to the teacher LM.
- BatchRunner injected, so the adapter is fully unit-tested with a cached runner and
ZERO live calls. Live execution stays a Phase 1-gated, budgeted decision.
- build_optimize_kwargs requires explicit reflection_lm + positive max_metric_calls
(no silent default); wires pareto + objective frontier.
Safety contracts preserved: allowlist on candidate + seed, redaction on reflective
records, control lane remains a gate (handled by the runner/wrapper, never a bonus).
Tests: score/output alignment, objective breakdown, allowlist rejection, redacted
per-component reflective dataset, budget guard, non-allowlisted-seed rejection.
ruff + mypy clean; 58 GEPA+research tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ellm dep Adds the disposable proof vehicle the CEO+CTO asked for before any under-the-hood integration: a single small GEPA run that answers "does reflective + Pareto-selected prompt optimization beat today's hard-coded mutation table on a held-out objective?" - scripts/spikes/gepa_phase1_spike.py: NOT a CLI command (surfacing stays under the hood, per unanimous CEO+CTO review). --mock runs an offline harness self-test (no model calls, no extra deps); the live path applies a candidate to the research-runtime prompt_profiles.json only, runs one bounded campaign per objective, and prints the baseline-vs-GEPA lift as a GO/NO-GO. Verified: attack algos (pair/tap/crescendo/mcts) read system_suffix/strategies from prompt_profiles at runtime, so the candidate truly changes behavior. - litellm>=1.0 added to the [research-gepa] optional group: gepa drives string reflection_lm ids (e.g. "ollama/<model>") through litellm, which it does not hard-depend on. Reflection LM stays local; judge stays the configured model. Live run is gated on a running Ollama (not available now); mock self-test, ruff, mypy all green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Analysis CompleteGenerated ECC bundle from 5 commits | Confidence: 55% View Pull Request #21Repository Profile
Changed Files (20)
Top hotspots
Top directories
Analysis Depth Readiness (evidence-backed, 29%)ECC Tools uses this to decide whether recommendations should stay at commit-history/setup guidance or expand into CI, security, harness, reference-set, AI-routing, and team backlog work.
Reference Set Readiness (1/7, 14%)
Detected Workflows (2)
Generated Instincts (22)
After merging, import with: Files
|
matheusht
added a commit
that referenced
this pull request
Aug 9, 2026
- rewrite docs/current_repo_state.md to reflect GEPA-era reality (PR #20 merged Phase 0-2, working tree carries Phase 1/3/4 spikes) - add GEPA research lane (R0-R4) to docs/PHASE_REGISTRY.md - add wiki research page gepa-adoption.md and link it from index - append wiki log entry - note GEPA research lane in README
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.
No description provided.