|
| 1 | +# SWE-bench-Pro (scaffold) |
| 2 | + |
| 3 | +This benchmark optimizes a code-editing agent on SWE-bench-Pro tasks. Each task |
| 4 | +checks a real project out at `/app/repo` and describes a bug fix or feature. The |
| 5 | +editable agent (`baseline/target/src/swebench_pro_agent/agent.py`) edits the |
| 6 | +repository in place; the **task-source verifier** applies the resulting repo state |
| 7 | +and runs the task's hidden test suite for the reward. The agent does not |
| 8 | +self-grade and writes no answer file: reward comes entirely from the suite. |
| 9 | + |
| 10 | +## Status: this is a SCAFFOLD, not a runnable benchmark |
| 11 | + |
| 12 | +Everything except the actual task data is in place: a robust Harbor-native agent, |
| 13 | +a `build.yaml`, partition scaffolding, a split script, and this README. It will |
| 14 | +**not run yet** because the real SWE-bench-Pro task dataset must come from a Harbor |
| 15 | +task source that is not committed here. |
| 16 | + |
| 17 | +### DONE (working skeleton) |
| 18 | + |
| 19 | +- `baseline/target/src/swebench_pro_agent/agent.py`: a tool-using code-editing |
| 20 | + agent on the OpenAI Responses API (`run_shell`, `read_file`, `write_file`, |
| 21 | + `apply_patch`, `run_tests`, `submit`), `MAX_TURNS = 50`. The |
| 22 | + `self._client.responses.create(...)` call is wrapped in a retry-with-backoff |
| 23 | + helper from the start (the GAIA baseline scored 0.0 because an unguarded call |
| 24 | + crashed on a transient error; that retry was the optimizer's winning fix). |
| 25 | +- `baseline/build.yaml`: the full VeRO/Harbor optimization config (agent import |
| 26 | + path, inference gateway, partitions wiring, timeouts, secrets, W&B). |
| 27 | +- `baseline/target/pyproject.toml`, smoke test, `secrets.env.example`, `.gitignore`. |
| 28 | +- `scripts/partition_swe_bench_pro.py`: a deterministic, sha256-keyed stratified |
| 29 | + split with a `--check` mode, modeled on `gaia/scripts/partition_gaia.py`. |
| 30 | + |
| 31 | +### STUBBED (must be completed before it runs) |
| 32 | + |
| 33 | +Two things must be finished: |
| 34 | + |
| 35 | +1. **Pin the real `task_source`.** `baseline/build.yaml` carries a clearly-marked |
| 36 | + placeholder: |
| 37 | + |
| 38 | + ``` |
| 39 | + task_source: scale-ai/swe-bench-pro@sha256:REPLACE_WITH_REAL_DIGEST |
| 40 | + ``` |
| 41 | + |
| 42 | + SWE-bench-Pro is a Scale benchmark. Find the real pinned task package in the |
| 43 | + Harbor task registry (ask the DEX-harness / Harbor team if it is not obvious). |
| 44 | + The baseline in this directory provides only the **agent + config**; the task |
| 45 | + package provides the **repos, tests, gold patches, and grading**. Replace the |
| 46 | + placeholder digest here and the `DATASET_DIGEST` constant in |
| 47 | + `scripts/partition_swe_bench_pro.py`. |
| 48 | + |
| 49 | +2. **Regenerate the partitions from the real task list.** The committed |
| 50 | + `partitions/{development,validation,test}.json` are empty placeholders and |
| 51 | + `partitions/manifest.json` is a stub (`"_stub": true`). Once the task source is |
| 52 | + pinned, set `TOTAL_TASKS`/`TARGET_COUNTS` and confirm `_read_tasks` against the |
| 53 | + real `task.toml` layout in `scripts/partition_swe_bench_pro.py`, then generate |
| 54 | + and verify the split: |
| 55 | + |
| 56 | + ```bash |
| 57 | + uv run --python 3.12 \ |
| 58 | + harness-engineering-bench/swe-bench-pro/scripts/partition_swe_bench_pro.py \ |
| 59 | + --tasks-dir /path/to/exported/swe-bench-pro \ |
| 60 | + --fetch-registry |
| 61 | + |
| 62 | + uv run --python 3.12 \ |
| 63 | + harness-engineering-bench/swe-bench-pro/scripts/partition_swe_bench_pro.py \ |
| 64 | + --tasks-dir /path/to/exported/swe-bench-pro \ |
| 65 | + --check |
| 66 | + ``` |
| 67 | + |
| 68 | + Also update the placeholder `total_cases` under `agent_access` in |
| 69 | + `baseline/build.yaml` to real disclosure counts, and run `uv lock` in |
| 70 | + `baseline/target/` so the compiled task pins an exact resolution. |
| 71 | + |
| 72 | +## Split design |
| 73 | + |
| 74 | +The committed split is intended to be deterministic and stratified by source |
| 75 | +repository (so each represented codebase appears across all three partitions): |
| 76 | + |
| 77 | +- development: 20% (full result disclosure to the optimizer) |
| 78 | +- validation: 40% (aggregate-only; used to select candidates) |
| 79 | +- test: 40% (held out until Harbor grades the completed outer task) |
| 80 | + |
| 81 | +Exact counts are TODO until the task source is pinned. |
| 82 | + |
| 83 | +## Build the outer Harbor task |
| 84 | + |
| 85 | +From the repository root: |
| 86 | + |
| 87 | +```bash |
| 88 | +cd vero |
| 89 | +VERO_SKIP_SECRET_CHECK=1 uv run vero harbor build \ |
| 90 | + --config ../harness-engineering-bench/swe-bench-pro/baseline/build.yaml \ |
| 91 | + --output ../harness-engineering-bench/swe-bench-pro/baseline/compiled |
| 92 | +``` |
| 93 | + |
| 94 | +Omit `VERO_SKIP_SECRET_CHECK=1` for a real build so VeRO verifies that the OpenAI |
| 95 | +and Modal credentials declared in `build.yaml` are present. Set `OPENAI_BASE_URL` |
| 96 | +to your OpenAI-compatible endpoint. The `compiled/` directory is generated and |
| 97 | +intentionally ignored. (This build will fail to resolve tasks until the |
| 98 | +placeholder `task_source` above is replaced with the real digest.) |
| 99 | + |
| 100 | +## Run the optimization |
| 101 | + |
| 102 | +`vero harbor run` compiles the `build.yaml` to a temporary task, wires credentials |
| 103 | +(relocating the upstream inference key to the gateway and handing the optimizer a |
| 104 | +scoped producer token), and invokes Harbor. Copy the secrets template first: |
| 105 | + |
| 106 | +```bash |
| 107 | +cp harness-engineering-bench/swe-bench-pro/baseline/secrets.env.example \ |
| 108 | + harness-engineering-bench/swe-bench-pro/baseline/secrets.env # then edit it |
| 109 | + |
| 110 | +cd vero |
| 111 | +uv run vero harbor run \ |
| 112 | + --config ../harness-engineering-bench/swe-bench-pro/baseline/build.yaml \ |
| 113 | + --env-file ../harness-engineering-bench/swe-bench-pro/baseline/secrets.env \ |
| 114 | + --environment modal \ |
| 115 | + --agent codex \ |
| 116 | + --model gpt-5.3-codex \ |
| 117 | + --yes \ |
| 118 | + -o ../runs/swe-bench-pro-full/jobs |
| 119 | +``` |
| 120 | + |
| 121 | +`--env-file` values override the ambient shell and are passed only through the |
| 122 | +subprocess environment, never on the command line. Anything after the known |
| 123 | +options (here `--yes -o ...`) is forwarded verbatim to `harbor run`. |
| 124 | + |
| 125 | +The producer scope's allow-list in `build.yaml` is `gpt-5.3-codex`, so pass |
| 126 | +`--model gpt-5.3-codex` (or an aligned model) to keep the optimizer's model and |
| 127 | +the gateway allow-list in lockstep and avoid a 403 mismatch. The evaluation scope |
| 128 | +is pinned to `gpt-4o` (matching `model: openai/gpt-4o`). |
| 129 | + |
| 130 | +**Modal endpoint requirement:** `--environment modal` runs eval sandboxes on |
| 131 | +Modal, which must be able to reach the model endpoint in `OPENAI_BASE_URL`. Use a |
| 132 | +Modal-reachable endpoint (for example the Azure |
| 133 | +`https://<resource>.openai.azure.com/openai/v1` endpoint), **not** a VPN-internal |
| 134 | +host that only resolves on the Scale network. Use `--environment docker` to run |
| 135 | +the optimizer locally against Modal eval backends instead. |
0 commit comments