9 Commits

Author SHA1 Message Date
sora
7085624da0 swe_agentic: env_state carries version/hints/env_commit (make_test_spec need)
MAP_REPO_VERSION_TO_SPECS[repo][version] KeyError'd on empty version --
env_state didn't store the version field, the scorer's fallback to
sample.metadata hit the positional misalign again. The four official
metadata fields now stored alongside the rest.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 16:03:21 +00:00
sora
b3c837d3f3 swe_agentic: PIP_INDEX_URL env → tuna mirror in agent containers
pypi.org is unreachable from this host's containers; agent pip installs
hit 600s _exec timeouts and burned 4/10 samples. The env var makes pip
use tuna (~7s for the same package, verified in-container).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 10:42:29 +00:00
sora
c7811fa774 swe_agentic: sentinel patch from container file, not text split
The model DISCUSSES the sentinel command in prose; splitting on the
first occurrence captured conversational English as the 'patch'
(145B of chatter instead of the diff). On sentinel detection we now
read /testbed/patch.txt directly from the container -- the file the
agent actually created. Empty/missing file falls through to git diff.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 10:35:39 +00:00
sora
fc8ade3c03 Background image service: pull-ahead + wait-barrier, unified lifecycle
One ImageService per process. When tasks arrive (runner) or a sample
starts (env), its images are REGISTERED; a background worker pool
delivers them -- local tar shipments first (es's swebench_v 500-image
batch set, disk-cached index), network mirror chain second. Sample
execution waits on a readiness barrier instead of the old failing
timings (docker-run implicit pull killed at 120s; score-phase batch
pull ran after generation had already failed).

- runner registers every pending sample's image up front (pull-ahead
  overlaps generation)
- env blocks on wait_ready(1800s) before docker run -- a slow pull
  delays that sample, never fails it
- tar index cached at /tmp/evalharness_tar_index.json (full scan costs
  minutes; only the first process pays)
- images the service loaded are released at exit (atexit; opt out with
  EVALHARNESS_KEEP_SWE_IMAGES); pre-existing local images never touched
- EVALHARNESS_IMAGE_WORKERS (default 2) tunes the pool

Verified E2E: register -> background load from swebench_batch_001.tar.gz
-> image present locally (matplotlib-14623); wait barrier semantics
confirmed (blocks until load completes).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 09:45:39 +00:00
sora
e9e3230e46 swe_agentic: auto-release pulled images at process exit
Per-instance images are 1-4GB each; a --limit 10 run pulls up to 10 of
them and previously stranded the whole footprint on Ctrl+C/exit. Every
image THIS process pulls is now registered and released by an atexit
hook (containers first, then rmi) -- images that already existed
locally are never touched. EVALHARNESS_KEEP_SWE_IMAGES=1 opts out for
prefetch-style runs that want to keep them.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 09:03:17 +00:00
sora
f09fe184fe swe_agentic: ensure per-instance image before docker run
docker run's implicit pull prints nothing and the 120s start timeout
kills runs on slow mirrors; ensure_image brings the progress display,
mirror chain and watchdog to per-instance pulls (each sample = its own
image, 10 samples = 10 pulls).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 08:54:30 +00:00
sora
a93996094d swe_agentic: sentinel patch must end with a newline
The captured diff was stripped, and git apply rejects diffs whose last
line lacks a trailing newline ('corrupt patch at line N') -- the first
agentic score was resolved=0 with patch_apply_failed despite a correct
fix. Verified: same payload + newline applies clean in the official
container.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 08:22:59 +00:00
sora
2a2335f842 swe_agentic: accept adapter kwarg in __init__ (get_env uniform signature)
Without it get_env('swe_agentic') raised TypeError at env creation --
and the swallowed exception silently degraded the run to SINGLE-TURN
prose generation (421s of model monologue, no container, empty
trajectory). This was the agentic 'run' that looked like it worked.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 04:01:48 +00:00
sora
f662006517 swe_bench_verified_agentic: multi-turn SWE agent (mini-swe-agent protocol)
Ports es's swe_bench_agentic_adapter into our plugin architecture:
- env swe_agentic: per-sample LONG-RUNNING container (official sweb
  image, /testbed, bash -lc like the testbed startup files expect),
  single bash tool via function calling, sentinel-submission protocol
  (COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT + patch), git-diff fallback;
  observations capped at 30k chars
- dataset swe_bench_verified_agentic: same princeton source/converter,
  separate bench name so both variants coexist
- recipe: recovered patch + OFFICIAL test_patch applied in-container,
  FAIL_TO_PASS + capped PASS_TO_PASS via conda testbed pytest, 1800s
- config: max_turns 250, env swe_agentic

Single-turn swe_bench_verified is untouched.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-18 02:29:35 +00:00