Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ Changes are grouped by software version. Entries under Unreleased describe work
message's `<FINAL_ANSWER>` scored by the paper's `reward.py` (the OfficeQA repository's at its commit) at a 0.0%
relative error, with 0.1%, 1% and 5% recorded. A Codex event stream must show a completed final reply. The agent
uses a network allowlist and the verifier runs offline. No-adapter baseline configs cover Codex and Claude Code.
- `examples/swebench_pro_v2/`: SWE-bench Pro V2 (642 tasks of 11 repositories, Scale AI's release v2.0.0) as the
release's own Harbor task directories, pinned by `utils/registry.json` to the release's commit, graded under the
release's locked protocol in each task's Harbor environment: once the agent stopped, its change of the repository is
collected as `model.patch` (what Hermit's deployment of an adapter writes left out) and applied in a fresh container
of the task's image, where the release's verifier runs (`utils/patches.py`); a change that could not be collected is
no score (`utils/judge.py`). The HARD-51 subset is a split of its own.
No-adapter baseline configs cover Codex and Claude Code, and test an adapter trained elsewhere, frozen.
- `hermit convert` names the adapter's folder and files as a deployment does: a Claude Code plugin prints, from a
`SessionStart` hook, where its embedded adapter is and the files no export connects (the list a deployment's
context gives); Codex, Pi and Hermes plugins list those files under `unnamed_files` in the result and their README.
Expand Down Expand Up @@ -402,6 +409,8 @@ Changes are grouped by software version. Entries under Unreleased describe work

### Changed

- A relative `dataset.registry_path` of a benchmark file (`python -m hermit.harbor.dataset prepare`), outside a git
registry, is the benchmark file's folder's, as `dataset.data` is; before, it was the working directory's.
- A chat request through a CLI session follows a stated contract, on Codex as on Claude Code: what a session cannot do
(tools, sampling, non-text parts, another model) is a 400, not dropped; `max_tokens` is accepted and said not to apply
(`unapplied` in the reply); `llm.unapplied` accepts a named field going unapplied.
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ itself (B).
| `task.toml` limits | applied by Harbor; Hermit adds the agent's model hosts to `allowed_hosts` | the agent's timeout and the network applied by Hermit; a task that needs more memory than `environment.resources.memory_mb` is refused; `cpus` is not applied |
| Harbor at run time | needed (in a venv of its own) | not needed (`hermit/task/directory.py` reads the format) |
| Not supported yet (refused) | the adapter's tools, the agent's mounts, `prepare` and `collect`, multi-step tasks | files placed in the agent's workspace before it starts, multi-step tasks |
| Examples | `terminal_bench_2_0`, `terminal_bench_science`, `swebench_verified`, `algotune`, `labbench`, `officeqa_harbor`, `officeqa/gepa/run_codex_harbor.yaml` | `libero`, `robosuite`, `robodojo_sim`, `clbench_*`, `servelearnbench`, `agentdyn`, `agentdojo`, `officeqa` |
| Examples | `terminal_bench_2_0`, `terminal_bench_science`, `swebench_verified`, `swebench_pro_v2`, `algotune`, `labbench`, `officeqa_harbor`, `officeqa/gepa/run_codex_harbor.yaml` | `libero`, `robosuite`, `robodojo_sim`, `clbench_*`, `servelearnbench`, `agentdyn`, `agentdojo`, `officeqa` |

The task format is the same, so a task set of B moves to A when its tasks need stricter isolation: give each task's
`environment/` a Dockerfile (or a `docker_image`) and the run config `environment.harbor`. OfficeQA runs both ways:
Expand Down
18 changes: 14 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ a `.hermit/CARD.md`.

## Harbor benchmarks

Five benchmarks of Harbor's registry and OfficeQA from Harbor's dataset repository, each with a baseline and, for the
Five benchmarks of Harbor's registry, SWE-bench Pro V2 from its release's own Harbor tasks and OfficeQA from Harbor's
dataset repository, each with a baseline and, for the
five, the method whose paper's protocol fits it, packaged so
that any of their runs can be handed to someone with a Docker host. Each task runs in its own Harbor environment
(`environment.harbor`): Harbor starts the task's container and verifies the agent's work with the task's tests; the
Expand All @@ -63,6 +64,7 @@ Claude Haiku 5.5 on a Claude subscription (`*claude*.yaml`), both at medium effo
| [`swebench_verified/`](swebench_verified/) | 500 GitHub issues | resolve rate | no adapter, each issue once | nothing trains: Terminal-Bench 2.0's final AHE adapter, frozen, against AHE's seed (the AHE and RRSI papers' transfer test) |
| [`algotune/`](algotune/) | 154 speedup tasks | harmonic mean of the speedups | no adapter, the 108 test tasks | [`skillopt`](algotune/skillopt/): SkillOpt's split 2:1:7, 4 epochs, its gate, slow update and meta skill |
| [`terminal_bench_science/`](terminal_bench_science/) | 70 science workflows, 8 hours each | pass@1 | no adapter, each task twice (#3, #4) | Terminal-Bench 2.0's AHE adapter, frozen; [`ahe_adapter`](terminal_bench_science/ahe_adapter/) in Terminal-Bench 2.0's protocol |
| [`swebench_pro_v2/`](swebench_pro_v2/) | 642 tasks of SWE-bench Pro V2 (11 repositories; Go, Python, JS, TS), from the release's own Harbor tasks, graded under its locked protocol (the agent's change re-graded in a fresh container) | resolve rate | no adapter, each task once | nothing trains: Terminal-Bench 2.0's final AHE adapter, frozen, against AHE's seed, as for SWE-bench Verified |
| [`labbench/`](labbench/) | 181 FigQA figure questions | accuracy | no adapter, the 127 test questions | [`skillopt`](labbench/skillopt/), as for AlgoTune |
| [`officeqa_harbor/`](officeqa_harbor/) | 246 questions about U.S. Treasury Bulletins, in the OfficeQA paper's evaluation | the OfficeQA scorer at a 0.0% relative error | Codex with no adapter (50 train, 24 validation, 172 test): the 2026-11-25 run scored 58.1% on all 172 test questions and 43.0% on its 93 OfficeQA Pro questions, before the verifier update for interrupted turns | none yet |

Expand All @@ -83,14 +85,18 @@ Claude Haiku 5.5 on a Claude subscription (`*claude*.yaml`), both at medium effo
environment (or a config mounts one of this machine's and names it as `agent.<cli>.bin`); a method run also needs it
on this machine, where its learners run. The sign-in reaches the CLI in each task's environment (Codex's sign-in
file, taken back and removed before the verifier; Claude Code's token by name, then on a descriptor), where the
session's commands run and, in these task sets but OfficeQA's, reach the public network: a command that read it could send it out.
session's commands run and, in these task sets but OfficeQA's, reach the public network: a command that read it could
send it out. In SWE-bench Pro V2's the session reaches only the model's hosts, but the code the agent leaves in the
repository runs again in the verifier's container, which has the public network, so a sign-in a command wrote into
the repository could still leave from there.
Run them on a sign-in you accept that risk for.
- Room. No task's environment starts while Docker's disk has less than 25 GB free (the benchmark files'
`disk_gate_gb`); a task's image is built or pulled for it: Terminal-Bench 2.0's prebuilt images from Docker Hub, 120-150 GB in all, each removed
after its rollouts and so pulled again at every AHE step (sign in with `docker login` for Docker Hub's pull limits, or
keep them where the disk holds them: [Terminal-Bench 2.0](terminal_bench_2_0/README.md#prepare)); SWE-bench's image of
the issue, one for each of the 500, which stays in Docker's build cache (their size on disk is not measured here: this
machine pulled three of them); AlgoTune's 8 GB, the same layers for every task. An AlgoTune container takes 8 CPUs and
machine pulled three of them); SWE-bench Pro V2's prebuilt image of each task from GHCR, about 1 TB compressed for
the 642, each removed after its task; AlgoTune's 8 GB, the same layers for every task. An AlgoTune container takes 8 CPUs and
up to 64 GB, six at a time. No environment starts either while the host's `/tmp` has less than 1 GB free
(`tmp_gate_gb`). Each gate holds a task up to six hours (`disk_gate_wait_s`), one after the other (so up to twelve),
then the task's run fails as not the agent's result.
Expand Down Expand Up @@ -143,6 +149,9 @@ table. An AHE run also sends back its best iteration's in-sample pass@1, numbers
| `swebench_verified` | baseline | `hermit eval --config baseline/<p>.yaml --adapter none` | 500 | 50 min |
| | AHE's seed | `... --adapter "$PWD/hermit/adapter/templates/ahe"` | 500 | |
| | transfer | `... --adapter "$PWD/<export>"`, after Terminal-Bench 2.0's AHE run | 500 | |
| `swebench_pro_v2` | baseline | `hermit eval --config baseline/<p>.yaml --adapter none` | 642 | 50 min |
| | AHE's seed | `... --adapter "$PWD/hermit/adapter/templates/ahe"` | 642 | |
| | transfer | `... --adapter "$PWD/<export>"`, after Terminal-Bench 2.0's AHE run | 642 | |
| `algotune` | baseline | `hermit eval --config baseline/<p>.yaml --adapter none` | 108 | 1 h, and the timing |
| | the empty skill | `hermit eval --config skillopt/run_<p>.yaml --adapter root`, after SkillOpt's training | 108 | |
| | SkillOpt | `hermit train --config skillopt/run_<p>.yaml`, then `hermit eval ... --adapter final` | at most 364 (more if resumed mid-step), then 108 | |
Expand All @@ -160,7 +169,8 @@ again in a fresh environment when the provider could not serve its session (`env
n-th after n x `busy_wait_s`, 120 s, not counted in `infra_retries`) or its login's plan refused it (once the plan
allows, not counted), and a row's tokens are all its runs'. Before a long
training, its method's `smoke_<p>.yaml` checks the task set, the CLI in the containers and the method's learners
together. SWE-bench Verified trains nothing and has no smoke config: its baseline config runs its 2 smoke tasks apart
together. SWE-bench Verified trains nothing and has no smoke config (nor does SWE-bench Pro V2, the same with
`swebench_pro_v2`): its baseline config runs its 2 smoke tasks apart
from the baseline's run and trials, as the methods' smokes run apart from theirs, with

```bash
Expand Down
2 changes: 2 additions & 0 deletions examples/swebench_pro_v2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
utils/tasks.jsonl
*/runs/
118 changes: 118 additions & 0 deletions examples/swebench_pro_v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# SWE-bench Pro V2

[SWE-bench Pro V2](https://github.com/scaleapi/SWE-bench_Pro-os/tree/main/v2) through Harbor: the validated public
split of SWE-bench Pro, 642 tasks of 11 repositories in Go, Python, JavaScript and TypeScript, each in its own container
with the repository at the task's base commit, scored 1 when the tests the change must make pass, and those it must
keep passing, pass, else 0. The task set is the release's own Harbor task directories (`v2/tasks/` at tag `v2.0.0`,
commit `66f9276`), locked in `utils/dataset.lock`, and graded under the release's locked protocol. Nothing trains here:
as for [SWE-bench Verified](../swebench_verified/), the protocol is a transfer, a frozen adapter evolved elsewhere tested
on all 642 tasks against the same acting agent with no adapter.

| Folder | What it runs |
|---|---|
| `utils/benchmark.yaml` | the task set and the settings every config shares: each task's own 3,000 s, no network for the agent but its model's, the disk gate, each image removed after its task |
| `utils/registry.json` | where the tasks are: each one's directory in the release's repository at its commit (they are in no Harbor registry) |
| `utils/patches.py` | the locked protocol in the tasks: the agent's change collected as `model.patch`, graded in a fresh container |
| `utils/judge.py` | the verifier's reward as the score; a change that could not be collected is no score |
| `baseline/` | `codex.yaml`, `claude.yaml`: `hermit eval` on the 642 tasks, with no adapter or with an adapter directory |

Each config comes twice: Codex with GPT-5.6-Luna on a ChatGPT login, and Claude Code with Claude Haiku 5.5 on a Claude
subscription, both at medium effort. [Run the Harbor benchmarks](../README.md#harbor-benchmarks) says what a machine
needs and how to switch to another model or CLI.

## Prepare

```bash
python -m hermit.harbor.dataset prepare examples/swebench_pro_v2/utils/benchmark.yaml
```

It downloads the 642 task directories (30 MB) through Harbor from `registry.json`, runs `patches.py` on them, checks
them against the lock, and writes `utils/tasks.jsonl` (one row per task, and the smoke rows
`instance_flipt-io__flipt-518ec324...#0`, a Go task, and `instance_qutebrowser__qutebrowser-6b320dc1...#0`, a Python
one), `utils/splits/` (`test.txt`: all 642) and `utils/image_sizes.json`. Each task's image is pulled from
`ghcr.io/scaleapi/swe-bench_pro-v2:<instance id>` (anonymously) when its trial starts and removed after it: 0.5 to 6.5 GB
compressed each, about 1 TB for the 642. `utils/splits/hard51.txt` is the release's HARD-51 subset
(`v2/hard51_ids.txt`): the 51 tasks at least two of five model families failed, on which scores separate frontier
models far better than on the full set.

## The locked protocol

The release's tasks run their verifier in the container the agent worked in; its README asks for a stricter protocol
and reports only that one: the agent's phase offline but for its model, a 50-minute budget, and "the verifier never
runs in the agent's sandbox": the agent's `git diff` is captured and re-graded on a pristine image (its
`patch_replay` agent, a second Harbor job). Here that is in the tasks themselves, one trial each, with Harbor's own
separate verifier (`utils/patches.py`, run by prepare and recorded in the lock):

- once the agent stopped, a `[[verifier.collect]]` command in its container writes its change of the repository as
`/logs/artifacts/model.patch`: the release's capture (`git add -A`, the index's diff), taken against the commit the
repository stood at before the agent first moved HEAD, so work it committed counts too, binary files included, and
without the files Hermit's deployment of the adapter puts there (`hermit/`, `AGENTS.md`, `CLAUDE.md`, `.codex/`,
`.claude/`, `.mcp.json`, `.hermit-deploy.json`, the hooks' `.hermit-hooks/`, `tool-calls.jsonl`; no task's reference
or test patch touches them), so that every arm is graded on the agent's change alone;
- the verifier runs in a fresh container of the task's image (`environment_mode = "separate"`), applies the patch as
`patch_replay` does and runs the release's verifier unchanged;
- a change that could not be collected (no repository, a reflog whose first entry names no commit, a git step that
failed) is not graded: the collect command writes `collect-failed` in place of the patch, the verifier writes
`collect_failed` in its `reward.json`, and `utils/judge.py` records the trial as no score, which `python -m
hermit.harbor.report` counts as infra, apart from the trials its pass@1 is over. Harbor runs collect commands
best-effort, so the failure travels through the verifier rather than the trial's status.

The task's `[agent] network_mode = "no-network"` is the release's; Hermit lets the session reach its model's hosts
alone. The budget is each task's own 3,000 s.

## Baseline

```bash
hermit eval --config examples/swebench_pro_v2/baseline/codex.yaml --adapter none
```

642 trials, once each. The resolve rate is the `pass_at_1` of `python -m hermit.harbor.report` on the eval's folder
(`examples/swebench_pro_v2/baseline/runs/codex-baseline/eval/none/`), over the trials that are the agent's result; the
summary's `mean_score` counts an infra trial as 0. For HARD-51 alone, add `data.test=../utils/splits/hard51.txt
trainer.run_name=codex-hard51`.

The two smoke tasks run apart from the baseline's run and trials, as SWE-bench Verified's do:

```bash
hermit eval --config examples/swebench_pro_v2/baseline/<p>.yaml --adapter none data.test=../utils/splits/smoke.txt \
trainer.run_name=<p>-smoke environment.harbor.jobs_dir=~/.cache/hermit/harbor/jobs/swebpro-<p>-smoke
```

## Transfer

The same config tests an adapter trained elsewhere, frozen, as [SWE-bench Verified](../swebench_verified/README.md)
does with Terminal-Bench 2.0's final AHE adapter and AHE's seed:

```bash
hermit eval --config examples/swebench_pro_v2/baseline/codex.yaml --adapter "$PWD/examples/terminal_bench_2_0/ahe_adapter/runs/ahe-final-codex"
hermit eval --config examples/swebench_pro_v2/baseline/codex.yaml --adapter "$PWD/hermit/adapter/templates/ahe"
```

## Known limits

- The release's own numbers are of its locked agents (Claude Code, Codex and mini-swe-agent wrapped to capture the
patch, in Modal sandboxes); Hermit's agents run the same tasks under the same grading but are Hermit's, in local
Docker. Compare arms run here with each other.
- A few Go tasks fetch modules while their tests run; the verifier's container keeps the public network, as the
release's does.
- A file the agent creates that the repository's `.gitignore` ignores is not in its change (the release's capture is
the same).

## Results

The smoke (the command in [Baseline](#baseline), `codex.yaml`, no adapter): both tasks
scored (no infra, no error), 2 of 2 resolved. Codex's change of each repository (its source fix, with a test or test
data of its own) was collected from its container and applied cleanly in the fresh one, where the task's hidden tests
passed.

| Task | Agent's time | Tokens | Reward |
|---|---|---|---|
| `flipt-518ec324` (Go) | 75 s | 203K | 1 |
| `qutebrowser-6b320dc1` (Python) | 171 s | 419K | 1 |

The full runs: not run yet.

| Acting agent | No adapter | AHE's seed | AHE's final adapter from Terminal-Bench 2.0 |
|---|---|---|---|
| Codex, GPT-5.6-Luna | | | |
| Claude Code, Claude Haiku 5.5 | | | |
34 changes: 34 additions & 0 deletions examples/swebench_pro_v2/baseline/claude.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SWE-bench Pro V2, the baseline: Claude Code with no adapter on all 642 tasks, once each, each task's own 3,000 s,
# no web search. Claude Code runs Claude Haiku 5.5 at medium effort on a Claude subscription (`claude setup-token`, the
# token exported as CLAUDE_CODE_OAUTH_TOKEN; no API key) in each task's container. The same config tests an adapter
# trained elsewhere, frozen (the transfer protocol of ../README.md):
#
# hermit eval --config examples/swebench_pro_v2/baseline/claude.yaml --adapter none
# hermit eval --config examples/swebench_pro_v2/baseline/claude.yaml --adapter <an adapter directory>
#
# The resolve rate is the pass_at_1 of `python -m hermit.harbor.report` on the eval's folder
# (runs/claude-baseline/eval/none/ beside this file; eval/<its name>/ for an adapter directory), over the trials that
# are the agent's result; the summary's mean_score counts an infra trial as 0.
data:
tasks: ../utils/tasks.jsonl
train: ../utils/splits/smoke.txt # placeholder, as template and evolver are: hermit eval reads it, trains nothing
test: ../utils/splits/test.txt # the 642 tasks
agent:
base: claude # Claude Code in each task's own Harbor environment, installed there by Harbor
concurrency: 8
model: {name: claude-haiku-5-5, login: claude, effort: medium} # the subscription's plan, shared
claude: {web_search: false} # the CLI's web search off
environment:
harbor: # each task in its own Harbor environment, verified by Harbor's verifier
benchmark: ../utils/benchmark.yaml # the settings every config of this example shares
jobs_dir: ~/.cache/hermit/harbor/jobs/swebpro-claude # the Claude Code configs' environments (each task's trial)
judge:
path: ../utils/judge.py # Harbor's verifier's reward; a change never collected is no score (utils/judge.py)
template: prompt-only@1.0 # placeholder (see data.train)
task_info: ../utils/task-info # what hermit check asks of a training config
evolver: {name: eval-only} # placeholder: no Evolver of this name, so hermit train refuses this config
trainer:
run_name: claude-baseline
output_dir: runs
eval:
repeats: 1
Loading
Loading