Meta-Harness
A harness evolution method after Meta-Harness: full-history search over a fixed model's harness, scored on fixed evaluation tasks.
What it trains#
The whole harness tree, code included where the adapter's tree has an extension part. A training request starts
each job. The job shows a proposer model the search so far: every earlier candidate with its files, parent, outcome
and scores, and excerpts of its evaluation runs. The proposer branches from any candidate and returns one complete
tree. Reef evaluates that tree and publishes it when its mean score is above the served tree's.
method.py describes the job, the prompt and the refused replies.
Difference from upstream: upstream's proposer is a coding agent that reads the search as files. MetaHarness makes
one model call per job with an excerpt of the history. agent/ runs the upstream form on the
deployment's coding agent.
When to use it#
- To search over complete harness trees, code included, on fixed tasks with a scorer.
- With any Reef adapter and any run scorer.
To rewrite only harness text, with GEPA's minibatch and Pareto rules, use GEPA. To learn from live sessions, use ACE or ReasoningBank.
Requirements#
- A Reef checkout, the model under test, and a separate proposer model in
evolution.models. No GPU. - The Terminal-Bench example needs Linux, Python 3.12+, Git LFS, bubblewrap, an E2B key, and a
Terminal-Bench 2 checkout at the pinned revision.
pip install -e examples/terminal_benchinstalls itsterminusadapter.
Run the example#
From the repository root, after the setup of the Terminal-Bench example:
cd recipes/meta_harness/examples/terminal_bench
pip install -e .
./run.sh --tasks-root /opt/terminal-bench-2 --dry-run
./run.sh --task extract-elf --iterations 1 --repeats 1The dry run checks the pinned tasks and renders the seed, without model calls. A live run sends one training request
per step and writes work/<campaign-id>/summary.json: each candidate's parent, outcome and scores.
Configuration#
The settings reference describes the
recipe.config.evolution keys. A deployment sets:
recipe.config.training_mode: manual: eachPOST /reef/trainruns one job (manual training).evolution.method:recipes.meta_harness:MetaHarness. Itsconfigkeys are the fields ofMetaHarnessSettingsinmethod.py:mode,model,components,max_files,max_runsandrun_chars.evolution.models.proposer: the proposer. The method refuses the served model.evolution.evaluation: fixedtasks, ascorer,policy: compareandstatistic: mean. Keep the tasks fixed (no task collection), so that the scores of all candidates stay comparable.- To evolve Terminus 2 code:
adapter: terminus,executor: sandboxandcomponents: [extension], as interminal_bench.yaml.
Results#
Terminal-Bench 2, a matched search against upstream from vanilla Terminus 2: Reef's best selected score
is 23/60 (baseline 20/60), upstream's 24/60 (its baseline). The example's results
give the settings, and results/reef_harness.py is the selected harness.
Files#
meta_harness/
__init__.py exports MetaHarness and MetaHarnessSettings
method.py MetaHarness: one complete tree per job from the whole search history
system_prompt.md the proposer's system prompt
proposal_prompt.md the instructions in front of the search state
agent/ the same search with a coding agent as the proposer (AgentMethod prompts)
examples/terminal_bench/
the Terminal-Bench search and its terminus adapter
RESULTS.md the Terminal-Bench comparison with upstream
results/ the selected harness of that comparisonThe tests are in tests/recipes/meta_harness/.