Datasets:
Scale-SWE-Verified: 16,786 retained tasks and 416 archived
Browse filesKeeps **16,786 tasks** and archives **416** from [PrimeIntellect/Scale-SWE-Verified](https://huggingface.co/datasets/PrimeIntellect/Scale-SWE-Verified), covering all **17,202 source tasks**.
Includes the full validation run and reruns of repaired tasks.
| Validation | Latest passing outcomes among retained tasks |
| --- | ---: |
| Stage 1: static checks, training profile | 16,786 / 16,786 |
| Stage 3: build and startup | 16,786 / 16,786 |
| Stage 4: reference solution, reward 1 | 16,786 / 16,786 |
| Stage 5: no-op, reward 0 | 16,786 / 16,786 |
The evidence combines the original full audit with targeted repair reruns on Helma using Apptainer. The later full reproduction failed during startup and contributes no passing evidence. This PR does not claim a successful fresh reproduction of the complete final dataset. The training profile’s static exclusions and each historical report’s provenance are retained in the run record and evidence.
## Archived tasks
| Reason | Tasks | Explanation |
| --- | ---: | --- |
| image-dependency-mismatch | 3 | Installed dependencies conflict with the selected tests. |
| image-missing-test-dependency | 2 | The image lacks a package needed to collect tests. |
| reference-solution-reward-zero | 149 | The reference solution scores zero; task-specific test, setup and verifier causes are recorded in the manifest. |
| task-changes-only-test-files | 15 | Only test files change, leaving no source fix for an agent to make. |
| verifier-collection-error | 55 | The selected tests cannot be collected or set up. |
| verifier-execution-checker-pythonpath | 4 | A test rejects the validation runtime’s PYTHONPATH setting; a runtime limitation. |
| verifier-execution-error | 2 | Verifier execution fails; detailed causes are saved per task. |
| verifier-external-dependency | 2 | Verification depends on an external resource. |
| verifier-network-dependency | 120 | Tests require remote services that are blocked, unavailable or time out. |
| verifier-no-op-passes | 37 | The tests also pass without the reference fix. |
| verifier-privileged-port | 7 | Tests require a privileged port unavailable in the container. |
| verifier-stale-cassette | 18 | Recorded HTTP fixtures no longer match the client requests. |
| verifier-timeout-without-fix | 1 | Verification times out without an accepted repair. |
| verifier-timing-dependent | 1 | The outcome depends on timing. |
## Repairs
The patcher changed **1,197 retained tasks**. A task can have more than one repair.
| Change | Tasks | Explanation |
| --- | ---: | --- |
| instruction-path-clarified | 750 | Clarify paths using observations after task setup and reference execution. |
| verifier-call-time-imports | 5 | Restore required imports at call time. |
| verifier-cpu-affinity | 5 | Size worker pools from allocated CPU affinity. |
| verifier-debug-stream-isolation | 26 | Isolate completion debug streams from pytest’s file descriptors. |
| verifier-exact-test-ids | 5 | Use exact collected test IDs and reject incomplete or skipped required tests. |
| verifier-import-path | 36 | Import the task checkout and its test helpers. |
| verifier-request-cleanup | 1 | Close a test-created request after its assertions. |
| verifier-required-test-skipped | 5 | Remove an unexecutable required test that always skips because the image includes the C++ extension; the remaining required tests cover the change. |
| verifier-test-fixture-restoration | 367 | Restore upstream test-support files omitted by the verifier’s test patch. |
| verifier-worker-cleanup | 6 | Clean up test workers and isolate problematic shutdown behavior. |
Task-specific reasons and original excluded payloads are preserved in the archive and patch manifest.
- .gitattributes +1 -0
- evidence/2026-10-14-scaleswe-historical-audit/scaleswe/patchers/34c203a443e9713fee620975f2b8e837540fa7c27057aeebdd6066e1e4a7f419/patch.py +1270 -0
- runs/2026-10-14-scaleswe-historical-audit.json +3 -0
- runs/2026-10-14-scaleswe-historical-audit/contract.tasks.json +0 -0
- runs/2026-10-14-scaleswe-historical-audit/expected-outcomes.json +0 -0
- runs/2026-10-14-scaleswe-historical-audit/patch-manifest.json +0 -0
- runs/2026-10-14-scaleswe-historical-audit/publication-contract.json +0 -0
- runs/2026-10-14-scaleswe-historical-audit/source-reports.json.gz +3 -0
- runs/2026-10-14-scaleswe-historical-audit/task-evidence-index.json.gz +3 -0
- scaleswe/archive.parquet +3 -0
- scaleswe/tasks.parquet +3 -0
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm fil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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Apply reviewed instruction and verifier repairs to pinned Scale-SWE tasks."""
|
| 2 |
+
from __future__ import annotations
|
| 3 |
+
|
| 4 |
+
# Support both direct execution and python -m data.<source>.patch.
|
| 5 |
+
import sys
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
import argparse
|
| 11 |
+
import copy
|
| 12 |
+
import hashlib
|
| 13 |
+
import io
|
| 14 |
+
import inspect
|
| 15 |
+
import json
|
| 16 |
+
from pathlib import Path, PurePosixPath
|
| 17 |
+
import re
|
| 18 |
+
import tarfile
|
| 19 |
+
|
| 20 |
+
import pyarrow as pa
|
| 21 |
+
import pyarrow.parquet as pq
|
| 22 |
+
|
| 23 |
+
from data.utils.patch_reporting import write_patch_report
|
| 24 |
+
from data.utils.resolve_absolute_paths import apply_reviewed_replacements, collect_reports
|
| 25 |
+
from validation.contract import files_digest
|
| 26 |
+
|
| 27 |
+
REVISION = '8935f8e55244fd56080cdb8dcd0819a57e8a003c'
|
| 28 |
+
HERE = Path(__file__).resolve().parent
|
| 29 |
+
|
| 30 |
+
APPIUM_IMPORT_TASKS = frozenset({
|
| 31 |
+
'appium_python-client_pr446',
|
| 32 |
+
'appium_python-client_pr521',
|
| 33 |
+
'appium_python-client_pr594',
|
| 34 |
+
})
|
| 35 |
+
|
| 36 |
+
VERIFIER_IMPORT_TASKS = {
|
| 37 |
+
**{task: ('python-client', 'Expose Appium repository test helpers when grading through /tests/score.py.')
|
| 38 |
+
for task in APPIUM_IMPORT_TASKS},
|
| 39 |
+
'dbcli_pgcli_pr942': ('pgcli', 'Expose the repository root so restored tests.utils imports resolve after the reference removes tests/__init__.py.'),
|
| 40 |
+
'sbdchd_flake8-pie_pr93': ('flake8-pie', 'Import flake8_pie from the task checkout instead of the installed package, which lacks the selected feature modules.'),
|
| 41 |
+
**{f'sbdchd_flake8-pie_pr{pr}': ('flake8-pie', 'Import flake8_pie from the task checkout: the image installs a non-editable copy of a later commit in site-packages, so the unchanged checkout also scored 1 under no-op.')
|
| 42 |
+
for pr in (40, 42, 44, 54)},
|
| 43 |
+
'joseph-roitman_pytest-snapshot_pr30': ('pytest-snapshot', 'Load the pytest_snapshot plugin from the task checkout: the image installs a non-editable copy of a later commit in site-packages, so the unchanged checkout also scored 1 under no-op.'),
|
| 44 |
+
# No-op reward 1 in the 2026-10-08 full run: the selected tests imported the package installed in
|
| 45 |
+
# site-packages instead of the task checkout, so the unchanged checkout passed. Confirmed by the
|
| 46 |
+
# 2026-10-10 rerun (job 963978): with the repository root first on PYTHONPATH every reference scores 1
|
| 47 |
+
# and every no-op scores 0.
|
| 48 |
+
'ethereum_eth-utils_pr78': ('eth-utils', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 49 |
+
'ethereum_eth-utils_pr84': ('eth-utils', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 50 |
+
'hussein-awala_spark-on-k8s_pr1': ('spark-on-k8s', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 51 |
+
'hussein-awala_spark-on-k8s_pr11': ('spark-on-k8s', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 52 |
+
'hussein-awala_spark-on-k8s_pr12': ('spark-on-k8s', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 53 |
+
'hussein-awala_spark-on-k8s_pr13': ('spark-on-k8s', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 54 |
+
'joseph-roitman_pytest-snapshot_pr10': ('pytest-snapshot', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 55 |
+
'joseph-roitman_pytest-snapshot_pr13': ('pytest-snapshot', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 56 |
+
'joseph-roitman_pytest-snapshot_pr32': ('pytest-snapshot', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 57 |
+
'joseph-roitman_pytest-snapshot_pr34': ('pytest-snapshot', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 58 |
+
'joseph-roitman_pytest-snapshot_pr36': ('pytest-snapshot', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 59 |
+
'lasp_cdflib_pr38': ('cdflib', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 60 |
+
'lasp_cdflib_pr49': ('cdflib', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 61 |
+
'onnx_tensorflow-onnx_pr832': ('tensorflow-onnx', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 62 |
+
'onnx_tensorflow-onnx_pr839': ('tensorflow-onnx', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 63 |
+
'onnx_tensorflow-onnx_pr850': ('tensorflow-onnx', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 64 |
+
'onnx_tensorflow-onnx_pr867': ('tensorflow-onnx', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 65 |
+
'onnx_tensorflow-onnx_pr882': ('tensorflow-onnx', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 66 |
+
'onnx_tensorflow-onnx_pr949': ('tensorflow-onnx', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 67 |
+
'onnx_tensorflow-onnx_pr968': ('tensorflow-onnx', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 68 |
+
'onnx_tensorflow-onnx_pr974': ('tensorflow-onnx', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 69 |
+
'pytest-dev_pytest-bdd_pr335': ('pytest-bdd', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 70 |
+
'pytest-dev_pytest-bdd_pr398': ('pytest-bdd', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 71 |
+
'pytransitions_transitions_pr73': ('transitions', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 72 |
+
's4v4g3_otel-extensions-python_pr4': ('otel-extensions-python', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 73 |
+
'stephrdev_pytest-isort_pr40': ('pytest-isort', 'Import the package under test from the task checkout instead of the installed site-packages copy, which made the unchanged checkout score 1 under no-op.'),
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
# Tasks archived after the 2026-10-10 recheck (reference, no-op and environment evidence per task); see archived_tasks.json.
|
| 77 |
+
RECHECK_ARCHIVE = json.loads((HERE / 'archived_tasks.json').read_text()) if (HERE / 'archived_tasks.json').is_file() else {}
|
| 78 |
+
|
| 79 |
+
ARCHIVED_TASKS = {
|
| 80 |
+
**{f'matan1008_pykdebugparser_pr{pr}': {
|
| 81 |
+
'category': 'image-missing-test-dependency',
|
| 82 |
+
'reason': 'The task image lacks the construct package that the test modules import, so neither the reference nor the no-op run can collect a single test, even with the repository on the import path. Installing it at verification time would make the verifier depend on PyPI; archived until the image is fixed.'}
|
| 83 |
+
for pr in (5, 6)},
|
| 84 |
+
'biocommons_hgvs_pr699': {
|
| 85 |
+
'category': 'verifier-external-dependency',
|
| 86 |
+
'reason': 'The reference verifier requires a connection to the external UTA database at uta.biocommons.org:5432. The service timed out during validation, so test results depend on an unavailable external database. Archived at user request because this verifier dependency is not reliable.'},
|
| 87 |
+
'biocommons_hgvs_pr775': {
|
| 88 |
+
'category': 'verifier-external-dependency',
|
| 89 |
+
'reason': 'The reference verifier requires a connection to the external UTA database at uta.biocommons.org:5432. The service timed out during validation, so test results depend on an unavailable external database. Archived at user request because this verifier dependency is not reliable.'},
|
| 90 |
+
'kurtbrose_pyjks_pr19': {
|
| 91 |
+
'category': 'reference-solution-reward-zero',
|
| 92 |
+
'reason': 'Reference scores 0 because verifier baseline restoration deletes the new tests/expected/custom_entry_passwords.py helper while leaving its import in tests/expected/__init__.py. Pytest fails during collection before executing tests. This is a verifier preparation defect, not evidence of a broken reference implementation. Archived without repair at user request.'},
|
| 93 |
+
'turner-townsend_flask-pydantic-spec_pr78': {
|
| 94 |
+
'category': 'verifier-execution-error',
|
| 95 |
+
'reason': 'Verifier test patch omits tests/common.py defining DemoModelV1, causing no-op collection failure. Reference executes 38 passing tests but scores zero because expected unparameterized selectors do not match parameterized results. Archived without repair at user request.'},
|
| 96 |
+
'meerk40t_svgelements_pr24': {
|
| 97 |
+
'category': 'verifier-execution-error',
|
| 98 |
+
'reason': 'Verifier test patch deletes test/test_distance.py and moves tests to test/test_length.py, but selected test IDs still reference the deleted file. Reference and no-op both execute zero tests. Archived without repair at user request.'},
|
| 99 |
+
}
|
| 100 |
+
ARCHIVED_TASKS = {**RECHECK_ARCHIVE, **ARCHIVED_TASKS}
|
| 101 |
+
|
| 102 |
+
# Reference failures from the 2026-10-08 full run whose gold patch adds or modifies test-support files that the
|
| 103 |
+
# verifier reset discards (2026-10-10 static scan of gold.patch against f2p.patch). The restoration repair applies
|
| 104 |
+
# only to these tasks and to TEST_FIXTURE_REPAIRS; previously validated tasks keep their verifiers unchanged.
|
| 105 |
+
FIXTURE_RESTORATION_TASKS = frozenset({
|
| 106 |
+
'appium_python-client_pr531',
|
| 107 |
+
'ariebovenberg_slotscheck_pr93',
|
| 108 |
+
'audreyr_cookiecutter_pr1419',
|
| 109 |
+
'audreyr_cookiecutter_pr1468',
|
| 110 |
+
'audreyr_cookiecutter_pr1874',
|
| 111 |
+
'audreyr_cookiecutter_pr1981',
|
| 112 |
+
'audreyr_cookiecutter_pr1995',
|
| 113 |
+
'audreyr_cookiecutter_pr839',
|
| 114 |
+
'bottlepy_bottle_pr787',
|
| 115 |
+
'burnash_gspread_pr1010',
|
| 116 |
+
'burnash_gspread_pr1012',
|
| 117 |
+
'burnash_gspread_pr1013',
|
| 118 |
+
'burnash_gspread_pr1021',
|
| 119 |
+
'burnash_gspread_pr1030',
|
| 120 |
+
'burnash_gspread_pr1063',
|
| 121 |
+
'burnash_gspread_pr1095',
|
| 122 |
+
'burnash_gspread_pr1138',
|
| 123 |
+
'burnash_gspread_pr1207',
|
| 124 |
+
'burnash_gspread_pr1215',
|
| 125 |
+
'burnash_gspread_pr1225',
|
| 126 |
+
'burnash_gspread_pr1233',
|
| 127 |
+
'burnash_gspread_pr1299',
|
| 128 |
+
'burnash_gspread_pr1305',
|
| 129 |
+
'burnash_gspread_pr1308',
|
| 130 |
+
'burnash_gspread_pr1364',
|
| 131 |
+
'burnash_gspread_pr1392',
|
| 132 |
+
'burnash_gspread_pr1402',
|
| 133 |
+
'burnash_gspread_pr1404',
|
| 134 |
+
'burnash_gspread_pr1417',
|
| 135 |
+
'burnash_gspread_pr1498',
|
| 136 |
+
'burnash_gspread_pr945',
|
| 137 |
+
'businho_pytest-ruff_pr25',
|
| 138 |
+
'clemense_yourdfpy_pr4',
|
| 139 |
+
'clld_clldutils_pr93',
|
| 140 |
+
'cloudtools_troposphere_pr2069',
|
| 141 |
+
'cookiecutter_cookiecutter_pr1200',
|
| 142 |
+
'cookiecutter_cookiecutter_pr1468',
|
| 143 |
+
'cookiecutter_cookiecutter_pr1493',
|
| 144 |
+
'cookiecutter_cookiecutter_pr1981',
|
| 145 |
+
'cookiecutter_cookiecutter_pr1995',
|
| 146 |
+
'dantebben_nox-uv_pr4',
|
| 147 |
+
'dapr_python-sdk_pr89',
|
| 148 |
+
'drgarcia1986_simple-settings_pr11',
|
| 149 |
+
'drgarcia1986_simple-settings_pr8',
|
| 150 |
+
'eerkunt_terraform-compliance_pr352',
|
| 151 |
+
'eerkunt_terraform-compliance_pr448',
|
| 152 |
+
'eerkunt_terraform-compliance_pr563',
|
| 153 |
+
'executablebooks_myst-nb_pr604',
|
| 154 |
+
'executablebooks_sphinx-design_pr13',
|
| 155 |
+
'fonttools_fonttools_pr1970',
|
| 156 |
+
'fonttools_fonttools_pr2080',
|
| 157 |
+
'fonttools_fonttools_pr3912',
|
| 158 |
+
'fortran-lang_fortls_pr49',
|
| 159 |
+
'globus_globus-sdk-python_pr1179',
|
| 160 |
+
'globus_globus-sdk-python_pr903',
|
| 161 |
+
'google_flatbuffers_pr5631',
|
| 162 |
+
'googleapis_proto-plus-python_pr112',
|
| 163 |
+
'googleapis_proto-plus-python_pr118',
|
| 164 |
+
'googlefonts_ufo2ft_pr866',
|
| 165 |
+
'googlefonts_ufo2ft_pr870',
|
| 166 |
+
'gorakhargosh_watchdog_pr968',
|
| 167 |
+
'hadialqattan_pycln_pr120',
|
| 168 |
+
'hakancelikdev_unimport_pr289',
|
| 169 |
+
'hhatto_autopep8_pr288',
|
| 170 |
+
'iterative_gto_pr148',
|
| 171 |
+
'iterative_gto_pr309',
|
| 172 |
+
'jackdewinter_pymarkdown_pr1413',
|
| 173 |
+
'jackdewinter_pymarkdown_pr1414',
|
| 174 |
+
'jackdewinter_pymarkdown_pr279',
|
| 175 |
+
'jackdewinter_pymarkdown_pr280',
|
| 176 |
+
'jackdewinter_pymarkdown_pr455',
|
| 177 |
+
'jackdewinter_pymarkdown_pr559',
|
| 178 |
+
'jackdewinter_pymarkdown_pr636',
|
| 179 |
+
'jackdewinter_pymarkdown_pr80',
|
| 180 |
+
'jsh9_pydoclint_pr155',
|
| 181 |
+
'jsh9_pydoclint_pr188',
|
| 182 |
+
'jsh9_pydoclint_pr192',
|
| 183 |
+
'jsh9_pydoclint_pr199',
|
| 184 |
+
'jsh9_pydoclint_pr205',
|
| 185 |
+
'jsh9_pydoclint_pr206',
|
| 186 |
+
'jsh9_pydoclint_pr207',
|
| 187 |
+
'jsh9_pydoclint_pr225',
|
| 188 |
+
'jsh9_pydoclint_pr227',
|
| 189 |
+
'jsh9_pydoclint_pr230',
|
| 190 |
+
'jsh9_pydoclint_pr259',
|
| 191 |
+
'jsh9_pydoclint_pr260',
|
| 192 |
+
'jsh9_pydoclint_pr271',
|
| 193 |
+
'jsh9_pydoclint_pr277',
|
| 194 |
+
'jxtech_wechatpy_pr328',
|
| 195 |
+
'jxtech_wechatpy_pr333',
|
| 196 |
+
'jxtech_wechatpy_pr66',
|
| 197 |
+
'jxtech_wechatpy_pr69',
|
| 198 |
+
'jxtech_wechatpy_pr74',
|
| 199 |
+
'jxtech_wechatpy_pr94',
|
| 200 |
+
'keboola_python-component_pr63',
|
| 201 |
+
'localstack_plux_pr28',
|
| 202 |
+
'ludeeus_awesomeversion_pr290',
|
| 203 |
+
'mesonbuild_meson-python_pr177',
|
| 204 |
+
'mesonbuild_meson-python_pr467',
|
| 205 |
+
'mesonbuild_meson-python_pr569',
|
| 206 |
+
'mesonbuild_meson-python_pr96',
|
| 207 |
+
'mitmproxy_mitmproxy_pr4860',
|
| 208 |
+
'neovim_python-client_pr534',
|
| 209 |
+
'olofk_fusesoc_pr711',
|
| 210 |
+
'p1c2u_jsonschema-spec_pr6',
|
| 211 |
+
'pdm-project_pdm-backend_pr105',
|
| 212 |
+
'pepkit_peppy_pr489',
|
| 213 |
+
'pepkit_peppy_pr495',
|
| 214 |
+
'praw-dev_praw_pr563',
|
| 215 |
+
'praw-dev_praw_pr575',
|
| 216 |
+
'praw-dev_praw_pr602',
|
| 217 |
+
'praw-dev_praw_pr612',
|
| 218 |
+
'praw-dev_prawcore_pr112',
|
| 219 |
+
'praw-dev_prawcore_pr116',
|
| 220 |
+
'praw-dev_prawcore_pr119',
|
| 221 |
+
'praw-dev_prawcore_pr13',
|
| 222 |
+
'praw-dev_prawcore_pr15',
|
| 223 |
+
'praw-dev_prawcore_pr206',
|
| 224 |
+
'praw-dev_prawcore_pr25',
|
| 225 |
+
'praw-dev_prawcore_pr26',
|
| 226 |
+
'praw-dev_prawcore_pr32',
|
| 227 |
+
'praw-dev_prawcore_pr4',
|
| 228 |
+
'praw-dev_prawcore_pr42',
|
| 229 |
+
'praw-dev_prawcore_pr57',
|
| 230 |
+
'praw-dev_prawcore_pr59',
|
| 231 |
+
'praw-dev_prawcore_pr61',
|
| 232 |
+
'praw-dev_prawcore_pr62',
|
| 233 |
+
'praw-dev_prawcore_pr66',
|
| 234 |
+
'pydantic_bump-pydantic_pr90',
|
| 235 |
+
'pyinfra-dev_pyinfra_pr192',
|
| 236 |
+
'pyinfra-dev_pyinfra_pr194',
|
| 237 |
+
'pyinfra-dev_pyinfra_pr196',
|
| 238 |
+
'pypa_pyproject-metadata_pr206',
|
| 239 |
+
'pypa_pyproject-metadata_pr232',
|
| 240 |
+
'pypa_twine_pr83',
|
| 241 |
+
'python-distro_distro_pr106',
|
| 242 |
+
'python-distro_distro_pr247',
|
| 243 |
+
'python-distro_distro_pr30',
|
| 244 |
+
'python-poetry_poetry-core_pr101',
|
| 245 |
+
'python-poetry_poetry-core_pr108',
|
| 246 |
+
'python-poetry_poetry-core_pr221',
|
| 247 |
+
'python-poetry_poetry-core_pr228',
|
| 248 |
+
'python-poetry_poetry-core_pr368',
|
| 249 |
+
'python-poetry_poetry-core_pr462',
|
| 250 |
+
'python-poetry_poetry-core_pr469',
|
| 251 |
+
'python-poetry_poetry-core_pr57',
|
| 252 |
+
'python-poetry_poetry-core_pr578',
|
| 253 |
+
'python-poetry_poetry-core_pr620',
|
| 254 |
+
'python-poetry_poetry-core_pr629',
|
| 255 |
+
'python-poetry_poetry-core_pr634',
|
| 256 |
+
'python-poetry_poetry-core_pr661',
|
| 257 |
+
'python-poetry_poetry-core_pr666',
|
| 258 |
+
'python-poetry_poetry-core_pr675',
|
| 259 |
+
'python-poetry_poetry-core_pr710',
|
| 260 |
+
'python-poetry_poetry-core_pr734',
|
| 261 |
+
'python-poetry_poetry-core_pr81',
|
| 262 |
+
'python-poetry_poetry-core_pr830',
|
| 263 |
+
'python-poetry_poetry-core_pr874',
|
| 264 |
+
'python-trio_flake8-async_pr100',
|
| 265 |
+
'python-trio_flake8-async_pr22',
|
| 266 |
+
'python-trio_flake8-async_pr34',
|
| 267 |
+
'python-trio_flake8-async_pr98',
|
| 268 |
+
'radish-bdd_radish_pr447',
|
| 269 |
+
'ros-infrastructure_rosdep_pr789',
|
| 270 |
+
'sigmavirus24_github3.py_pr1199',
|
| 271 |
+
'sphinx-contrib_confluencebuilder_pr1044',
|
| 272 |
+
'sphinx-contrib_confluencebuilder_pr769',
|
| 273 |
+
'sphinx-doc_sphinx-argparse_pr49',
|
| 274 |
+
'spulec_freezegun_pr119',
|
| 275 |
+
'tconbeer_sqlfmt_pr16',
|
| 276 |
+
'tconbeer_sqlfmt_pr221',
|
| 277 |
+
'tconbeer_sqlfmt_pr25',
|
| 278 |
+
'tefra_xsdata_pr653',
|
| 279 |
+
'tlambert03_mkdocs-api-autonav_pr12',
|
| 280 |
+
'ultrabug_mkdocs-static-i18n_pr183',
|
| 281 |
+
})
|
| 282 |
+
|
| 283 |
+
# Fixture paths confirmed from failure logs in the 2026-10-09 audit; the repair below must still restore each of them.
|
| 284 |
+
TEST_FIXTURE_REPAIRS = {
|
| 285 |
+
'andialbrecht_sqlparse_pr317': ('tests/files/encoding_utf8.sql',),
|
| 286 |
+
'audreyr_cookiecutter_pr1692': ('tests/test-generate-context/nested_dict.json',),
|
| 287 |
+
'audreyr_cookiecutter_pr2010': ('tests/test-generate-context/nested_dict_additional.json',),
|
| 288 |
+
'awslabs_serverless-application-model_pr1756': ('tests/translator/input/http_api_lambda_auth.yaml',),
|
| 289 |
+
'awslabs_serverless-application-model_pr2242': ('tests/translator/input/function_with_event_filtering.yaml',),
|
| 290 |
+
'awslabs_serverless-application-model_pr2261': ('tests/translator/input/http_api_multiple_authorizers.yaml',),
|
| 291 |
+
'beetbox_beets_pr3641': ('test/rsrc/lyrics/geniuscom/Wutangclancreamlyrics.txt',),
|
| 292 |
+
'beetbox_beets_pr5352': ('test/rsrc/lyrics/geniuscom/2pacalleyezonmelyrics.txt',),
|
| 293 |
+
'best-doctor_flake8-class-attributes-order_pr13': ('tests/test_files/special_method.py',),
|
| 294 |
+
'best-doctor_flake8-functions_pr5': ('tests/test_files/file_pure_function.py',),
|
| 295 |
+
'bufbuild_protovalidate-python_pr308': ('tests/testdata/string_ext_supplemental.textproto',),
|
| 296 |
+
'buriy_python-readability_pr190': ('tests/samples/summary-keep-all-images.sample.html',),
|
| 297 |
+
'butler54_mdformat-frontmatter_pr5': ('tests/simple-md-test.md',),
|
| 298 |
+
'c4deszes_ldfparser_pr106': ('tests/ldf/ldf_with_sporadic_frames.ldf',),
|
| 299 |
+
'c4deszes_ldfparser_pr116': ('tests/ldf/j2602_1.ldf',),
|
| 300 |
+
'c4deszes_ldfparser_pr80': ('tests/ldf/lin_schedules.ldf',),
|
| 301 |
+
'canonical_operator_pr800': ('test/charms/test_smoke/charmcraft.yaml',),
|
| 302 |
+
'censys_censys-python_pr312': ('tests/cli/test.xml',),
|
| 303 |
+
'cookiecutter_cookiecutter_pr1692': ('tests/test-generate-context/nested_dict.json',),
|
| 304 |
+
'cookiecutter_cookiecutter_pr2010': ('tests/test-generate-context/nested_dict_additional.json',),
|
| 305 |
+
'cthoyt_pystow_pr17': ('tests/resources/test_1.tsv',),
|
| 306 |
+
'demisto_demisto-sdk_pr102': ('tests/test_files/indicator-field-exact-scheme.json',),
|
| 307 |
+
'django-crispy-forms_crispy-bootstrap5_pr151': ('tests/results/modal.html',),
|
| 308 |
+
'django-crispy-forms_crispy-bootstrap5_pr44': ('tests/results/field_with_buttons.html',),
|
| 309 |
+
'django-crispy-forms_crispy-bootstrap5_pr81': ('tests/results/alert.html',),
|
| 310 |
+
'drgarcia1986_simple-settings_pr19': ('tests/samples/simple_yaml_file.yaml',),
|
| 311 |
+
'fastavro_fastavro_pr482': ('tests/load_schema_test_3/A.avsc',),
|
| 312 |
+
'fastavro_fastavro_pr491': ('tests/load_schema_test_7/A.avsc',),
|
| 313 |
+
'fastavro_fastavro_pr492': ('tests/load_schema_test_8/A.avsc',),
|
| 314 |
+
'fastavro_fastavro_pr497': ('tests/load_schema_test_12/com/namespace/E.avsc',),
|
| 315 |
+
'fonttools_fonttools_pr1460': ('Tests/feaLib/data/bug1459.fea',),
|
| 316 |
+
'fonttools_fonttools_pr1669': ('Tests/cffLib/data/TestCFF2Widths.ttx',),
|
| 317 |
+
'fonttools_fonttools_pr1752': ('Tests/varLib/data/SingleMaster.designspace',),
|
| 318 |
+
'fonttools_fonttools_pr1827': ('Tests/varLib/data/VarLibLocationTest.designspace',),
|
| 319 |
+
'fonttools_fonttools_pr1876': ('Tests/feaLib/data/GSUB_error.fea',),
|
| 320 |
+
'fonttools_fonttools_pr1878': ('Tests/feaLib/data/aalt_chain_contextual_subst.fea',),
|
| 321 |
+
'fonttools_fonttools_pr1905': ('Tests/feaLib/data/MultipleLookupsPerGlyph2.fea',),
|
| 322 |
+
'fonttools_fonttools_pr1944': ('Tests/subset/data/TestContextSubstFormat3.ttx',),
|
| 323 |
+
'fonttools_fonttools_pr1957': ('Tests/varLib/data/FeatureVarsWholeRange.designspace',),
|
| 324 |
+
'fonttools_fonttools_pr1973': ('Tests/feaLib/data/include/test.ufo/features.fea',),
|
| 325 |
+
'fonttools_fonttools_pr2112': ('Tests/subset/data/layout_scripts.ttx',),
|
| 326 |
+
'fonttools_fonttools_pr2161': ('Tests/ttLib/data/woff2_overlap_offcurve_in.ttx',),
|
| 327 |
+
'fonttools_fonttools_pr2170': ('Tests/feaLib/data/delete_glyph.fea',),
|
| 328 |
+
'fonttools_fonttools_pr2277': ('Tests/feaLib/data/bug2276.fea',),
|
| 329 |
+
'fonttools_fonttools_pr2313': ('Tests/subset/data/GPOS_SinglePos_no_value_issue_2312.ttx',),
|
| 330 |
+
'fonttools_fonttools_pr2432': ('Tests/feaLib/data/variable_scalar_anchor.fea',),
|
| 331 |
+
'fonttools_fonttools_pr2447': ('Tests/merge/data/CFFFont1.ttx',),
|
| 332 |
+
'fonttools_fonttools_pr2462': ('Tests/subset/data/BungeeColor-Regular.ttx',),
|
| 333 |
+
'fonttools_fonttools_pr2555': ('Tests/varLib/instancer/data/SinglePos.ttx',),
|
| 334 |
+
'fonttools_fonttools_pr2660': ('Tests/varLib/data/TestVariableCOLR.designspace',),
|
| 335 |
+
'fonttools_fonttools_pr2673': ('Tests/varLib/instancer/data/STATInstancerTest.ttx',),
|
| 336 |
+
'fonttools_fonttools_pr2684': ('Tests/designspaceLib/data/DS5BreakTest.designspace',),
|
| 337 |
+
'fonttools_fonttools_pr2776': ('Tests/feaLib/data/variable_bug2772.fea',),
|
| 338 |
+
'fonttools_fonttools_pr2789': ('Tests/ttLib/data/TestTTF_normalizeLocation.ttx',),
|
| 339 |
+
'fonttools_fonttools_pr3024': ('Tests/varLib/data/master_no_overwrite_stat/Test-CondensedThin.ttx',),
|
| 340 |
+
'fonttools_fonttools_pr3027': ('Tests/ttLib/tables/data/COLRv1-clip-boxes-glyf.ttx',),
|
| 341 |
+
'fonttools_fonttools_pr3034': ('Tests/varLib/data/test_results/InterpolateLayoutGPOS_7_diff.ttx',),
|
| 342 |
+
'fonttools_fonttools_pr3075': ('Tests/varLib/data/SparseMasters_ufo.designspace',),
|
| 343 |
+
'fonttools_fonttools_pr3092': ('Tests/ttLib/tables/data/_g_l_y_f_instructions.ttx',),
|
| 344 |
+
'fonttools_fonttools_pr3115': ('Tests/ttx/data/roundtrip_DSIG_split_at_XML_parse_buffer_size.ttx',),
|
| 345 |
+
'fonttools_fonttools_pr3305': ('Tests/subset/data/NotoSansCJKjp-Regular.subset.ttx',),
|
| 346 |
+
'fonttools_fonttools_pr3330': ('Tests/feaLib/data/variable_mark_anchor.fea',),
|
| 347 |
+
'fonttools_fonttools_pr3506': ('Tests/varLib/instancer/data/CFF2Instancer-VF-1.ttx',),
|
| 348 |
+
'fonttools_fonttools_pr3520': ('Tests/feaLib/data/duplicate_lookup_reference.fea',),
|
| 349 |
+
'fonttools_fonttools_pr3559': ('Tests/feaLib/data/contextual_inline_multi_sub_format_2.fea',),
|
| 350 |
+
'fonttools_fonttools_pr3672': ('Tests/subset/data/cmap14_font1.ttx',),
|
| 351 |
+
'fonttools_fonttools_pr3726': ('Tests/feaLib/data/contextual_inline_format_4.fea',),
|
| 352 |
+
'fonttools_fonttools_pr3783': ('Tests/feaLib/data/spec9a2.fea',),
|
| 353 |
+
'fonttools_fonttools_pr3800': ('Tests/feaLib/data/CursivePosSubtable.fea',),
|
| 354 |
+
'fonttools_fonttools_pr3803': ('Tests/feaLib/data/single_pos_NULL.fea',),
|
| 355 |
+
'fonttools_fonttools_pr3804': ('Tests/feaLib/data/class_pair_pos_duplicates.fea',),
|
| 356 |
+
'fonttools_fonttools_pr3811': ('Tests/feaLib/data/spec8a_2.fea',),
|
| 357 |
+
'fonttools_fonttools_pr3838': ('Tests/varLib/data/test_results/FeatureVars_latn_dflt_var.ttx',),
|
| 358 |
+
'fonttools_fonttools_pr3849': ('Tests/feaLib/data/bug3846_1.fea',),
|
| 359 |
+
'fonttools_fonttools_pr3853': ('Tests/subset/data/PreserveSillyNamesTest.ttx',),
|
| 360 |
+
'fonttools_fonttools_pr3874': ('Tests/feaLib/data/combo_mult_and_lig_sub.fea',),
|
| 361 |
+
'fonttools_fonttools_pr3895': ('Tests/feaLib/data/identical_feature_lookups.fea',),
|
| 362 |
+
'frictionlessdata_frictionless-py_pr1052': ('tests/fixtures/output-markdown/package.md',),
|
| 363 |
+
'goodmami_wn_pr264': ('tests/data/mini-lmf-1.4.xml',),
|
| 364 |
+
'google_flatbuffers_pr6217': ('tests/optional_scalars/ScalarStuff.cs',),
|
| 365 |
+
'googlefonts_ufo2ft_pr289': ('tests/data/TestFont-NoOptimize-CFF.ttx',),
|
| 366 |
+
'googlefonts_ufo2ft_pr318': ('tests/data/IncompatibleMasters/NewFont-Regular.ufo/metainfo.plist',),
|
| 367 |
+
'googlefonts_ufo2ft_pr335': ('tests/data/Instructions.ufo/metainfo.plist',),
|
| 368 |
+
'googlefonts_ufo2ft_pr359': ('tests/data/ColorTest.ufo/metainfo.plist',),
|
| 369 |
+
'googlefonts_ufo2ft_pr816': ('tests/data/TestVarFont.designspace',),
|
| 370 |
+
'googlefonts_ufo2ft_pr817': ('tests/data/OTestFont.designspace',),
|
| 371 |
+
'googlefonts_ufo2ft_pr869': ('tests/data/ContextualAnchorsTest-Regular.ufo/metainfo.plist',),
|
| 372 |
+
'googlefonts_ufo2ft_pr909': ('tests/data/Bug908.ufo/metainfo.plist',),
|
| 373 |
+
'googlefonts_ufo2ft_pr942': ('tests/data/BagelFatOne-Regular.designspace',),
|
| 374 |
+
'goose3_goose3_pr157': ('tests/data/publishdate/test_publish_date_unix_milliseconds.json',),
|
| 375 |
+
'goose3_goose3_pr180': ('tests/data/title/test_title_sitename_list.json',),
|
| 376 |
+
'goose3_goose3_pr25': ('tests/data/images/test_base64_image.json',),
|
| 377 |
+
'goose3_goose3_pr54': ('tests/data/metas/test_meta_encoding.json',),
|
| 378 |
+
'goose3_goose3_pr60': ('tests/data/title/test_title_splitter.json',),
|
| 379 |
+
'goose3_goose3_pr64': ('tests/data/opengraph/test_opengraph_type.json',),
|
| 380 |
+
'goose3_goose3_pr66': ('tests/data/content/test_retry_top_node.json',),
|
| 381 |
+
'goose3_goose3_pr90': ('tests/data/opengraph/test_opengraph_types_mult.json',),
|
| 382 |
+
'gruebel_pycep_pr151': ('tests/test_function/examples/array/flatten/result.json',),
|
| 383 |
+
'gruebel_pycep_pr181': ('tests/examples/basic/06-type/result.json',),
|
| 384 |
+
'gruebel_pycep_pr320': ('tests/examples/complex/10-extension/result.json',),
|
| 385 |
+
'gruebel_pycep_pr321': ('tests/examples/complex/11-typed-var/result.json',),
|
| 386 |
+
'gruebel_pycep_pr322': ('tests/examples/complex/12-nullable-type/result.json',),
|
| 387 |
+
'gruebel_pycep_pr323': ('tests/examples/complex/13-import/result.json',),
|
| 388 |
+
'gruebel_pycep_pr326': ('tests/examples/complex/14-type-decorator/result.json',),
|
| 389 |
+
'gruebel_pycep_pr43': ('tests/test_function/examples/date/date_time_to_epoch/result.json',),
|
| 390 |
+
'gruebel_pycep_pr52': ('tests/test_function/examples/file/load_json_content/result.json',),
|
| 391 |
+
'home-assistant-libs_python-supervisor-client_pr152': ('tests/fixtures/host_disk_usage.json',),
|
| 392 |
+
'iterative_gto_pr269': ('tests/resources/sample_remote_repo_expected_registry.json',),
|
| 393 |
+
'jackdewinter_pymarkdown_pr1050': ('test/resources/rules/md010/issue-1015.md',),
|
| 394 |
+
'jacksmith15_json-ref-dict_pr13': ('tests/schemas/slash-key.yaml',),
|
| 395 |
+
'jacksmith15_json-ref-dict_pr4': ('tests/schemas/bad-circular.yaml',),
|
| 396 |
+
'jacksmith15_json-ref-dict_pr9': ('tests/schemas/with-tabs.json',),
|
| 397 |
+
'jazzband_icalevents_pr133': ('test/test_data/google_2024.ics',),
|
| 398 |
+
'jazzband_icalevents_pr140': ('test/test_data/regression_offset_native.ics',),
|
| 399 |
+
'jazzband_icalevents_pr79': ('test/test_data/google_tz.ics',),
|
| 400 |
+
'jazzband_icalevents_pr80': ('test/test_data/cest.ics',),
|
| 401 |
+
'jazzband_icalevents_pr88': ('test/test_data/rrule_until_only_date.ics',),
|
| 402 |
+
'jazzband_icalevents_pr91': ('test/test_data/empty.ics',),
|
| 403 |
+
'jazzband_icalevents_pr92': ('test/test_data/status_and_url.ics',),
|
| 404 |
+
'jazzband_icalevents_pr95': ('test/test_data/multi_attendee_response.ics',),
|
| 405 |
+
'jazzband_icalevents_pr97': ('test/test_data/multi_exdate_same_line_ms.ics',),
|
| 406 |
+
'jazzband_tablib_pr534': ('tests/files/issue_524.yaml',),
|
| 407 |
+
'joshtemple_lkml_pr10': ('tests/resources/duplicate_top_level_keys.view.lkml',),
|
| 408 |
+
'jsh9_pydoclint_pr123': ('tests/data/edge_cases/09_double_quotes_in_Literal/google.py',),
|
| 409 |
+
'jsh9_pydoclint_pr129': ('tests/data/edge_cases/10_absent_return_anno/numpy.py',),
|
| 410 |
+
'jsh9_pydoclint_pr130': ('tests/data/google/class_attributes/cases.py',),
|
| 411 |
+
'jsh9_pydoclint_pr153': ('tests/data/edge_cases/12_property_methods_as_class_attr/google.py',),
|
| 412 |
+
'jsh9_pydoclint_pr86': ('tests/data/edge_cases/06_no_type_hints_in_doc/numpy.py',),
|
| 413 |
+
'jsh9_pydoclint_pr89': ('tests/data/edge_cases/07_underscore_args/google.py',),
|
| 414 |
+
'jxtech_wechatpy_pr381': ('tests/fixtures/changeopenid.json',),
|
| 415 |
+
'jxtech_wechatpy_pr412': ('tests/fixtures/sns_jscode2session.json',),
|
| 416 |
+
'jxtech_wechatpy_pr456': ('tests/fixtures/enterprise/user_list.json',),
|
| 417 |
+
'lovesegfault_beautysh_pr36': ('tests/indent_test1_raw.sh',),
|
| 418 |
+
'marshallward_f90nml_pr120': ('tests/long_string.nml',),
|
| 419 |
+
'marshallward_f90nml_pr180': ('tests/null_target_end_comma.nml',),
|
| 420 |
+
'mattijn_topojson_pr141': ('tests/files_topojson/gm.topo.json',),
|
| 421 |
+
'maxb2_typer-config_pr15': ('tests/config.env',),
|
| 422 |
+
'maxb2_typer-config_pr17': ('tests/config.ini',),
|
| 423 |
+
'meeb_whoisit_pr7': ('tests/data_rdap_response_domain3.json',),
|
| 424 |
+
'meeb_whoisit_pr8': ('tests/data_rdap_response_ip_v4_2.json',),
|
| 425 |
+
'mesonbuild_meson-python_pr219': ('tests/packages/unknown-user-args-top-level/pyproject.toml',),
|
| 426 |
+
'mesonbuild_meson-python_pr377': ('tests/packages/purelib-platlib-split/pyproject.toml',),
|
| 427 |
+
'mesonbuild_meson-python_pr455': ('tests/packages/missing-meson-version/pyproject.toml',),
|
| 428 |
+
'mesonbuild_meson-python_pr71': ('tests/packages/unsupported-python-version/pyproject.toml',),
|
| 429 |
+
'mhe_pynrrd_pr40': ('tests/test1d_ascii.nrrd',),
|
| 430 |
+
'mirumee_ariadne-codegen_pr106': ('tests/main/graphql_schemas/example/pyproject.toml',),
|
| 431 |
+
'mirumee_ariadne-codegen_pr264': ('tests/main/graphql_schemas/example/pyproject-schema-graphql.toml',),
|
| 432 |
+
'ncclient_ncclient_pr299': ('test/unit/ssh_config',),
|
| 433 |
+
'ncclient_ncclient_pr628': ('test/unit/transport/certs/id_ed25519_test.pub',),
|
| 434 |
+
'nicklambourne_slackblocks_pr32': ('test/samples/blocks/section_block_empty_text_field_value.json',),
|
| 435 |
+
'nicklambourne_slackblocks_pr49': ('test/samples/messages/message_with_optional_arguments.json',),
|
| 436 |
+
'olofk_fusesoc_pr645': ('tests/capi2_cores/parser/inheritance.core',),
|
| 437 |
+
'pappasam_toml-sort_pr91': ('tests/examples/gradle-version-catalog.toml',),
|
| 438 |
+
'pdm-project_pdm-backend_pr14': ('tests/fixtures/projects/demo-package-include-old/pyproject.toml',),
|
| 439 |
+
'pdm-project_pdm-backend_pr20': ('tests/fixtures/projects/demo-package-with-deep-path/pyproject.toml',),
|
| 440 |
+
'pdm-project_pdm-backend_pr21': ('tests/fixtures/projects/demo-cextension/pyproject.toml',),
|
| 441 |
+
'pdm-project_pdm-backend_pr49': ('tests/fixtures/projects/demo-no-name-nor-version/pyproject.toml',),
|
| 442 |
+
'pdm-project_pdm-backend_pr5': ('tests/fixtures/projects/demo-legacy/pyproject.toml',),
|
| 443 |
+
'pdm-project_pdm-backend_pr65': ('tests/fixtures/projects/demo-purelib-with-build/pyproject.toml',),
|
| 444 |
+
'pdm-project_pdm-backend_pr8': ('tests/fixtures/projects/demo-explicit-package-dir/pyproject.toml',),
|
| 445 |
+
'python-poetry_poetry-core_pr118': ('tests/fixtures/with_readme_files/README-1.rst',),
|
| 446 |
+
'python-poetry_poetry-core_pr248': ('tests/fixtures/with_readme_files/README-1.rst',),
|
| 447 |
+
'radish-bdd_radish_pr457': ('tests/output/unix/filter-when-using-tags-with-args.txt',),
|
| 448 |
+
'salesforce_cloudsplaining_pr90': ('test/files/shared/test_exclusions_for_service_roles_expected.json',),
|
| 449 |
+
'sayanarijit_expandvars_pr18': ('tests/data/foo.txt',),
|
| 450 |
+
'snowflakedb_snowflake-cli_pr505': ('tests/test_data/projects/snowpark_procedures/snowflake.yml',),
|
| 451 |
+
'spdx_tools-python_pr236': ('tests/data/formats/SPDXSBOMExample.tag',),
|
| 452 |
+
'stac-utils_stac-pydantic_pr108': ('tests/example_stac/example-item_geometry-null.json',),
|
| 453 |
+
'stac-utils_stac-pydantic_pr81': ('tests/example_stac/example-collection-list.json',),
|
| 454 |
+
'tconbeer_sqlfmt_pr126': ('tests/data/unformatted/110_other_identifiers.sql',),
|
| 455 |
+
'tconbeer_sqlfmt_pr127': ('tests/data/unformatted/111_chained_boolean_between.sql',),
|
| 456 |
+
'tconbeer_sqlfmt_pr143': ('tests/data/unformatted/201_basic_snapshot.sql',),
|
| 457 |
+
'tconbeer_sqlfmt_pr146': ('tests/data/preformatted/301_multiline_jinjafmt.sql',),
|
| 458 |
+
'tconbeer_sqlfmt_pr21': ('tests/data/unit_tests/test_parser/test_multiline_wrapping.sql',),
|
| 459 |
+
'tconbeer_sqlfmt_pr210': ('tests/data/unformatted/116_chained_booleans.sql',),
|
| 460 |
+
'tconbeer_sqlfmt_pr216': ('tests/data/unformatted/213_gitlab_fct_sales_funnel_target.sql',),
|
| 461 |
+
'tconbeer_sqlfmt_pr228': ('tests/data/unformatted/118_within_group.sql',),
|
| 462 |
+
'tconbeer_sqlfmt_pr233': ('tests/data/unformatted/119_psycopg_placeholders.sql',),
|
| 463 |
+
'tconbeer_sqlfmt_pr238': ('tests/data/unformatted/120_array_literals.sql',),
|
| 464 |
+
'tconbeer_sqlfmt_pr47': ('tests/data/unit_tests/test_splitter/test_comment_split_impact_on_open_brackets.sql',),
|
| 465 |
+
'tilezen_mapbox-vector-tile_pr70': ('tests/error_nested_multipolygon.wkt',),
|
| 466 |
+
'twitterdev_twitter-python-ads-sdk_pr212': ('tests/fixtures/promoted_tweets_attach.json',),
|
| 467 |
+
'valohai_valohai-yaml_pr118': ('tests/warning_examples/override-with-extra-fields-warning.yaml',),
|
| 468 |
+
'valohai_valohai-yaml_pr94': ('tests/error_examples/invalid-indentation-with-valid-YAML.yaml',),
|
| 469 |
+
'wbond_asn1crypto_pr79': ('tests/fixtures/ocsp-with-pkup.pem',),
|
| 470 |
+
'xmunoz_sodapy_pr17': ('tests/test_data/successblobres.txt',),
|
| 471 |
+
'xmunoz_sodapy_pr23': ('tests/test_data/update_song_metadata.txt',),
|
| 472 |
+
'yu-iskw_dbt-artifacts-parser_pr19': ('tests/resources/v7/jaffle_shop/manifest.json',),
|
| 473 |
+
'zapier_email-reply-parser_pr14': ('test/emails/email_headers_no_delimiter.txt',),
|
| 474 |
+
'zapier_email-reply-parser_pr31': ('test/emails/email_2_3.txt',),
|
| 475 |
+
'zheller_flake8-quotes_pr52': ('test/data/multiline_string.py',),
|
| 476 |
+
'zheller_flake8-quotes_pr78': ('test/data/doubles_escaped.py',),
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
NETWORK_TIMEOUT_GROUPS = {
|
| 480 |
+
'swagger-api_swagger-codegen': ((2765, 2796, 2801, 2831, 2863, 2878, 2899, 2929, 2987, 3015, 3031, 3034, 3075, 3090, 3126, 3130), 'public Petstore API'),
|
| 481 |
+
'elastic_elastic-transport-python': ((26, 55, 127), 'httpbin.org test service'),
|
| 482 |
+
'developmentseed_rio-stac': ((65, 71), 'remote STAC schemas'),
|
| 483 |
+
'richardkiss_pycoin': ((392, 400), 'public blockchain transaction services'),
|
| 484 |
+
}
|
| 485 |
+
for _repo, (_prs, _dependency) in NETWORK_TIMEOUT_GROUPS.items():
|
| 486 |
+
for _pr in _prs:
|
| 487 |
+
ARCHIVED_TASKS[f'{_repo}_pr{_pr}'] = {
|
| 488 |
+
'category': 'verifier-network-dependency',
|
| 489 |
+
'reason': f'Original reference and no-op verifiers hit the 1800-second limit. Diagnostics on a representative task from this repository confirmed blocking access to {_dependency}. Archived at user request as part of this network-dependent timeout group; this task was not individually diagnosed unless included in the diagnostic sample.'}
|
| 490 |
+
|
| 491 |
+
EXACT_ID_SCORING_TASKS = frozenset({
|
| 492 |
+
'comtravo_ctparse_pr129',
|
| 493 |
+
'falconry_falcon_pr2366',
|
| 494 |
+
'falconry_falcon_pr2503',
|
| 495 |
+
'falconry_falcon_pr2572',
|
| 496 |
+
'falconry_falcon_pr2581',
|
| 497 |
+
})
|
| 498 |
+
|
| 499 |
+
|
| 500 |
+
class ExactPytestResults:
|
| 501 |
+
"""Record actual pytest identities without rewriting parameter text."""
|
| 502 |
+
def __init__(self, expected):
|
| 503 |
+
self.expected = set(expected)
|
| 504 |
+
self.collected = set()
|
| 505 |
+
self.coverage = {}
|
| 506 |
+
self.phases = {}
|
| 507 |
+
self.failed = False
|
| 508 |
+
|
| 509 |
+
def pytest_collection_finish(self, session):
|
| 510 |
+
self.collected = {item.nodeid for item in session.items}
|
| 511 |
+
for selector in self.expected:
|
| 512 |
+
self.coverage[selector] = ({selector} if selector in self.collected else {
|
| 513 |
+
node for node in self.collected
|
| 514 |
+
if node.startswith(selector + '[') or node.startswith(selector + '::')})
|
| 515 |
+
|
| 516 |
+
def pytest_collectreport(self, report):
|
| 517 |
+
if report.failed:
|
| 518 |
+
self.failed = True
|
| 519 |
+
|
| 520 |
+
def pytest_runtest_logreport(self, report):
|
| 521 |
+
if not report.passed:
|
| 522 |
+
self.failed = True
|
| 523 |
+
self.phases.setdefault(report.nodeid, set()).add(report.when)
|
| 524 |
+
|
| 525 |
+
def all_passed(self, exitcode):
|
| 526 |
+
return (exitcode == 0 and not self.failed and bool(self.expected)
|
| 527 |
+
and set(self.coverage) == self.expected
|
| 528 |
+
and all(self.coverage.values())
|
| 529 |
+
and set().union(*self.coverage.values()) == self.collected
|
| 530 |
+
and all(self.phases.get(node, set()) >= {'setup', 'call', 'teardown'}
|
| 531 |
+
for node in self.collected))
|
| 532 |
+
|
| 533 |
+
|
| 534 |
+
def exact_pytest_score_main():
|
| 535 |
+
import json
|
| 536 |
+
import sys
|
| 537 |
+
import pytest
|
| 538 |
+
with open(sys.argv[1]) as stream:
|
| 539 |
+
expected = json.load(stream)
|
| 540 |
+
if not expected:
|
| 541 |
+
print('<score>0.0</score>', flush=True)
|
| 542 |
+
return
|
| 543 |
+
results = ExactPytestResults(expected)
|
| 544 |
+
exitcode = pytest.main(['-vv', '-o', 'addopts=', '--rootdir=.', *expected], plugins=[results])
|
| 545 |
+
print('<score>1.0</score>' if results.all_passed(exitcode) else '<score>0.0</score>', flush=True)
|
| 546 |
+
|
| 547 |
+
|
| 548 |
+
def repair_exact_test_scoring(contents, task_id):
|
| 549 |
+
if task_id not in EXACT_ID_SCORING_TASKS:
|
| 550 |
+
return []
|
| 551 |
+
replacement = ('"""Score exact pytest identities; require complete successful execution."""\n\n'
|
| 552 |
+
+ inspect.getsource(ExactPytestResults) + '\n'
|
| 553 |
+
+ inspect.getsource(exact_pytest_score_main)
|
| 554 |
+
+ '\nif __name__ == "__main__":\n exact_pytest_score_main()\n')
|
| 555 |
+
text = contents['tests/score.py'].decode()
|
| 556 |
+
if text == replacement:
|
| 557 |
+
return []
|
| 558 |
+
if 'def all_passed(xml_content: str, expected: list[str])' not in text:
|
| 559 |
+
raise ValueError('ScaleSWE scorer changed since exact-ID review')
|
| 560 |
+
contents['tests/score.py'] = replacement.encode()
|
| 561 |
+
return [{'file': 'tests/score.py', 'phase': 'verifier-exact-test-ids',
|
| 562 |
+
'reason': 'Replace lossy JUnit name reconstruction with exact pytest collection and execution identities. Preserve parameter text, require every selected test and all setup/call/teardown phases to pass, and reject skipped tests, collection failures and unsuccessful pytest exit.'}]
|
| 563 |
+
|
| 564 |
+
|
| 565 |
+
JSONARGPARSE_DEBUG_TASKS = frozenset(
|
| 566 |
+
f'omni-us_jsonargparse_pr{pr}' for pr in
|
| 567 |
+
(162, 164, 176, 177, 186, 190, 194, 197, 198, 210, 211, 214, 216,
|
| 568 |
+
218, 222, 223, 233, 239, 242, 253, 266, 267, 268, 270, 272, 273))
|
| 569 |
+
|
| 570 |
+
JSONARGPARSE_DEBUG_FIXTURE = '''
|
| 571 |
+
|
| 572 |
+
# ScaleSWE verifier: completion tests must not take ownership of pytest's fd 9.
|
| 573 |
+
import pytest as _scaleswe_pytest
|
| 574 |
+
|
| 575 |
+
@_scaleswe_pytest.fixture(autouse=True)
|
| 576 |
+
def _scaleswe_argcomplete_debug_stream(monkeypatch):
|
| 577 |
+
import io
|
| 578 |
+
import sys
|
| 579 |
+
import argcomplete.io as completion_io
|
| 580 |
+
from argcomplete.finders import CompletionFinder
|
| 581 |
+
class DebugStream(io.StringIO):
|
| 582 |
+
target = None
|
| 583 |
+
def write(self, text):
|
| 584 |
+
self.target.write(text)
|
| 585 |
+
return super().write(text)
|
| 586 |
+
def flush(self):
|
| 587 |
+
self.target.flush()
|
| 588 |
+
return super().flush()
|
| 589 |
+
with DebugStream() as debug_stream:
|
| 590 |
+
def init_debug_stream(self):
|
| 591 |
+
debug_stream.target = sys.stderr
|
| 592 |
+
with monkeypatch.context() as patch:
|
| 593 |
+
patch.setattr(completion_io, 'debug_stream', debug_stream)
|
| 594 |
+
patch.setattr(CompletionFinder, '_init_debug_stream', init_debug_stream)
|
| 595 |
+
yield
|
| 596 |
+
'''
|
| 597 |
+
|
| 598 |
+
|
| 599 |
+
def repair_argcomplete_test_fixture(fixture):
|
| 600 |
+
from pathlib import Path
|
| 601 |
+
path = Path('jsonargparse_tests/test_argcomplete.py')
|
| 602 |
+
text = path.read_text()
|
| 603 |
+
if 'class ArgcompleteTests(' not in text:
|
| 604 |
+
raise ValueError('Jsonargparse completion tests changed since review')
|
| 605 |
+
if 'def _scaleswe_argcomplete_debug_stream(' not in text:
|
| 606 |
+
path.write_text(text + fixture)
|
| 607 |
+
|
| 608 |
+
|
| 609 |
+
def repair_argcomplete_debug_stream(contents, task_id):
|
| 610 |
+
if task_id not in JSONARGPARSE_DEBUG_TASKS:
|
| 611 |
+
return []
|
| 612 |
+
name = 'tests/score.py'
|
| 613 |
+
text = contents[name].decode()
|
| 614 |
+
if 'def repair_argcomplete_test_fixture(' in text:
|
| 615 |
+
return []
|
| 616 |
+
entry = 'if __name__ == "__main__":\n main()'
|
| 617 |
+
if text.count(entry) != 1:
|
| 618 |
+
raise ValueError('Jsonargparse scorer entrypoint changed since review')
|
| 619 |
+
replacement = inspect.getsource(repair_argcomplete_test_fixture) + '\n' + entry.replace(
|
| 620 |
+
' main()', ' repair_argcomplete_test_fixture(' + repr(JSONARGPARSE_DEBUG_FIXTURE) + ')\n main()')
|
| 621 |
+
contents[name] = text.replace(entry, replacement).encode()
|
| 622 |
+
return [{'file': name, 'phase': 'verifier-debug-stream-isolation',
|
| 623 |
+
'reason': 'Jsonargparse completion tests invoke argcomplete in the pytest process. Argcomplete wraps fixed descriptor 9 as its debug stream; replacing that owning wrapper closes pytest faulthandler\'s descriptor and crashes after passing tests. Give completion tests an isolated in-memory debug stream that forwards warnings to the stderr selected at autocomplete entry without owning its descriptor, and restore original state after each test. Preserve assertions, selectors, dependency versions, scoring and pytest cleanup.'}]
|
| 624 |
+
|
| 625 |
+
|
| 626 |
+
def repair_werkzeug_request_test():
|
| 627 |
+
from pathlib import Path
|
| 628 |
+
path = Path('tests/test_test.py')
|
| 629 |
+
text = path.read_text()
|
| 630 |
+
old = (' req = builder.get_request()\n'
|
| 631 |
+
' strict_eq(req.form["foo"], u"bar")\n'
|
| 632 |
+
' strict_eq(req.files["blafasel"].read(), b"foo")\n')
|
| 633 |
+
new = (' req = builder.get_request()\n'
|
| 634 |
+
' try:\n'
|
| 635 |
+
' strict_eq(req.form["foo"], u"bar")\n'
|
| 636 |
+
' strict_eq(req.files["blafasel"].read(), b"foo")\n'
|
| 637 |
+
' finally:\n'
|
| 638 |
+
' req.close() # ScaleSWE: release the uploaded temporary file.\n')
|
| 639 |
+
if text.count(new) == 1:
|
| 640 |
+
return
|
| 641 |
+
if text.count(old) != 1:
|
| 642 |
+
raise ValueError('Werkzeug multipart request test changed since review')
|
| 643 |
+
path.write_text(text.replace(old, new, 1))
|
| 644 |
+
|
| 645 |
+
|
| 646 |
+
def repair_werkzeug_request_cleanup(contents, task_id):
|
| 647 |
+
if task_id != 'pallets_werkzeug_pr1694':
|
| 648 |
+
return []
|
| 649 |
+
name = 'tests/score.py'
|
| 650 |
+
text = contents[name].decode()
|
| 651 |
+
if 'def repair_werkzeug_request_test(' in text:
|
| 652 |
+
return []
|
| 653 |
+
entry = 'if __name__ == "__main__":\n main()'
|
| 654 |
+
if text.count(entry) != 1:
|
| 655 |
+
raise ValueError('Werkzeug scorer entrypoint changed since review')
|
| 656 |
+
replacement = inspect.getsource(repair_werkzeug_request_test) + '\n' + entry.replace(
|
| 657 |
+
' main()', ' repair_werkzeug_request_test()\n main()')
|
| 658 |
+
contents[name] = text.replace(entry, replacement).encode()
|
| 659 |
+
return [{'file': name, 'phase': 'verifier-request-cleanup',
|
| 660 |
+
'reason': 'Werkzeug test_environ_builder_content_type leaves its multipart request open, leaking an uploaded SpooledTemporaryFile. Pytest promotes the resulting unraisable ResourceWarning to an error during shutdown after all 211 reference tests pass. Close that request in a finally block after its existing assertions. Preserve assertions, selectors, scoring, dependency versions and warning checks.'}]
|
| 661 |
+
|
| 662 |
+
|
| 663 |
+
PYOUT_CLEANUP_TASKS = frozenset(f'pyout_pyout_pr{pr}' for pr in (108, 109, 111))
|
| 664 |
+
|
| 665 |
+
PYOUT_CLEANUP_FIXTURE = '''
|
| 666 |
+
|
| 667 |
+
# ScaleSWE verifier: release delayed test work after assertions, then join pools.
|
| 668 |
+
@pytest.fixture(autouse=True)
|
| 669 |
+
def _scaleswe_cleanup_delayed_workers(monkeypatch):
|
| 670 |
+
import pyout.interface as interface
|
| 671 |
+
delays, pools = [], []
|
| 672 |
+
original_init = Delayed.__init__
|
| 673 |
+
original_pool = interface.Pool
|
| 674 |
+
|
| 675 |
+
def tracked_init(self, *args, **kwargs):
|
| 676 |
+
original_init(self, *args, **kwargs)
|
| 677 |
+
delays.append(self)
|
| 678 |
+
|
| 679 |
+
class TrackedPool(original_pool):
|
| 680 |
+
def __init__(self, *args, **kwargs):
|
| 681 |
+
super().__init__(*args, **kwargs)
|
| 682 |
+
pools.append(self)
|
| 683 |
+
|
| 684 |
+
monkeypatch.setattr(Delayed, '__init__', tracked_init)
|
| 685 |
+
monkeypatch.setattr(interface, 'Pool', TrackedPool)
|
| 686 |
+
try:
|
| 687 |
+
yield
|
| 688 |
+
finally:
|
| 689 |
+
for delay in delays:
|
| 690 |
+
delay.now = True
|
| 691 |
+
for pool in pools:
|
| 692 |
+
pool.shutdown(wait=True)
|
| 693 |
+
'''
|
| 694 |
+
|
| 695 |
+
|
| 696 |
+
def repair_pyout_test_cleanup(fixture):
|
| 697 |
+
from pathlib import Path
|
| 698 |
+
path = Path('pyout/tests/test_tabular.py')
|
| 699 |
+
text = path.read_text()
|
| 700 |
+
if 'class Delayed(' not in text or 'def test_tabular_write_callable_kb_interrupt_in_exit(' not in text:
|
| 701 |
+
raise ValueError('Pyout delayed-work tests changed since review')
|
| 702 |
+
if 'def _scaleswe_cleanup_delayed_workers(' not in text:
|
| 703 |
+
path.write_text(text + fixture)
|
| 704 |
+
|
| 705 |
+
|
| 706 |
+
def repair_flask_worker_fixtures():
|
| 707 |
+
"""Size test-owned pools from the container CPU affinity, then join them."""
|
| 708 |
+
import os
|
| 709 |
+
from pathlib import Path
|
| 710 |
+
try:
|
| 711 |
+
workers = max(1, len(os.sched_getaffinity(0)))
|
| 712 |
+
except (AttributeError, OSError):
|
| 713 |
+
workers = 1
|
| 714 |
+
path = Path('tests/conftest.py')
|
| 715 |
+
text = path.read_text()
|
| 716 |
+
if '# ScaleSWE affinity-aware fixture pools' in text:
|
| 717 |
+
return
|
| 718 |
+
if text.count(' return app') != 2:
|
| 719 |
+
raise ValueError('Flask-executor app fixtures changed since review')
|
| 720 |
+
replacement = """ # ScaleSWE affinity-aware fixture pools
|
| 721 |
+
app.config['EXECUTOR_MAX_WORKERS'] = {workers}
|
| 722 |
+
try:
|
| 723 |
+
yield app
|
| 724 |
+
finally:
|
| 725 |
+
for value in app.extensions.values():
|
| 726 |
+
if isinstance(value, Executor):
|
| 727 |
+
value.shutdown(wait=True)""".format(workers=workers)
|
| 728 |
+
path.write_text(text.replace(' return app', replacement))
|
| 729 |
+
print('ScaleSWE fixture worker count from CPU affinity:', workers, flush=True)
|
| 730 |
+
|
| 731 |
+
|
| 732 |
+
def run_joblib_with_available_cpus(main):
|
| 733 |
+
"""Give the old multiprocessing API the verifier's allowed CPU count."""
|
| 734 |
+
import multiprocessing
|
| 735 |
+
import os
|
| 736 |
+
original = multiprocessing.cpu_count
|
| 737 |
+
|
| 738 |
+
def available_cpus():
|
| 739 |
+
try:
|
| 740 |
+
return max(1, len(os.sched_getaffinity(0)))
|
| 741 |
+
except (AttributeError, OSError):
|
| 742 |
+
return 1
|
| 743 |
+
|
| 744 |
+
multiprocessing.cpu_count = available_cpus
|
| 745 |
+
try:
|
| 746 |
+
print('ScaleSWE available verifier CPUs:', available_cpus(), flush=True)
|
| 747 |
+
return main()
|
| 748 |
+
finally:
|
| 749 |
+
multiprocessing.cpu_count = original
|
| 750 |
+
|
| 751 |
+
|
| 752 |
+
RECHUNKER_CPU_TASKS = frozenset(f'pangeo-data_rechunker_pr{pr}' for pr in (22, 27, 30, 48))
|
| 753 |
+
|
| 754 |
+
|
| 755 |
+
def run_dask_with_available_cpus(main):
|
| 756 |
+
import os
|
| 757 |
+
import dask
|
| 758 |
+
try:
|
| 759 |
+
cpus = max(1, len(os.sched_getaffinity(0)))
|
| 760 |
+
except (AttributeError, OSError):
|
| 761 |
+
cpus = 1
|
| 762 |
+
print('ScaleSWE available verifier CPUs:', cpus, flush=True)
|
| 763 |
+
with dask.config.set(num_workers=cpus):
|
| 764 |
+
return main()
|
| 765 |
+
|
| 766 |
+
|
| 767 |
+
def repair_timeout_verifiers(contents, task_id):
|
| 768 |
+
edits = []
|
| 769 |
+
if task_id in ('joblib_joblib_pr449', 'joblib_joblib_pr541'):
|
| 770 |
+
name = 'tests/score.py'
|
| 771 |
+
text = contents[name].decode()
|
| 772 |
+
entry = 'if __name__ == "__main__":\n main()'
|
| 773 |
+
if 'def run_joblib_with_available_cpus(' not in text:
|
| 774 |
+
if text.count(entry) != 1:
|
| 775 |
+
raise ValueError('Joblib score entrypoint changed since review')
|
| 776 |
+
replacement = inspect.getsource(run_joblib_with_available_cpus) + '\n' + entry.replace(
|
| 777 |
+
' main()', ' run_joblib_with_available_cpus(main)')
|
| 778 |
+
contents[name] = text.replace(entry, replacement).encode()
|
| 779 |
+
edits.append({'file': name, 'phase': 'verifier-cpu-affinity' if task_id == 'joblib_joblib_pr541' else 'verifier-worker-cleanup',
|
| 780 |
+
'reason': 'Host CPU discovery can size pools for 384 CPUs despite only four allocated CPUs, causing out-of-memory termination. Use process CPU affinity for multiprocessing.cpu_count during verification, falling back to one CPU; preserve Joblib negative n_jobs semantics, explicit worker counts, tests, scoring and the 4096 MB memory limit'})
|
| 781 |
+
if task_id in RECHUNKER_CPU_TASKS:
|
| 782 |
+
name = 'tests/score.py'
|
| 783 |
+
text = contents[name].decode()
|
| 784 |
+
entry = 'if __name__ == "__main__":\n main()'
|
| 785 |
+
if 'def run_dask_with_available_cpus(' not in text:
|
| 786 |
+
if text.count(entry) != 1:
|
| 787 |
+
raise ValueError('Rechunker score entrypoint changed since review')
|
| 788 |
+
replacement = inspect.getsource(run_dask_with_available_cpus) + '\n' + entry.replace(
|
| 789 |
+
' main()', ' run_dask_with_available_cpus(main)')
|
| 790 |
+
contents[name] = text.replace(entry, replacement).encode()
|
| 791 |
+
edits.append({'file': name, 'phase': 'verifier-cpu-affinity',
|
| 792 |
+
'reason': 'Dask defaults to 384 host CPUs despite only four allocated CPUs, causing out-of-memory termination. Set verifier Dask num_workers from process CPU affinity, falling back to one CPU, and restore configuration afterward. Preserve tests, assertions, selectors, scoring and the 4096 MB memory limit.'})
|
| 793 |
+
if task_id == 'dchevell_flask-executor_pr12':
|
| 794 |
+
name = 'tests/score.py'
|
| 795 |
+
text = contents[name].decode()
|
| 796 |
+
entry = 'if __name__ == "__main__":\n main()'
|
| 797 |
+
if 'def repair_flask_worker_fixtures(' not in text:
|
| 798 |
+
if text.count(entry) != 1:
|
| 799 |
+
raise ValueError('Flask-executor score entrypoint changed since review')
|
| 800 |
+
replacement = inspect.getsource(repair_flask_worker_fixtures) + '\n' + entry.replace(
|
| 801 |
+
' main()', ' repair_flask_worker_fixtures()\n main()')
|
| 802 |
+
contents[name] = text.replace(entry, replacement).encode()
|
| 803 |
+
edits.append({'file': name, 'phase': 'verifier-worker-cleanup',
|
| 804 |
+
'reason': 'Set test fixture default workers from container CPU affinity (one worker if unavailable) and join fixture executors after each test; preserve explicit worker-count tests, assertions, scoring and the 4096 MB task memory limit'})
|
| 805 |
+
if task_id in PYOUT_CLEANUP_TASKS:
|
| 806 |
+
name = 'tests/score.py'
|
| 807 |
+
text = contents[name].decode()
|
| 808 |
+
entry = 'if __name__ == "__main__":\n main()'
|
| 809 |
+
if 'def repair_pyout_test_cleanup(' not in text:
|
| 810 |
+
if text.count(entry) != 1:
|
| 811 |
+
raise ValueError('Pyout score entrypoint changed since review')
|
| 812 |
+
replacement = inspect.getsource(repair_pyout_test_cleanup) + '\n' + entry.replace(
|
| 813 |
+
' main()', ' repair_pyout_test_cleanup(' + repr(PYOUT_CLEANUP_FIXTURE) + ')\n main()')
|
| 814 |
+
contents[name] = text.replace(entry, replacement).encode()
|
| 815 |
+
edits.append({'file': name, 'phase': 'verifier-worker-cleanup',
|
| 816 |
+
'reason': 'Release delayed test helper work after assertions and join test-created pools; preserve selected tests and assertions'})
|
| 817 |
+
if task_id == 'rom1504_embedding-reader_pr9':
|
| 818 |
+
name = 'tests/f2p.patch'
|
| 819 |
+
if 'diff --git a/tests/fixtures.py b/tests/fixtures.py' not in contents[name].decode():
|
| 820 |
+
chunks = contents['solution/gold.patch'].decode().split('diff --git ')
|
| 821 |
+
chunk = next(c for c in chunks if c.startswith('a/tests/fixtures.py b/tests/fixtures.py\n'))
|
| 822 |
+
contents[name] += ('\ndiff --git ' + chunk).encode()
|
| 823 |
+
script = contents['tests/test.sh'].decode()
|
| 824 |
+
anchor = 'if [ -s /tests/f2p.patch ]; then'
|
| 825 |
+
if script.count(anchor) != 1:
|
| 826 |
+
raise ValueError('Embedding-reader test preparation changed since review')
|
| 827 |
+
contents['tests/test.sh'] = script.replace(anchor, 'git checkout "$base" -- tests/fixtures.py || exit $?\n' + anchor).encode()
|
| 828 |
+
score = contents['tests/score.py'].decode()
|
| 829 |
+
anchor = 'pytest.main(["-vv",'
|
| 830 |
+
if score.count(anchor) != 1:
|
| 831 |
+
raise ValueError('Embedding-reader grader changed since review')
|
| 832 |
+
contents['tests/score.py'] = score.replace(anchor, 'pytest.main(["-vv", "--forked", "--timeout=60", "--timeout-method=thread",').encode()
|
| 833 |
+
edits.append({'file': 'tests', 'phase': 'verifier-worker-cleanup',
|
| 834 |
+
'reason': 'Include and consistently restore the missing id2 fixture update; isolate each selected test with pytest-forked and a 60-second test timeout so broken reader worker shutdown cannot wedge the verifier; preserve assertions and reward rules'})
|
| 835 |
+
return edits
|
| 836 |
+
|
| 837 |
+
DEFERRED_IMPORTS = {
|
| 838 |
+
'keboola_python-component_pr39': {'tests/test_base.py': {'keboola.component.base': ['sync_action']}},
|
| 839 |
+
'bluetooth-devices_cached-ipaddress_pr26': {'tests/test_ipaddress.py': {'cached_ipaddress': ['*'], 'cached_ipaddress.ipaddress': ['*']}},
|
| 840 |
+
'semuconsulting_pynmeagps_pr84': {'tests/test_static.py': {'pynmeagps.nmeahelpers': ['leapsecond']}},
|
| 841 |
+
'semuconsulting_pynmeagps_pr78': {
|
| 842 |
+
'tests/test_static.py': {'pynmeagps.nmeatypes_decodes': ['*']},
|
| 843 |
+
'tests/test_stream.py': {'pynmeagps': ['FMI_STATUS']}},
|
| 844 |
+
'ouhammmourachid_mermaid-py_pr105': {
|
| 845 |
+
'mermaid/tests/test_flowchart.py': {'mermaid': ['Direction'], 'mermaid.style': ['Style']},
|
| 846 |
+
'mermaid/tests/test_statediagram.py': {'mermaid': ['Direction'], 'mermaid.style': ['Style']},
|
| 847 |
+
'mermaid/tests/test_style.py': {'mermaid.style': ['Style']}},
|
| 848 |
+
}
|
| 849 |
+
|
| 850 |
+
|
| 851 |
+
def defer_test_imports(plan):
|
| 852 |
+
"""Move reviewed module imports into their consuming functions, preserving test bodies."""
|
| 853 |
+
import ast
|
| 854 |
+
from pathlib import Path
|
| 855 |
+
|
| 856 |
+
for filename, modules in plan.items():
|
| 857 |
+
path = Path(filename)
|
| 858 |
+
source = path.read_text()
|
| 859 |
+
tree = ast.parse(source)
|
| 860 |
+
lines = source.splitlines(keepends=True)
|
| 861 |
+
moved = {}
|
| 862 |
+
edits = []
|
| 863 |
+
for node in tree.body:
|
| 864 |
+
if not isinstance(node, ast.ImportFrom) or node.level or node.module not in modules:
|
| 865 |
+
continue
|
| 866 |
+
selected = modules[node.module]
|
| 867 |
+
remaining = []
|
| 868 |
+
for alias in node.names:
|
| 869 |
+
if '*' in selected or alias.name in selected:
|
| 870 |
+
if alias.name == '*':
|
| 871 |
+
raise ValueError('Cannot defer a wildcard import: ' + filename)
|
| 872 |
+
name = alias.asname or alias.name
|
| 873 |
+
moved[name] = 'from ' + node.module + ' import ' + alias.name + (' as ' + alias.asname if alias.asname else '')
|
| 874 |
+
else:
|
| 875 |
+
remaining.append(alias)
|
| 876 |
+
if len(remaining) != len(node.names):
|
| 877 |
+
replacement = ast.unparse(ast.ImportFrom(module=node.module, names=remaining, level=0)) + '\n' if remaining else ''
|
| 878 |
+
edits.append((node.lineno - 1, node.end_lineno, replacement))
|
| 879 |
+
if not moved:
|
| 880 |
+
raise ValueError('Reviewed imports missing from ' + filename)
|
| 881 |
+
|
| 882 |
+
def visit_scope(nodes):
|
| 883 |
+
for node in nodes:
|
| 884 |
+
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
|
| 885 |
+
headers = [*node.decorator_list, node.args, *([node.returns] if node.returns else [])]
|
| 886 |
+
if any(isinstance(n, ast.Name) and n.id in moved for h in headers for n in ast.walk(h)):
|
| 887 |
+
raise ValueError('Deferred import used in function signature: ' + filename)
|
| 888 |
+
used = {n.id for stmt in node.body for n in ast.walk(stmt)
|
| 889 |
+
if isinstance(n, ast.Name) and isinstance(n.ctx, ast.Load)} & moved.keys()
|
| 890 |
+
if used:
|
| 891 |
+
first = node.body[0]
|
| 892 |
+
if isinstance(first, ast.Expr) and isinstance(first.value, ast.Constant) and isinstance(first.value.value, str):
|
| 893 |
+
first = node.body[1]
|
| 894 |
+
indent = ' ' * first.col_offset
|
| 895 |
+
edits.append((first.lineno - 1, first.lineno - 1,
|
| 896 |
+
''.join(indent + moved[name] + '\n' for name in sorted(used))))
|
| 897 |
+
elif isinstance(node, ast.ClassDef):
|
| 898 |
+
if any(isinstance(n, ast.Name) and n.id in moved for h in [*node.bases, *node.keywords, *node.decorator_list] for n in ast.walk(h)):
|
| 899 |
+
raise ValueError('Deferred import used in class definition: ' + filename)
|
| 900 |
+
visit_scope(node.body)
|
| 901 |
+
elif not isinstance(node, (ast.Import, ast.ImportFrom)):
|
| 902 |
+
if any(isinstance(n, ast.Name) and isinstance(n.ctx, ast.Load) and n.id in moved for n in ast.walk(node)):
|
| 903 |
+
raise ValueError('Deferred import used outside a function: ' + filename)
|
| 904 |
+
visit_scope(tree.body)
|
| 905 |
+
for start, end, replacement in sorted(edits, reverse=True):
|
| 906 |
+
lines[start:end] = [replacement]
|
| 907 |
+
updated = ''.join(lines)
|
| 908 |
+
ast.parse(updated)
|
| 909 |
+
path.write_text(updated)
|
| 910 |
+
|
| 911 |
+
|
| 912 |
+
def repair_collection_imports(contents, task_id):
|
| 913 |
+
if task_id not in DEFERRED_IMPORTS:
|
| 914 |
+
return []
|
| 915 |
+
filename = 'tests/score.py'
|
| 916 |
+
text = contents[filename].decode()
|
| 917 |
+
marker = '# ScaleSWE reviewed call-time test imports v1\n'
|
| 918 |
+
if marker in text:
|
| 919 |
+
return []
|
| 920 |
+
entry = 'if __name__ == "__main__":\n main()'
|
| 921 |
+
if text.count(entry) != 1:
|
| 922 |
+
raise ValueError('ScaleSWE score entrypoint changed since review')
|
| 923 |
+
replacement = marker + inspect.getsource(defer_test_imports) + '\n' + entry.replace(' main()', ' defer_test_imports(' + repr(DEFERRED_IMPORTS[task_id]) + ')\n main()')
|
| 924 |
+
contents[filename] = text.replace(entry, replacement).encode()
|
| 925 |
+
return [{'file': filename, 'phase': 'verifier-call-time-imports',
|
| 926 |
+
'reason': 'Defer reviewed feature imports to consuming test functions; preserve selected tests, assertions and reward rules',
|
| 927 |
+
'imports': DEFERRED_IMPORTS[task_id]}]
|
| 928 |
+
|
| 929 |
+
|
| 930 |
+
def repair_verifier_imports(contents, task_id):
|
| 931 |
+
if task_id not in VERIFIER_IMPORT_TASKS:
|
| 932 |
+
return []
|
| 933 |
+
name = 'tests/test.sh'
|
| 934 |
+
text = contents[name].decode()
|
| 935 |
+
command = 'python /tests/score.py /tests/test_ids.json | tee /logs/verifier/score.txt'
|
| 936 |
+
prefix = 'export PYTHONPATH="$PWD${PYTHONPATH:+:$PYTHONPATH}"\n'
|
| 937 |
+
if prefix + command in text:
|
| 938 |
+
return []
|
| 939 |
+
repo, reason = VERIFIER_IMPORT_TASKS[task_id]
|
| 940 |
+
if text.count(command) != 1 or f'cd /workspace/{repo} || exit 1' not in text:
|
| 941 |
+
raise ValueError('Verifier changed since import-path review')
|
| 942 |
+
contents[name] = text.replace(command, prefix + command, 1).encode()
|
| 943 |
+
return [{'file': name, 'old': command, 'new': prefix + command,
|
| 944 |
+
'phase': 'verifier-import-path',
|
| 945 |
+
'reason': reason + ' Prepend the repository root to PYTHONPATH; preserve assertions, selectors and reward rules.'}]
|
| 946 |
+
|
| 947 |
+
|
| 948 |
+
SKIPPED_REQUIRED_TESTS = {
|
| 949 |
+
# dimod's test_nocpp_error checks the fallback used when the C++ extension is absent and skips
|
| 950 |
+
# itself when the extension is present. Scale's images build the extension, so the test can never
|
| 951 |
+
# pass there, yet Scale lists it among the required tests; the scorer treats a skip as not passed.
|
| 952 |
+
**{f'dwavesystems_dimod_pr{pr}': ('tests/test_fixedvariablecomposite.py::TestRoofDualityComposite::test_nocpp_error',)
|
| 953 |
+
for pr in (432, 445, 462, 471, 512)},
|
| 954 |
+
}
|
| 955 |
+
SKIPPED_REQUIRED_TEST_REASON = ('Remove a required test that the task image can never run: it checks the fallback used when the dimod C++ '
|
| 956 |
+
'extension is absent and skips itself because the image builds the extension. The scorer counts a skip as '
|
| 957 |
+
'not passed, so the reference solution scored 0 although every other required test passed. The remaining '
|
| 958 |
+
'required tests still cover the change; tests, assertions and the scorer are unchanged.')
|
| 959 |
+
|
| 960 |
+
|
| 961 |
+
def repair_skipped_required_tests(contents, task_id):
|
| 962 |
+
"""Drop required test IDs that are skipped by design in the task image."""
|
| 963 |
+
remove = SKIPPED_REQUIRED_TESTS.get(task_id)
|
| 964 |
+
if not remove or 'tests/test_ids.json' not in contents:
|
| 965 |
+
return []
|
| 966 |
+
ids = json.loads(contents['tests/test_ids.json'].decode())
|
| 967 |
+
missing = [t for t in remove if t not in ids]
|
| 968 |
+
if missing:
|
| 969 |
+
raise ValueError(f'Required test list changed since review for {task_id}: {missing}')
|
| 970 |
+
kept = [t for t in ids if t not in remove]
|
| 971 |
+
if not kept:
|
| 972 |
+
raise ValueError(f'No required tests would remain for {task_id}')
|
| 973 |
+
contents['tests/test_ids.json'] = json.dumps(kept).encode()
|
| 974 |
+
return [{'file': 'tests/test_ids.json', 'phase': 'verifier-required-test-skipped', 'removed': list(remove),
|
| 975 |
+
'reason': SKIPPED_REQUIRED_TEST_REASON}]
|
| 976 |
+
|
| 977 |
+
|
| 978 |
+
RESET_TEST_DIRS = ('test', 'tests', 'Test', 'Tests')
|
| 979 |
+
FIXTURE_RESTORATION_REASON = (
|
| 980 |
+
'Scoring resets the test directories to the base commit and then applies tests/f2p.patch, the tests that verify '
|
| 981 |
+
'the fix. The pull request also added or changed test-support files under those directories (fixtures, recorded '
|
| 982 |
+
'cassettes, sample inputs) that f2p.patch leaves out, so the reset removes them and the selected tests fail even '
|
| 983 |
+
'with the reference solution. Append the pull request\'s own diff for exactly these files to f2p.patch so the '
|
| 984 |
+
'verifier restores the complete post-PR test tree. Source files, other tests and the reset itself are unchanged.')
|
| 985 |
+
TEST_MODULE_RE = re.compile(r'(^|/)(test_[^/]*\.py|[^/]*_test\.py|conftest\.py)$')
|
| 986 |
+
|
| 987 |
+
|
| 988 |
+
def _diff_chunks(patch):
|
| 989 |
+
"""Map each same-path file diff in a git patch to its chunk text."""
|
| 990 |
+
chunks = {}
|
| 991 |
+
for chunk in patch.split('diff --git ')[1:]:
|
| 992 |
+
header = chunk.splitlines()[0] if chunk.splitlines() else ''
|
| 993 |
+
match = re.fullmatch(r'a/(.+) b/(.+)', header)
|
| 994 |
+
if match and match.group(1) == match.group(2):
|
| 995 |
+
chunks[match.group(1)] = 'diff --git ' + chunk
|
| 996 |
+
return chunks
|
| 997 |
+
|
| 998 |
+
|
| 999 |
+
def _repair_hunk_headers(patch):
|
| 1000 |
+
"""Make every hunk header state the line counts the hunk actually carries.
|
| 1001 |
+
|
| 1002 |
+
Some Scale-SWE patches lost their final context line, so the last hunk
|
| 1003 |
+
header claims one line more than follows it. git apply rejects such a
|
| 1004 |
+
patch and patch(1) only tolerates the shortfall at end of file; once more
|
| 1005 |
+
diff chunks follow, patch(1) stops at the junction with "malformed patch".
|
| 1006 |
+
Headers whose counts already match are kept byte-identical; correcting the
|
| 1007 |
+
others changes no patch content.
|
| 1008 |
+
"""
|
| 1009 |
+
lines = patch.split('\n')
|
| 1010 |
+
out, i = [], 0
|
| 1011 |
+
while i < len(lines):
|
| 1012 |
+
match = re.match(r'@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(.*)$', lines[i])
|
| 1013 |
+
if not match:
|
| 1014 |
+
out.append(lines[i]); i += 1
|
| 1015 |
+
continue
|
| 1016 |
+
j = i + 1
|
| 1017 |
+
while j < len(lines) and not lines[j].startswith('@@') and not lines[j].startswith('diff --git '):
|
| 1018 |
+
j += 1
|
| 1019 |
+
body = lines[i + 1:j]
|
| 1020 |
+
old = sum(1 for l in body if l[:1] in (' ', '-'))
|
| 1021 |
+
new = sum(1 for l in body if l[:1] in (' ', '+'))
|
| 1022 |
+
declared = (int(match.group(2) or 1), int(match.group(4) or 1))
|
| 1023 |
+
header = lines[i] if declared == (old, new) else f'@@ -{match.group(1)},{old} +{match.group(3)},{new} @@{match.group(5)}'
|
| 1024 |
+
out.append(header); out.extend(body); i = j
|
| 1025 |
+
return '\n'.join(out)
|
| 1026 |
+
|
| 1027 |
+
|
| 1028 |
+
def _in_verifier_reset_scope(path):
|
| 1029 |
+
"""Paths ScaleSWE's test.sh checks out from the base commit or removes before applying f2p.patch."""
|
| 1030 |
+
return PurePosixPath(path).parts[0] in RESET_TEST_DIRS or bool(TEST_MODULE_RE.search(path))
|
| 1031 |
+
|
| 1032 |
+
|
| 1033 |
+
def repair_added_test_fixtures(contents, task_id):
|
| 1034 |
+
"""Give the verifier the complete post-PR test tree.
|
| 1035 |
+
|
| 1036 |
+
Scoring rebuilds the test tree in two steps: reset the test directories to
|
| 1037 |
+
the base commit (so agent edits to tests are discarded), then apply
|
| 1038 |
+
tests/f2p.patch, the tests that verify the fix. The pull request also added
|
| 1039 |
+
or changed test-support files under those directories (fixtures, recorded
|
| 1040 |
+
cassettes, sample inputs), but f2p.patch leaves them out. The reset removes
|
| 1041 |
+
them, so the selected tests fail even with the reference solution, and no
|
| 1042 |
+
agent can make them pass because anything it creates there is reset too.
|
| 1043 |
+
|
| 1044 |
+
This repair appends the pull request's own diff for exactly those files to
|
| 1045 |
+
f2p.patch: files under the top-level test directories that f2p.patch does
|
| 1046 |
+
not already contain, excluding source files and new test modules that the
|
| 1047 |
+
selected test IDs do not use. Hunk headers whose counts no longer match
|
| 1048 |
+
their lines (a truncated final context line in the dataset) are corrected so
|
| 1049 |
+
the combined patch applies as one. The reset and every other gold change are
|
| 1050 |
+
untouched. It applies only to tasks whose reference failed for this reason.
|
| 1051 |
+
"""
|
| 1052 |
+
if task_id not in FIXTURE_RESTORATION_TASKS and task_id not in TEST_FIXTURE_REPAIRS:
|
| 1053 |
+
return []
|
| 1054 |
+
gold = contents.get('solution/gold.patch', b'').decode(errors='replace')
|
| 1055 |
+
if not gold or 'tests/f2p.patch' not in contents:
|
| 1056 |
+
return []
|
| 1057 |
+
f2p = contents['tests/f2p.patch'].decode(errors='replace')
|
| 1058 |
+
gold_chunks, f2p_chunks = _diff_chunks(gold), _diff_chunks(f2p)
|
| 1059 |
+
try:
|
| 1060 |
+
selected_files = {entry.split('::')[0] for entry in json.loads(contents.get('tests/test_ids.json', b'[]').decode())}
|
| 1061 |
+
except ValueError:
|
| 1062 |
+
selected_files = set()
|
| 1063 |
+
restored, additions = [], []
|
| 1064 |
+
for path, chunk in gold_chunks.items():
|
| 1065 |
+
if path in f2p_chunks or 'deleted file mode ' in chunk or not _in_verifier_reset_scope(path):
|
| 1066 |
+
continue
|
| 1067 |
+
if PurePosixPath(path).parts[0] not in RESET_TEST_DIRS:
|
| 1068 |
+
continue # test-named files outside the test trees stay with the gold/f2p split
|
| 1069 |
+
if TEST_MODULE_RE.search(path) and not ('new file mode ' in chunk and path in selected_files):
|
| 1070 |
+
continue
|
| 1071 |
+
additions.append(chunk)
|
| 1072 |
+
restored.append(path)
|
| 1073 |
+
required = set(TEST_FIXTURE_REPAIRS.get(task_id, ()))
|
| 1074 |
+
if required - set(restored) - set(f2p_chunks):
|
| 1075 |
+
raise ValueError(f'Reviewed test fixtures not restored for {task_id}: {sorted(required - set(restored) - set(f2p_chunks))}')
|
| 1076 |
+
if not additions:
|
| 1077 |
+
return []
|
| 1078 |
+
f2p = _repair_hunk_headers(f2p)
|
| 1079 |
+
additions = [_repair_hunk_headers(chunk) for chunk in additions]
|
| 1080 |
+
separator = '' if f2p.endswith('\n') or not f2p else '\n'
|
| 1081 |
+
contents['tests/f2p.patch'] = (f2p + separator + '\n'.join(additions)).encode()
|
| 1082 |
+
return [{'file': 'tests/f2p.patch', 'phase': 'verifier-test-fixture-restoration',
|
| 1083 |
+
'paths': restored,
|
| 1084 |
+
'reason': FIXTURE_RESTORATION_REASON}]
|
| 1085 |
+
|
| 1086 |
+
|
| 1087 |
+
# Explicitly reviewed instruction corrections; keep the task's other hints intact.
|
| 1088 |
+
INSTRUCTION_CORRECTIONS = {
|
| 1089 |
+
'appium_python-client_pr517': (
|
| 1090 |
+
'b1f4a2dc528408bb6651e198b76963c04069b6558453c3da42233ed54848bea2',
|
| 1091 |
+
[('Attempt to run iOS functional tests in parallel using the `-n` flag.',
|
| 1092 |
+
'Attempt to run iOS functional tests in parallel using the existing test file:'),
|
| 1093 |
+
('pytest -n 2 test/functional/ios/find_by_ios_class_chain_tests.py',
|
| 1094 |
+
'pytest -n 2 /workspace/python-client/test/functional/ios/search_context/find_by_ios_class_chain_tests.py')]),
|
| 1095 |
+
'beetbox_mediafile_pr86': (
|
| 1096 |
+
'25ddb4ef83ecc81c538044f8bf4ebfeb367be92adb7a8e2eb5ea283927184e24',
|
| 1097 |
+
[('**`mediafile/utils.py`**: For general utility functions and helpers.',
|
| 1098 |
+
'**`/workspace/mediafile/mediafile/utils/`**: For general utility functions and helpers.')]),
|
| 1099 |
+
}
|
| 1100 |
+
|
| 1101 |
+
|
| 1102 |
+
def patch_blob(blob, diagnostic=None, decisions=(), oracle_passed=False, task_id=None, automatic_paths=False):
|
| 1103 |
+
with tarfile.open(fileobj=io.BytesIO(blob)) as archive:
|
| 1104 |
+
members = archive.getmembers()
|
| 1105 |
+
contents = {}
|
| 1106 |
+
for member in members:
|
| 1107 |
+
name = PurePosixPath(member.name)
|
| 1108 |
+
if name.is_absolute() or '..' in name.parts or not (member.isfile() or member.isdir()):
|
| 1109 |
+
raise ValueError('Unsafe task archive member')
|
| 1110 |
+
if member.isfile():
|
| 1111 |
+
if str(name) in contents:
|
| 1112 |
+
raise ValueError('Duplicate archive member')
|
| 1113 |
+
contents[str(name)] = archive.extractfile(member).read()
|
| 1114 |
+
if (decisions or automatic_paths) and files_digest(contents.items()) != (diagnostic or {}).get('agent_baseline', {}).get('task_sha256'):
|
| 1115 |
+
raise ValueError('Task changed since path resolution')
|
| 1116 |
+
original = contents['instruction.md'].decode()
|
| 1117 |
+
changed, edits = (apply_reviewed_replacements(original, diagnostic, decisions, oracle_passed=oracle_passed)
|
| 1118 |
+
if decisions else (original, []))
|
| 1119 |
+
if automatic_paths:
|
| 1120 |
+
from validation.checks.instruction_paths import automatic
|
| 1121 |
+
changed, edits = automatic(original, diagnostic, oracle_passed)
|
| 1122 |
+
# Task-specific corrections take precedence over generic spans.
|
| 1123 |
+
protected = []
|
| 1124 |
+
for old, _ in INSTRUCTION_CORRECTIONS.get(task_id, ('', []))[1]:
|
| 1125 |
+
start = original.find(old)
|
| 1126 |
+
if start >= 0:
|
| 1127 |
+
protected.append((start, start + len(old)))
|
| 1128 |
+
edits = [e for e in edits if not any(e['start'] < end and start < e['end'] for start, end in protected)]
|
| 1129 |
+
changed = original
|
| 1130 |
+
for edit in reversed(edits):
|
| 1131 |
+
changed = changed[:edit['start']] + edit['new'] + changed[edit['end']:]
|
| 1132 |
+
if task_id in INSTRUCTION_CORRECTIONS:
|
| 1133 |
+
digest, replacements = INSTRUCTION_CORRECTIONS[task_id]
|
| 1134 |
+
if hashlib.sha256(original.encode()).hexdigest() != digest:
|
| 1135 |
+
raise ValueError('Instruction changed since task-specific correction review')
|
| 1136 |
+
for old, new in replacements:
|
| 1137 |
+
if changed.count(old) != 1:
|
| 1138 |
+
raise ValueError('Reviewed instruction correction is missing or conflicts with another edit')
|
| 1139 |
+
changed = changed.replace(old, new, 1)
|
| 1140 |
+
edits.append({'old': old, 'new': new, 'phase': 'explicit-instruction-review',
|
| 1141 |
+
'reason': 'User-approved minimal path correction; preserve remaining task wording'})
|
| 1142 |
+
edits.extend(repair_verifier_imports(contents, task_id))
|
| 1143 |
+
edits.extend(repair_collection_imports(contents, task_id))
|
| 1144 |
+
edits.extend(repair_timeout_verifiers(contents, task_id))
|
| 1145 |
+
edits.extend(repair_exact_test_scoring(contents, task_id))
|
| 1146 |
+
edits.extend(repair_argcomplete_debug_stream(contents, task_id))
|
| 1147 |
+
edits.extend(repair_werkzeug_request_cleanup(contents, task_id))
|
| 1148 |
+
edits.extend(repair_added_test_fixtures(contents, task_id))
|
| 1149 |
+
edits.extend(repair_skipped_required_tests(contents, task_id))
|
| 1150 |
+
if not edits:
|
| 1151 |
+
return blob, []
|
| 1152 |
+
contents['instruction.md'] = changed.encode()
|
| 1153 |
+
output = io.BytesIO()
|
| 1154 |
+
with tarfile.open(fileobj=output, mode='w') as target:
|
| 1155 |
+
for member in members:
|
| 1156 |
+
member = copy.copy(member)
|
| 1157 |
+
if member.isfile():
|
| 1158 |
+
data = contents[str(PurePosixPath(member.name))]
|
| 1159 |
+
member.size = len(data)
|
| 1160 |
+
target.addfile(member, io.BytesIO(data))
|
| 1161 |
+
else:
|
| 1162 |
+
target.addfile(member)
|
| 1163 |
+
return output.getvalue(), edits
|
| 1164 |
+
|
| 1165 |
+
|
| 1166 |
+
def main():
|
| 1167 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 1168 |
+
parser.add_argument('--source', type=Path, required=True)
|
| 1169 |
+
parser.add_argument('--output', type=Path, required=True, help='new output directory')
|
| 1170 |
+
parser.add_argument('--resolution-report', type=Path, action='append', default=[])
|
| 1171 |
+
parser.add_argument('--automatic-paths', action='store_true', help='use shared automatic normalization, without a review file')
|
| 1172 |
+
parser.add_argument('--review', type=Path, help='review JSON: tasks maps IDs to decisions and unresolved reasons')
|
| 1173 |
+
args = parser.parse_args()
|
| 1174 |
+
if args.output.exists():
|
| 1175 |
+
raise ValueError('Use a new output directory')
|
| 1176 |
+
review = json.loads(args.review.read_text())['tasks'] if args.review else {}
|
| 1177 |
+
evidence = collect_reports(args.resolution_report)
|
| 1178 |
+
source = pq.read_table(args.source)
|
| 1179 |
+
rows = source.to_pylist()
|
| 1180 |
+
names = {row['path'] for row in rows}
|
| 1181 |
+
if set(review) - names:
|
| 1182 |
+
raise ValueError('Review contains tasks outside the source')
|
| 1183 |
+
labels, reasons, unresolved, changes = {}, {}, {}, {}
|
| 1184 |
+
dropped = {name: ARCHIVED_TASKS[name] for name in names & ARCHIVED_TASKS.keys()}
|
| 1185 |
+
rows = [row for row in rows if row['path'] not in dropped]
|
| 1186 |
+
for row in rows:
|
| 1187 |
+
name = row['path']
|
| 1188 |
+
decision = review.get(name, {})
|
| 1189 |
+
automatic_paths = args.automatic_paths and name in evidence and bool(evidence[name]['selected'].get('diagnostic', {}).get('agent_baseline', {}).get('task_sha256'))
|
| 1190 |
+
selected = evidence[name]['selected'] if automatic_paths or decision.get('replacements') else {}
|
| 1191 |
+
row['task_binary'], edits = patch_blob(
|
| 1192 |
+
row['task_binary'], selected.get('diagnostic'), decision.get('replacements', []),
|
| 1193 |
+
oracle_passed=selected.get('status') == 'passed' and bool(selected.get('rewards')) and all(r == 1 for r in selected['rewards']),
|
| 1194 |
+
task_id=name, automatic_paths=automatic_paths)
|
| 1195 |
+
if not edits:
|
| 1196 |
+
continue
|
| 1197 |
+
changes[name] = edits
|
| 1198 |
+
labels[name] = []
|
| 1199 |
+
descriptions = []
|
| 1200 |
+
if any(e.get('phase') not in ('verifier-import-path', 'verifier-call-time-imports', 'verifier-worker-cleanup', 'verifier-exact-test-ids', 'verifier-debug-stream-isolation', 'verifier-request-cleanup', 'verifier-cpu-affinity', 'verifier-test-fixture-restoration', 'verifier-required-test-skipped') for e in edits):
|
| 1201 |
+
labels[name].append('instruction-path-clarified')
|
| 1202 |
+
descriptions.append('User-approved minimal instruction correction' if name in INSTRUCTION_CORRECTIONS
|
| 1203 |
+
else 'Absolute paths supported by task-setup/reference-solution observations')
|
| 1204 |
+
if any(e.get('phase') == 'verifier-import-path' for e in edits):
|
| 1205 |
+
labels[name].append('verifier-import-path')
|
| 1206 |
+
descriptions.extend(e['reason'] for e in edits if e.get('phase') == 'verifier-import-path')
|
| 1207 |
+
fixture_repairs = [e for e in edits if e.get('phase') == 'verifier-test-fixture-restoration']
|
| 1208 |
+
if fixture_repairs:
|
| 1209 |
+
labels[name].append('verifier-test-fixture-restoration')
|
| 1210 |
+
descriptions.extend(e['reason'] for e in fixture_repairs)
|
| 1211 |
+
if any(e.get('phase') == 'verifier-call-time-imports' for e in edits):
|
| 1212 |
+
labels[name].append('verifier-call-time-imports')
|
| 1213 |
+
descriptions.append('Move reviewed feature imports into consuming test functions so missing functionality fails during test execution; preserve selected tests, assertions and reward rules')
|
| 1214 |
+
cleanup = [e['reason'] for e in edits if e.get('phase') == 'verifier-worker-cleanup']
|
| 1215 |
+
if cleanup:
|
| 1216 |
+
labels[name].append('verifier-worker-cleanup')
|
| 1217 |
+
descriptions.extend(cleanup)
|
| 1218 |
+
exact_ids = [e['reason'] for e in edits if e.get('phase') == 'verifier-exact-test-ids']
|
| 1219 |
+
if exact_ids:
|
| 1220 |
+
labels[name].append('verifier-exact-test-ids')
|
| 1221 |
+
descriptions.extend(exact_ids)
|
| 1222 |
+
debug_stream = [e['reason'] for e in edits if e.get('phase') == 'verifier-debug-stream-isolation']
|
| 1223 |
+
if debug_stream:
|
| 1224 |
+
labels[name].append('verifier-debug-stream-isolation')
|
| 1225 |
+
descriptions.extend(debug_stream)
|
| 1226 |
+
request_cleanup = [e['reason'] for e in edits if e.get('phase') == 'verifier-request-cleanup']
|
| 1227 |
+
if request_cleanup:
|
| 1228 |
+
labels[name].append('verifier-request-cleanup')
|
| 1229 |
+
descriptions.extend(request_cleanup)
|
| 1230 |
+
cpu_affinity = [e['reason'] for e in edits if e.get('phase') == 'verifier-cpu-affinity']
|
| 1231 |
+
if cpu_affinity:
|
| 1232 |
+
labels[name].append('verifier-cpu-affinity')
|
| 1233 |
+
descriptions.extend(cpu_affinity)
|
| 1234 |
+
skipped = [e['reason'] for e in edits if e.get('phase') == 'verifier-required-test-skipped']
|
| 1235 |
+
if skipped:
|
| 1236 |
+
labels[name].append('verifier-required-test-skipped')
|
| 1237 |
+
descriptions.extend(skipped)
|
| 1238 |
+
reasons[name] = '; '.join(descriptions)
|
| 1239 |
+
if decision.get('unresolved'):
|
| 1240 |
+
unresolved[name] = decision['unresolved']
|
| 1241 |
+
args.output.mkdir(parents=True)
|
| 1242 |
+
output = args.output / 'tasks.parquet'
|
| 1243 |
+
from validation.checks.path_cache import KEY, blob_fingerprint, completed
|
| 1244 |
+
cache = {row['path']: blob_fingerprint(row['task_binary']) for row in rows
|
| 1245 |
+
if row['path'] in evidence and completed(evidence[row['path']]['selected']['diagnostic'])}
|
| 1246 |
+
metadata = dict(source.schema.metadata or {})
|
| 1247 |
+
metadata[KEY] = json.dumps(cache).encode()
|
| 1248 |
+
pq.write_table(pa.Table.from_pylist(rows, schema=source.schema).replace_schema_metadata(metadata), output)
|
| 1249 |
+
(args.output / 'path-edits.json').write_text(json.dumps(changes, indent=2)+'\n')
|
| 1250 |
+
(args.output / 'unresolved-paths.json').write_text(json.dumps(unresolved, indent=2)+'\n')
|
| 1251 |
+
write_patch_report(args.source, output, patcher=__file__, source={
|
| 1252 |
+
'dataset': 'PrimeIntellect/Scale-SWE-Verified', 'revision': REVISION,
|
| 1253 |
+
'url': f'https://huggingface.co/datasets/PrimeIntellect/Scale-SWE-Verified/tree/{REVISION}'},
|
| 1254 |
+
dropped=dropped, change_labels=labels, change_reasons=reasons,
|
| 1255 |
+
patches=[{'version': 'absolute-paths-v1', 'resolver_reports': [str(p.resolve()) for p in args.resolution_report],
|
| 1256 |
+
'automatic_paths': args.automatic_paths, 'review': str(args.review.resolve()) if args.review else None},
|
| 1257 |
+
{'version': 'verifier-import-path-v2',
|
| 1258 |
+
'tasks': sorted(name for name in changes if name in VERIFIER_IMPORT_TASKS)},
|
| 1259 |
+
{'version': 'reviewed-collection-repairs-v1', 'tasks': sorted(set(changes) & DEFERRED_IMPORTS.keys()),
|
| 1260 |
+
'archived_tasks': sorted(dropped)},
|
| 1261 |
+
{'version': 'gold-added-test-fixtures-v1',
|
| 1262 |
+
'tasks': sorted(name for name, task_edits in changes.items()
|
| 1263 |
+
if any(e.get('phase') == 'verifier-test-fixture-restoration'
|
| 1264 |
+
for e in task_edits))},
|
| 1265 |
+
{'version': 'skipped-required-tests-v1', 'tasks': sorted(name for name in changes if name in SKIPPED_REQUIRED_TESTS)}])
|
| 1266 |
+
print(json.dumps({'tasks': len(rows), 'changed': len(changes), 'output': str(output)}))
|
| 1267 |
+
|
| 1268 |
+
|
| 1269 |
+
if __name__ == '__main__':
|
| 1270 |
+
main()
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb2cbb95512676e91078d736370661ae69d77b2dd139591fc051d41bf30e56f5
|
| 3 |
+
size 10870523
|
|
The diff for this file is too large to render.
See raw diff
|
|
|
|
The diff for this file is too large to render.
See raw diff
|
|
|
|
The diff for this file is too large to render.
See raw diff
|
|
|
|
The diff for this file is too large to render.
See raw diff
|
|
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4305c13a35a47f7466e32ae672d056a2e201f935fe5ee0ebe2bea084513243ab
|
| 3 |
+
size 6307250
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da3c07fe5ac72ad8c8ef72173a493a1b980b41859dcfe15de3a744697d2b89e2
|
| 3 |
+
size 970637
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec254232ee53bb9e91a6b0e4a45fb3fe58548251764286c991b68ff81cad5831
|
| 3 |
+
size 8845873
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:419db6ac2f715bf3381da35daefc5d88323a125197d224907ae754d4c8906fa4
|
| 3 |
+
size 256589251
|