FWeindel commited on
Commit
65cc78e
·
verified ·
1 Parent(s): 210acb3

swelego-real-data-verified: validation run 2026-10-11-swelego-real-data-verified-d15f2a1ef8c8

Browse files

Results combine one full run with a rerun of the 183 tasks that had not settled. In the full run, some task setups ran in containers whose Python environment was temporarily unreadable; these tasks had passed in the audit and passed again when rerun. The cause is not yet known.

### Reproducibility and retries

| Stage | Mode | Tasks with expectation | Matched first attempt | Matched after 1 / 2 / 3+ retries | Archived as not robust | Not-run retried | Recovered | Unresolved |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 3 | expected | 4281 | 4096 | 184 / 0 / 0 | 1 | 0 | 0 | 0 |
| 4 | expected | 4281 | 3874 | 402 / 2 / 1 | 2 | 0 | 0 | 0 |
| 5 | expected | 4281 | 4053 | 220 / 4 / 0 | 4 | 0 | 0 | 0 |

Expected outcomes come from an earlier audit of the same tasks (matched by task ID). A task whose result differs from that audit is rerun up to the retry limit; a task that never matches is archived as not robust. Without an expectation only tasks with no result (crash, node failure, missing reward or missing runner evidence) are rerun, and a task still without a result after the last attempt is archived as not robust. Stages 3, 4 and 5 are covered; the retries run after the whole pipeline.

Archived as not robust: stage 3: peopledoc__vault-cli-140; stage 4: peopledoc__vault-cli-140; stage 4: bridgecrewio__checkov-3007; stage 5: peopledoc__vault-cli-140; stage 5: bridgecrewio__checkov-3007; stage 5: tensorly__tensorly-318; stage 5: tortoise__tortoise-orm-1010

## swelego-real-data-verified

