Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
573e515
snapshot: pre-SDD baseline (working state with broken real mode)
rhljj Jul 30, 2026
c8bb99b
feat(pipeline): add EvalBackend Protocol with TraceBackend
rhljj Jul 30, 2026
aafa545
feat(pipeline): add LiveBackend for real-mode evaluation
rhljj Jul 30, 2026
8939bed
refactor(pipeline): narrow exception handling and delegate to EvalBac…
rhljj Jul 30, 2026
a59ec80
feat(pipeline): add applied_prompts context manager for candidate wri…
rhljj Jul 30, 2026
8571d55
refactor(pipeline): stage 4 writes best_prompts via applied_prompts
rhljj Jul 30, 2026
a1c2323
feat(pipeline): extend OptimizationExecutionReport with audit fields
rhljj Jul 30, 2026
eb50d3b
feat(pipeline): plumb audit fields and isolate optimizer output to su…
rhljj Jul 31, 2026
c3225a7
feat(pipeline): failure attribution accepts per_case dict
rhljj Jul 31, 2026
68edbea
refactor(pipeline): runner adopts EvalBackend and timestamp subdir
rhljj Jul 31, 2026
fe75b6f
refactor(pipeline): drop dead counter and tighten per_case typing in …
rhljj Jul 31, 2026
589b26a
feat(pipeline): audit trail renders stop_reason, rounds, and token usage
rhljj Jul 31, 2026
fa785a1
refactor(data): split evalsets into trace/ and live/ subdirs
rhljj Jul 31, 2026
f60c672
refactor(data): dedupe expected-turn builders and tighten regressions
rhljj Jul 31, 2026
5731ce8
fix(pipeline): stage 4 evaluates the candidate evalset, not the baseline
rhljj Jul 31, 2026
a08fb9c
refactor(data): rename test_config.json to gate_metrics.json (gate la…
rhljj Jul 31, 2026
cf17452
feat(data): update optimizer config (pareto, max_metric_calls=150, ti…
rhljj Jul 31, 2026
7bac54a
refactor(cli): assemble backend, derive scenario from suffix
rhljj Jul 31, 2026
d8f126b
fix(cli): drop eager factory wrapper, expose run_dir, update stale do…
rhljj Jul 31, 2026
ac259ec
test: update pipeline fake test paths to trace/ and gate_metrics
rhljj Jul 31, 2026
2637f91
test: update optimizer config test to reference gate_metrics.json
rhljj Jul 31, 2026
7eb82ae
test: add regression-gate test suite (7 new test files)
rhljj Jul 31, 2026
74a8da5
docs: add EvalBackend protocol test to README consistency guards
rhljj Jul 31, 2026
23898a6
feat: update eval_optimize_loop example and evaluation module
rhljj Jul 31, 2026
c90924f
merge: combine local eval_optimize_loop work with upstream main
rhljj Jul 31, 2026
9d11f52
fix(pipeline): honor max_regressions_allowed override, narrow asserti…
rhljj Jul 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,877 changes: 1,877 additions & 0 deletions docs/superpowers/plans/2026-07-30-eval-optimize-loop-optimization.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You parse free-text postal addresses and return a JSON object.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You parse free-text postal addresses and return a JSON object.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"evaluate": {
"metrics": [
{
"metric_name": "final_response_avg_score",
"threshold": 1.0,
"criterion": {
"final_response": {
"text": {
"match": "exact",
"case_insensitive": false
}
}
}
}
],
"num_runs": 1
},
"optimize": {
"eval_case_parallelism": 2,
"stop": {
"required_metrics": "all"
},
"algorithm": {
"name": "gepa_reflective",
"seed": 42,
"reflection_lm": {
"model_name": "${TRPC_AGENT_MODEL_NAME}",
"base_url": "${TRPC_AGENT_BASE_URL}",
"api_key": "${TRPC_AGENT_API_KEY}",
"generation_config": { "max_tokens": 4096, "temperature": 0.6 }
},
"candidate_selection_strategy": "pareto",
"module_selector": "round_robin",
"frontier_type": "objective",
"reflection_minibatch_size": 3,
"reflection_history_top_k": 2,
"skip_perfect_score": true,
"perfect_score": 1.0,
"use_merge": true,
"max_merge_invocations": 3,
"merge_val_overlap_floor": 5,
"max_metric_calls": 60,
"score_threshold": 1.0,
"max_iterations_without_improvement": 4
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"schemaVersion": "v1",
"algorithm": "gepa_reflective",
"status": "FAILED",
"finishReason": "error",
"stopReason": null,
"errorMessage": "frontier_type='objective' requires objective_scores to be provided by the evaluator, but none were found. Use an evaluator that returns objective_scores or use frontier_type='instance'.",
"baselinePassRate": 0.0,
"bestPassRate": 0.0,
"passRateImprovement": 0.0,
"baselineMetricBreakdown": {},
"bestMetricBreakdown": {},
"metricThresholds": {
"final_response_avg_score": 1.0
},
"perMetricBestCandidates": {},
"baselinePrompts": {
"system_prompt": "You parse free-text postal addresses and return a JSON object.\n"
},
"bestPrompts": {
"system_prompt": "You parse free-text postal addresses and return a JSON object.\n"
},
"totalRounds": 0,
"rounds": [],
"totalReflectionLmCalls": 0,
"totalJudgeModelCalls": 0,
"totalLlmCost": 0.0,
"totalTokenUsage": {
"prompt": 0,
"completion": 0,
"total": 0
},
"durationSeconds": 0.024374,
"startedAt": "2026-07-30T09:24:38.791593+00:00",
"finishedAt": "2026-07-30T09:24:38.815967+00:00",
"extras": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Optimization complete | status=FAILED | algorithm=gepa_reflective

pass_rate : 0.0000 -> 0.0000 (+0.0000, no improvement)
rounds : 0 accepted / 0 total
duration : 0.02s
started_at : 2026-07-30T09:24:38.791593+00:00
finished_at : 2026-07-30T09:24:38.815967+00:00
error_message : frontier_type='objective' requires objective_scores to be provided by the evaluator, but none were found. Use an evaluator that returns objective_scores or use frontier_type='instance'.
update_source : false
output_dir : /Users/lvjiajia/Desktop/trpc-agent-python-main/examples/optimization/advanced_strategies/runs/advanced_2026-07-30T17-24-38

metric breakdown (threshold | baseline -> best):
- final_response_avg_score threshold 1.0000 nan -> nan

best prompts:
- system_prompt 63 chars (best_prompts/system_prompt.md)

artifacts directory: /Users/lvjiajia/Desktop/trpc-agent-python-main/examples/optimization/advanced_strategies/runs/advanced_2026-07-30T17-24-38
result.json summary.txt rounds/ run.log baseline_prompts/ best_prompts/ config.snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You parse free-text postal addresses and return a JSON object.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You parse free-text postal addresses and return a JSON object.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"evaluate": {
"metrics": [
{
"metric_name": "final_response_avg_score",
"threshold": 1.0,
"criterion": {
"final_response": {
"text": {
"match": "exact",
"case_insensitive": false
}
}
}
}
],
"num_runs": 1
},
"optimize": {
"eval_case_parallelism": 2,
"stop": {
"required_metrics": "all"
},
"algorithm": {
"name": "gepa_reflective",
"seed": 42,
"reflection_lm": {
"model_name": "${TRPC_AGENT_MODEL_NAME}",
"base_url": "${TRPC_AGENT_BASE_URL}",
"api_key": "${TRPC_AGENT_API_KEY}",
"generation_config": { "max_tokens": 4096, "temperature": 0.6 }
},
"candidate_selection_strategy": "pareto",
"module_selector": "round_robin",
"frontier_type": "objective",
"reflection_minibatch_size": 3,
"reflection_history_top_k": 2,
"skip_perfect_score": true,
"perfect_score": 1.0,
"use_merge": true,
"max_merge_invocations": 3,
"merge_val_overlap_floor": 5,
"max_metric_calls": 60,
"score_threshold": 1.0,
"max_iterations_without_improvement": 4
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"schemaVersion": "v1",
"algorithm": "gepa_reflective",
"status": "FAILED",
"finishReason": "error",
"stopReason": null,
"errorMessage": "frontier_type='objective' requires objective_scores to be provided by the evaluator, but none were found. Use an evaluator that returns objective_scores or use frontier_type='instance'.",
"baselinePassRate": 0.0,
"bestPassRate": 0.0,
"passRateImprovement": 0.0,
"baselineMetricBreakdown": {},
"bestMetricBreakdown": {},
"metricThresholds": {
"final_response_avg_score": 1.0
},
"perMetricBestCandidates": {},
"baselinePrompts": {
"system_prompt": "You parse free-text postal addresses and return a JSON object.\n"
},
"bestPrompts": {
"system_prompt": "You parse free-text postal addresses and return a JSON object.\n"
},
"totalRounds": 0,
"rounds": [],
"totalReflectionLmCalls": 0,
"totalJudgeModelCalls": 0,
"totalLlmCost": 0.0,
"totalTokenUsage": {
"prompt": 0,
"completion": 0,
"total": 0
},
"durationSeconds": 0.024032,
"startedAt": "2026-07-30T09:25:41.748195+00:00",
"finishedAt": "2026-07-30T09:25:41.772227+00:00",
"extras": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Optimization complete | status=FAILED | algorithm=gepa_reflective

pass_rate : 0.0000 -> 0.0000 (+0.0000, no improvement)
rounds : 0 accepted / 0 total
duration : 0.02s
started_at : 2026-07-30T09:25:41.748195+00:00
finished_at : 2026-07-30T09:25:41.772227+00:00
error_message : frontier_type='objective' requires objective_scores to be provided by the evaluator, but none were found. Use an evaluator that returns objective_scores or use frontier_type='instance'.
update_source : false
output_dir : /Users/lvjiajia/Desktop/trpc-agent-python-main/examples/optimization/advanced_strategies/runs/advanced_2026-07-30T17-25-41

metric breakdown (threshold | baseline -> best):
- final_response_avg_score threshold 1.0000 nan -> nan

best prompts:
- system_prompt 63 chars (best_prompts/system_prompt.md)

artifacts directory: /Users/lvjiajia/Desktop/trpc-agent-python-main/examples/optimization/advanced_strategies/runs/advanced_2026-07-30T17-25-41
result.json summary.txt rounds/ run.log baseline_prompts/ best_prompts/ config.snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You parse free-text postal addresses and return a JSON object.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You parse free-text postal addresses and return a JSON object. The JSON must always contain exactly four keys in the following order: "city", "country", "postal_code", "street". If a field is not present in the input, set its value to null. Do not omit any keys. Output only the JSON object, with no extra whitespace, spaces, newlines, or explanatory text. Use compact JSON format (no spaces after colons or commas). Example: for "Sydney, Australia" output {"city":"Sydney","country":"Australia","postal_code":null,"street":null}.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"evaluate": {
"metrics": [
{
"metric_name": "final_response_avg_score",
"threshold": 1.0,
"criterion": {
"final_response": {
"text": {
"match": "exact",
"case_insensitive": false
}
}
}
}
],
"num_runs": 1
},
"optimize": {
"eval_case_parallelism": 2,
"stop": {
"required_metrics": "all"
},
"algorithm": {
"name": "gepa_reflective",
"seed": 42,
"reflection_lm": {
"model_name": "${TRPC_AGENT_MODEL_NAME}",
"base_url": "${TRPC_AGENT_BASE_URL}",
"api_key": "${TRPC_AGENT_API_KEY}",
"generation_config": { "max_tokens": 4096, "temperature": 0.6 }
},
"candidate_selection_strategy": "pareto",
"module_selector": "round_robin",
"frontier_type": "objective",
"reflection_minibatch_size": 3,
"reflection_history_top_k": 2,
"skip_perfect_score": true,
"perfect_score": 1.0,
"use_merge": true,
"max_merge_invocations": 3,
"merge_val_overlap_floor": 5,
"max_metric_calls": 60,
"score_threshold": 1.0,
"max_iterations_without_improvement": 4
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"schemaVersion": "v1",
"algorithm": "gepa_reflective",
"status": "SUCCEEDED",
"finishReason": "completed",
"stopReason": "score_threshold",
"errorMessage": "",
"baselinePassRate": 0.16666666666666666,
"bestPassRate": 1.0,
"passRateImprovement": 0.8333333333333334,
"baselineMetricBreakdown": {
"final_response_avg_score": 0.16666666666666666
},
"bestMetricBreakdown": {
"final_response_avg_score": 1.0
},
"metricThresholds": {
"final_response_avg_score": 1.0
},
"perMetricBestCandidates": {
"final_response_avg_score": [
1
]
},
"baselinePrompts": {
"system_prompt": "You parse free-text postal addresses and return a JSON object.\n"
},
"bestPrompts": {
"system_prompt": "You parse free-text postal addresses and return a JSON object. The JSON must always contain exactly four keys in the following order: \"city\", \"country\", \"postal_code\", \"street\". If a field is not present in the input, set its value to null. Do not omit any keys. Output only the JSON object, with no extra whitespace, spaces, newlines, or explanatory text. Use compact JSON format (no spaces after colons or commas). Example: for \"Sydney, Australia\" output {\"city\":\"Sydney\",\"country\":\"Australia\",\"postal_code\":null,\"street\":null}."
},
"totalRounds": 1,
"rounds": [
{
"round": 1,
"optimizedFieldNames": [
"system_prompt"
],
"candidatePrompts": {
"system_prompt": "You parse free-text postal addresses and return a JSON object. The JSON must always contain exactly four keys in the following order: \"city\", \"country\", \"postal_code\", \"street\". If a field is not present in the input, set its value to null. Do not omit any keys. Output only the JSON object, with no extra whitespace, spaces, newlines, or explanatory text. Use compact JSON format (no spaces after colons or commas). Example: for \"Sydney, Australia\" output {\"city\":\"Sydney\",\"country\":\"Australia\",\"postal_code\":null,\"street\":null}."
},
"trainPassRate": 0.0,
"validationPassRate": 1.0,
"metricBreakdown": {
"final_response_avg_score": 1.0
},
"accepted": true,
"acceptanceReason": "GEPA accepted proposal (val_score=1.0000)",
"failedCaseIds": [],
"failedCasesTruncated": 0,
"perFieldDiagnosis": {},
"reflectionLmCalls": 1,
"roundLlmCost": 0.0,
"roundTokenUsage": {
"prompt": 1800,
"completion": 899,
"total": 2699
},
"startedAt": "2026-07-30T09:27:16.459534+00:00",
"durationSeconds": 26.582981,
"kind": "reflective",
"trainMinibatchSize": 3,
"trainSubsampleParentScore": 0.0,
"trainSubsampleCandidateScore": 1.0,
"skipReason": null,
"errorMessage": null,
"budgetUsed": 18,
"budgetTotal": 60,
"extras": {}
}
],
"totalReflectionLmCalls": 1,
"totalJudgeModelCalls": 0,
"totalLlmCost": 0.0,
"totalTokenUsage": {
"prompt": 1800,
"completion": 899,
"total": 2699
},
"durationSeconds": 35.247283,
"startedAt": "2026-07-30T09:27:07.797621+00:00",
"finishedAt": "2026-07-30T09:27:43.044904+00:00",
"extras": {
"total_metric_calls": 18
}
}
Loading
Loading