verifiers 0.3.2.dev6__py3-none-any.whl → 0.3.2.dev8__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.
@@ -19,10 +19,10 @@ logger = logging.getLogger(__name__)
19
19
  GITHUB_RELEASE_URL = (
20
20
  "https://github.com/PrimeIntellect-ai/prime-agent/releases/download"
21
21
  )
22
- PRIME_AGENT_COMMIT: Literal["b5ee2f81a59510e7225a0db10d65102e91e98803"] = (
23
- "b5ee2f81a59510e7225a0db10d65102e91e98803"
22
+ PRIME_AGENT_COMMIT: Literal["514633727bf26d74f39f3119c2b0e31a5ceb2a9d"] = (
23
+ "514633727bf26d74f39f3119c2b0e31a5ceb2a9d"
24
24
  )
25
- PRIME_AGENT_VERSION = "0.8.0-beta.549.1.b5ee2f8"
25
+ PRIME_AGENT_VERSION = "0.8.1"
26
26
  PRIME_AGENT_DIR = "/var/tmp/vf-prime-agent"
27
27
  STATE_ROOT = "/tmp/vf-prime-agent-runs"
28
28
  SKILLS_DIR = ".agents/skills"
@@ -39,7 +39,7 @@ prefix="$VF_PRIME_AGENT_DIR/$PRIME_AGENT_COMMIT"
39
39
  [ -x "$prefix/bin/prime-agent" ] && exit 0
40
40
  export NPM_CONFIG_PREFIX="$prefix"
41
41
  export PRIME_AGENT_BOOTSTRAP_KERNEL_ON_INSTALL=0
42
- release_url="$VF_PRIME_AGENT_GITHUB_RELEASE_URL/beta"
42
+ release_url="$VF_PRIME_AGENT_GITHUB_RELEASE_URL/v$PRIME_AGENT_RELEASE_VERSION"
43
43
  agent_tarball="prime-agent-$PRIME_AGENT_RELEASE_VERSION.tgz"
44
44
  ai_tarball="prime-agent-ai-$PRIME_AGENT_RELEASE_VERSION.tgz"
45
45
  core_tarball="prime-agent-core-$PRIME_AGENT_RELEASE_VERSION.tgz"
@@ -51,10 +51,10 @@ for tarball in "$agent_tarball" "$ai_tarball" "$core_tarball" "$tui_tarball"; do
51
51
  "$release_url/$tarball" -o "$download_dir/$tarball"
52
52
  done
53
53
  printf '%s %s\n' \
54
- 'f3b98bd7bf70dc25077dbd6afcec8d651570bead96919b42b8fde36d3e7d7268' "$agent_tarball" \
55
- '0d655397ca9fda765afb5ba7b2b65ab74b928f9c178e548ef3befc0358f39ce2' "$ai_tarball" \
56
- '0cb81e79422887a43d850722812c6a4589760eb69441cb4c042e665cbfdff5e1' "$core_tarball" \
57
- '307ec5e5a320f9a0355b08ec352230cb406f82fac0ebbd6e33f6306a3e9452a8' "$tui_tarball" \
54
+ '46c24db1782dd31adc35d5c6cbcc75564faba6ced3bf2ccf03d836ee77134475' "$agent_tarball" \
55
+ 'f6c3bdb6093bc24a327546fe865ef9a4a172c734fcd4c4093e30c19476f0134d' "$ai_tarball" \
56
+ '0cc3660953545f8ac9a7e704fcb9875f954d58c3085304080ef615c280aa5748' "$core_tarball" \
57
+ 'bd07bccee0ca495565b1d62e9411f3fdebe49e3dfa52870564f08af5e61fde15' "$tui_tarball" \
58
58
  > "$download_dir/SHA256SUMS"
59
59
  (cd "$download_dir" && sha256sum -c SHA256SUMS)
60
60
  mkdir "$download_dir/package-root"
@@ -87,7 +87,7 @@ PRIME_AGENT_BOOTSTRAP_TOOLS_ON_INSTALL=1 npm install -g \
87
87
 
88
88
 
89
89
  class PrimeAgentHarnessConfig(HarnessConfig):
90
- commit: Literal["b5ee2f81a59510e7225a0db10d65102e91e98803"] = PRIME_AGENT_COMMIT
90
+ commit: Literal["514633727bf26d74f39f3119c2b0e31a5ceb2a9d"] = PRIME_AGENT_COMMIT
91
91
  """Prime Agent main commit to install."""
92
92
 
93
93
  autonomous: bool = False
verifiers/v1/rollout.py CHANGED
@@ -80,8 +80,7 @@ class Rollout:
80
80
  self._shared_tools = shared_tools or {}
81
81
  self._interception = interception
82
82
  self.runtime = runtime
83
- self._owns_runtime = runtime is None
84
- self._previous_runtime_env: dict[str, str] | None = None
83
+ self._borrowed_runtime = runtime
85
84
  self.trace: Trace = Trace(
86
85
  task=TraceTask(
87
86
  type=type(task).__name__,
@@ -158,12 +157,12 @@ class Rollout:
158
157
  """Record `error` as this rollout's outcome (captured onto the trace, the
159
158
  remaining stages skipped) — the run's owner reporting a failure the run
160
159
  itself couldn't see, e.g. its user raising between segments."""
161
- if not self._owns_runtime and self.runtime is not None and self.runtime.stopped:
160
+ if self._borrowed_runtime is not None and self._borrowed_runtime.stopped:
162
161
  # The owner tore the borrowed box down mid-run — a lifetime bug in the
163
162
  # borrowing program: raise to the caller instead of capturing a
164
163
  # misattributed error onto the trace.
165
164
  raise ValueError(
166
- f"borrowed runtime {self.runtime.name!r} was torn down by its owner "
165
+ f"borrowed runtime {self._borrowed_runtime.name!r} was torn down by its owner "
167
166
  "mid-run; keep the provisioning context open until every run "
168
167
  "placed into the box has completed"
169
168
  ) from error
@@ -173,12 +172,6 @@ class Rollout:
173
172
  self._failure = error
174
173
  self.trace.record_error(error)
175
174
 
176
- def _release_borrowed_runtime(self) -> None:
177
- if self._previous_runtime_env is not None and self.runtime is not None:
178
- self.runtime.env = self._previous_runtime_env
179
- self._previous_runtime_env = None
180
- self.runtime.borrow_lock.release()
181
-
182
175
  async def open(self) -> bool:
183
176
  """Boot the rollout's world up to the point where segments can run: start
184
177
  (or borrow) the runtime, run task + harness setup, bring up the
@@ -186,9 +179,9 @@ class Rollout:
186
179
  proceed; a setup failure is captured onto the trace."""
187
180
  self._opened = True
188
181
  self.trace.timing.boot.start = time.time()
189
- if self._owns_runtime:
182
+ if self._borrowed_runtime is None:
190
183
  self.runtime = make_runtime(self.runtime_config, name=self.trace.id)
191
- elif self.runtime.stopped:
184
+ elif self._borrowed_runtime is not None and self._borrowed_runtime.stopped:
192
185
  # A lifetime bug in the borrowing program: raise to the caller instead
193
186
  # of capturing onto the trace.
194
187
  raise ValueError(
@@ -208,21 +201,18 @@ class Rollout:
208
201
  )
209
202
  try:
210
203
  runtime_env = dict(self.task.runtime_env())
211
- if self._owns_runtime:
204
+ if self._borrowed_runtime is None:
212
205
  runtime.env = runtime_env
213
206
  else:
214
- await runtime.borrow_lock.acquire()
215
- self._previous_runtime_env = runtime.env
216
- # The owner's defaults return after the borrow; they do not belong to
217
- # this task and must not flow into its processes.
218
- runtime.env = runtime_env
207
+ runtime = runtime.with_env(runtime_env)
208
+ self.runtime = runtime
219
209
  if self.task.data.prompt is None and not self._has_user:
220
210
  raise TaskError(
221
211
  "task has no prompt and no user to open the conversation; set "
222
212
  "task.prompt, or drive the run through agent.interaction() and open "
223
213
  "it with the first turn(message)"
224
214
  )
225
- if self._owns_runtime:
215
+ if self._borrowed_runtime is None:
226
216
  await runtime.start()
227
217
  await runtime.prepare_setup()
228
218
  now = time.time()
@@ -441,8 +431,7 @@ class Rollout:
441
431
  if self.runtime is not None:
442
432
  with contextlib.suppress(Exception):
443
433
  await self.harness.cleanup(self.trace, self.runtime)
444
- self._release_borrowed_runtime()
445
- if self._owns_runtime and self.runtime is not None:
434
+ if self._borrowed_runtime is None and self.runtime is not None:
446
435
  with contextlib.suppress(Exception):
447
436
  await self.runtime.stop()
448
437
 
@@ -523,11 +512,10 @@ class Rollout:
523
512
  logger.warning(
524
513
  "harness cleanup failed (rollout %s)", trace.id, exc_info=True
525
514
  )
526
- self._release_borrowed_runtime()
527
515
  # Tear down here — the env's `score()` (later) needs only the traces,
528
516
  # not a live runtime. A borrowed runtime is its creator's to tear down,
529
517
  # not this rollout's.
530
- if self._owns_runtime and runtime is not None:
518
+ if self._borrowed_runtime is None and runtime is not None:
531
519
  try:
532
520
  await runtime.stop()
533
521
  except Exception:
@@ -4,6 +4,7 @@ import asyncio
4
4
  import atexit
5
5
  import base64
6
6
  import contextlib
7
+ import copy
7
8
  import hashlib
8
9
  import logging
9
10
  import shlex
@@ -129,6 +130,8 @@ class BaseRuntimeInfo(BaseConfig):
129
130
 
130
131
 
131
132
  class Runtime(ABC):
133
+ __slots__ = ("env",)
134
+
132
135
  is_local: ClassVar[bool] = True
133
136
  """Whether this runtime exchanges host-local URLs without a public tunnel. True for
134
137
  subprocess and Docker (directly or through Docker's policy proxy); remote runtimes
@@ -150,8 +153,6 @@ class Runtime(ABC):
150
153
  # Per-run task values live on the runtime rather than its serializable config/info.
151
154
  # Explicit process values (model credentials, proxy settings, etc.) override these.
152
155
  self.env: dict[str, str] = {}
153
- # A borrowed box is one mutable world, so its rollouts must own it one at a time.
154
- self.borrow_lock = asyncio.Lock()
155
156
  self._uv_interpreters: dict[str, str] = {}
156
157
  self._uv_script_locks: dict[str, asyncio.Lock] = {}
157
158
  self._setup_claimed = False
@@ -198,6 +199,14 @@ class Runtime(ABC):
198
199
  """Combine the task's runtime-wide environment with one process's values."""
199
200
  return {**self.env, **env}
200
201
 
202
+ def with_env(self, env: dict[str, str]) -> "Runtime":
203
+ """Share this physical runtime through a view with its own process environment."""
204
+ runtime = copy.copy(self)
205
+ # `env` is slotted, so every other runtime field stays physical and shared.
206
+ runtime.__dict__ = self.__dict__
207
+ runtime.env = dict(env)
208
+ return runtime
209
+
201
210
  async def alive(self) -> bool:
202
211
  """Whether the box still executes anything. Not every runtime raises when
203
212
  the box is gone — some surface it as `exec`'s own non-zero result,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev6
3
+ Version: 0.3.2.dev8
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
@@ -176,7 +176,7 @@ verifiers/v1/errors.py,sha256=kQeEPX06TwAIuiz7MlWFYirrpKbx5STi6A5b_dtQQoA,6885
176
176
  verifiers/v1/graph.py,sha256=vjxIrE0e-IXeb8fIY0pRGfwrQlGsIAe9IjwHNZXqizk,30652
177
177
  verifiers/v1/harness.py,sha256=ziECqEBWV34UWbLlxrkhY6MwkbVYkoXBOoaY7mZxwTs,14753
178
178
  verifiers/v1/judge.py,sha256=Pvr0C41ah1qkNSZ0WXdkDvBMfv5YSfY1REHncwlJ8cg,9346
179
- verifiers/v1/rollout.py,sha256=Eg6loXytL5ZaUiBZwQTrn74mo7waUIiauKQA650auJs,23974
179
+ verifiers/v1/rollout.py,sha256=HhHCWxH_N7dVjz8WCwmjKdygww9rvpkC91RuaSSwASQ,23442
180
180
  verifiers/v1/session.py,sha256=GmwZoE-L4jzsUy7Fj9OUHu0yMLBe9lgSFKCbhLoZdjk,18706
181
181
  verifiers/v1/state.py,sha256=EckF2bWp-vV4b1jYJ9sLI5xrfGuI5spIgYYwW926toI,595
182
182
  verifiers/v1/task.py,sha256=ZiAE5uGxgHWqz8UF5YJHs80RgSKhxGMGQo4lJusSRus,11375
@@ -277,7 +277,7 @@ verifiers/v1/harnesses/pi/harness.py,sha256=M0BRsfJxnBNP-KCrp0vT5gHlaJEDnyti5x_3
277
277
  verifiers/v1/harnesses/pool/__init__.py,sha256=HTYsNiWGdiNEsSHj4xhPmshJSNb7SHjQ7d4yZQ4p3HM,127
278
278
  verifiers/v1/harnesses/pool/harness.py,sha256=HKAogPbyLK5QpvPQ1teHOh_IyRQX-or2JF71nnZ_5Ps,3875
279
279
  verifiers/v1/harnesses/prime_agent/__init__.py,sha256=xfPC4RrlnyYWaf38tPAOZq4YL6M55lMpj5BoRLmaK8I,171
280
- verifiers/v1/harnesses/prime_agent/harness.py,sha256=ymctYIKLBeStLX59qhHkOEemtAwlbTepYIgbLe1-w_8,11199
280
+ verifiers/v1/harnesses/prime_agent/harness.py,sha256=byplbbIOFACCn2BvVZAxBSHdaPKBGERYz_hA1rgBj0E,11205
281
281
  verifiers/v1/harnesses/rlm/__init__.py,sha256=hwx51xTdEWzzYgMj-p4ETNcptoub3IPMDbEdJ4uB8Ns,122
282
282
  verifiers/v1/harnesses/rlm/harness.py,sha256=rQDME1GaYcApf7Giqt2ZyBQCBhuXvwLR-X-ofAbfWPo,6860
283
283
  verifiers/v1/harnesses/terminus_2/__init__.py,sha256=l1pwfg1HyVDEqT9efdnFWcXqaZwtKwe7TrplkyxZSA0,166
@@ -302,7 +302,7 @@ verifiers/v1/mcp/launch.py,sha256=dqi5UCE-ShPn663glL4DwnTHk4_VBLG_0qUUwlr3p10,23
302
302
  verifiers/v1/mcp/server.py,sha256=RoDDRae-dqRP4gRVQg85nYKz6iwpzobfNfFmUc6MIM8,12350
303
303
  verifiers/v1/mcp/toolset.py,sha256=VZPMTMEeEPj9wTlpau0_TY5AhDktwhNUmzKlWg8YZFk,1001
304
304
  verifiers/v1/runtimes/__init__.py,sha256=ppc1R_sx-aMcuJSx4t99rTSjloUXI0M6EUj676-1PeY,2862
305
- verifiers/v1/runtimes/base.py,sha256=QEGKR_4v6tAxjaOVLvpwPdR9MbFzRWPImaVjX_oJ01E,16556
305
+ verifiers/v1/runtimes/base.py,sha256=SRTUNAcdW0xJIWjfS5RcijFXqdKyXmGvp2tvV58eu58,16826
306
306
  verifiers/v1/runtimes/limiters.py,sha256=C6cWDD4pwyFwUY4QFke3oiMXwydSNIfSbJSIglUC2kE,3062
307
307
  verifiers/v1/runtimes/modal.py,sha256=Lgc0OkQEWHVBHCqBE2ja-mxtRYGserixlO4B9b5Vwn4,12661
308
308
  verifiers/v1/runtimes/prime.py,sha256=QnrSCmq9lA_u4o0k6igsum_okSTOZR1lSAHqeRhwldk,18931
@@ -350,8 +350,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
350
350
  verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
351
351
  verifiers/v1/utils/score.py,sha256=-R5Cog14r_tJ6Q_oOfGr5VPAm2CCUhofYZB6B9lm4wM,5787
352
352
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
353
- verifiers-0.3.2.dev6.dist-info/METADATA,sha256=4t3Ty6reOhIm8YZAnnSupEV50OixpaM09UJ8UqZrm1Q,4653
354
- verifiers-0.3.2.dev6.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
355
- verifiers-0.3.2.dev6.dist-info/entry_points.txt,sha256=hZ5wDc1T8y-EvOziw7kQqatBJ6PbdSu2ygP5rjANl7c,564
356
- verifiers-0.3.2.dev6.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
357
- verifiers-0.3.2.dev6.dist-info/RECORD,,
353
+ verifiers-0.3.2.dev8.dist-info/METADATA,sha256=vBN-kNq8u-vBtNaJwrK7GP1dpGv0ypLm42UyM2mqoN4,4653
354
+ verifiers-0.3.2.dev8.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
355
+ verifiers-0.3.2.dev8.dist-info/entry_points.txt,sha256=hZ5wDc1T8y-EvOziw7kQqatBJ6PbdSu2ygP5rjANl7c,564
356
+ verifiers-0.3.2.dev8.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
357
+ verifiers-0.3.2.dev8.dist-info/RECORD,,