Keeps **4,277 tasks** and archives **46** from [PrimeIntellect/SWE-Lego-Real-Data-Verified](https://huggingface.co/datasets/PrimeIntellect/SWE-Lego-Real-Data-Verified/tree/8b0d2bed6f04ef571ca04abebf737ea23cbceaf3) at commit `8b0d2bed6f04ef571ca04abebf737ea23cbceaf3`. Patch version: `swelego-shared-python-v2`.

| Archive label | Tasks | Explanation |
| --- | ---: | --- |
| build-execution-error | 1 | The source repository https://github.com/peopledoc/vault-cli is no longer available (git fetch: repository not found), so the task cannot be set up (same result in all 4 attempts) |
| no-op-reward-one | 1 | The no-op run passes the required tests (13 passed, 2 skipped; reward 1 without the reference patch), so the verifier cannot tell the reference from no change (same result in all 4 attempts) |
| patch-drop:incompatible-verifier-dependency | 5 | Seventeen tests fail because the pinned HTTPretty exposes no HTTPrettyRequest.headers attribute under Python 3.7 while 24 pass (job 959554, batch v66-1), the same HTTPretty incompatibility that archived PyPeri-8. Archived with the original payload preserved; see pilot-results/swelego-reference-17-diagnosis-v68.json.<br>The reference run crashes inside respx/mock.py:229 with AttributeError: str object has no attribute attachment for every HTTPX mock test (job 959554, batch v66-1). The pinned httpx no longer passes the pattern objects this historical respx expects, so the recorded dependency set cannot execute the suite. Archived with the original payload preserved; see pilot-results/swelego-reference-17-diagnosis-v68.json.<br>The same str-versus-pattern AttributeError as respx-13 occurs at respx/mock.py:273 together with unmatched-mock assertions (job 959554, batch v66-1); the pinned httpx is incompatible with this historical respx. Archived with the original payload preserved; see pilot-results/swelego-reference-17-diagnosis-v68.json.<br>The verifier uses HTTP mocks, but its pinned HTTPretty 1.1.4 test adapter raises AttributeError because HTTPrettyRequest has no headers attribute in the pinned Python environment. The reference scored 0.0 while the no-op scored 0.0, so the required reference/no-op distinction is not established. Archived as an incompatible verifier dependency; this is not classified as a live-service failure. A fresh Stage 4/5 retry already in progress is retained as diagnostic evidence only. Original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json and the reference42-v66-2 stage 4 report.<br>test_safe_repr_never_broken_for_strings fails inside hypothesis 3.69.9, which drives coverage.py internals that the pinned coverage 7.2.7 no longer provides (TypeError: missing should_start_context and file_mapper). test_transport_works additionally saw its local pytest-localserver bypassed by the cluster proxy (job 964137); loopback is now excluded from the proxy, but the hypothesis/coverage pin conflict remains in the recorded environment. Archived with the original payload preserved. |
| patch-drop:no-op-passes-required-tests | 1 | The two required tests (testBillSearchMissingFilter, testBillDetailInputs) check input validation that already passes on the unpatched tree, so the no-op run scores 1 (job 958628); the other 26 tests in the module query the live Open States API and fail with NotFound regardless of the patch. The verifier cannot distinguish the reference from no change. Archived with the original payload preserved. |
| patch-drop:proxy-sensitive-verification | 23 | Case-insensitive environment parsing fails because inherited NO_PROXY/no_proxy settings produce duplicate configuration keys. Archived at user request because verification is unreliable under our proxy environment. This does not establish that the test requires live external network access. Original task payload preserved. Evidence: pilot-results/swelego-reference-failure-triage-20261009.json.<br>HTTP interception tests reject inherited proxy environment variables; wsgi-intercept explicitly requires them to be unset. Archived at user request because verification is unreliable under our proxy environment. This does not establish that the test requires live external network access. Original task payload preserved. Evidence: pilot-results/swelego-reference-failure-triage-20261009.json.<br>Inherited cluster proxy changes the HTTP request host and prevents matching the recorded HTTP responses used by verification. Archived at user request because verification is unreliable under our proxy environment. This does not establish that the test requires live external network access. Original task payload preserved. Evidence: pilot-results/swelego-reference-failure-triage-20261009.json.<br>Proxy configuration assertions observe the inherited cluster proxy instead of the test-controlled configuration. Archived at user request because verification is unreliable under our proxy environment. This does not establish that the test requires live external network access. Original task payload preserved. Evidence: pilot-results/swelego-reference-failure-triage-20261009.json.<br>The inherited cluster proxy overrides the localhost proxy selected by the test. Archived at user request because verification is unreliable under our proxy environment. This does not establish that the test requires live external network access. Original task payload preserved. Evidence: pilot-results/swelego-reference-failure-triage-20261009.json.<br>The verifier uses local HTTP mocks, but the fresh reference rerun received HTTP 503 responses from the inherited cluster proxy for the HTTP-client tests, including test_real_post. Reference reward remained 0.0; the no-op also scored 0.0 as expected. Archived because the proxy prevents reliable mock verification in this environment, not because the task intentionally requires a live service. Original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json and the reference42-v66-0 stage 4 report.<br>Verification reaches the inherited HTTP proxy and receives HTTP 503 instead of the expected mocked transport response. Archived at user request because verification is unreliable under our proxy environment. This does not establish that the test requires live external network access. Original task payload preserved. Evidence: pilot-results/swelego-reference-failure-triage-20261009.json. |
| patch-drop:unreliable-external-service-dependency | 2 | Reference and no-op verification exceeded 1800 seconds. A diagnostic rerun traced test_tx_create_dump_sign_txt to an unbounded blockchain.info socket connection; the CLI test helper removes proxy settings. Archived at user request, with original payload preserved. Evidence: pilot-results/swelego-correctness-investigation-20261008.json.<br>Required Zenodo download tests intermittently fail resolving DOI 10.5281/zenodo.4924875. The same payload also passed previously; caching files alone would bypass neither the fresh-directory downloads nor their assertions. Archived at user request instead of adding response replay, with original payload preserved. Evidence: pilot-results/swelego-correctness-investigation-20261008.json. |
| patch-drop:unreliable-live-service-dependency | 5 | Reference verification calls the live Periscope service for API, broadcast, and user data; these requests failed TLS verification in the cluster and depend on an external service remaining available. Archived because live-service verification is unreliable here. Original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.<br>Reference verification calls the live Periscope service for API, broadcast, user, and session-token data; these requests failed TLS verification in the cluster and depend on an external service remaining available. Archived because live-service verification is unreliable here. Original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.<br>The linkcheck verifier fetches https://www.w3.org/TR/2006/REC-xml-names-20060816/#defaulting and asserts the remote anchor exists. The current W3C response no longer contains that anchor, so results depend on mutable live site content. Archived as unreliable; original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.<br>The valid timeout and retry verifier cases call github.com directly rather than using a local HTTP fixture. Their outcome depends on live DNS/network/service behavior, so verification is unreliable on our cluster. Archived as unreliable;

evidence/2026-10-11-swelego-real-data-verified-d15f2a1ef8c8/swelego-real-data-verified/patchers/e82d1c7f269b7f4977fb7c41b2a096fa6a8b9ed718138adca686fa18f5a4a1f4/patch.py ADDED
@@ -0,0 +1,1274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Convert pinned SWE-Lego tasks to shared Python images and timed task setup."""
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import base64
6
+ from functools import lru_cache
7
+ import hashlib
8
+ import io
9
+ import json
10
+ from pathlib import Path, PurePosixPath
11
+ import re
12
+ import shlex
13
+ import sys
14
+ import tarfile
15
+
16
+ sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
17
+
18
+ REVISION = '8b0d2bed6f04ef571ca04abebf737ea23cbceaf3'
19
+ HERE = Path(__file__).resolve().parent
20
+ MARKER = 'swelego-shared-python-v2'
21
+ COMMON_PACKAGES = {'gcc', 'g++', 'gfortran', 'make', 'git', 'curl', 'wget',
22
+ 'ca-certificates', 'tmux', 'patch', 'pkg-config', 'libffi-dev', 'libssl-dev'}
23
+ DATASET = 'PrimeIntellect/SWE-Lego-Real-Data-Verified'
24
+ VERIFIER_FIXES = {
25
+ 'msgpack__msgpack-python-388': {
26
+ 'commit': '7a8ce0f9ca910a851b6835d26b1d6970a188fa4e',
27
+ 'label': 'verifier-python-backend',
28
+ 'reason': 'Run verification with MSGPACK_PUREPYTHON=1 so the existing regression tests exercise msgpack/fallback.py, which the reference patch repairs. The default compiled backend already passes without the fix. Preserve test assertions, required results, dependency versions and reference patch.'},
29
+ 'mtgjson__mtgjson-469': {
30
+ 'commit': 'b3d7bc4531bdca514dc1cf9f4ea5f6eac1104f89',
31
+ 'label': 'verifier-pythonpath-append',
32
+ 'reason': 'The verifier command sets PYTHONPATH=. so the tests import the checkout; it is the only SWE-Lego verifier that assigns PYTHONPATH, and the bare assignment discards any path the grading runner adds, which made pytest abort before running tests (reward 0 for the reference). Append the inherited PYTHONPATH after the checkout directory instead. Test selection, assertions, required results, dependency versions and reference patch are unchanged.'},
33
+ 'h2non__pook-111': {
34
+ 'commit': 'fac40e9f571152ba09bc16954548ce51d590ccea',
35
+ 'label': 'mocked-http',
36
+ 'unset_env': ['HTTP_PROXY', 'http_proxy', 'HTTPS_PROXY', 'https_proxy', 'ALL_PROXY', 'all_proxy'],
37
+ 'reason': 'The constructor tests mock https://httpbin.org and never reach the network, but with the cluster proxy configured the intercepted request carries the proxy address and no mock matches; removing only the plain-HTTP proxy left the two https cases failing (job 964411) while the other ten tests pass. The verifier command runs with all proxy variables unset; task setup keeps them for its downloads. Test selection, assertions, required results, dependency versions and reference patch are unchanged.'},
38
+ 'sdss__sdss_access-69': {
39
+ 'commit': '1519bc3870486d8bc3b6293d8c76680fabee909a',
40
+ 'label': 'verifier-fixed-date',
41
+ 'reason': 'Fix the verifier-local sdss_access.path.path clock at 2025-04-01, before the pinned sdss-tree 4.0.7 DR19 release date of 2025-07-11. This preserves the pre-release regression case that otherwise stops detecting the missing fix after release. Preserve test assertions, required results, dependency versions and reference patch.'},
42
+ }
43
+ TASK_RESOURCE_FIXES = {
44
+ 'dask__dask-1150': {
45
+ 'memory_mb': 8192,
46
+ 'label': 'task-memory-8gib',
47
+ 'reason': 'Raise the task memory limit from 4 GiB to 8 GiB. The unchanged reference verifier passed with a 12 GiB limit and recorded 7,527,284 KiB (about 7.18 GiB) MaxRSS, so 8 GiB provides a modest margin above measured peak while avoiding the unnecessary 12 GiB allocation.'},
48
+ 'dask__dask-4050': {
49
+ 'memory_mb': 8192,
50
+ 'label': 'task-memory-8gib',
51
+ 'reason': 'Raise the task memory limit from 4 GiB to 8 GiB. With a 12 GiB limit the unchanged verifier passed reference (reward 1) and no-op (reward 0) in job 960179; its reference step recorded 7.17 GiB MaxRSS and the no-op step 6.30 GiB, the same dask array test load as dask-1150. At 4 GiB the verifier was killed before scoring.'},
52
+ 'dask__dask-4181': {
53
+ 'memory_mb': 8192,
54
+ 'label': 'task-memory-8gib',
55
+ 'reason': 'Raise the task memory limit from 4 GiB to 8 GiB. With a 12 GiB limit the unchanged verifier passed reference (reward 1) and no-op (reward 0) in job 960179; its steps recorded 6.49 GiB and 6.65 GiB MaxRSS. At 4 GiB the verifier was killed before scoring.'},
56
+ 'tobymao__sqlglot-1889': {
57
+ 'memory_mb': 16384,
58
+ 'label': 'task-memory-16gib',
59
+ 'reason': 'Raise the task memory limit from 4 GiB to 16 GiB. With a 12 GiB limit the unchanged reference verifier passed (reward 1) in job 960179 and recorded 7.82 GiB MaxRSS even with its two bounded worker processes; 8 GiB would leave too little margin, and 16 GiB is the next size the static resource check allows (1, 2, 4, 8, 16, 32 GiB; a 10 GiB limit failed that check in job 965822). At 4 GiB the verifier was killed before scoring.'},
60
+ 'microsoft__electionguard-python-381': {
61
+ 'memory_mb': 8192,
62
+ 'label': 'task-memory-8gib',
63
+ 'reason': 'Raise the task memory limit from 4 GiB to 8 GiB. The big-integer key-ceremony and decryption tests passed reference in four of five 4 GiB attempts and were killed by the task memory limit in the fifth (job 959908); the 12 GiB rerun in job 960179 passed with 3.06 GiB MaxRSS. 8 GiB removes the limit-dependent flakiness without changing tests or dependencies.'},
64
+ 'zarr-developers__zarr-python-2784': {
65
+ 'memory_mb': 16384,
66
+ 'label': 'task-memory-16gib',
67
+ 'reason': 'Raise the task memory limit from 4 GiB to 16 GiB. With a 12 GiB limit the verifier ran to completion in job 964135 and its reference and no-op steps recorded 8.11 GiB and 8.09 GiB MaxRSS, above 8 GiB; 16 GiB is the next size the static resource check allows (1, 2, 4, 8, 16, 32 GiB; a 10 GiB limit failed that check in job 965822). At 4 GiB it was killed before scoring. Tests and dependency versions are unchanged.'},
68
+ 'tcgdex__python-sdk-2': {
69
+ 'no_proxy': 'api.tcgdex.net',
70
+ 'label': 'recorded-http',
71
+ 'reason': 'The verifier replays recorded vcrpy cassettes (RecordMode.ONCE) for api.tcgdex.net. Through the inherited cluster proxy the live request URI names the proxy host and port, so every cassette lookup fails on the host and port matchers while method, path and query match (job 964137). Send that host directly so the recordings match; no cassette, test or reference change.'},
72
+ 'contentful__contentful-management.py-117': {
73
+ 'no_proxy': 'api.contentful.com',
74
+ 'label': 'recorded-http',
75
+ 'reason': 'Thirteen ContentType tests fail with vcrpy CannotOverwriteExistingCassette for api.contentful.com recordings while the other seventeen tests pass (job 959554). The same proxy-rewritten request URI breaks tcgdex-2; send the recorded host directly so the cassettes match. Verified by rerun; no cassette, test or reference change.'},
76
+ 'h2non__pook-83': {
77
+ 'runtime_unset': ['HTTP_PROXY', 'http_proxy', 'ALL_PROXY', 'all_proxy'],
78
+ 'label': 'mocked-http',
79
+ 'reason': 'pook intercepts HTTP at the client library and never reaches the network, but with the cluster proxy configured the intercepted request URL becomes http://proxy.nhr.fau.de:80http://httpbin.org/foo and no mock matches (job 964137). The verifier runs without plain-HTTP proxy variables (the mocked URLs are http://); HTTPS keeps the proxy so the git fetch during setup still works, as for conan-5005. Tests and reference patch are unchanged.'},
80
+ 'googleapis__google-auth-library-python-424': {
81
+ 'runtime_unset': ['HTTP_PROXY', 'http_proxy', 'ALL_PROXY', 'all_proxy'],
82
+ 'label': 'mocked-http',
83
+ 'reason': 'The required test_connection_error expects a TransportError from a plain-HTTP request to the reserved invalid host test.invalid; through the cluster proxy the request gets an HTTP error reply instead and nothing is raised (jobs 964137 and 964323, all 21 other tests pass). The verifier runs without plain-HTTP proxy variables; HTTPS keeps the proxy for setup downloads. Tests and reference patch are unchanged.'},
84
+ }
85
+ ARCHIVED_TASKS = {
86
+ 'openstates__pyopenstates-15': {
87
+ 'category': 'no-op-passes-required-tests',
88
+ 'reason': 'The two required tests (testBillSearchMissingFilter, testBillDetailInputs) check input validation that already passes on the unpatched tree, so the no-op run scores 1 (job 958628); the other 26 tests in the module query the live Open States API and fail with NotFound regardless of the patch. The verifier cannot distinguish the reference from no change. Archived with the original payload preserved.'},
89
+ 'modin-project__modin-5058': {
90
+ 'category': 'verifier-memory-exceeds-limits',
91
+ 'reason': 'The reference verifier (modin/test/storage_formats/pandas/test_internals.py on Ray 2.7.2) ran for the full 1800 s and was killed at a 12 GiB task limit (job 960179). With MODIN_CPUS=4 and a 512 MiB MODIN_MEMORY object store, the bound that fixed modin-1842, it was still killed at 12 GiB after 16 minutes with 46 OOM-killed Ray processes (job 964168) and at 4 GiB in job 964134. Archived at user request as exceeding supportable task memory; original payload preserved.'},
92
+ 'lundberg__respx-13': {
93
+ 'category': 'incompatible-verifier-dependency',
94
+ 'reason': 'The reference run crashes inside respx/mock.py:229 with AttributeError: str object has no attribute attachment for every HTTPX mock test (job 959554, batch v66-1). The pinned httpx no longer passes the pattern objects this historical respx expects, so the recorded dependency set cannot execute the suite. Archived with the original payload preserved; see pilot-results/swelego-reference-17-diagnosis-v68.json.'},
95
+ 'lundberg__respx-21': {
96
+ 'category': 'incompatible-verifier-dependency',
97
+ 'reason': 'The same str-versus-pattern AttributeError as respx-13 occurs at respx/mock.py:273 together with unmatched-mock assertions (job 959554, batch v66-1); the pinned httpx is incompatible with this historical respx. Archived with the original payload preserved; see pilot-results/swelego-reference-17-diagnosis-v68.json.'},
98
+ 'mdsol__rwslib-111': {
99
+ 'category': 'incompatible-verifier-dependency',
100
+ 'reason': 'Seventeen tests fail because the pinned HTTPretty exposes no HTTPrettyRequest.headers attribute under Python 3.7 while 24 pass (job 959554, batch v66-1), the same HTTPretty incompatibility that archived PyPeri-8. Archived with the original payload preserved; see pilot-results/swelego-reference-17-diagnosis-v68.json.'},
101
+ 'getsentry__sentry-python-79': {
102
+ 'category': 'incompatible-verifier-dependency',
103
+ 'reason': 'test_safe_repr_never_broken_for_strings fails inside hypothesis 3.69.9, which drives coverage.py internals that the pinned coverage 7.2.7 no longer provides (TypeError: missing should_start_context and file_mapper). test_transport_works additionally saw its local pytest-localserver bypassed by the cluster proxy (job 964137); loopback is now excluded from the proxy, but the hypothesis/coverage pin conflict remains in the recorded environment. Archived with the original payload preserved.'},
104
+ '2gis__k8s-handle-120': {
105
+ 'category': 'version-sensitive-test-expectation',
106
+ 'reason': 'Only test_generate_templates fails: the rendered YAML has the same lines in a different order and blank-line placement than the expected literal, while the reference patch changes tag filtering, not template serialization (jobs 959554 and batch v66-0). The expectation depends on the exact YAML/Jinja versions of the original environment. Archived with the original payload preserved.'},
107
+ 'pytest-dev__pytest-asyncio-1029': {
108
+ 'category': 'version-sensitive-test-expectation',
109
+ 'reason': 'Three nested pytester tests expect exactly two unclosed-event-loop warnings but observe three: the recorded Python/pytest patch versions emit an additional unraisable ResourceWarning for the loop\'s self-pipe socket (job 964137). The other four selected tests pass. Archived with the original payload preserved.'},
110
+ 'ctypesgen__ctypesgen-150': {
111
+ 'category': 'unsupported-host-environment',
112
+ 'reason': 'Archived because the task does not work with the shared base image we chose: the historical parser reports syntax errors in the glibc 2.36 sys/cdefs.h of the Debian 12 image and its version test exits 2 (jobs 959554 and batch v66-0). It could be repaired with a separate older base image, which would mean one extra image for a single task. Archived with the original payload preserved; see pilot-results/swelego-reference-17-diagnosis-v68.json.'},
113
+ 'richardkiss__pycoin-353': {
114
+ 'category': 'unreliable-external-service-dependency',
115
+ 'reason': 'Reference and no-op verification exceeded 1800 seconds. A diagnostic rerun traced test_tx_create_dump_sign_txt to an unbounded blockchain.info socket connection; the CLI test helper removes proxy settings. Archived at user request, with original payload preserved. Evidence: pilot-results/swelego-correctness-investigation-20261008.json.'},
116
+ 'fatiando__pooch-291': {
117
+ 'category': 'unreliable-external-service-dependency',
118
+ 'reason': 'Required Zenodo download tests intermittently fail resolving DOI 10.5281/zenodo.4924875. The same payload also passed previously; caching files alone would bypass neither the fresh-directory downloads nor their assertions. Archived at user request instead of adding response replay, with original payload preserved. Evidence: pilot-results/swelego-correctness-investigation-20261008.json.'},
119
+ 'takeontom__PyPeri-29': {
120
+ 'category': 'unreliable-live-service-dependency',
121
+ 'reason': 'Reference verification calls the live Periscope service for API, broadcast, and user data; these requests failed TLS verification in the cluster and depend on an external service remaining available. Archived because live-service verification is unreliable here. Original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.'},
122
+ 'takeontom__PyPeri-35': {
123
+ 'category': 'unreliable-live-service-dependency',
124
+ 'reason': 'Reference verification calls the live Periscope service for API, broadcast, user, and session-token data; these requests failed TLS verification in the cluster and depend on an external service remaining available. Archived because live-service verification is unreliable here. Original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.'},
125
+ 'kivy__kivy-6954': {
126
+ 'category': 'unreliable-live-service-dependency',
127
+ 'reason': 'Verifier tests issue real requests to google.com and httpbin.org to check callbacks, authentication, and TLS behavior. Those external endpoints failed to complete in the cluster, so reference scores depend on live service and network availability. Archived as unreliable; original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.'},
128
+ 'sphinx-doc__sphinx-5203': {
129
+ 'category': 'unreliable-live-service-dependency',
130
+ 'reason': 'The linkcheck verifier fetches https://www.w3.org/TR/2006/REC-xml-names-20060816/#defaulting and asserts the remote anchor exists. The current W3C response no longer contains that anchor, so results depend on mutable live site content. Archived as unreliable; original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.'},
131
+ 'cisagov__check-cve-2019-19781-10': {
132
+ 'category': 'unreliable-live-service-dependency',
133
+ 'reason': 'The valid timeout and retry verifier cases call github.com directly rather than using a local HTTP fixture. Their outcome depends on live DNS/network/service behavior, so verification is unreliable on our cluster. Archived as unreliable; original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.'},
134
+ }
135
+ ARCHIVED_TASKS.update({'Azure__azure-cli-3409': {'category': 'proxy-sensitive-verification',
136
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
137
+ 'matching the recorded HTTP responses used by verification. Archived at '
138
+ 'user request because verification is unreliable under our proxy '
139
+ 'environment. This does not establish that the test requires live '
140
+ 'external network access. Original task payload preserved. Evidence: '
141
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
142
+ 'burnash__gspread-1030': {'category': 'proxy-sensitive-verification',
143
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
144
+ 'matching the recorded HTTP responses used by verification. Archived at '
145
+ 'user request because verification is unreliable under our proxy '
146
+ 'environment. This does not establish that the test requires live '
147
+ 'external network access. Original task payload preserved. Evidence: '
148
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
149
+ 'burnash__gspread-1040': {'category': 'proxy-sensitive-verification',
150
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
151
+ 'matching the recorded HTTP responses used by verification. Archived at '
152
+ 'user request because verification is unreliable under our proxy '
153
+ 'environment. This does not establish that the test requires live '
154
+ 'external network access. Original task payload preserved. Evidence: '
155
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
156
+ 'burnash__gspread-1095': {'category': 'proxy-sensitive-verification',
157
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
158
+ 'matching the recorded HTTP responses used by verification. Archived at '
159
+ 'user request because verification is unreliable under our proxy '
160
+ 'environment. This does not establish that the test requires live '
161
+ 'external network access. Original task payload preserved. Evidence: '
162
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
163
+ 'burnash__gspread-1211': {'category': 'proxy-sensitive-verification',
164
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
165
+ 'matching the recorded HTTP responses used by verification. Archived at '
166
+ 'user request because verification is unreliable under our proxy '
167
+ 'environment. This does not establish that the test requires live '
168
+ 'external network access. Original task payload preserved. Evidence: '
169
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
170
+ 'burnash__gspread-1229': {'category': 'proxy-sensitive-verification',
171
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
172
+ 'matching the recorded HTTP responses used by verification. Archived at '
173
+ 'user request because verification is unreliable under our proxy '
174
+ 'environment. This does not establish that the test requires live '
175
+ 'external network access. Original task payload preserved. Evidence: '
176
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
177
+ 'burnash__gspread-1269': {'category': 'proxy-sensitive-verification',
178
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
179
+ 'matching the recorded HTTP responses used by verification. Archived at '
180
+ 'user request because verification is unreliable under our proxy '
181
+ 'environment. This does not establish that the test requires live '
182
+ 'external network access. Original task payload preserved. Evidence: '
183
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
184
+ 'burnash__gspread-1308': {'category': 'proxy-sensitive-verification',
185
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
186
+ 'matching the recorded HTTP responses used by verification. Archived at '
187
+ 'user request because verification is unreliable under our proxy '
188
+ 'environment. This does not establish that the test requires live '
189
+ 'external network access. Original task payload preserved. Evidence: '
190
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
191
+ 'burnash__gspread-1404': {'category': 'proxy-sensitive-verification',
192
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
193
+ 'matching the recorded HTTP responses used by verification. Archived at '
194
+ 'user request because verification is unreliable under our proxy '
195
+ 'environment. This does not establish that the test requires live '
196
+ 'external network access. Original task payload preserved. Evidence: '
197
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
198
+ 'burnash__gspread-1415': {'category': 'proxy-sensitive-verification',
199
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
200
+ 'matching the recorded HTTP responses used by verification. Archived at '
201
+ 'user request because verification is unreliable under our proxy '
202
+ 'environment. This does not establish that the test requires live '
203
+ 'external network access. Original task payload preserved. Evidence: '
204
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
205
+ 'burnash__gspread-1417': {'category': 'proxy-sensitive-verification',
206
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
207
+ 'matching the recorded HTTP responses used by verification. Archived at '
208
+ 'user request because verification is unreliable under our proxy '
209
+ 'environment. This does not establish that the test requires live '
210
+ 'external network access. Original task payload preserved. Evidence: '
211
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
212
+ 'burnash__gspread-1498': {'category': 'proxy-sensitive-verification',
213
+ 'reason': 'Inherited cluster proxy changes the HTTP request host and prevents '
214
+ 'matching the recorded HTTP responses used by verification. Archived at '
215
+ 'user request because verification is unreliable under our proxy '
216
+ 'environment. This does not establish that the test requires live '
217
+ 'external network access. Original task payload preserved. Evidence: '
218
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
219
+ 'cdent__gabbi-186': {'category': 'proxy-sensitive-verification',
220
+ 'reason': 'HTTP interception tests reject inherited proxy environment variables; '
221
+ 'wsgi-intercept explicitly requires them to be unset. Archived at user '
222
+ 'request because verification is unreliable under our proxy environment. '
223
+ 'This does not establish that the test requires live external network '
224
+ 'access. Original task payload preserved. Evidence: '
225
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
226
+ 'cdent__gabbi-191': {'category': 'proxy-sensitive-verification',
227
+ 'reason': 'HTTP interception tests reject inherited proxy environment variables; '
228
+ 'wsgi-intercept explicitly requires them to be unset. Archived at user '
229
+ 'request because verification is unreliable under our proxy environment. '
230
+ 'This does not establish that the test requires live external network '
231
+ 'access. Original task payload preserved. Evidence: '
232
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
233
+ 'cdent__wsgi-intercept-47': {'category': 'proxy-sensitive-verification',
234
+ 'reason': 'HTTP interception tests reject inherited proxy environment '
235
+ 'variables; wsgi-intercept explicitly requires them to be unset. '
236
+ 'Archived at user request because verification is unreliable under '
237
+ 'our proxy environment. This does not establish that the test '
238
+ 'requires live external network access. Original task payload '
239
+ 'preserved. Evidence: '
240
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
241
+ 'desihub__desitransfer-5': {'category': 'proxy-sensitive-verification',
242
+ 'reason': 'Case-insensitive environment parsing fails because inherited '
243
+ 'NO_PROXY/no_proxy settings produce duplicate configuration keys. '
244
+ 'Archived at user request because verification is unreliable under '
245
+ 'our proxy environment. This does not establish that the test '
246
+ 'requires live external network access. Original task payload '
247
+ 'preserved. Evidence: '
248
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
249
+ 'getsentry__sentry-python-2009': {'category': 'proxy-sensitive-verification',
250
+ 'reason': 'Proxy configuration assertions observe the inherited cluster '
251
+ 'proxy instead of the test-controlled configuration. Archived '
252
+ 'at user request because verification is unreliable under our '
253
+ 'proxy environment. This does not establish that the test '
254
+ 'requires live external network access. Original task payload '
255
+ 'preserved. Evidence: '
256
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
257
+ 'getsentry__sentry-python-3351': {'category': 'proxy-sensitive-verification',
258
+ 'reason': 'Proxy configuration assertions observe the inherited cluster '
259
+ 'proxy instead of the test-controlled configuration. Archived '
260
+ 'at user request because verification is unreliable under our '
261
+ 'proxy environment. This does not establish that the test '
262
+ 'requires live external network access. Original task payload '
263
+ 'preserved. Evidence: '
264
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
265
+ 'lundberg__respx-60': {'category': 'proxy-sensitive-verification',
266
+ 'reason': 'Verification reaches the inherited HTTP proxy and receives HTTP 503 '
267
+ 'instead of the expected mocked transport response. Archived at user '
268
+ 'request because verification is unreliable under our proxy environment. '
269
+ 'This does not establish that the test requires live external network '
270
+ 'access. Original task payload preserved. Evidence: '
271
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
272
+ 'pdm-project__pdm-3255': {'category': 'proxy-sensitive-verification',
273
+ 'reason': 'The inherited cluster proxy overrides the localhost proxy selected by '
274
+ 'the test. Archived at user request because verification is unreliable '
275
+ 'under our proxy environment. This does not establish that the test '
276
+ 'requires live external network access. Original task payload '
277
+ 'preserved. Evidence: '
278
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
279
+ 'radiasoft__pykern-107': {'category': 'proxy-sensitive-verification',
280
+ 'reason': 'Case-insensitive environment parsing fails because inherited '
281
+ 'NO_PROXY/no_proxy settings produce duplicate configuration keys. '
282
+ 'Archived at user request because verification is unreliable under our '
283
+ 'proxy environment. This does not establish that the test requires live '
284
+ 'external network access. Original task payload preserved. Evidence: '
285
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'},
286
+ 'radiasoft__pykern-259': {'category': 'proxy-sensitive-verification',
287
+ 'reason': 'Case-insensitive environment parsing fails because inherited '
288
+ 'NO_PROXY/no_proxy settings produce duplicate configuration keys. '
289
+ 'Archived at user request because verification is unreliable under our '
290
+ 'proxy environment. This does not establish that the test requires live '
291
+ 'external network access. Original task payload preserved. Evidence: '
292
+ 'pilot-results/swelego-reference-failure-triage-20261009.json.'}})
293
+ ARCHIVED_TASKS.update({
294
+ 'Yelp__bravado-410': {
295
+ 'category': 'proxy-sensitive-verification',
296
+ 'reason': 'The verifier uses local HTTP mocks, but the fresh reference rerun received HTTP 503 responses from the inherited cluster proxy for the HTTP-client tests, including test_real_post. Reference reward remained 0.0; the no-op also scored 0.0 as expected. Archived because the proxy prevents reliable mock verification in this environment, not because the task intentionally requires a live service. Original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json and the reference42-v66-0 stage 4 report.'},
297
+ 'takeontom__PyPeri-8': {
298
+ 'category': 'incompatible-verifier-dependency',
299
+ 'reason': 'The verifier uses HTTP mocks, but its pinned HTTPretty 1.1.4 test adapter raises AttributeError because HTTPrettyRequest has no headers attribute in the pinned Python environment. The reference scored 0.0 while the no-op scored 0.0, so the required reference/no-op distinction is not established. Archived as an incompatible verifier dependency; this is not classified as a live-service failure. A fresh Stage 4/5 retry already in progress is retained as diagnostic evidence only. Original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json and the reference42-v66-2 stage 4 report.'},
300
+ 'PyPSA__linopy-77': {
301
+ 'category': 'unsupported-expired-proprietary-license',
302
+ 'reason': 'The reference verifier exercises Xpress solver cases, but the available Xpress license expired on 2026-02-28. The required proprietary solver cases cannot be validated on our infrastructure without a renewed license. Archived with the original task payload preserved. Evidence: pilot-results/swelego-reference-stage4-remaining-20261009.json.'},
303
+ 'airbrake__pybrake-77': {
304
+ 'category': 'unreliable-live-service-verification',
305
+ 'reason': 'The verifier calls the default Airbrake endpoint and an intentionally invalid external host without HTTP mocks. The unauthorized test received a non-JSON response and raised JSONDecodeError; the invalid-host test also failed instead of observing the expected DNS URLError. The reference scored 0.0 and no-op scored 0.0. These tests depend on live network/proxy behavior, so archive the original payload as unreliable on our cluster.'},
306
+ })
307
+ SOURCE_MIRRORS = {
308
+ 'NREL/hescore-hpxml': 'https://github.com/rubythonode/hescore-hpxml.git',
309
+ 'cuenca-mx/cuenca-python': 'https://github.com/ricardo8990/cuenca-python.git',
310
+ 'globality-corp/flake8-logging-format': 'https://github.com/pawmarkor/flake8-logging-format.git',
311
+ 'tarohi24/typedflow': 'https://github.com/mirror-dump/typedflow.git',
312
+ }
313
+ AMQP_ARCHIVE_OLD = ('https://github.com/celery/py-amqp/zipball/main#sha256='
314
+ 'bc618e1a51e852a457ee5aca2a8d1b46440d1304ca23f50d250d2fc216e3e499')
315
+ # This commit's archive has exactly the original recorded SHA-256.
316
+ AMQP_ARCHIVE_PINNED = AMQP_ARCHIVE_OLD.replace('/main#', '/b1f9c2e3d10c35601c9453a074bf8ae8dee9dd5b#')
317
+ VINE_ARCHIVE_OLD = ('https://github.com/celery/vine/zipball/master#sha256='
318
+ '955be2b59aaf8e6b68540d03a5af8dc493f6ef3dacbdcc977907f9909e6c866e')
319
+ VINE_ARCHIVE_PINNED = VINE_ARCHIVE_OLD.replace('/master#', '/84c6431a4f57ce7018f2231ba3f363aa050b0e32#')
320
+ SELF_REQUIREMENTS = {
321
+ 'plone__plone.app.robotframework-117':
322
+ ('f79eead00881762884365424d46df1c8fbf61b33', 'plone.app.robotframework==1.5.3.dev0'),
323
+ }
324
+ REQUIREMENT_SOURCES = {
325
+ 'mne-tools__mne-bids-1388': (
326
+ '4ac800537776b63b8fde1f8ad97bdbfcdeb50389', 'sphinx-gallery @ https://github.com/sphinx-gallery/sphinx-gallery/archive/refs/heads/master.zip#sha256=67ad22fe2187c5799d800fa5219f1bfcc9b47438f1eb4c688f071f58a2e663ac',
327
+ 'sphinx-gallery @ https://github.com/sphinx-gallery/sphinx-gallery/archive/d653bfc679b8baffd39577f526fc324e2c97f69d.zip#sha256=5871f8b5be8d077851f51052c0ea3dbecaa341cb5c2f41cb622ce4310ac0afab'),
328
+ 'mne-tools__mne-bids-1357': (
329
+ '3492fa01157d921f77b93ea31a4db192c47d3bb0', 'sphinx-gallery @ https://github.com/sphinx-gallery/sphinx-gallery/archive/refs/heads/master.zip#sha256=67ad22fe2187c5799d800fa5219f1bfcc9b47438f1eb4c688f071f58a2e663ac',
330
+ 'sphinx-gallery @ https://github.com/sphinx-gallery/sphinx-gallery/archive/d653bfc679b8baffd39577f526fc324e2c97f69d.zip#sha256=5871f8b5be8d077851f51052c0ea3dbecaa341cb5c2f41cb622ce4310ac0afab'),
331
+ 'mne-tools__mne-bids-1359': (
332
+ '3f59b0e0ee835549d068ad4ad85936ddf0ed04cb', 'sphinx-gallery @ https://github.com/sphinx-gallery/sphinx-gallery/archive/refs/heads/master.zip#sha256=67ad22fe2187c5799d800fa5219f1bfcc9b47438f1eb4c688f071f58a2e663ac',
333
+ 'sphinx-gallery @ https://github.com/sphinx-gallery/sphinx-gallery/archive/d653bfc679b8baffd39577f526fc324e2c97f69d.zip#sha256=5871f8b5be8d077851f51052c0ea3dbecaa341cb5c2f41cb622ce4310ac0afab'),
334
+ 'pgmpy__pgmpy-1905': (
335
+ '4b1743dfefcc2b749517df68887ec783f009e5e7', 'daft==0.4.9',
336
+ 'getdaft @ https://files.pythonhosted.org/packages/ee/51/9a858ea182857a42b6df9039f917861ff2244b6d9accce26c3f0b28af63b/getdaft-0.4.9-cp39-abi3-manylinux_2_28_x86_64.whl#sha256=5d7f1bde9f272b56a5a51e662fe5a9e3f4ec5689e55f7892b02160049c9f4304'),
337
+ 'All-Hands-AI__openhands-resolver-107': (
338
+ '2d68cabf4ea855bbaf9957b3a84e7ab9805a69e6', 'litellm==1.46.0',
339
+ 'litellm @ git+https://github.com/BerriAI/litellm.git'
340
+ '@2efdd2a6a4723616b9dea62594560b4094c08373'),
341
+ 'dwavesystems__dwave-system-276': (
342
+ '6b4c9f790f41fda29b6391fbb7add702fa4d582a', 'dwave-drivers==0.4.4',
343
+ 'dwave-drivers @ https://pypi.dwavesys.com/simple/dwave-drivers/'
344
+ 'dwave_drivers-0.4.4-py3-none-any.whl#sha256='
345
+ '8e5b37e97be7610c00005e5f8a3c10f27f7cec4bd2b88c80f9c6fef8172a3c3f'),
346
+ 'dwavesystems__dwave-system-373': (
347
+ '01d3c061440d94c22234dbf99ecd277def4259b9', 'dwave-drivers==0.4.4',
348
+ 'dwave-drivers @ https://pypi.dwavesys.com/simple/dwave-drivers/'
349
+ 'dwave_drivers-0.4.4-py3-none-any.whl#sha256='
350
+ '8e5b37e97be7610c00005e5f8a3c10f27f7cec4bd2b88c80f9c6fef8172a3c3f'),
351
+ 'acorg__dark-matter-651': (
352
+ 'e48f39aded59ac675d9b250f3cb0c7677968fbe3', 'mysql-connector-python==8.0.11',
353
+ 'mysql-connector-python @ https://cdn.mysql.com/archives/mysql-connector-python-8.0/'
354
+ 'mysql-connector-python-8.0.11.tar.gz#sha256='
355
+ '66135b1c45158c63d19f9a914cb038b7936e0cc2a68549a6d97425258de2607a'),
356
+ 'acorg__dark-matter-637': (
357
+ '7fc47a737e687f6b0f0bfe7414c7f8947bb16bea', 'mysql-connector-python==8.0.11',
358
+ 'mysql-connector-python @ https://cdn.mysql.com/archives/mysql-connector-python-8.0/'
359
+ 'mysql-connector-python-8.0.11.tar.gz#sha256='
360
+ '66135b1c45158c63d19f9a914cb038b7936e0cc2a68549a6d97425258de2607a'),
361
+ }
362
+ ADDITIONAL_REQUIREMENT_SOURCES = {
363
+ 'pgmpy__pgmpy-1905': (
364
+ '4b1743dfefcc2b749517df68887ec783f009e5e7', 'litellm==1.47.0',
365
+ 'litellm @ git+https://github.com/BerriAI/litellm.git'
366
+ '@7ca9165d597d21d957a1071293e79afb298b88de'),
367
+ }
368
+ METADATA_COLUMNS = ['instance_id', 'repo', 'base_commit', 'image_name', 'version',
369
+ 'install_config', 'environment_setup_commit', 'environment', 'requirements']
370
+
371
+
372
+ def load_recipes(metadata, cache):
373
+ """Fetch missing recipe metadata at the same pinned revision as the tasks."""
374
+ if metadata.exists():
375
+ document = json.loads(metadata.read_text())
376
+ if document.get('revision') != REVISION or document.get('dataset') != DATASET:
377
+ raise ValueError('Recipe metadata must identify the pinned dataset and revision')
378
+ return document['recipes']
379
+ from huggingface_hub import hf_hub_download
380
+ import pyarrow.parquet as pq
381
+ recipes = {}
382
+ shards = []
383
+ for index in range(3):
384
+ name = f'data/resolved-{index:05d}-of-00003.parquet'
385
+ path = Path(hf_hub_download(DATASET, name, repo_type='dataset', revision=REVISION,
386
+ cache_dir=str(cache)))
387
+ for batch in pq.ParquetFile(path).iter_batches(columns=METADATA_COLUMNS):
388
+ for row in batch.to_pylist():
389
+ if row['instance_id'] in recipes:
390
+ raise ValueError('Duplicate upstream task: ' + row['instance_id'])
391
+ recipes[row['instance_id']] = row
392
+ with path.open('rb') as stream:
393
+ shards.append({'name': name, 'sha256': hashlib.file_digest(stream, 'sha256').hexdigest()})
394
+ metadata.parent.mkdir(parents=True, exist_ok=True)
395
+ metadata.write_text(json.dumps({'dataset': DATASET, 'revision': REVISION,
396
+ 'shards': shards, 'recipes': recipes}, indent=2) + '\n')
397
+ return recipes
398
+
399
+
400
+ def canonical(name):
401
+ return re.sub(r'[-_.]+', '-', name).lower()
402
+
403
+
404
+ def environment(row):
405
+ python, specs = _environment(row['environment'])
406
+ return python, list(specs)
407
+
408
+
409
+ @lru_cache(maxsize=512)
410
+ def _environment(serialized):
411
+ import yaml
412
+ # The pinned Parquets store literal backslash-n in this field.
413
+ env = yaml.safe_load(serialized.replace('\\n', '\n'))
414
+ specs = sorted(x for x in env['dependencies'] if isinstance(x, str))
415
+ python = next(x.split('=')[1] for x in specs if x.startswith('python='))
416
+ return python, tuple(specs)
417
+
418
+
419
+ OEMOF_COMMIT = '585b123e3dc02b191fead4d202ba60c057c473fd'
420
+ OEMOF_PREINSTALL = ['apt-get update', 'apt-get install -y gcc',
421
+ 'git clone https://github.com/oemof/oemof-solph.git', 'cd oemof-solph',
422
+ 'git checkout ' + OEMOF_COMMIT, 'pip install .', 'cd ..']
423
+
424
+
425
+ def local_resolution(row, line):
426
+ """Only resolve documented non-conda entries from the pinned snapshot."""
427
+ name, url = line.split(' @ ', 1)
428
+ name = canonical(name)
429
+ if name == 'swebench-matterhorn' and url == 'file:///swebench_matterhorn':
430
+ # Upstream collection harness; Harbor supplies its own verifier. The
431
+ # affected pinned repository trees contain no references to this package.
432
+ return 'omit-collection-harness', None
433
+ if (row['repo'] == 'dask/dask' and name == 'msgpack'
434
+ and url == 'file:///tmp/build/80754af9/msgpack-python_1612287171716/work'
435
+ and 'msgpack-python==0.5.6' in row['requirements'].splitlines()):
436
+ # The old and renamed distributions share the msgpack module. Restore
437
+ # the explicitly frozen pip installation, not stale conda build metadata.
438
+ return 'superseded-by-frozen-msgpack-python', None
439
+ if (row.get('instance_id') == 'rl-institut__smooth-167' and name == 'oemof'
440
+ and url == 'file:///smooth/oemof-solph'
441
+ and row['install_config'].get('pre_install') == OEMOF_PREINSTALL):
442
+ return 'pinned-preinstall-source', ('oemof @ git+https://github.com/oemof/'
443
+ 'oemof-solph.git@' + OEMOF_COMMIT)
444
+ return None
445
+
446
+
447
+ def dependencies(row, specs):
448
+ """Retain frozen pip pins; conda restores nonportable file:// packages."""
449
+ conda = {canonical(s.split('=')[0]): s.split('=')[1] for s in specs}
450
+ aliases = {'msgpack': ('msgpack-python',), 'esmf-regrid': ('iris-esmf-regrid',),
451
+ 'scitools-iris': ('iris',), 'stratify': ('python-stratify',),
452
+ 'brotli': ('brotli-python', 'brotli'), 'dask': ('dask-core',),
453
+ 'openforcefields': ('openff-forcefields',), 'torch': ('pytorch',),
454
+ 'antlr4-python3-runtime': ('antlr-python-runtime',), 'tables': ('pytables',),
455
+ 'lief': ('py-lief',),
456
+ 'openff-interchange': ('openff-interchange-base',),
457
+ 'openff-toolkit': ('openff-toolkit-base',),
458
+ 'openff-nagl': ('openff-nagl-base',),
459
+ 'matplotlib': ('matplotlib-base',), 'ruamel-yaml-conda': ('ruamel-yaml',)}
460
+ lines = []
461
+ own = 'git+https://github.com/' + row['repo'] + '.git@'
462
+ for line in row['requirements'].splitlines():
463
+ line = line.strip()
464
+ if not line or line.startswith('#'):
465
+ continue
466
+ if line.startswith('-e ' + own):
467
+ continue # Install the task checkout, never a second VCS copy.
468
+ own_pin = SELF_REQUIREMENTS.get(row.get('instance_id'))
469
+ if own_pin and line == own_pin[1]:
470
+ if row['base_commit'] != own_pin[0]:
471
+ raise ValueError('Self requirement source commit mismatch')
472
+ continue # setup.py at this exact commit supplies the recorded version.
473
+ line = line.replace(AMQP_ARCHIVE_OLD, AMQP_ARCHIVE_PINNED)
474
+ line = line.replace(VINE_ARCHIVE_OLD, VINE_ARCHIVE_PINNED)
475
+ for sources in (REQUIREMENT_SOURCES, ADDITIONAL_REQUIREMENT_SOURCES):
476
+ source = sources.get(row.get('instance_id'))
477
+ if source and line == source[1]:
478
+ if row['base_commit'] != source[0]:
479
+ raise ValueError('Requirement source task commit mismatch')
480
+ line = source[2]
481
+ if ' @ file://' in line:
482
+ resolution = local_resolution(row, line)
483
+ if resolution is not None:
484
+ if resolution[1] is not None:
485
+ lines.append(resolution[1])
486
+ continue
487
+ name = canonical(line.split(' @ ', 1)[0])
488
+ if name == canonical(row['repo'].split('/')[1]):
489
+ continue # A local installation of the task repository.
490
+ candidates = (name, 'python-' + name, name + '-core', name + '-split',
491
+ name + '-ext', *aliases.get(name, ()))
492
+ if not any(candidate in conda for candidate in candidates):
493
+ raise ValueError('Local requirement has no frozen conda package: ' + line)
494
+ continue
495
+ if '==' in line:
496
+ name, version = line.split('==', 1)
497
+ name = canonical(name)
498
+ candidates = (name, 'python-' + name, name + '-core', name + '-split',
499
+ name + '-ext', *aliases.get(name, ()))
500
+ if any(conda.get(candidate) == version for candidate in candidates):
501
+ continue
502
+ lines.append(line)
503
+ if row.get('instance_id') in {'goodmami__wn-174', 'goodmami__wn-178'}:
504
+ # Both pinned pyprojects require flit_core >=3.4,<4. The isolated
505
+ # upstream build backend is absent from the runtime freeze.
506
+ lines.append('flit_core==3.9.0')
507
+ if row.get('instance_id') == 'encode__starlette-1715':
508
+ # Its pinned pyproject requires hatchling, originally installed only in
509
+ # pip's ephemeral build environment and absent from the frozen snapshot.
510
+ # 1.17.1 supports Python 3.7; 1.18.0 requires Python 3.8.
511
+ lines += ['hatchling==1.17.1', 'editables==0.3', 'trove-classifiers==2023.8.7']
512
+ if row.get('instance_id') == 'astropy__astropy-16127':
513
+ # Its pinned pyproject declares these build dependencies; upstream's
514
+ # isolated build environment was not included in the runtime freeze.
515
+ lines += ['extension-helpers==1.2.0', 'Cython==3.0.12', 'setuptools-scm==8.2.0']
516
+ if row.get('instance_id') == 'sphinx-doc__sphinx-12875':
517
+ lines.append('flit_core==3.9.0')
518
+ if row.get('instance_id') in {'fatiando__pooch-291', 'fatiando__pooch-315', 'fatiando__pooch-365'}:
519
+ # These pinned pyprojects generate pooch/_version.py through this
520
+ # build plugin, absent from the recorded runtime environment.
521
+ lines.append('setuptools-scm==8.2.0')
522
+ if row.get('instance_id') == 'rsagroup__rsatoolbox-375':
523
+ lines += ['setuptools-scm==8.2.0', 'Cython==3.0.12']
524
+ if row.get('instance_id') == 'mwouts__itables-352':
525
+ lines += ['hatchling==1.27.0', 'pathspec==0.12.1', 'trove-classifiers==2025.3.19.19',
526
+ 'hatch-jupyter-builder==0.9.1', 'editables==0.5']
527
+ backend = build_backends().get(row.get('instance_id'))
528
+ if backend:
529
+ if backend['base_commit'] != row['base_commit']:
530
+ raise ValueError('Build backend source commit mismatch')
531
+ recorded = dict(conda)
532
+ for requirement in row['requirements'].splitlines():
533
+ match = re.fullmatch(r'([A-Za-z0-9_.-]+)==([^\s;]+)', requirement.strip())
534
+ if match:
535
+ recorded[canonical(match[1])] = match[2]
536
+ for requirement in backend['install']:
537
+ name, version = requirement.split('==', 1)
538
+ if recorded.get(canonical(name), version) != version:
539
+ raise ValueError('Build dependency conflicts with frozen runtime: ' + requirement)
540
+ lines += backend['install']
541
+ repair = environment_repair(row)
542
+ for old, new in repair.get('runtime_replacements', {}).items():
543
+ if lines.count(old) != 1:
544
+ raise ValueError('Runtime repair requires exactly one original pin: ' + old)
545
+ lines[lines.index(old)] = new
546
+ lines += repair.get('test_dependencies', [])
547
+ return '\n'.join(lines) + '\n'
548
+
549
+
550
+ @lru_cache(maxsize=1)
551
+ def environment_repairs():
552
+ document = json.loads((HERE / 'environment-repairs.json').read_text())
553
+ if document['source_revision'] != REVISION:
554
+ raise ValueError('Wrong environment repair source revision')
555
+ return document['tasks']
556
+
557
+
558
+ def environment_repair(row):
559
+ repair = environment_repairs().get(row.get('instance_id'), {})
560
+ if repair and repair['base_commit'] != row['base_commit']:
561
+ raise ValueError('Environment repair source commit mismatch')
562
+ return repair
563
+
564
+
565
+ @lru_cache(maxsize=1)
566
+ def build_backends():
567
+ document = json.loads((HERE / 'build-backends.json').read_text())
568
+ if document['source_revision'] != REVISION:
569
+ raise ValueError('Wrong build backend source revision')
570
+ return document['tasks']
571
+
572
+
573
+ @lru_cache(maxsize=1)
574
+ def wheel_cache():
575
+ document = json.loads((HERE / 'wheel-cache.json').read_text())
576
+ if document['source_revision'] != REVISION:
577
+ raise ValueError('Wrong wheel cache source revision')
578
+ return document['profiles']
579
+
580
+
581
+ def wheel_batches(pins):
582
+ """One version per distribution per pip invocation, with no dependency solving."""
583
+ batches = []
584
+ for pin in pins:
585
+ name = canonical(pin.split('==', 1)[0])
586
+ for batch in batches:
587
+ if all(canonical(other.split('==', 1)[0]) != name for other in batch):
588
+ batch.append(pin)
589
+ break
590
+ else:
591
+ batches.append([pin])
592
+ return batches
593
+
594
+
595
+ def select_image(row, lock):
596
+ """Promote measured expensive environments; keep the default shared image."""
597
+ python, specs = environment(row)
598
+ key = hashlib.sha256('\n'.join(specs).encode()).hexdigest()
599
+ selected = dict(lock)
600
+ identity = python
601
+ if key in lock.get('setup_profiles', {}):
602
+ if lock['setup_profiles'][key] != specs:
603
+ raise ValueError('Promoted environment mismatch')
604
+ selected['environments'] = {**lock['environments'], python: specs}
605
+ selected['_omit_wheels'] = True
606
+ identity += ':conda-' + key[:12]
607
+ requirements = set(dependencies(row, specs).splitlines())
608
+ profiles = [(name, profile) for name, profile in lock.get('pip_layers', {}).items()
609
+ if python == profile['python'] and set(profile['requires']).issubset(requirements)]
610
+ for name, profile in profiles:
611
+ # A complete frozen environment already includes its smaller shared
612
+ # scientific core. Preserve the more specific existing image.
613
+ if any(set(profile['requires']) < set(other['requires']) for _, other in profiles):
614
+ continue
615
+ if python == profile['python'] and set(profile['requires']).issubset(requirements):
616
+ if '_pip_layer' in selected:
617
+ raise ValueError('Overlapping pip image profiles')
618
+ selected['_pip_layer'] = profile['install']
619
+ if profile.get('wheel_subset'):
620
+ selected['_wheel_subset'] = profile['install']
621
+ if profile.get('omit_wheels'):
622
+ selected['_omit_wheels'] = True
623
+ if profile.get('system_packages'):
624
+ selected['system_packages'] = {**selected.get('system_packages', {}), python:
625
+ sorted(set(selected.get('system_packages', {}).get(python, []))
626
+ | set(profile['system_packages']))}
627
+ identity += ':' + name
628
+ system = (lock.get('system_tasks', {}).get(row.get('instance_id'))
629
+ or lock.get('system_repositories', {}).get(row['repo']))
630
+ if system:
631
+ selected['system_packages'] = {**selected.get('system_packages', {}), python:
632
+ sorted(set(selected.get('system_packages', {}).get(python, [])) | set(system))}
633
+ identity += ':system-' + hashlib.sha256('\n'.join(system).encode()).hexdigest()[:12]
634
+ if row.get('instance_id') in lock.get('compiled_checkouts', {}):
635
+ if row['base_commit'] != lock['compiled_checkouts'][row['instance_id']]:
636
+ raise ValueError('Compiled checkout commit mismatch')
637
+ selected['_compiled'] = True
638
+ identity += ':compiled-' + row['base_commit'][:12]
639
+ direct_http = {
640
+ 'cuenca-mx/cuenca-python': 'api.cuenca.com,sandbox.cuenca.com',
641
+ 'edgi-govdata-archiving/wayback': 'web.archive.org',
642
+ 'conan-io/conan': 'localhost,127.0.0.1,::1',
643
+ }
644
+ if row['repo'] in direct_http:
645
+ # Preserve recorded request hosts and access local test servers directly.
646
+ selected['_no_proxy'] = direct_http[row['repo']]
647
+ identity += ':recorded-http'
648
+ if row.get('instance_id') == 'modin-project__modin-1842':
649
+ # Ray 0.8 reads host resources rather than the task's cgroup limits.
650
+ selected['_runtime_env'] = {'MODIN_CPUS': '4', 'MODIN_MEMORY': '536870912'}
651
+ identity += ':bounded-ray'
652
+ resource_fix = TASK_RESOURCE_FIXES.get(row.get('instance_id'), {})
653
+ if resource_fix.get('runtime_env'):
654
+ # Reviewed per-task runtime bounds for libraries that size themselves from the host.
655
+ selected['_runtime_env'] = {**selected.get('_runtime_env', {}), **resource_fix['runtime_env']}
656
+ identity += ':' + resource_fix['label']
657
+ if resource_fix.get('no_proxy'):
658
+ # Recorded or mocked hosts must keep their original URI through the verifier.
659
+ hosts = [h for h in selected.get('_no_proxy', '').split(',') if h] + [resource_fix['no_proxy']]
660
+ selected['_no_proxy'] = ','.join(hosts)
661
+ identity += ':' + resource_fix['label']
662
+ if resource_fix.get('runtime_unset'):
663
+ selected['_runtime_unset'] = sorted(set(selected.get('_runtime_unset', [])) | set(resource_fix['runtime_unset']))
664
+ identity += ':' + resource_fix['label']
665
+ if row.get('instance_id') == 'conan-io__conan-5005':
666
+ # This historical Conan requester copies HTTP proxies into explicit
667
+ # request arguments, bypassing NO_PROXY for its local HTTP server.
668
+ # HTTPS downloads used by setup retain their configured proxy.
669
+ selected['_runtime_unset'] = ['HTTP_PROXY', 'http_proxy', 'ALL_PROXY', 'all_proxy']
670
+ identity += ':local-http'
671
+ return selected, identity
672
+
673
+
674
+ def isolated_wheels(python, lock):
675
+ return {**lock.get('isolated_wheels', {}),
676
+ **lock.get('isolated_wheels_by_python', {}).get(python, {})}
677
+
678
+
679
+ def image_wheels(python, lock):
680
+ pins = [] if lock.get('_omit_wheels') else wheel_cache().get(python, [])
681
+ if '_wheel_subset' in lock:
682
+ pins = [pin for pin in dict.fromkeys(lock['_wheel_subset'])
683
+ if pin in pins or pin in isolated_wheels(python, lock)]
684
+ return pins
685
+
686
+
687
+ def dockerfile(python, lock):
688
+ specs = lock['environments'][python]
689
+ explicit = explicit_conda(sorted(specs))
690
+ channels = ''.join('-c ' + shlex.quote(channel) + ' '
691
+ for channel in lock.get('extra_channels', {}).get(python, []))
692
+ apt = COMMON_PACKAGES | set(lock.get('system_packages', {}).get(python, []))
693
+ commands = [
694
+ 'if ! dpkg-statoverride --list /usr/lib/x86_64-linux-gnu/utempter/utempter; then dpkg-statoverride --add root root 0755 /usr/lib/x86_64-linux-gnu/utempter/utempter; fi',
695
+ 'apt-get update && apt-get install -y --no-install-recommends ' + ' '.join(sorted(apt)) + ' && rm -rf /var/lib/apt/lists/*',
696
+ '/opt/conda/bin/conda create -y -n testbed --solver libmamba --override-channels ' + channels + '-c defaults -c conda-forge ' + shlex.join(specs) + ' && /opt/conda/bin/conda clean -afy',
697
+ '/opt/conda/bin/conda clean -afy && mkdir -p /testbed && ln -s /opt/conda /opt/miniconda3',
698
+ ]
699
+ # Install conda before apt; the upstream static check otherwise mistakes
700
+ # conda version pins following an apt RUN for apt package pins.
701
+ commands = [commands[2], commands[0], commands[1], commands[3]]
702
+ if 'ghostscript' in apt:
703
+ # fontconfig-config otherwise creates this directory and chowns it to
704
+ # the unmapped staff group in a single-UID build namespace.
705
+ commands[1] += ' && mkdir -p /usr/local/share/fonts && chmod 2775 /usr/local/share/fonts'
706
+ if explicit:
707
+ # The Apptainer fallback defers COPY until container startup, after
708
+ # build RUN commands. Materialize the lock inside RUN instead.
709
+ commands[0] = ("printf '%s\\n' " + shlex.join(explicit.splitlines())
710
+ + ' > /opt/base-conda.txt && /opt/conda/bin/conda create -y -n testbed '
711
+ '--file /opt/base-conda.txt && /opt/conda/bin/conda clean -afy '
712
+ '&& rm /opt/base-conda.txt')
713
+ pins = image_wheels(python, lock)
714
+ if pins:
715
+ commands.append('mkdir -p /opt/swelego-wheels')
716
+ isolated = isolated_wheels(python, lock)
717
+ for batch in wheel_batches([pin for pin in pins if pin not in isolated]):
718
+ commands.append('/opt/conda/envs/testbed/bin/python -m pip wheel '
719
+ '--no-deps --no-build-isolation --wheel-dir /opt/swelego-wheels '
720
+ + shlex.join(batch) + ' && rm -rf /root/.cache/pip')
721
+ for pin in pins:
722
+ if pin in isolated:
723
+ commands.append("printf '%s\\n' " + shlex.join(isolated[pin])
724
+ + ' > /opt/wheel-build-constraints.txt && '
725
+ 'PIP_CONSTRAINT=/opt/wheel-build-constraints.txt '
726
+ '/opt/conda/envs/testbed/bin/python -m pip wheel --no-deps '
727
+ '--wheel-dir /opt/swelego-wheels ' + shlex.quote(pin)
728
+ + ' && rm /opt/wheel-build-constraints.txt && rm -rf /root/.cache/pip')
729
+ if lock.get('_pip_layer'):
730
+ options = '--no-index --find-links /opt/swelego-wheels '
731
+ if not set(lock['_pip_layer']).issubset(pins):
732
+ options = '--no-build-isolation ' + ('--find-links /opt/swelego-wheels ' if pins else '')
733
+ commands.append('/opt/conda/envs/testbed/bin/python -m pip install --no-deps '
734
+ + options + shlex.join(lock['_pip_layer']))
735
+ runtime_env = ''
736
+ if lock.get('_no_proxy'):
737
+ domains = lock['_no_proxy']
738
+ # VCR replays these recorded endpoints locally. Preserve their original
739
+ # host names instead of routing them through an inherited HTTP proxy.
740
+ lines = ['export ' + name + '="${' + name + ':+${' + name + '},}' + domains + '"'
741
+ for name in ('NO_PROXY', 'no_proxy')]
742
+ commands.append("printf '%s\\n' " + shlex.join(lines)
743
+ + ' > /etc/profile.d/swelego-no-proxy.sh')
744
+ runtime_env = 'ENV NO_PROXY=' + domains + ' no_proxy=' + domains + '\n'
745
+ if lock.get('_runtime_env'):
746
+ pairs = [name + '=' + shlex.quote(value)
747
+ for name, value in sorted(lock['_runtime_env'].items())]
748
+ commands.append("printf '%s\\n' " + shlex.join(['export ' + pair for pair in pairs])
749
+ + ' > /etc/profile.d/swelego-runtime.sh')
750
+ runtime_env += 'ENV ' + ' '.join(pairs) + '\n'
751
+ if lock.get('_runtime_unset'):
752
+ names = lock['_runtime_unset']
753
+ commands.append("printf '%s\\n' " + shlex.quote('unset ' + ' '.join(names))
754
+ + ' > /etc/profile.d/swelego-direct-http.sh')
755
+ runtime_env += 'ENV ' + ' '.join(name + '=""' for name in names) + '\n'
756
+ return ('FROM ' + lock['base'] + '\n# swelego-shared-python-v1\nUSER root\n'
757
+ + ''.join('RUN ' + c + '\n' for c in commands)
758
+ + runtime_env
759
+ + 'ENV PATH=/opt/conda/envs/testbed/bin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\nWORKDIR /testbed\n')
760
+
761
+
762
+ @lru_cache(maxsize=1)
763
+ def explicit_lock():
764
+ document = json.loads((HERE / 'conda-explicit-lock.json').read_text())
765
+ if document['source_revision'] != REVISION or document['unresolved']:
766
+ raise ValueError('Invalid explicit conda lock')
767
+ return document
768
+
769
+
770
+ def explicit_conda(specs):
771
+ """Use complete recorded environments without loading/solving repodata."""
772
+ document = explicit_lock()
773
+ key = hashlib.sha256('\n'.join(specs).encode()).hexdigest()
774
+ profile = document['profiles'].get(key)
775
+ if profile is None:
776
+ return None
777
+ if profile['specs'] != specs:
778
+ raise ValueError('Explicit conda profile mismatch')
779
+ return '@EXPLICIT\n' + ''.join(document['packages'][spec]['url'] + '#'
780
+ + document['packages'][spec]['md5'] + '\n'
781
+ for spec in specs)
782
+
783
+
784
+ def task_setup(row, specs, lock):
785
+ python, _ = environment(row)
786
+ config = row['install_config']
787
+ install = config.get('install') or 'true'
788
+ data_manifest = lock.get('data_manifests', {}).get(row.get('instance_id'))
789
+ if data_manifest:
790
+ if row['base_commit'] != data_manifest['base_commit']:
791
+ raise ValueError('Data manifest task commit mismatch')
792
+ command = 'mykrobe panels update_metadata'
793
+ if install.count(command) != 1:
794
+ raise ValueError('Unexpected panel metadata installation recipe')
795
+ install = install.replace(command, command + ' --filename /setup_files/data-manifest.json')
796
+ if install in {'poetry install', 'poetry install --with dev,cli',
797
+ 'poetry install --all-extras', 'poetry install --with test --with dev'}:
798
+ # Frozen dependencies are already installed in the task environment.
799
+ install = 'POETRY_VIRTUALENVS_CREATE=false poetry install --only-root'
800
+ if row.get('instance_id') == 'Informasjonsforvaltning__fdk-fulltext-search-138':
801
+ # Its old virtualenv imports distutils while Poetry starts. The
802
+ # Python 3.8 standard implementation matches its frozen packaging.
803
+ install = 'SETUPTOOLS_USE_DISTUTILS=stdlib ' + install
804
+ if row.get('instance_id') == 'elastic__apm-agent-python-1510':
805
+ # New setuptools calls a packaging API absent from this frozen runtime.
806
+ # Build with a compatible pinned backend without changing runtime pins.
807
+ install = ("printf '%s\\n' setuptools==70.3.0 wheel==0.45.1 > /setup_files/build-constraints.txt\n"
808
+ 'PIP_CONSTRAINT=/setup_files/build-constraints.txt PIP_NO_BUILD_ISOLATION=1 '
809
+ + install)
810
+ backend = build_backends().get(row.get('instance_id'), {})
811
+ if backend.get('legacy_setup'):
812
+ if not install.startswith('pip install -e .'):
813
+ raise ValueError('Unexpected legacy editable installation recipe')
814
+ install = 'python setup.py develop --no-deps'
815
+ if backend.get('isolated_build_constraints'):
816
+ if not install.startswith('pip install ') or '\n' in install:
817
+ raise ValueError('Unsupported isolated backend installation recipe')
818
+ # Build tools can require versions that conflict with the frozen runtime.
819
+ # Allow dependency resolution only inside pip's isolated build environment;
820
+ # the explicit CLI flag keeps local project runtime dependencies untouched.
821
+ options = '--no-deps ' + ('--use-pep517 ' if backend.get('force_pep517') else '')
822
+ install = ("printf '%s\\n' " + shlex.join(backend['isolated_build_constraints'])
823
+ + ' > /setup_files/build-constraints.txt\n'
824
+ 'PIP_CONSTRAINT=/setup_files/build-constraints.txt PIP_NO_DEPS=0 '
825
+ 'PIP_NO_BUILD_ISOLATION=1 '
826
+ + install.replace('pip install ', 'pip install ' + options, 1))
827
+ env_vars = config.get('env_vars') or {}
828
+ if any(not re.fullmatch(r'[A-Za-z_][A-Za-z0-9_]*', k) for k in env_vars):
829
+ raise ValueError('Invalid environment variable name')
830
+ exports = ''.join('export ' + k + '=' + shlex.quote(v) + '\n' for k, v in sorted(env_vars.items()))
831
+ delta = ''
832
+ if not set(specs).issubset(lock['environments'][python]):
833
+ import yaml
834
+ recorded = yaml.safe_load(row['environment'].replace('\\n', '\n'))
835
+ standard = {'defaults', 'conda-forge', 'https://repo.anaconda.com/pkgs/main',
836
+ 'https://repo.anaconda.com/pkgs/r'}
837
+ extra_channels = ''.join('-c ' + shlex.quote(channel) + ' '
838
+ for channel in recorded.get('channels', [])
839
+ if channel not in standard)
840
+ delta = ('/opt/conda/bin/conda install -y -n testbed --solver libmamba --override-channels '
841
+ + extra_channels + '-c defaults -c conda-forge ' + shlex.join(specs) + '\n')
842
+ if delta and explicit_conda(specs) is not None:
843
+ delta = ('/opt/conda/bin/conda install -y -n testbed --file /setup_files/conda-explicit.txt\n'
844
+ '/opt/conda/bin/conda clean -afy\n')
845
+ pre = []
846
+ if row.get('instance_id') == 'skypilot-org__skypilot-4908':
847
+ # Frozen sdists import pkg_resources, removed by newer isolated backends.
848
+ # Pin only their isolated build backend; runtime setuptools stays frozen.
849
+ if row['base_commit'] != '86e242f811bbab00fc896a3f6a6b3dd591eb6626':
850
+ raise ValueError('Dependency build constraint commit mismatch')
851
+ pre += [
852
+ "printf '%s\\n' setuptools==75.8.0 > /setup_files/dependency-build-constraints.txt",
853
+ 'export PIP_CONSTRAINT=/setup_files/dependency-build-constraints.txt',
854
+ ]
855
+ if row.get('instance_id') in {'chaostoolkit__chaostoolkit-lib-53',
856
+ 'chaostoolkit__chaostoolkit-lib-70',
857
+ 'chaostoolkit__chaostoolkit-lib-89'}:
858
+ # pyhcl imports ply while building its wheel, before pip installs the
859
+ # rest of the requirements. Install the recorded ply pin first.
860
+ ply = [line for line in dependencies(row, specs).splitlines()
861
+ if line.startswith('ply==')]
862
+ if len(ply) != 1:
863
+ raise ValueError('Missing frozen ply build dependency')
864
+ pre.append('python -m pip install --no-deps ' + shlex.quote(ply[0]))
865
+ if row['repo'] == 'lightkurve/lightkurve':
866
+ # Its conftest creates a child directory but assumes this parent exists.
867
+ pre.append('mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}"')
868
+ if row.get('instance_id') == 'matplotlib__matplotlib-18184':
869
+ # Match setupext.py's pinned bundled FreeType. GNU tar keeps files owned
870
+ # by the current build namespace instead of restoring archive UID 1000.
871
+ pre += [
872
+ 'mkdir -p build',
873
+ 'curl -fsSL https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz '
874
+ '-o /setup_files/freetype-2.6.1.tar.gz',
875
+ "printf '%s\\n' '0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014 "
876
+ "/setup_files/freetype-2.6.1.tar.gz' | sha256sum -c -",
877
+ 'tar --no-same-owner -xzf /setup_files/freetype-2.6.1.tar.gz -C build',
878
+ 'chmod u+x build/freetype-2.6.1/configure build/freetype-2.6.1/builds/unix/configure',
879
+ ]
880
+ preinstall = config.get('pre_install') or []
881
+ if row.get('instance_id') == 'rl-institut__smooth-167' and preinstall == OEMOF_PREINSTALL:
882
+ preinstall = [] # Exact source is installed with frozen dependencies.
883
+ for command in preinstall:
884
+ words = shlex.split(command)
885
+ if command.strip() == 'apt-get update':
886
+ continue
887
+ if words[:3] == ['apt-get', 'install', '-y']:
888
+ baked = COMMON_PACKAGES | set(lock.get('system_packages', {}).get(python, []))
889
+ extra = sorted(set(words[3:]) - baked)
890
+ if extra:
891
+ options = '--no-install-recommends ' if row.get('instance_id') in lock.get('no_recommends_tasks', []) else ''
892
+ pre.append('apt-get update && apt-get install -y ' + options + shlex.join(extra))
893
+ else:
894
+ if row.get('instance_id') == '12rambau__sepal_ui-758' and words[:2] == ['pip', 'install']:
895
+ # Its wheel index contains multiple GDAL releases. Preserve
896
+ # the captured GDAL/localtileserver pins during pre-install.
897
+ command = 'PIP_CONSTRAINT=/setup_files/requirements.txt ' + command
898
+ pre.append(command)
899
+ depth, version_tag = '1', ''
900
+ if row['repo'] == 'beeware/briefcase':
901
+ # Briefcase queries setuptools-scm at import time with warnings treated
902
+ # as errors. Fetch the pinned commit's complete ancestry, without later
903
+ # commits, so it has real history rather than a shallow-checkout warning.
904
+ depth = '2147483647'
905
+ history = lock.get('checkout_tags', {}).get(row.get('instance_id'))
906
+ if history:
907
+ if row['base_commit'] != history['base_commit']:
908
+ raise ValueError('Historical version tag commit mismatch')
909
+ depth = str(history['depth'])
910
+ version_tag = ('git merge-base --is-ancestor ' + shlex.quote(history['tag_commit']) + ' HEAD\n'
911
+ 'git tag -f ' + shlex.quote(history['tag']) + ' ' + shlex.quote(history['tag_commit']))
912
+ if history.get('tag_object'):
913
+ # git describe without --tags requires the original annotated tag.
914
+ tag_ref = 'refs/tags/' + history['tag']
915
+ tag_object = shlex.quote(history['tag_object'])
916
+ fetch_depth = '' if history.get('complete_history') else '--depth 1 '
917
+ version_tag += ('\ngit fetch ' + fetch_depth + 'origin ' + tag_object
918
+ + '\ngit update-ref ' + shlex.quote(tag_ref) + ' ' + tag_object
919
+ + '\ntest "$(git rev-parse ' + shlex.quote(tag_ref + '^{}')
920
+ + ')" = ' + shlex.quote(history['tag_commit']))
921
+ if row.get('instance_id') == 'just-work__fffw-100':
922
+ release = '660e60664812b377a9ac43c0a6b9bb807bc7e394'
923
+ if row['base_commit'] != release:
924
+ raise ValueError('Unexpected fffw release commit')
925
+ version_tag = 'git tag -f 3.3.1 ' + release
926
+ if row.get('instance_id') == 'robotpy__robotpy-cppheaderparser-42':
927
+ release = 'dd564dda795c3b78fc4843a80a5906577533521d'
928
+ if row['base_commit'] != release:
929
+ raise ValueError('Unexpected robotpy release commit')
930
+ version_tag = 'git tag -f 5.0.3 ' + release
931
+ if row.get('instance_id') == 'openforcefield__openff-toolkit-2026':
932
+ # The frozen version 0.16.8.post2+g459a7334 needs two ancestor commits
933
+ # and its release tag. Fetch only that history, never later fixes.
934
+ depth = '3'
935
+ release = 'b7a97ebb8590750e7c5c82f5ce7b1f5ad2ebd6df'
936
+ version_tag = ('git merge-base --is-ancestor ' + release + ' HEAD\n'
937
+ 'git tag -f 0.16.8 ' + release)
938
+ repair = environment_repair(row)
939
+ if repair.get('remove_directory_metadata'):
940
+ metadata = PurePosixPath(repair['remove_directory_metadata'])
941
+ if metadata.is_absolute() or '..' in metadata.parts:
942
+ raise ValueError('Unsafe malformed package metadata path')
943
+ pre.append(
944
+ 'site_packages="$(python -c \'import sysconfig; print(sysconfig.get_paths()["purelib"])\')"\n'
945
+ 'metadata_path="$site_packages/' + str(metadata) + '"\n'
946
+ 'if [ -d "$metadata_path" ] && [ ! -L "$metadata_path" ]; then '
947
+ 'rm -rf -- "$metadata_path"; fi')
948
+ if repair.get('full_history'):
949
+ depth = '2147483647'
950
+ if repair.get('leap_second_table'):
951
+ install += ('\npython -c ' + shlex.quote(
952
+ 'import astropy_iers_data, shutil; '
953
+ 'shutil.copyfile("/setup_files/Leap_Second.dat", astropy_iers_data.IERS_LEAP_SECOND_FILE)'))
954
+ if repair.get('branch'):
955
+ version_tag += '\ngit checkout -B ' + shlex.quote(repair['branch']) + ' ' + shlex.quote(row['base_commit'])
956
+ identity = hashlib.sha256(json.dumps(row, sort_keys=True).encode()).hexdigest()
957
+ cache_pins = set(image_wheels(python, lock))
958
+ pip_cache = ''
959
+ if any(line.startswith('torch==') and '+cpu' in line
960
+ for line in dependencies(row, specs).splitlines()):
961
+ # The recorded CPU build is published on PyTorch's own wheel index.
962
+ pip_cache = ' --extra-index-url https://download.pytorch.org/whl/cpu'
963
+ if cache_pins:
964
+ pip_cache += ' --find-links /opt/swelego-wheels'
965
+ if set(dependencies(row, specs).splitlines()).issubset(cache_pins):
966
+ pip_cache += ' --no-index'
967
+ template = (HERE / 'setup.sh').read_text()
968
+ prepared = ''
969
+ if lock.get('_compiled'):
970
+ prepared = (f'if [ -f /opt/swelego-ready/{identity} ]; then\n'
971
+ ' cached_started=$SECONDS\n mkdir -p /testbed\n'
972
+ f' tar -xzf /opt/swelego-ready/{identity}.tar.gz -C /testbed\n'
973
+ ' test "$(git -C /testbed rev-parse HEAD)" = ' + shlex.quote(row['base_commit']) + '\n'
974
+ ' printf \'{"seconds":%s,"exit_code":0,"phases":{"prepared_checkout":%s}}\\n\' '
975
+ '"$((SECONDS-cached_started))" "$((SECONDS-cached_started))" > /setup_files/setup-timing.json\n'
976
+ ' touch "$marker"\n exit 0\nfi\n')
977
+ return (template.replace('@IDENTITY@', identity)
978
+ .replace('@PREPARED@\n', prepared)
979
+ .replace('@REPO@', shlex.quote(SOURCE_MIRRORS.get(
980
+ row['repo'], 'https://github.com/' + row['repo'] + '.git')))
981
+ .replace('@COMMIT@', shlex.quote(row['base_commit']))
982
+ .replace('@DEPTH@', depth)
983
+ .replace('@VERSION_TAG@\n', version_tag + '\n' if version_tag else '')
984
+ .replace('@EXPORTS@', exports).replace('@CONDA@', delta)
985
+ .replace('@PIP_CACHE@', pip_cache)
986
+ .replace('@PREINSTALL@', '\n'.join(pre))
987
+ .replace('@INSTALL@', install))
988
+
989
+
990
+ def patch_files(files, row, lock):
991
+ if lock['source_revision'] != REVISION:
992
+ raise ValueError('Wrong base environment source revision')
993
+ if not re.fullmatch(r'[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+', row['repo']):
994
+ raise ValueError('Invalid repository')
995
+ if not re.fullmatch(r'[a-f0-9]{40}', row['base_commit']):
996
+ raise ValueError('Invalid base commit')
997
+ if 'setup_files/swelego.json' in files:
998
+ raise ValueError('Patch the immutable source, not an already converted task')
999
+ expected = f"FROM {row['image_name']}\nWORKDIR /testbed\n".encode()
1000
+ if files['environment/Dockerfile'] != expected:
1001
+ raise ValueError('Task image and upstream metadata do not match')
1002
+ if any(k.startswith('setup_files/') for k in files):
1003
+ raise ValueError('Existing setup requires review')
1004
+ if ('base=' + row['base_commit'] + '\n').encode() not in files['tests/test.sh']:
1005
+ raise ValueError('Task base commit and upstream metadata do not match')
1006
+ python, specs = environment(row)
1007
+ lock, image_identity = select_image(row, lock)
1008
+ updated = dict(files)
1009
+ resource_fix = TASK_RESOURCE_FIXES.get(row.get('instance_id'))
1010
+ if resource_fix and 'memory_mb' in resource_fix:
1011
+ if 'task.toml' not in updated:
1012
+ raise ValueError('Task resource fix requires task.toml')
1013
+ task_toml = updated['task.toml'].decode()
1014
+ memory_pattern = re.compile(r'(?m)^(memory_mb\s*=\s*)\d+(\s*(?:#.*)?)$')
1015
+ task_toml, replacements = memory_pattern.subn(
1016
+ lambda match: match.group(1) + str(resource_fix['memory_mb']) + match.group(2), task_toml)
1017
+ if replacements != 1:
1018
+ raise ValueError('Task resource fix requires exactly one memory_mb in task.toml')
1019
+ updated['task.toml'] = task_toml.encode()
1020
+ updated['environment/Dockerfile'] = dockerfile(python, lock).encode()
1021
+ base_explicit = explicit_conda(sorted(lock['environments'][python]))
1022
+ if base_explicit:
1023
+ updated['environment/base-conda.txt'] = base_explicit.encode()
1024
+ updated['setup_files/requirements.txt'] = dependencies(row, specs).encode()
1025
+ explicit = explicit_conda(specs)
1026
+ if explicit is not None:
1027
+ updated['setup_files/conda-explicit.txt'] = explicit.encode()
1028
+ updated['setup_files/setup.sh'] = task_setup(row, specs, lock).encode()
1029
+ if environment_repair(row).get('leap_second_table'):
1030
+ table = (HERE / 'Leap_Second.dat').read_bytes()
1031
+ if hashlib.sha256(table).hexdigest() != environment_repair(row)['leap_second_table']['sha256']:
1032
+ raise ValueError('Leap-second table checksum mismatch')
1033
+ updated['setup_files/Leap_Second.dat'] = table
1034
+ if lock.get('_compiled'):
1035
+ build_files = {k: v for k, v in updated.items() if k.startswith('setup_files/')}
1036
+ commands = ['mkdir -p /setup_files']
1037
+ for name, content in sorted(build_files.items()):
1038
+ commands.append("printf '%s' " + shlex.quote(base64.b64encode(content).decode())
1039
+ + ' | base64 -d > /' + name)
1040
+ identity = hashlib.sha256(json.dumps(row, sort_keys=True).encode()).hexdigest()
1041
+ commands += ['bash /setup_files/setup.sh', 'mkdir -p /opt/swelego-ready',
1042
+ 'tar -czf /opt/swelego-ready/' + identity + '.tar.gz -C /testbed .',
1043
+ 'touch /opt/swelego-ready/' + identity,
1044
+ 'find /testbed -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +',
1045
+ 'rm -rf /setup_files']
1046
+ updated['environment/Dockerfile'] += ''.join('RUN ' + c + '\n' for c in commands).encode()
1047
+ data_manifest = lock.get('data_manifests', {}).get(row.get('instance_id'))
1048
+ if data_manifest:
1049
+ updated['setup_files/data-manifest.json'] = json.dumps(data_manifest['manifest'], indent=2).encode()
1050
+ updated['setup_files/swelego.json'] = json.dumps({
1051
+ 'version': MARKER, 'revision': REVISION, 'repo': row['repo'],
1052
+ 'base_commit': row['base_commit'], 'original_image': row['image_name'],
1053
+ **({'environment_repair': environment_repair(row)} if environment_repair(row) else {}),
1054
+ **({'checkout_mirror': SOURCE_MIRRORS[row['repo']]} if row['repo'] in SOURCE_MIRRORS else {}),
1055
+ 'python': python, 'conda_specs': specs, 'explicit_conda': explicit is not None,
1056
+ 'image_profile': image_identity, 'compiled_checkout': bool(lock.get('_compiled')),
1057
+ 'conda_adjustment': not set(specs).issubset(lock['environments'][python]),
1058
+ 'local_resolutions': [{'requirement': line, 'action': resolution[0],
1059
+ 'replacement': resolution[1]}
1060
+ for line in row['requirements'].splitlines()
1061
+ if ' @ file://' in line
1062
+ if (resolution := local_resolution(row, line)) is not None],
1063
+ **({'archive_resolution': {'original': AMQP_ARCHIVE_OLD, 'replacement': AMQP_ARCHIVE_PINNED,
1064
+ 'same_sha256': True}}
1065
+ if AMQP_ARCHIVE_OLD in row['requirements'] else {}),
1066
+ **({'vine_archive_resolution': {'original': VINE_ARCHIVE_OLD, 'replacement': VINE_ARCHIVE_PINNED,
1067
+ 'same_sha256': True}}
1068
+ if VINE_ARCHIVE_OLD in row['requirements'] else {}),
1069
+ **({'self_requirement': SELF_REQUIREMENTS[row['instance_id']][1]}
1070
+ if row.get('instance_id') in SELF_REQUIREMENTS else {}),
1071
+ **({'requirement_source': {'original': REQUIREMENT_SOURCES[row['instance_id']][1],
1072
+ 'replacement': REQUIREMENT_SOURCES[row['instance_id']][2]}}
1073
+ if row.get('instance_id') in REQUIREMENT_SOURCES else {}),
1074
+ **({'additional_requirement_source': {
1075
+ 'original': ADDITIONAL_REQUIREMENT_SOURCES[row['instance_id']][1],
1076
+ 'replacement': ADDITIONAL_REQUIREMENT_SOURCES[row['instance_id']][2]}}
1077
+ if row.get('instance_id') in ADDITIONAL_REQUIREMENT_SOURCES else {}),
1078
+ **({'data_manifest_source': data_manifest['source']} if data_manifest else {}),
1079
+ }, indent=2).encode()
1080
+ solve = files['solution/solve.sh'].decode()
1081
+ if not solve.startswith('#!/bin/bash\nset -e\n'):
1082
+ raise ValueError('Unknown solution entrypoint')
1083
+ updated['solution/solve.sh'] = solve.replace('set -e\n', 'set -e\nbash /setup_files/setup.sh\n', 1).encode()
1084
+ test = files['tests/test.sh'].decode()
1085
+ test = test.replace('mkdir -p /logs/verifier\n', 'mkdir -p /logs/verifier\n'
1086
+ 'bash /setup_files/setup.sh || exit $?\n'
1087
+ 'cp /setup_files/setup-timing.json /logs/verifier/setup-timing.json\n', 1)
1088
+ if row.get('instance_id') == 'F5Networks__f5-common-python-967':
1089
+ entry = 'bash /tests/eval.sh | tee /logs/verifier/test-output.txt'
1090
+ if test.count(entry) != 1:
1091
+ raise ValueError('Unknown F5 verifier entrypoint')
1092
+ updated['tests/f5_test_imports.py'] = (HERE / 'f5_test_imports.py').read_bytes()
1093
+ test = test.replace(entry, 'python /tests/f5_test_imports.py || exit $?\n' + entry)
1094
+ verifier_fix = VERIFIER_FIXES.get(row.get('instance_id'))
1095
+ if verifier_fix:
1096
+ if row['base_commit'] != verifier_fix['commit']:
1097
+ raise ValueError('Verifier fix task commit mismatch')
1098
+ entry = 'bash /tests/eval.sh | tee /logs/verifier/test-output.txt'
1099
+ if test.count(entry) != 1:
1100
+ raise ValueError('Unknown verifier fix entrypoint')
1101
+ if row['instance_id'] == 'msgpack__msgpack-python-388':
1102
+ test = test.replace(entry, 'MSGPACK_PUREPYTHON=1 ' + entry)
1103
+ elif verifier_fix.get('unset_env'):
1104
+ test = test.replace(entry, 'env ' + ' '.join('-u ' + name for name in verifier_fix['unset_env']) + ' ' + entry)
1105
+ elif row['instance_id'] == 'mtgjson__mtgjson-469':
1106
+ evaluate = files['tests/eval.sh'].decode()
1107
+ if evaluate.count(' PYTHONPATH=. pytest ') != 1:
1108
+ raise ValueError('Unknown mtgjson verifier command')
1109
+ updated['tests/eval.sh'] = evaluate.replace(
1110
+ ' PYTHONPATH=. pytest ', ' PYTHONPATH=.${PYTHONPATH:+:$PYTHONPATH} pytest ').encode()
1111
+ else:
1112
+ updated['tests/swelego_sdss_clock.py'] = (HERE / 'sdss_verifier_clock.py').read_bytes()
1113
+ test = test.replace(entry,
1114
+ 'export PYTHONPATH=/tests${PYTHONPATH:+:$PYTHONPATH}\n'
1115
+ 'export PYTEST_PLUGINS=swelego_sdss_clock${PYTEST_PLUGINS:+,$PYTEST_PLUGINS}\n'
1116
+ + entry)
1117
+ repair = environment_repair(row)
1118
+ if repair.get('verifier_script'):
1119
+ script = repair['verifier_script']
1120
+ if not re.fullmatch(r'[A-Za-z0-9_.-]+\.py', script):
1121
+ raise ValueError('Invalid verifier repair script name')
1122
+ entry = 'bash /tests/eval.sh | tee /logs/verifier/test-output.txt'
1123
+ if test.count(entry) != 1:
1124
+ raise ValueError('Unknown verifier script repair entrypoint')
1125
+ updated['tests/' + script] = (HERE / script).read_bytes()
1126
+ test = test.replace(entry, 'python /tests/' + script
1127
+ + ' /testbed/tests/test_affinity.py || exit $?\n' + entry)
1128
+ if repair.get('pytest_workers'):
1129
+ entry = ' pytest '
1130
+ evaluate = files['tests/eval.sh'].decode()
1131
+ if evaluate.count(entry) != 1:
1132
+ raise ValueError('Unknown parallel verifier command')
1133
+ # An explicit -n on the command line overrides the repository's addopts.
1134
+ evaluate = evaluate.replace(entry, ' pytest -n ' + str(repair['pytest_workers']) + ' ')
1135
+ updated['tests/eval.sh'] = evaluate.encode()
1136
+ test = test.replace('bash /tests/eval.sh | tee',
1137
+ 'OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 '
1138
+ 'NUMEXPR_NUM_THREADS=1 bash /tests/eval.sh | tee')
1139
+ if repair.get('pytest_plugin'):
1140
+ plugin = repair['pytest_plugin']
1141
+ entry = 'bash /tests/eval.sh | tee /logs/verifier/test-output.txt'
1142
+ if test.count(entry) != 1:
1143
+ raise ValueError('Unknown environment repair verifier entrypoint')
1144
+ updated['tests/' + plugin + '.py'] = (HERE / (plugin + '.py')).read_bytes()
1145
+ test = test.replace(entry,
1146
+ 'export PYTHONPATH=/tests${PYTHONPATH:+:$PYTHONPATH}\n'
1147
+ 'export PYTEST_PLUGINS=' + plugin + '${PYTEST_PLUGINS:+,$PYTEST_PLUGINS}\n' + entry)
1148
+ updated['tests/test.sh'] = test.encode()
1149
+ updated['instruction.md'] = files['instruction.md'].rstrip() + (
1150
+ '\n\nThe repository is at `/testbed`. Before working, run `bash /setup_files/setup.sh`. '
1151
+ 'It initializes the task once; later calls preserve your changes.\n').encode()
1152
+ return updated
1153
+
1154
+
1155
+ def patch_blob(blob, row, lock):
1156
+ with tarfile.open(fileobj=io.BytesIO(blob)) as archive:
1157
+ files = {}
1158
+ for member in archive:
1159
+ name = PurePosixPath(member.name)
1160
+ if name.is_absolute() or '..' in name.parts or not (member.isfile() or member.isdir()):
1161
+ raise ValueError('Unsafe task archive member')
1162
+ if member.isfile():
1163
+ if str(name) in files:
1164
+ raise ValueError('Duplicate task archive member')
1165
+ files[str(name)] = archive.extractfile(member).read()
1166
+ updated = patch_files(files, row, lock)
1167
+ result = io.BytesIO()
1168
+ with tarfile.open(fileobj=result, mode='w') as archive:
1169
+ for name, data in sorted(updated.items()):
1170
+ member = tarfile.TarInfo(name)
1171
+ member.mode = 0o755 if name.endswith('.sh') else 0o644
1172
+ member.size = len(data)
1173
+ archive.addfile(member, io.BytesIO(data))
1174
+ return result.getvalue()
1175
+
1176
+
1177
+ def main():
1178
+ import pyarrow as pa
1179
+ import pyarrow.parquet as pq
1180
+ from data.utils.patch_reporting import write_patch_report
1181
+ parser = argparse.ArgumentParser(description=__doc__)
1182
+ parser.add_argument('--source', type=Path, required=True)
1183
+ parser.add_argument('--output', type=Path, required=True)
1184
+ parser.add_argument('--metadata', type=Path, help='Pinned upstream recipe JSON; defaults to recipes.json beside source')
1185
+ args = parser.parse_args()
1186
+ metadata = args.metadata or (args.source.parent if args.source.is_file() else args.source) / 'recipes.json'
1187
+ recipes = load_recipes(metadata, args.output.parent / 'swelego-upstream-cache')
1188
+ lock = json.loads((HERE / 'base-environments.json').read_text())
1189
+ sources = [args.source] if args.source.is_file() else sorted(args.source.glob('*.parquet'))
1190
+ if not sources:
1191
+ raise ValueError('No source Parquets')
1192
+ args.output.mkdir(parents=True, exist_ok=False)
1193
+ for source in sources:
1194
+ table = pq.read_table(source)
1195
+ original_rows = table.to_pylist()
1196
+ dropped = {item['path']: ARCHIVED_TASKS[item['path']] for item in original_rows
1197
+ if item['path'] in ARCHIVED_TASKS}
1198
+ rows = [item for item in original_rows if item['path'] not in dropped]
1199
+ labels, images, unresolved, reasons = {}, set(), {}, {}
1200
+ for item in rows:
1201
+ recipe = recipes[item['path']]
1202
+ if recipe['instance_id'] != item['path']:
1203
+ raise ValueError('Recipe task ID mismatch')
1204
+ try:
1205
+ item['task_binary'] = patch_blob(item['task_binary'], recipe, lock)
1206
+ except ValueError as exc:
1207
+ if not str(exc).startswith('Local requirement has no frozen conda package:'):
1208
+ raise
1209
+ unresolved[item['path']] = str(exc)
1210
+ images.add(recipe['image_name'])
1211
+ continue
1212
+ selected, identity = select_image(recipe, lock)
1213
+ images.add(identity)
1214
+ labels[item['path']] = ['shared-python-image', 'pinned-dependencies-in-setup', 'setup-timing']
1215
+ reasons[item['path']] = (
1216
+ 'Uses image profile ' + identity + ' with the pinned Python and dependency versions. '
1217
+ 'Task setup restores the pinned source checkout and remaining dependencies, records phase timings, '
1218
+ 'and preserves task IDs, grading inputs and reference patches.')
1219
+ if selected.get('_pip_layer') or ':conda-' in identity:
1220
+ reasons[item['path']] += ' Measured expensive dependency installation runs during the image build.'
1221
+ if selected.get('_compiled'):
1222
+ reasons[item['path']] += ' The image precompiles only the pinned base checkout, which setup restores into a fresh workspace.'
1223
+ if item['path'] in REQUIREMENT_SOURCES:
1224
+ reasons[item['path']] += ' Restores unavailable frozen dependency artifacts from pinned upstream sources; setup_files/swelego.json records each original requirement and replacement.'
1225
+ if item['path'] == 'pgmpy__pgmpy-1905':
1226
+ reasons[item['path']] += ' Daft 0.4.9 uses its official getdaft distribution alias, built from the same release with only the distribution name changed; the imported module remains daft.'
1227
+ if item['path'] == 'F5Networks__f5-common-python-967':
1228
+ labels[item['path']].append('verifier-call-time-imports')
1229
+ reasons[item['path']] += ' Defer the reviewed Import_Policy test import to consuming functions so the unpatched task executes tests instead of aborting collection; preserve test selection, assertions, required results and reference patch.'
1230
+ if item['path'] in VERIFIER_FIXES:
1231
+ labels[item['path']].append(VERIFIER_FIXES[item['path']]['label'])
1232
+ reasons[item['path']] += ' ' + VERIFIER_FIXES[item['path']]['reason']
1233
+ if item['path'] in TASK_RESOURCE_FIXES:
1234
+ fix = TASK_RESOURCE_FIXES[item['path']]
1235
+ labels[item['path']].append(fix['label'])
1236
+ reasons[item['path']] += ' ' + fix['reason']
1237
+ if item['path'] in environment_repairs():
1238
+ repair = environment_repairs()[item['path']]
1239
+ labels[item['path']].append(repair['label'])
1240
+ labels[item['path']] += repair.get('additional_labels', [])
1241
+ reasons[item['path']] += ' ' + repair['reason']
1242
+ if item['path'] in build_backends() or item['path'] == 'encode__starlette-1715':
1243
+ labels[item['path']].append('pinned-build-backend')
1244
+ reasons[item['path']] += ' Restores a declared build backend or plugin omitted from the runtime dependency freeze.'
1245
+ output = args.output / source.name
1246
+ pq.write_table(pa.Table.from_pylist(rows, schema=table.schema), output)
1247
+ write_patch_report(source, output, patcher=__file__, source={
1248
+ 'dataset': 'PrimeIntellect/SWE-Lego-Real-Data-Verified', 'revision': REVISION,
1249
+ 'url': 'https://huggingface.co/datasets/PrimeIntellect/SWE-Lego-Real-Data-Verified/tree/' + REVISION},
1250
+ dropped=dropped, change_labels=labels, change_reasons=reasons, patches=[{
1251
+ 'version': MARKER, 'images': sorted(images), 'unconverted': unresolved,
1252
+ 'metadata_sha256': hashlib.sha256(metadata.read_bytes()).hexdigest(),
1253
+ 'base_environments_sha256': hashlib.sha256((HERE / 'base-environments.json').read_bytes()).hexdigest(),
1254
+ 'conda_explicit_lock_sha256': hashlib.sha256((HERE / 'conda-explicit-lock.json').read_bytes()).hexdigest(),
1255
+ 'wheel_cache_sha256': hashlib.sha256((HERE / 'wheel-cache.json').read_bytes()).hexdigest(),
1256
+ 'build_backends_sha256': hashlib.sha256((HERE / 'build-backends.json').read_bytes()).hexdigest(),
1257
+ 'setup_sha256': hashlib.sha256((HERE / 'setup.sh').read_bytes()).hexdigest(),
1258
+ 'environment_repairs_sha256': hashlib.sha256((HERE / 'environment-repairs.json').read_bytes()).hexdigest(),
1259
+ 'sympy_pytest_sha256': hashlib.sha256((HERE / 'swelego_sympy_pytest.py').read_bytes()).hexdigest(),
1260
+ 'sqlglot_workers_sha256': hashlib.sha256((HERE / 'swelego_sqlglot_workers.py').read_bytes()).hexdigest(),
1261
+ 'rope_workers_sha256': hashlib.sha256((HERE / 'swelego_rope_workers.py').read_bytes()).hexdigest(),
1262
+ 'rpyc_affinity_sha256': hashlib.sha256((HERE / 'swelego_rpyc_affinity.py').read_bytes()).hexdigest(),
1263
+ 'pytrakt_clock_sha256': hashlib.sha256((HERE / 'swelego_pytrakt_clock.py').read_bytes()).hexdigest(),
1264
+ 'sdss_verifier_clock_sha256': hashlib.sha256((HERE / 'sdss_verifier_clock.py').read_bytes()).hexdigest()}])
1265
+ (args.output / (source.stem + '.images.json')).write_text(json.dumps({
1266
+ 'tasks': len(rows), 'archived': len(dropped), 'converted': len(labels), 'unique_images': len(images),
1267
+ 'unconverted': unresolved}, indent=2) + '\n')
1268
+ for name in ('base-environments.json', 'conda-explicit-lock.json', 'wheel-cache.json', 'build-backends.json', 'setup.sh', 'f5_test_imports.py', 'sdss_verifier_clock.py', 'swelego_pytrakt_clock.py', 'environment-repairs.json', 'swelego_sympy_pytest.py', 'swelego_sqlglot_workers.py', 'swelego_rope_workers.py', 'swelego_rpyc_affinity.py', 'Leap_Second.dat'):
1269
+ (args.output / name).write_bytes((HERE / name).read_bytes())
1270
+ print(f'{output}: {len(rows)} tasks, {len(images)} images, {len(unresolved)} explicitly unconverted, {len(dropped)} archived')
1271
+
1272
+
1273
+ if __name__ == '__main__':
1274
+ main()
images/manifests/2026-10-11-swelego-real-data-verified-d15f2a1ef8c8.json ADDED
The diff for this file is too large to render. See raw diff
 
runs/2026-10-11-swelego-real-data-verified-d15f2a1ef8c8.json ADDED
The diff for this file is too large to render. See raw diff
 
swelego-real-data-verified/archive.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0136ec975ddcf341f3dbb85c94f6594ba41b9c2fb8ff99a91bdaa5023637366
3
+ size 4053242
swelego-real-data-verified/tasks.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bdc1910844bfa76955bb4c022195764a7a572154733dbc361534e21fb7a78e8
3
+ size 59869977