8000 SWE-bench Pro V2 through Harbor, graded under its locked protocol by illusoryw · Pull Request #138 · Infini-AI-Lab/hermit · GitHub
[go: up one dir, main page]

Skip to content

SWE-bench Pro V2 through Harbor, graded under its locked protocol - #138

Open
illusoryw wants to merge 1 commit into
Infini-AI-Lab:mainfrom
illusoryw:feat/swebench-pro-v2
Open

illusoryw wants to merge 1 commit into
Infini-AI-Lab:mainfrom
illusoryw:feat/swebench-pro-v2

Conversation

@illusoryw
@illusoryw illusoryw commented Dec 1, 2026 •
Copy link
Copy Markdown
Contributor

Change

Adds examples/swebench_pro_v2/: SWE-bench Pro V2, the
validated public split of SWE-bench Pro (642 tasks of 11 repositories in Go, Python, JavaScript and TypeScript; Scale
AI's release v2.0.0), each task in its own Harbor environment, graded under the release's locked protocol. It is
packaged as swebench_verified/ is: a utils/benchmark.yaml whose dataset: block
python -m hermit.harbor.dataset prepare reads, the committed dataset.lock and image_sizes.json, splits, Codex and
Claude Code baseline configs, task-info and README. Nothing trains: like SWE-bench Verified, the protocol is a
transfer, a frozen adapter evolved elsewhere (Terminal-Bench 2.0's final AHE adapter) tested against the same acting
agent with no adapter.

  • Where the tasks come from. The release ships its 642 tasks as Harbor task directories in its own repository
    (v2/tasks/), not in any Harbor registry. utils/registry.json is a Harbor registry file naming each task's
    directory at the v2.0.0 commit (66f9276), so prepare downloads them through Harbor like any registry
    dataset (dataset.registry_path: registry.json). Every downloaded file matches the release's v2/SHA256SUMS
    (6,420 files). utils/splits/hard51.txt is the release's HARD-51 subset.
  • The locked protocol, in the tasks (utils/patches.py, the block's dataset.patch, recorded in the lock). The
    release's tasks run their verifier in the agent's container; its README asks for a stricter protocol and reports
    only that one: the agent's diff captured and re-graded on a pristine image (its patch_replay agent, a second
    Harbor job). The patch does the same inside one trial with Harbor's own separate verifier:
    • task.toml: [verifier] environment_mode = "separate", and a [[verifier.collect]] command that writes the
      agent's change of the repository as /logs/artifacts/model.patch. The capture is the release's (git add -A,
      the index's diff, git reset), taken against the commit before the agent's first move of HEAD (the first entry of
      .git/logs/HEAD; the images ship with no reflog), so work the agent committed is graded too, and with
      --binary.
    • The capture leaves out what Hermit's deployment of an adapter writes at the repository's root (hermit/,
      AGENTS.md, CLAUDE.md, .codex/, .claude/, .mcp.json, .hermit-deploy.json, the hooks'
      .hermit-hooks/, tool-calls.jsonl); a test deploys AHE's template as a run does and fails if any entry it
      writes there is not left out. Without this an arm with an
      adapter would be graded on a tree holding those files and an arm with none without them. No task's reference or
      test patch touches any of them (checked on all 642).
    • tests/test.sh: the patch applied first, as patch_replay applies it (git apply, then --3way, then
      patch --fuzz=3); the rest of the verifier is the release's, unchanged.
    • The change is staged in an index of its own (a copy of the agent's), so the agent's index, and a lock a git
      command it ran left there, are neither in the way nor changed. A change that cannot be collected (no repository,
      a reflog whose first entry names no commit, a git step that fails) is not graded: Harbor runs collect commands
      best-effort, so the collect command writes collect-failed in place of the patch, the verifier writes
      collect_failed in reward.json, and the example's utils/judge.py records the trial as no score (counted as
      infra by hermit.harbor.report), not as the agent's 0.
  • Core change: a relative dataset.registry_path outside a git registry is now the
    benchmark file's folder's, as dataset.data is. Before, Harbor got it as spelled and resolved it against the working
    directory, so a registry.json kept beside the benchmark file worked from one directory only. A repo's
    registry_path and an absolute one are unchanged; the lock records the path as spelled.
  • Docs: the example's README.md and utils/task-info/README.md, examples/README.md (Harbor benchmarks, the
    hand-off table, the disk note, the sign-in's reach: the session reaches only the model's hosts, but the agent's code runs again in the verifier's container, which has the public network), docs/framework/task.md (the example list), CHANGELOG.md (Added, Changed).

Differences from the release's protocol:

The release (locked protocol) Here
Agent's network none but the model's endpoint the same: the task's no-network, plus the model's hosts Hermit adds
Budget 50 min, in-sandbox timeout each task's own 3,000 s; Hermit ends the session 60 s before
Capture git add -A; git diff --cached (vs. HEAD) the same, against the commit before the agent's first HEAD move, --binary, without Hermit's deployment
Re-grade a second Harbor job (patch_replay) on a pristine image Harbor's separate verifier in the same trial, a fresh container of the task's image
Sandboxes Modal local Docker
Agents its locked Claude Code, Codex, mini-swe-agent Hermit's Codex or Claude Code agent

Validation

On fed2a98 (this PR's commit), Python 3.12, Linux, Docker, Harbor 0.25.0:

  • python -m pytest --changed --base main, with every dependency group installed (pip install -e '.[test]' --group all), every test group (hermit/harbor/ is a shared layer): 2,189 passed, 158 skipped, 6 failed. The same 6 fail the
    same way on main in this environment: test_codex_in_a_tasks_environment_keeps_the_runners_256k_instruction_allowance
    (the task environment's own Python lacks jsonschema), test_round_6_hermit_side, and the sandbox's four venv tests
    (test_a_granted_venvs_*, test_a_venv_under_*, test_a_linked_venv_*), whose interpreter path differs in this test
    environment's venv.

  • python -m pytest examples/swebench_pro_v2 --durations=0: 15 passed in 0.85 s (the slowest, the deployment guard,
    deploys AHE's template twice), and the registry test in tests/core/test_harbor_dataset.py. With the prepared tasks
    moved away (as on CI), the example's tests and tests/core/test_harbor_examples.py: 113 passed. The core change alone
    (main with hermit/harbor/dataset.py and its test): tests/core/test_harbor_dataset.py, 44 passed.

  • bash docs/build.sh: built, no warnings. pre-commit run --all-files: all hooks passed.

  • The offline walkthrough of CONTRIBUTING.md: hermit check exit 0, every item [ok] (one warning, the
    walkthrough config's best_effort sandbox); hermit train exit 0, completed all epochs, 2 steps; hermit eval --adapter final exit 0, mean_score 1.0 on 2 tasks, 0 errors.

  • hermit check --no-probe on both baseline configs: only what every Harbor baseline reports (the eval-only
    placeholder Evolver, no hard budget); the Claude Code config also reports that CLAUDE_CODE_OAUTH_TOKEN is not set
    here.

  • python -m hermit.harbor.dataset prepare examples/swebench_pro_v2/utils/benchmark.yaml, run from another directory:
    642 rows, matching the lock, image_sizes.json for all 642 images (about 1 TB compressed).

  • Harbor's oracle (reference patch) and nop (empty patch) on the patched smoke tasks (harbor run -a oracle / -a nop):

    Task Reference patch Empty patch
    flipt-518ec324 (Go) 1 0
    qutebrowser-6b320dc1 (Python) 1 0
  • Through Hermit's own Harbor environment (hermit.environment.harbor; a scripted agent's commands in the task's
    container), with the files Hermit's deployment of an adapter writes left at the repository's root (hermit/ahe/,
    AGENTS.md, .codex/config.toml, tool-calls.jsonl, .hermit-deploy.json naming a workspace path,
    .hermit-hooks/hook-calls.jsonl): the reference patch on flipt-518ec324, uncommitted and committed (git add -A),
    scored 1 both times, the graded model.patch holding internal/config/config.go alone, the reference patch's file;
    with a .git/index.lock left in the repository too, it scored 1 with the same patch; with .git removed, so that
    nothing can be collected, the verifier's rewards were {"reward": 0, "collect_failed": 1}, which the judge records
    as no score.

  • Smoke, hermit eval --config examples/swebench_pro_v2/baseline/codex.yaml --adapter none data.test=../utils/splits/smoke.txt
    (config): mean_score
    1, errors 0, 435 s, 2 of 2 resolved (python -m hermit.harbor.report: 2 scored, 0 infra, 0 failed). The records
    (baseline/runs/<run>/eval/none/, git-ignored as CONTRIBUTING.md asks), one row each:

    Task Status Reward Tokens Agent's time Trial (jobs_dir)
    flipt-518ec324 (Go) ok 1 203k 75 s instance_flipt-io__flipt-518ec324b66a07fdd95464a__00e33991
    qutebrowser-6b320dc1 (Python) ok 1 419k 171 s instance_qutebrowser__qutebrowser-6b320dc1866258__ce447345

    In each, Codex's change (a 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 hidden tests passed.

    The smoke's records: summary.json and each record of results.jsonl (without its output, the agent's final message, and with the judge's feedback cut to its first line)
    {"adapter": "none", "commit": null, "tasks": 2, "repeats": 1, "mean_score": 1.0, "solved_once": 1.0, "cost_usd": null, "unknown_cost_tasks": 2, "errors": 0, "wall_s": 434.7}
    {"id": "instance_flipt-io__flipt-518ec324b66a07fdd95464a5e9ca5fe7681ad8f9#0", "status": "ok", "error": null, "judge": {"score": 1.0, "feedback": "passed", "extra": {"status": "ok", "passed": true, "rewards": {"reward": 1.0}}}, "tokens": 202758, "wall_s": 74.9, "trial": "instance_flipt-io__flipt-518ec324b66a07fdd95464a__00e33991"}
    {"id": "instance_qutebrowser__qutebrowser-6b320dc18662580e1313d2548fdd6231d2a97e6d-v363c8a7e5ccdf6968fc7ab84a2053ac78036691d#0", "status": "ok", "error": null, "judge": {"score": 1.0, "feedback": "passed", "extra": {"status": "ok", "passed": true, "rewards": {"reward": 1.0}}}, "tokens": 419322, "wall_s": 171.3, "trial": "instance_qutebrowser__qutebrowser-6b320dc1866258__ce447345"}

    trial is the record's judge.extra.trial_dir under jobs_dir.

  • Not verified: baseline/claude.yaml has not been run (no Claude subscription token here; its config loads and passes
    the Harbor environment's checks in the tests). No full run of the 642 tasks.

Review

  • Tests and documentation cover the affected behavior, where applicable. Tests:
    examples/swebench_pro_v2/utils/tests/test_locked_protocol.py,
    examples/swebench_pro_v2/utils/tests/test_uncollected_change.py, the swebench_pro_v2 entry of
    tests/core/test_harbor_examples.py, and the new test in tests/core/test_harbor_dataset.py. Documentation: as in
    Change.

  • Commands, defaults, and public interfaces are consistent. One behaviour change: a relative
    dataset.registry_path outside a git registry (Change, CHANGELOG.md under Changed). No example used one before.

  • Agents follow the agent layers. No new agent: the configs use the Codex and Claude Code Base Agents in each
    task's Harbor environment (environment.harbor).

  • Shared logs and examples contain no credentials or private data. No run records are committed; the prepared
    tasks are git-ignored (utils/tasks, utils/tasks.jsonl).

  • Documentation-only: not applicable.

  • Core changes. hermit/harbor/dataset.py (registry_path, prepare), with its test; why: Change. No
    sandbox or environment code changes.

  • Implementation correctness and failures. Traced: the benchmark file's settings to Harbor's trial (the
    model's hosts as extra_allowed_hosts, each task's own agent and verifier timeouts), seen in the smoke trials'
    config.json; the collect command and the apply step on real git repositories in the tests and on the real
    images. A patch that does not apply leaves the base state, which scores 0 (the release's own behaviour); an
    agent that changes nothing gets an empty patch and 0; a change that cannot be collected is no score (the
    judge), never the agent's 0; an infra trial (an image that did not pull, a verifier
    container that did not start) is infra as for every Harbor benchmark.

  • Real execution paths and tests. The smoke goes through hermit eval with real Codex sessions; the end-to-end
    runs through Hermit's Harbor environment and Harbor's oracle use the real tasks and images. The tests run the
    real collect command and apply step on git repositories (commits, untracked, binary and deleted files,
    Hermit's deployment), and the patch on tasks in the published form.

  • Documentation. As in Change.

  • This description. Read end to end against the code at fed2a98 and the records.

  • Independent review (post-PR audit). An agent in a separate session audited the published PR against the
    general, benchmark, test and sandbox checklists: nothing blocking. Its confirmed findings are fixed in this
    commit: a change that could not be collected (a git step failing, its errors discarded) was graded as the
    agent's 0; the shared README's note on the sign-in left out that the agent's code runs again in the verifier's
    container, which has the public network. Left as minor: files a config adds with agent.<cli>.files would be
    collected (no config here sets any); two benchmark files of one ref that both spell registry_path: registry.json would share a default data directory (the lock check still refuses tasks that differ); some
    added prose lines run past 120 characters.

  • Task directories. The release's Harbor task directories, through python -m hermit.harbor.dataset prepare
    with dataset.registry_path (the tasks are in no registry) and one dataset.patch (the locked protocol, reason
    above). Run in Harbor's environments with hermit.task.verify.

  • Public and private halves. No data.view. A row holds the instruction, the task's settings (image,
    resources, network modes, timeouts) and its metadata (difficulty, category, tags). The tests, their lists and
    the reference patch are only in the task's tests/ and solution/, never in the agent's container (the probe
    below). The judge's feedback is the verdict and the verifier output's tail (test names and failures); no learner
    reads it in these eval-only configs, as for SWE-bench Verified.

  • What a task asks. Each task.toml: agent no-network (the run adds its model's hosts), verifier public
    (the release's: a few Go tasks fetch modules at test time), 1 CPU, 4 GB, 10 GB, which the configs do not
    override. Effective timeouts:

    | | `task.toml` | The run |
    |---|---|---|
    | Agent | 3,000 s | the task's own (`agent_timeout_sec: null`); Hermit ends the session 60 s before, 2,940 s |
    | Collect (agent's container) | 300 s | 300 s |
    | Verifier (fresh container) | 3,000 s | 3,000 s |
    | Environment build | 1,800 s | 1,800 s |
    
  • Parity, for a moved benchmark. Not applicable: a new benchmark.

  • A real run. The smoke above, through hermit eval, no infrastructure error.

  • Group and selection. The example's tests are in its own examples/swebench_pro_v2/utils/tests/ (the core
    group by tests/selection.py, which --changed selects); the registry test in tests/core/. The file names are
    unique among the examples' tests (pytest imports them by basename).

  • Names. e.g. test_the_agents_change_committed_or_not_reaches_the_fresh_container_and_hermits_deployment_does_not,
    test_a_relative_registry_path_is_the_benchmark_files_folders_and_the_lock_keeps_its_spelling.

  • Docstrings. Each file opens with the code under test, its stand-ins (git repositories under tmp_path for
    the agent's and a fresh container; a download stand-in for Harbor) and "no network, no Harbor, no Docker".

  • What it asserts. Files and records a caller sees: the collected patch's files, the fresh tree after the apply
    step, the lock's source, the path Harbor is given; the deployment guard deploys AHE's template for both CLIs and
    checks every root entry. Checked to fail without each fix: resolving registry_path as before; the capture
    without the exclusion; the old exclusion list (the guard and the extended commit-all test); with HEAD as the
    base (committed work lost); without --binary; the capture on the agent's own index (a leftover index.lock
    gave an empty patch); a failed capture with no marker; the judge without its collect_failed check.

  • Real entry points and stand-ins. The collect command and the apply step as the trial runs them (bash -c,
    paths rewritten to tmp_path); prepare through hermit.harbor.dataset.prepare with Harbor's download stood in.

  • Isolation. tmp_path only, git's global config a file of its own (GIT_CONFIG_GLOBAL), no network,
    sign-in or agent CLI; the registry/lock test reads committed files only and passes without prepared data.

  • Time and order. No dates, sleeps or shared state.

  • Cost. 15 tests in the example, 0.85 s together, and one in tests/core (0.01 s).

  • Hygiene. No unused imports; each git subprocess ends with its test.

  • Reuse the framework's sandbox. The agent runs in its task's Harbor environment, the verifier in a fresh
    container of the task's image (Harbor's separate mode); no process runs Local. Evidence: the smoke trials
    (judge.extra.trial_dir, under the config's jobs_dir), whose config.json carries
    extra_allowed_hosts: ["chatgpt.com", "auth.openai.com"]; and the check below, run through Hermit's Harbor
    environment with that allowlist on flipt-518ec324 (a copy of the prepared task whose test.sh runs the probe):
    in the agent's phase only the model's hosts answer and neither /tests nor /solution exists; the verifier's
    container is another host, holds the collected model.patch, and has none of the agent's files (its marker
    outside the repository and its uncommitted file are absent: the probe's test.sh applies nothing), with the
    public network the release gives its verifier.

    <details><summary>The check's output</summary>
    
    ```text
    == agent phase, root@<agent's container>
    https chatgpt.com (model host)     exit 0: 200
    https auth.openai.com (model host) exit 0: 200
    https example.com                  exit 35: curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to example.com:443  000
    https github.com                   exit 35: curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443  000
    https 1.1.1.1 (direct IP)          exit 35: curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 1.1.1.1:443  000
    http example.com (plain HTTP)      exit 52: curl: (52) Empty reply from server 000
    ls /tests                          exit 2: ls: cannot access '/tests': No such file or directory
    ls /solution                       exit 2: ls: cannot access '/solution': No such file or directory
    ls /logs/artifacts                 exit 0: total 8 drwxrwxrwx 2 root root 4096 <date> . drwxr-xr-x 5 root root 4096 <date> ..
    agent's marker (/root/agent-marker) exit 1: cat: /root/agent-marker: No such file or directory
    agent's file in repo (probe-agent.txt) exit 1: cat: /app/probe-agent.txt: No such file or directory cat: /testbed/probe-agent.txt: No such file or directory
    write /app                         exit 0: writable
    agent left its files: 0
    == verifier phase, root@<verifier's container>
    https chatgpt.com (model host)     exit 0: 200
    https auth.openai.com (model host) exit 0: 302
    https example.com                  exit 0: 200
    https github.com                   exit 0: 200
    https 1.1.1.1 (direct IP)          exit 0: 301
    http example.com (plain HTTP)      exit 0: 200
    ls /tests                          exit 0: config.json parser.py probe.sh run_script.sh test.sh test_patch.patch
    ls /solution                       exit 2: ls: cannot access '/solution': No such file or directory
    ls /logs/artifacts                 exit 0: total 12 drwxrwxrwx 2 root root 4096 <date> . drwxr-xr-x 4 root root 4096 <date> .. -rw-r--r-- 1 1000 1000  157 <date> model.patch
    agent's marker (/root/agent-marker) exit 1: cat: /root/agent-marker: No such file or directory
    agent's file in repo (probe-agent.txt) exit 1: cat: /app/probe-agent.txt: No such file or directory cat: /testbed/probe-agent.txt: No such file or directory
    write /app                         exit 0: writable
    ```
    
    The probe (`probe.sh`, the phase as its argument), run in the agent's phase by the scripted agent and in the
    verifier's as the task copy's `test.sh` (`bash /tests/probe.sh verifier`, then reward 1):
    
    ```bash
    #!/bin/bash
    # What this phase can reach and see. Each line: the probe, then what came back.
    phase=$1
    try() { printf "%-34s " "$1"; shift; out=$(timeout 15 "$@" 2>&1); rc=$?; echo "exit $rc: $(printf "%s" "$out" | head -c 150 | tr "\n" " ")"; }
    echo "== $phase phase, $(id -un)@$(hostname)"
    try "https chatgpt.com (model host)"    curl -sS -o /dev/null -w '%{http_code}' https://chatgpt.com/
    try "https auth.openai.com (model host)" curl -sS -o /dev/null -w '%{http_code}' https://auth.openai.com/
    try "https example.com"                 curl -sS -o /dev/null -w '%{http_code}' https://example.com/
    try "https github.com"                  curl -sS -o /dev/null -w '%{http_code}' https://github.com/
    try "https 1.1.1.1 (direct IP)"         curl -sS -k -o /dev/null -w '%{http_code}' https://1.1.1.1/
    try "http example.com (plain HTTP)"     curl -sS -o /dev/null -w '%{http_code}' http://example.com/
    try "ls /tests"                         ls /tests
    try "ls /solution"                      ls /solution
    try "ls /logs/artifacts"                ls -la /logs/artifacts
    try "agent's marker (/root/agent-marker)" cat /root/agent-marker
    try "agent's file in repo (probe-agent.txt)" bash -c 'cat /app/probe-agent.txt 2>&1 || cat /testbed/probe-agent.txt'
    try "write /app"                        bash -c 'touch /app/.probe-w && echo writable && rm -f /app/.probe-w'
    ```
    </details>
    
  • Sandbox changes are core changes. No sandbox change.

@illusoryw
illusoryw force-pushed the feat/swebench-pro-v2 branch 3 times, most recently from ca995bb to 5521093 Compare December 1, 2026 23:00
examples/swebench_pro_v2/ packages SWE-bench Pro V2 (642 tasks of 11
repositories, Scale AI's release v2.0.0) as the other Harbor benchmarks
are: a benchmark file whose dataset block prepare reads, the lock of the
642 tasks and the images' sizes, splits (every task a test task, and the
release's HARD-51), baseline configs for both CLI profiles the other
benchmarks have, task-info and README. Nothing trains: the protocol is
SWE-bench Verified's transfer.

- utils/registry.json: the tasks are in no Harbor registry. It names each
  task's directory in scaleapi/SWE-bench_Pro-os at the v2.0.0 commit, and
  prepare downloads them through Harbor; every file matches the release's
  SHA256SUMS.
- utils/patches.py: the release's locked protocol in the tasks themselves,
  with Harbor's separate verifier. Once the agent stopped, its change of
  the repository (committed or not, binary files included, against the
  commit before its first move of HEAD) is collected as model.patch and
  applied in a fresh container of the task's image, where the release's
  verifier runs unchanged. Everything Hermit's deployment of an adapter
  writes at the repository's root (the adapter's folder, the context file,
  the CLI's places, the deployment's record, the hooks' audit) is left out
  of the patch, so that every arm is graded on the agent's change alone; a
  test deploys AHE's template as a run does and fails if any entry it
  writes there is not left out. The change is staged in an index of its
  own, so the agent's index (and a lock a git command left on it) is
  neither in the way nor changed.
- utils/judge.py: 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. Harbor runs collect commands best-effort, so the collect command
  writes collect-failed in place of the patch, the verifier records
  collect_failed in reward.json, and the judge makes it no score instead
  of the agent's 0.

dataset prepare: a relative dataset.registry_path outside a git registry
is now the benchmark file's folder's, as dataset.data is. Before, Harbor
got it as spelled and resolved it against the working directory, so a
registry.json kept beside the benchmark file worked from one directory
only. A repo's registry_path and an absolute one are unchanged; the lock
records the path as spelled.
@illusoryw
illusoryw force-pushed the feat/swebench-pro-v2 branch from 5521093 to fed2a98 Compare December 1, 2026 23:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0