verifiers 0.3.2.dev70__py3-none-any.whl → 0.3.2.dev72__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -295,17 +295,20 @@ class PrimeRuntime(Runtime):
295
295
 
296
296
  async def run(self, argv: list[str], env: dict[str, str]) -> ProgramResult:
297
297
  try:
298
- # The shared SDK client coalesces concurrent VM job polls into batches.
299
- # Rollout cancellation remains the practical execution timeout; this
300
- # long SDK deadline is only a final safety bound.
301
- result = await self._client.run_background_job(
298
+ # Poll directly so rollout cancellation owns the execution timeout.
299
+ job = await self._client.start_background_job(
302
300
  self.info.id,
303
301
  shlex.join(argv),
304
- timeout=EFFECTIVELY_UNBOUNDED_SECONDS,
305
302
  working_dir=self.config.workdir,
306
303
  env=self.process_env(env),
307
- poll_interval=1,
308
304
  )
305
+ delay = 0.1
306
+ while True:
307
+ result = await self._client.get_background_job(self.info.id, job)
308
+ if result.completed:
309
+ break
310
+ await asyncio.sleep(delay)
311
+ delay = min(delay * 2, 3)
309
312
  except (
310
313
  Exception
311
314
  ) as e: # a sandbox/API failure is one rollout's problem, not the eval's
@@ -27,7 +27,7 @@ import tempfile
27
27
  import time
28
28
  from collections.abc import Iterator
29
29
  from functools import lru_cache
30
- from pathlib import Path
30
+ from pathlib import Path, PurePosixPath
31
31
  from typing import Annotated
32
32
 
33
33
  from pydantic import BaseModel, ConfigDict, Field, TypeAdapter, ValidationError
@@ -250,31 +250,38 @@ class HarborTask(Task[HarborData]):
250
250
  if not self.scoring_deferred:
251
251
  trace.state.artifacts = await collect(runtime, self.data.artifacts)
252
252
 
253
- async def stage_verifier(self, runtime: Runtime) -> None:
254
- # An artifact under /tests must not replace the task package's verifier.
253
+ async def stage_verifier(self, trace: Trace, runtime: Runtime) -> None:
254
+ if any(
255
+ PurePosixPath(root).is_relative_to("/tests")
256
+ for root in trace.state.artifacts
257
+ ):
258
+ raise TaskError("Harbor artifacts cannot restore into /tests")
255
259
  await self.stage_tests(runtime, wipe=True)
256
260
  self.verifier_staged = True
257
261
 
258
262
  async def stage_tests(self, runtime: Runtime, wipe: bool = False) -> None:
259
- """Put the task package's `tests/` in `/tests`, where `test.sh` expects it.
263
+ """Use a dedicated verifier image's tests, or stage the task package's tests.
260
264
 
261
265
  Raises rather than scoring stale state: a leftover reward file — planted by
262
266
  the agent or shipped in the image — must be gone before `test.sh` runs, so a
263
267
  removal that fails must not fall through to reading it.
264
-
265
- `wipe` for a box we did not watch being built: a fresh container of the task's
266
- image can ship its own `/tests`, and a leftover file there would be graded as
267
- though it came from the package.
268
268
  """
269
- await runtime.write(
270
- "/tmp/tests.tgz", make_tar(Path(self.data.task_dir) / "tests")
271
- )
272
- stage = (
273
- f"{'rm -rf /tests && ' if wipe else ''}"
269
+ # Harbor's dedicated verifier image owns the complete test suite and its
270
+ # dependencies. Mixing it with packaged tests can retain obsolete helpers.
271
+ stage = "test -f /tests/test.sh"
272
+ if self.data.verifier is None or self.data.verifier.image is None:
273
+ await runtime.write(
274
+ "/tmp/tests.tgz", make_tar(Path(self.data.task_dir) / "tests")
275
+ )
276
+ stage = (
277
+ f"{'rm -rf /tests && ' if wipe else ''}"
278
+ "mkdir -p /tests && tar -xzf /tmp/tests.tgz -C /tests"
279
+ )
280
+ command = (
274
281
  "rm -f /logs/verifier/reward.json /logs/verifier/reward.txt && "
275
- "mkdir -p /logs/verifier /tests && tar -xzf /tmp/tests.tgz -C /tests"
282
+ f"mkdir -p /logs/verifier && {stage}"
276
283
  )
277
- result = await runtime.run(["sh", "-c", stage], {})
284
+ result = await runtime.run(["sh", "-c", command], {})
278
285
  if result.exit_code:
279
286
  raise TaskError(
280
287
  f"staging tests failed (exit {result.exit_code}): "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev70
3
+ Version: 0.3.2.dev72
4
4
  Summary: Verifiers: Environments for LLM Reinforcement Learning
5
5
  Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
6
6
  Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
@@ -144,7 +144,7 @@ verifiers/v1/runtimes/__init__.py,sha256=ppc1R_sx-aMcuJSx4t99rTSjloUXI0M6EUj676-
144
144
  verifiers/v1/runtimes/base.py,sha256=VMxYMnGE_zj4k1VseTxEtKhzOZroahRnZSfvruDenEw,17468
145
145
  verifiers/v1/runtimes/limiters.py,sha256=C6cWDD4pwyFwUY4QFke3oiMXwydSNIfSbJSIglUC2kE,3062
146
146
  verifiers/v1/runtimes/modal.py,sha256=wUNik2Wul1YISausdABIMAoSaTA0MNDwKUayKxVLwAA,13342
147
- verifiers/v1/runtimes/prime.py,sha256=7LIu-ciN_VT8GU6xD3W29k4ZJN1TpcL_5libDUN0VU0,19304
147
+ verifiers/v1/runtimes/prime.py,sha256=JUj_jl1UVXHKDif41UcLXnnwX5Sdt9lQTqw14FtIl9c,19346
148
148
  verifiers/v1/runtimes/subprocess.py,sha256=QmpQ235_xrX6gowrr8557VgbydOXpLbfFq0KKGfJThk,8774
149
149
  verifiers/v1/runtimes/docker/__init__.py,sha256=JN0mI10a_BKQpRRJKX_NqStAoODAEk2dAJF9mrz69ug,20972
150
150
  verifiers/v1/runtimes/docker/egress.py,sha256=iFH_1XotlEM-OCaW7GNu3TWVEq1sqesKYweyVBX8g90,14360
@@ -157,7 +157,7 @@ verifiers/v1/serve/types.py,sha256=CjZ6PWQlzSRkBG77gXfzKHnw_S_qKUm9dZSSxVgkv1w,1
157
157
  verifiers/v1/tasksets/__init__.py,sha256=5hTKSPLXSZTgKBbeKQI7FEp06c0ZsaQfuwvrvVFLgb8,712
158
158
  verifiers/v1/tasksets/harbor/__init__.py,sha256=JxThzHFYEkuSfQbVf3pEnjordgdfe4MU-QOsSSbyovU,326
159
159
  verifiers/v1/tasksets/harbor/env.py,sha256=rZEh-1IaHpfsrwSOn7qTq7uV0K7cZZ28bHB7BEWQdnc,3622
160
- verifiers/v1/tasksets/harbor/taskset.py,sha256=q4Eo8vcD-3zXB7eDygUcJddmf5KpY2IBUoIlyJ_D3VU,32210
160
+ verifiers/v1/tasksets/harbor/taskset.py,sha256=snoCQdoNBVdk9INQdfhZa8NXDXJjaidd7hU0T9cAuas,32525
161
161
  verifiers/v1/tasksets/lean/__init__.py,sha256=oyv-GbJQBvCyGwo7Ysxm2NjZW-aX4j1uDoHU0f-E7xQ,767
162
162
  verifiers/v1/tasksets/lean/scoring.py,sha256=sfzsT6MUK0zdMgAQ57_P_0CBaPHy3M7go71QMr5hDrs,10599
163
163
  verifiers/v1/tasksets/lean/taskset.py,sha256=Jax76i22G9dOAswQHiWujVbFIM_PUz5yGJI_ShR4n8Y,9238
@@ -189,8 +189,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
189
189
  verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
190
190
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
191
191
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
192
- verifiers-0.3.2.dev70.dist-info/METADATA,sha256=Db5MJf31phEx5wl2P-glZjUl7InSxps2uJLXwIYy9K8,4204
193
- verifiers-0.3.2.dev70.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
194
- verifiers-0.3.2.dev70.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
195
- verifiers-0.3.2.dev70.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
196
- verifiers-0.3.2.dev70.dist-info/RECORD,,
192
+ verifiers-0.3.2.dev72.dist-info/METADATA,sha256=cHFZZm0kOzbpSL2Z69ikceGGWhtWO-DWCx6NlpM1gw8,4204
193
+ verifiers-0.3.2.dev72.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
194
+ verifiers-0.3.2.dev72.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
195
+ verifiers-0.3.2.dev72.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
196
+ verifiers-0.3.2.dev72.dist-info/RECORD,,