verifiers 0.2.2.dev40__py3-none-any.whl → 0.2.2.dev41__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.
verifiers/v1/harness.py CHANGED
@@ -9,7 +9,7 @@ from typing import TYPE_CHECKING, ClassVar, Generic, TypeVar
9
9
  from verifiers.v1.clients import ModelContext
10
10
  from verifiers.v1.configs.harness import HarnessConfig
11
11
  from verifiers.v1.decorators import discover_decorated, invoke_all
12
- from verifiers.v1.errors import HarnessError, boundary
12
+ from verifiers.v1.errors import HarnessError, SandboxError, boundary
13
13
  from verifiers.v1.runtimes import ProgramResult, Runtime
14
14
  from verifiers.v1.task import TaskData
15
15
  from verifiers.v1.types import Messages
@@ -140,6 +140,11 @@ class Harness(ABC, Generic[ConfigT]):
140
140
  if result.exit_code != 0:
141
141
  # The real cause is at the END of a traceback, so keep the tail.
142
142
  detail = (result.stderr or result.stdout).strip()[-2000:] or "<no output>"
143
+ if not await runtime.alive():
144
+ raise SandboxError(
145
+ f"runtime died under harness {self.config.id!r} "
146
+ f"(exit {result.exit_code}): {detail}"
147
+ )
143
148
  raise HarnessError(
144
149
  f"harness {self.config.id!r} exited {result.exit_code}: {detail}"
145
150
  )
@@ -197,6 +197,16 @@ class Runtime(ABC):
197
197
  async def run(self, argv: list[str], env: dict[str, str]) -> ProgramResult:
198
198
  pass
199
199
 
200
+ async def alive(self) -> bool:
201
+ """Whether the box still executes anything. Not every runtime raises when
202
+ the box is gone — some surface it as `exec`'s own non-zero result,
203
+ indistinguishable from the command failing. One probe on the failure path
204
+ tells the two apart before we blame anyone."""
205
+ try:
206
+ return (await self.run(["true"], {})).exit_code == 0
207
+ except Exception: # noqa: BLE001 - failing to exec at all means the box is gone
208
+ return False
209
+
200
210
  async def run_program(self, argv: list[str], env: dict[str, str]) -> ProgramResult:
201
211
  """Run the harness's MAIN program — the rollout itself (a possibly long-lived, stateful,
202
212
  agentic run) — as opposed to the short idempotent infra ops (write / mv / install /
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: verifiers
3
- Version: 0.2.2.dev40
3
+ Version: 0.2.2.dev41
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
@@ -174,7 +174,7 @@ verifiers/v1/env.py,sha256=QFwhD1NKbEUWGf0l6G2ttK4JLbhUt2MUCDciWaaJ_1s,17834
174
174
  verifiers/v1/episode.py,sha256=KWyM9ovTphEIo2260BYu2HvtnOOTxjLRDPrF_jTCiuA,2497
175
175
  verifiers/v1/errors.py,sha256=Pj5Om8x1fP3TDPQQn6nUCoSPoZRsy2JeBz8pXhpPrDY,6883
176
176
  verifiers/v1/graph.py,sha256=-j8MNdIv1r5ifajv5ggnGPsfBNB74IO3WKLcrpYh9hg,29102
177
- verifiers/v1/harness.py,sha256=oL_CyPXw2ScCXfM-E0sk-7_y4PqvjxC8gq2jR2jyWUs,10709
177
+ verifiers/v1/harness.py,sha256=cDiDuhp29aqL4CxiqSZz-IT0QlOcVlye_vTTHZblWo8,10948
178
178
  verifiers/v1/judge.py,sha256=VnTi9iSfCJMCccYWc1qCTcT7iD3AcomS2cXfHwh1HVw,9423
179
179
  verifiers/v1/legacy.py,sha256=kGfx4CEmk17VEqwX6JfUBbjQRMqJ0tL4kkA2kqGypN8,22305
180
180
  verifiers/v1/loaders.py,sha256=TnNKY2msVo3p7m-5wjw376PYH-zTu3TLixXRst0VOiM,9985
@@ -292,7 +292,7 @@ verifiers/v1/mcp/launch.py,sha256=lRtcl98BO7imC44bsxO2yljwRQR_KCvJ6P-bd_hS5L8,18
292
292
  verifiers/v1/mcp/server.py,sha256=uW8qddXQbtECxIPCU-lkOlFIv3VKWoFAeZFNhwPoyWo,10985
293
293
  verifiers/v1/mcp/toolset.py,sha256=tSPXgTNREZyaeCnoFVnDfXxFAj_pStZMPUIgyPrY_Dk,996
294
294
  verifiers/v1/runtimes/__init__.py,sha256=TqNtJVahzQuLS4fgCVeT9xdOzTkp0hRAPOkl7eFVDUg,2011
295
- verifiers/v1/runtimes/base.py,sha256=hv1McFrIZgymLwMLNYPAlsR4At0uz60haVo5eXrFbNU,14196
295
+ verifiers/v1/runtimes/base.py,sha256=sTCiLo51yAU_T-Voc3BTH-FuzyEM0cGY05VzFE4DmYc,14720
296
296
  verifiers/v1/runtimes/limiters.py,sha256=ZjjYUFEt20yH8ggL5uU9w9U500AOB44qSUTQ7bYyh0c,2730
297
297
  verifiers/v1/runtimes/modal.py,sha256=FnocoJd9lQVQS3V3CoBon7KpKXm1bKWWeU2FAkq2bKU,8825
298
298
  verifiers/v1/runtimes/prime.py,sha256=wldpcZnKZHNRldpoubeMgHdl-ZlKWOyeulFu4nHNKwc,15110
@@ -327,8 +327,8 @@ verifiers/v1/utils/logging.py,sha256=OcMHA6NsYux3oIzjPuI95rDWmFBHNcHDjZeNIhXTX-Y
327
327
  verifiers/v1/utils/memory.py,sha256=ZkIvGk6uITAH5sKon65LifKPbvZr8mJ__PVc23FZpOQ,1835
328
328
  verifiers/v1/utils/sampling.py,sha256=JczGzBn6s3wsIrSY2Hy3hE8m6NreNgsNzhSjDikQqX0,1037
329
329
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
330
- verifiers-0.2.2.dev40.dist-info/METADATA,sha256=7FRJgVM3XdGU4JTZSsGsxxaKndzkW26q4EFyz9NsMhE,4540
331
- verifiers-0.2.2.dev40.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
332
- verifiers-0.2.2.dev40.dist-info/entry_points.txt,sha256=dF82JUYEFslR1AOW8LZfuBWeZeQoyX4wCRrduklg8-I,551
333
- verifiers-0.2.2.dev40.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
334
- verifiers-0.2.2.dev40.dist-info/RECORD,,
330
+ verifiers-0.2.2.dev41.dist-info/METADATA,sha256=DBJbZYlN8WMvZtMYyH2rDHocN0aa-l2mDI0NXAyR1kU,4540
331
+ verifiers-0.2.2.dev41.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
332
+ verifiers-0.2.2.dev41.dist-info/entry_points.txt,sha256=dF82JUYEFslR1AOW8LZfuBWeZeQoyX4wCRrduklg8-I,551
333
+ verifiers-0.2.2.dev41.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
334
+ verifiers-0.2.2.dev41.dist-info/RECORD,,