Recipes

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_bench installs its terminus adapter.

Run the example#

From the repository root, after the setup of the Terminal-Bench example:

Shell
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 1

The 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: each POST /reef/train runs one job (manual training).
  • evolution.method: recipes.meta_harness:MetaHarness. Its config keys are the fields of MetaHarnessSettings in method.py: mode, model, components, max_files, max_runs and run_chars.
  • evolution.models.proposer: the proposer. The method refuses the served model.
  • evolution.evaluation: fixed tasks, a scorer, policy: compare and statistic: 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: sandbox and components: [extension], as in terminal_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#

Text
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 comparison

The tests are in tests/recipes/meta_harness/.