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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ 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/deepswe/`: DeepSWE v1.1 (113 long-horizon engineering tasks, the Harbor hub's `datacurve/deep-swe-1-1`,
pinned) graded as DeepSWE grades it in each task's Harbor environment: the agent's commits collected as `model.patch`
and applied in a verifier container of their own. What Hermit's deployment of an adapter writes is left out of the
collected commits (`utils/patches.py`), and a grader's crash (reward -1) is no score (`utils/judge.py`). 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
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`, `deepswe`, `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
16 changes: 12 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, DeepSWE from the Harbor hub 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 |
| [`deepswe/`](deepswe/) | 113 long-horizon engineering tasks of DeepSWE v1.1 (Python, TypeScript, Go, JavaScript, Rust), 90 min each; the agent's commits graded in a verifier container of their own | pass@1 | no adapter, each task once | nothing trains (held-out evaluation data): 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,16 @@ 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 and DeepSWE's (whose agents reach only the model's
hosts), reach the public network: a command that read it could send it out.
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); DeepSWE's prebuilt image of each task from Amazon ECR, about 111 GB compressed for the
113, 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 +147,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 | |
| `deepswe` | baseline | `hermit eval --config baseline/<p>.yaml --adapter none` | 113 | 90 min |
| | AHE's seed | `... --adapter "$PWD/hermit/adapter/templates/ahe"` | 113 | |
| | transfer | `... --adapter "$PWD/<export>"`, after Terminal-Bench 2.0's AHE run | 113 | |
| `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 +167,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 DeepSWE, the same with `deepswe`): 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/deepswe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
utils/tasks.jsonl
*/runs/
115 changes: 115 additions & 0 deletions examples/deepswe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# DeepSWE

[DeepSWE](https://github.com/datacurve-ai/deep-swe) v1.1 through Harbor: 113 original, long-horizon engineering tasks
on 91 open-source repositories (tasks in Python 34, TypeScript 35, Go 34, JavaScript 5, Rust 5), each in its own container
with the repository at the task's base commit, scored 1 when every test the change must make pass passes and none it
must keep passing breaks, else 0. The task set is the Harbor hub's `datacurve/deep-swe-1-1` at revision 1, locked in
`utils/dataset.lock`. DeepSWE is held-out evaluation data, so nothing trains here: as for
[SWE-bench Verified](../swebench_verified/), the protocol is a transfer, a frozen adapter evolved elsewhere tested on
all 113 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 5,400 s, no network for the agent but its model's, the disk gate, each image removed after its task |
| `utils/patches.py` | Hermit's deployment of the adapter left out of the commits DeepSWE grades |
| `utils/judge.py` | the verifier's reward as the score, its grader's crash (reward -1) never a score |
| `baseline/` | `codex.yaml`, `claude.yaml`: `hermit eval` on the 113 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/deepswe/utils/benchmark.yaml
```

It downloads the 113 tasks from the Harbor hub, runs `patches.py` on them, checks them against the lock, and writes
`utils/tasks.jsonl` (one row per task, and the smoke rows `mashumaro-flattened-dataclass-fields#0`, a Python task, and
`tengo-callable-instance-isolation#0`, a Go one), `utils/splits/` (`test.txt`: all 113) and `utils/image_sizes.json`.
Each task's image is pulled from `public.ecr.aws/d3j8x8q7/swe-bench-202605` when its trial starts, the verifier's built
on it with the hidden tests, and removed after it: 0.75 to 2.5 GB compressed each, about 111 GB for the 113.

## How a task is graded

