ec-swe / harbor /README.md
servicesToptal's picture
Update dataset
517fae7 verified
|
Raw History Blame Contribute Delete
14 kB
# ExpertCrowd SWE tasks: Harbor packages
This folder holds Harbor packages for 24 ExpertCrowd software-engineering
tasks, for use with [Harbor](https://github.com/harbor-framework/harbor) and
Docker, and the build context of every task in the dataset. Each task is a real
repository at a fixed commit, a written request, and the original hidden rubric
that scores a change to that repository. In a package, an agent works in one
container; a second container, which the agent never sees, grades the patch it
leaves behind. The table under "Packaged tasks" maps each task folder to its row
in `data/test.parquet`.
The folder contains the reference solutions and the hidden graders. A model you
are evaluating must see only the task prompt and its own sandbox, which is what
Harbor gives it. Do not put the other files where that model, or its training
data, can reach them.
## Two ways to run a task
- **With Harbor, on your own machine.** 24 tasks are packaged for
this under `tasks/`.
- **On HUD, the platform the tasks were written for.** The agent results in the
dataset come from runs there. The tasks are published there as the taskset
[`ec-swe`](https://www.hud.ai/shared/tasksets/979e6e02-d726-46f6-a066-914afc5c9f44),
which anyone can view. To run a task in a workspace of your own: each folder
under `sources/` is the build source of a task's HUD environment. With a HUD
account and the `hud` command, on Linux, macOS or WSL:
```bash
pip install hud # the hud command
hud set HUD_API_KEY=<your key> # a key from hud.ai/project/api-keys
cd sources/<folder>
hud deploy # builds the environment in your HUD workspace
hud sync tasks my-ec-swe tasks.py # puts this folder's task into a taskset of yours
hud eval my-ec-swe claude --full # runs it on the platform with an agent
```
Results appear as jobs and traces on hud.ai (`hud jobs`). On HUD the agent
and the grader share one container, kept apart by file permissions, and the
four tasks with a criterion judged by a model get that judge from HUD's
gateway. The commands follow HUD's documentation. The build sources are the
ones the platform built the recorded environments from, with the changes
listed under "Contents".
## What you need
- Docker with Compose and BuildKit, on Linux, macOS or Windows with WSL.
- Python 3.12 and Harbor 0.23.0: `pip install harbor==0.23.0`.
- Network access while images are built. Packaged tasks run offline,
except that the verifier of the four tasks with a judged criterion
reaches its judge's host.
- Disk: allow 5 to 10 GB per task for its images. Each task container is
limited to 2 CPUs and 8 GiB.
No GPU, model account or API key is needed for the checks below,
except for the four tasks with a judged criterion, which need a key
for a model endpoint (see "Tasks with a judged criterion").
## Quick start
From this folder:
```bash
python verify_bundle.py
python build_images.py --task rope_rename_all_reexport_owners_contract
harbor run -p tasks/rope_rename_all_reexport_owners_contract -a oracle # the reference fix: reward 1.0
harbor run -p tasks/rope_rename_all_reexport_owners_contract -a nop # no change: reward 0.0
python run_checks.py --task rope_rename_all_reexport_owners_contract --output checks-001
```
1. `verify_bundle.py` checks every file against `checksums.json`.
2. `build_images.py` builds the task's source image from `sources/`. Leave out
`--task` to build every task. A build takes ten to forty minutes: most tasks
finish their build by scoring their own reference fix and the untouched
repository, and refuse to produce an image unless those score 1.0 and 0.0.
3. `harbor run` with Harbor's `oracle` agent applies the reference fix and with
its `nop` agent changes nothing. These two need no script from this folder.
4. `run_checks.py` runs five scripted checks per task and exits 0 only if each
gives what is expected:
| Check | What is submitted | Expected |
| --- | --- | --- |
| `noop` | nothing | reward 0 |
| `reference` | the reference fix | reward 1, and the agent's container is isolated |
| `broken` | the reference fix plus a syntax error | reward 0, graded normally |
| `infra` | the reference fix, with one grader file removed from the verifier | no reward: the attempt is invalid |
| `tamper` | nothing, while a process keeps writing a full score to the result file | reward 0 |
## Running an agent
```bash
harbor run -p tasks/rope_rename_all_reexport_owners_contract -a <agent> -m <model> --allow-agent-host <model API host>
```
Harbor's agents run inside the task's container, so they need to reach their
model. Every task here declares no network for the agent's phase;
`--allow-agent-host` opens it to the hosts you name and nothing else. The
verifier stays offline, except in
the four tasks with a judged criterion, where it reaches only its
judge's host. `harbor run --help` lists the agents.
An agent that installs itself into the container may need further hosts for
that step (`--allow-environment-host`).
## Tasks with a judged criterion
In four tasks one criterion is judged by a language model, which reads the
submitted diff against a maintainer's checklist. Their verifier asks the model
through an OpenAI-compatible endpoint, by default OpenRouter, with a key you
supply:
| Task folder | Judged criterion | Share of the reward |
| --- | --- | --- |
| `help_defaults` | `maintainer_review` | 6.25% |
| `druid_lenient_script` | `maintainer_review` | 2% |
| `ahooks_request_cache_races` | `maintainer_review` | 3% |
| `bulkcreate_ignore_duplicates` | `maintainer_review` | 6.25% |
```bash
export JUDGE_API_KEY=<your OpenRouter key>
python run_checks.py --task help_defaults --output checks-001
```
- `JUDGE_MODEL` (default `anthropic/claude-sonnet-5.5`) and `JUDGE_BASE_URL`
(default `https://openrouter.ai/api/v1`) choose another model or endpoint.
Harbor reads all three from your shell when it starts the verifier; none is
written into the task. For an endpoint on another host, put that host in
`allowed_hosts` under `[verifier.environment]` in the task's `task.toml`:
the verifier of these tasks reaches that host and DNS, and nothing else.
- The key stays with the verifier's own process. The grader commands, which
run the submitted code, do not get it.
- Without a key, or when the judge does not answer, an attempt that needs the
judge is invalid: Harbor reports an error and no reward.
- The judge reads the diff, not the test results. Where a task's rubric does
not tie it to the tests, it can credit the design of a fix that does not
compile, so for these tasks the `broken` check expects every tested
criterion to earn nothing and the reward to stay within the judged share.
- The agent rewards recorded in the dataset were judged by `claude-haiku-4-5` on
HUD, so another model can score this criterion differently.
## Packaged tasks
| Task folder | `instance_id` in the dataset | Language | Criteria |
| --- | --- | --- | --- |
| `babylonjs_scene_remove_owner_refs_contract` | `BabylonJS__Babylon.js-babylonjs_scene_remove_owner_refs_contract-382616f8` | TypeScript | 16 |
| `journal_recovery_after_unclean_stop` | `dgraph-io__badger-journal_recovery_after_unclean_stop` | Go | 8 |
| `bazel_remote_disk_eviction_accounting_contract` | `buchgr__bazel-remote-bazel_remote_disk_eviction_accounting_contract-afe5ea56` | Go | 8 |
| `celery_retry_expires_countdown_contract` | `celery__celery-celery_retry_expires_countdown_contract` | Python | 9 |
| `help_defaults` | `pallets__click-click-help-defaults` | Python | 11 |
| `druid_lenient_script` | `alibaba__druid-druid_lenient_script` | Java | 12 |
| `epicyon_deleted_post_announce_cache_contract` | `bashrc2__epicyon-epicyon_deleted_post_announce_cache_contract-1c066303` | Python | 11 |
| `geode_oql_index_null_semantics_contract` | `apache__geode-geode_oql_index_null_semantics_contract-1c066303` | Java | 10 |
| `go_mysql_mariadb_compressed_columns` | `go-mysql-org__go-mysql-go_mysql_mariadb_compressed_columns` | Go | 9 |
| `ahooks_request_cache_races` | `alibaba__hooks-ahooks_request_cache_races` | TypeScript | 26 |
| `kratos_cleanup_stale_flows_courier_contract` | `ory__kratos-kratos_cleanup_stale_flows_courier_contract` | Go | 9 |
| `microblogpub_deleted_object_resurrect_lookup_contract` | `tsileo__microblog.pub-microblogpub_deleted_object_resurrect_lookup_contract-382616f8` | Python | 21 |
| `mongoose_syncindexes_contract` | `Automattic__mongoose-mongoose_syncindexes_contract-97c2a76f` | JavaScript | 23 |
| `proxy_cookie_accounting` | `oauth2-proxy__oauth2-proxy-proxy_cookie_accounting` | Go | 14 |
| `open_xml_sdk_deletepart_refs_contract` | `dotnet__Open-XML-SDK-open_xml_sdk_deletepart_refs_contract-1c066303` | C# | 8 |
| `openfire_userdeleting_last_owner_contract` | `igniterealtime__Openfire-openfire_userdeleting_last_owner_contract-0163de9c` | Java | 17 |
| `pomerium_route_order_contract` | `pomerium__pomerium-pomerium_route_order_contract` | Go | 7 |
| `rope_rename_all_reexport_owners_contract` | `python-rope__rope-rope_rename_all_reexport_owners_contract-1c066303` | Python | 8 |
| `shared_handle_abandoned_operations` | `sfackler__rust-postgres-shared_handle_abandoned_operations` | Rust | 23 |
| `bulkcreate_ignore_duplicates` | `sequelize__sequelize-sequelize-bulkcreate-ignore-duplicates` | TypeScript | 12 |
| `retained_top_level_names_keep_their_values` | `terser__terser-retained_top_level_names_keep_their_values` | JavaScript | 7 |
| `xandikos_itip_recurrence_id_override_contract` | `jelmer__xandikos-xandikos_itip_recurrence_id_override_contract-c6aa163a` | Python | 13 |
| `zettlr_clickable_keywords` | `Zettlr__Zettlr-zettlr_clickable_keywords` | TypeScript | 20 |
| `zod_json_schema_target_legality` | `colinhacks__zod-zod-json-schema-target-legality` | TypeScript | 12 |
## How a score is produced
- The agent's container holds the repository at its base commit with a fresh
one-commit history, the toolchain, and nothing from the grading side. The
agent runs as an unprivileged user.
- When the agent finishes, a hook in the task captures its change as a patch
against a protected copy of the base commit. Only that patch reaches the
verifier.
- The verifier is a fresh container. It checks its own grader files against
recorded hashes, applies the patch, and runs the task's original grading code
unchanged. Grader commands, and with them the submitted code, run as an
unprivileged user; the report, the rubric files and the repository's original
history belong to root.
- The reward is the task's original reward: weighted criteria between 0 and 1,
with partial credit. Most tasks mark some criteria as blockers and cap the
reward at 0.6 when one fails. A few tasks apply a rule of their own instead
(`reward_rule` is `authored` in `manifest.json`); their reward is kept as
computed and cross-checked against the criteria.
- An attempt is **invalid**, and gets no reward, when grading itself could not
be completed: a missing grader file or dependency, a grader command that
timed out or ended outside its pass/fail contract, missing criteria, or a
report that does not add up. Harbor reports it as an error, not as a score.
Re-run or exclude it; do not average it in as a zero.
- A submission that does not compile is not an invalid attempt. Several tasks'
graders report "could not judge" when the build breaks. The verifier then
resets the repository and puts the same check to the untouched code. If the
grader reaches a verdict there, the submission is what broke it: the
criterion counts as unmet and the attempt is scored. If it cannot judge the
untouched code either, the environment is at fault and the attempt is invalid.
## Contents
- `tasks/<task id>/`: one Harbor task per folder: `instruction.md` (the prompt
the agent receives), `task.toml`, `environment/` (agent image recipe),
`tests/` (verifier recipe, verifier and its pinned configuration) and
`solution/` (reference fix).
- `sources/`: each task's build context as downloaded from HUD. In twenty-two of
them the environment name was changed to a neutral one (`ec-swe-...`, at most
four lines, in `env.py`, `pyproject.toml` and `tasks.py`). Besides, druid's
had comments shortened and three unused files removed, the four tasks with a
judged criterion read the judge's model from `JUDGE_MODEL`, and Babylon.js's
grader runs vitest from a copy of its harness, so that it needs no root.
`manifest.json` lists the changed files per task (`source_edited`). `sources/archives/` holds the
original archive of each context that was not changed. `build_images.py`
builds from these.
- `build_images.py`, `run_checks.py`, `verify_bundle.py`: standard-library
scripts; `run_checks.py` calls the `harbor` command.
- `evidence/`: per-task records written when the packages were made.
- `manifest.json`, `checksums.json`: versions, image names and file hashes.
## Notes
- Task images are built on your machine, so their image IDs differ from the
ones in `manifest.json`. What is pinned is the content of the grader files,
which the verifier checks before every grading.
- Builds download base images and dependencies. A recipe that builds today can
stop building when an upstream package is withdrawn.
- A download gives every file mode 644. Some images keep the modes of files
they copy, and the packages expect the modes of a build context in which
every file has mode 777. `build_images.py` builds from a temporary copy with
mode 777 for that reason. If you build a `Dockerfile.hud` by hand, give its
context the same modes first.
- Run one task at a time on a machine that is otherwise quiet when a score
matters: some repositories' own test suites are timing-sensitive.
- The graders execute the submitted code. The isolation described above is a
boundary, not a security certification.