Not loaded · from cap-evolve
Scores the best candidate on a held-out test split exactly once, producing a sealed final.json with test delta vs baseline. Use as the last evaluation step after optimization stops.
Claude Code won't load this skill
It ships in cap-evolve at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Optimization hill-climbs on val: every accept decision consumed val as a tuning
signal, so by the end of search val is optimistic — it has been selected
against. The number you report must come from data nothing was tuned against.
finalize scores the run's best candidate on the sealed test split, once, and
writes final.json. That file is the run's result.
A bare test number cannot be defended — a reader cannot tell whether it beat the
capability you started with. So one finalize scores test twice: the best
candidate as tag FINAL, and the untouched seed candidate as FINAL_seed
(harness.finalize). final.json therefore carries test, test_baseline,
baseline_id, and test_delta — the held-out improvement, which is the figure
report, the dashboard, and the event stream all headline. If the best candidate
IS the seed (nothing was accepted), the second eval is skipped and test_delta is
0 by construction.
So budget --n-trials 3 as 3 trials × 2 candidates × |test| rollouts — twice
what the flag looks like it buys on a paid benchmark.
Both evals sit inside one attempt and neither is a selection event: the delta is reported, never chosen on. That is why the seal counts attempts, not evals.
The instant test informs any choice — picking between finalists, "double-
checking" a low number, re-running until it looks better — it stops being held
out, because each peek is a selection event that pulls the number from an
unbiased estimate toward an optimistic fit metric (references/concepts.md).
cap_evolve enforces this in three parts (rundir.py:358-407), and the split
between them is the whole design:
split="test" eval first checks the seal without burning
it, so no phase other than finalize can reach test at all.final.json is written, so a finalize
that dies before scoring leaves it unused and is honestly retryable. A
transient crash must not destroy a run's headline number.begin_test_attempt refuses a retry once test
rollouts exist on disk, before anything is spent.The seal refuses that mistake by default; it is not unbypassable.
CAPEVOLVE_ALLOW_TEST_RESCORE=1 is a deliberate opt-in override
(rundir.py:166). Its own message promises the use "is recorded in the run" —
nothing records it (issue #341), so a run that took a second look currently looks
identical to an honest one. If you set it, disclose it in the write-up yourself.
Corollary: all selection happens before finalize. Choose the single best candidate on val, then finalize it. Finalists that genuinely need comparing get compared on val — never on test.
A TestSealError is three situations with three different right moves. Tell them
apart from <run>/rollouts/test/ and test_used in splits.json:
| State | What happened | Do this |
|---|---|---|
| no test rollouts, seal unused | crashed before scoring | Re-run finalize — the case seal-on-success exists for. |
| test rollouts exist, seal unused | crashed after scoring, before commit | Do not re-score. Read the rollouts under <run>/rollouts/test/ and report what that attempt already computed. |
test_used: true | the run is finalized | Read final.json and regenerate the human artifact with report alone; cap-evolve run --resume skips finalize for you. |
Never delete test rollouts or edit splits.json to get past the error — that
manufactures a clean-looking number from a split that has already been seen.
This phase runs two ways from the same SKILL.md: standalone as the slash command /cap-evolve:finalize (the argument-hint shows its run.py args), and orchestrator-callable — cap-evolve run / the orchestrate skill invokes the same scripts/run.py headlessly and threads the run dir between phases.
python scripts/run.py --run-dir .capevolve/run_XXXX --project .capevolve/project --n-trials 3
Multiple trials give the headline an honest stderr and a pass^k reliability
figure instead of one noisy point. Under cap-evolve run the count comes from
num_trials in capevolve.yaml and defaults to 1 — set it to ≥3, or the
orchestrated headline ships with stderr 0: the exact single point this warns
against. If the split was configured with no holdout (test == train/val) the
number is a fit metric, not a held-out result; the dashboard flags it, so say so
in the summary too.
Then read the result instead of just filing it: test ≈ val means the val gain generalized, test ≪ val means search overfit val — a real finding, not a reason to re-score.
references/concepts.md — why each peek biases the estimate, the
train-fits / val-selects / test-estimates rationale, no-holdout runs, and how
this maps to public benchmark protocol, with sources.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub skillberry-ai/cap-evolve --plugin cap-evolve22 skills in this plugin
/agent-optimizeFree-form optimization algorithm for agent orchestration mode: the conversational agent owns the whole search — reading a digest, proposing big coherent capability edits against failure-cluster hypotheses, probing only missing cells, promoting or pruning on a posterior, merging complementary branches, and sealing test once. Use when orchestration_mode is agent and algorithm_skill is agent-optimize. For a deterministic loop use hill-climb, gepa or skillopt instead./baselineEstablish the starting point. Use after implement-and-check and before any algorithm. Creates the run directory, freezes the seeded train/val/test split (written once), scores the unmodified seed capability on val, and records it as the candidate every algorithm must beat. Reports the remaining headroom so a saturated seed stops the run before it spends budget./blackboxOther plugins' skills for the same job