DeepSWE's own protocol, which Harbor 0.25.0 runs as published: the agent's phase has no network (Hermit lets the
session reach its model's hosts alone); the instruction ends "work on this in a new branch from main and commit
everything when you are done"; once the agent stopped, a `[[verifier.collect]]` command writes its commits (`git diff
--binary <base commit> HEAD`) as `/logs/artifacts/model.patch`; the verifier runs in a container of its own (`[verifier]
environment_mode = "separate"`, the task's verifier image, no network), applies the patch to the pristine repository
and runs the hidden tests. Work the agent did not commit is not graded.

Two things are Hermit's:

- `patches.py` adds a pathspec to each collect command that leaves out what Hermit's deployment of the adapter puts at
the repository's root (`hermit/`, `AGENTS.md`, `CLAUDE.md`, `.codex/`, `.claude/`, `.mcp.json`, `.hermit-deploy.json`,
the hooks' `.hermit-hooks/`, `tool-calls.jsonl`):
an agent that commits everything commits them too, and an arm with an adapter would otherwise be graded on a tree
with those files and an arm with none without them. No task's reference solution or test patch touches them.
- `utils/judge.py`: DeepSWE's verifier writes reward -1 when its grader crashed (no test graded), which the environment
judge would score as the agent's -1. The judge records such a trial as no score (`Unscored`): `python -m
hermit.harbor.report` counts it as infra, apart from the trials its pass@1 is over, and `hermit eval`'s `mean_score`
counts it as 0. The run does not run it again by itself. To grade it, run `hermit eval` again on its row under a run
of its own, not the eval's (the same run name would write over the eval's `results.jsonl` and `summary.json`):

```bash
hermit eval --config examples/deepswe/baseline/<p>.yaml --adapter none data.test=<a file naming the row> \
trainer.run_name=<p>-rerun environment.harbor.jobs_dir=~/.cache/hermit/harbor/jobs/deepswe-<p>-rerun
```

The eval's folder still counts the row as infra; the rerun's folder holds its score.

## Baseline

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

113 trials, once each. The score is the `pass_at_1` of `python -m hermit.harbor.report` on the eval's folder
(`examples/deepswe/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. Published DeepSWE numbers average pass@1 over several attempts
per task, and the count differs between reports: set `eval.repeats` to that of the report compared against.

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

```bash
hermit eval --config examples/deepswe/baseline/<p>.yaml --adapter none data.test=../utils/splits/smoke.txt \
trainer.run_name=<p>-smoke environment.harbor.jobs_dir=~/.cache/hermit/harbor/jobs/deepswe-<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/deepswe/baseline/codex.yaml --adapter "$PWD/examples/terminal_bench_2_0/ahe_adapter/runs/ahe-final-codex"
hermit eval --config examples/deepswe/baseline/codex.yaml --adapter "$PWD/hermit/adapter/templates/ahe"
```

## Known limits

- DeepSWE recommends its own runner, Pier; its tasks are Harbor's format and run here on Harbor 0.25.0, whose separate
verifier and collect commands they need.
- A task's container gets 2 CPUs and 8 GB, and its verifier as much again while it runs: the configs run 4 tasks at a
time.

## Results

The smoke (the command in [Baseline](#baseline), `codex.yaml`, no adapter): both tasks
scored (no infra, no error), 0 of 2 resolved. Codex committed its work on a branch of its own, as the instruction asks,
and its patch applied in the verifier's container; DeepSWE's all-or-nothing reward scores each 0 (on `mashumaro` it
made every test it had to make pass pass and broke one it had to keep passing).

| Task | Agent's time | Tokens | Tests it must make pass | Tests it must keep passing | Reward |
|---|---|---|---|---|---|
| `mashumaro-flattened-dataclass-fields` (Python) | 316 s | 1,386K | 66 / 66 | 30,013 / 30,014 | 0 |
| `tengo-callable-instance-isolation` (Go) | 526 s | 3,395K | 4 / 23 | 122 / 122 | 0 |

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/deepswe/baseline/claude.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# DeepSWE, the baseline: Claude Code with no adapter on all 113 tasks, once each, each task's own 5,400 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/deepswe/baseline/claude.yaml --adapter none
# hermit eval --config examples/deepswe/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 113 tasks
agent:
base: claude # Claude Code in each task's own Harbor environment, installed there by Harbor
concurrency: 4 # a task takes 2 CPUs and 8 GB, and its verifier as much again
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/deepswe-claude # the Claude Code configs' environments (each task's trial)
judge:
path: ../utils/judge.py # Harbor's verifier's reward, its grader's crash (-1) never a 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