verifiers 0.4.2.dev82__py3-none-any.whl → 0.4.2.dev83__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.
@@ -25,7 +25,6 @@ from verifiers.v1.dialects.base import Dialect
25
25
  CacheRetention = Literal["none", "short", "long"]
26
26
 
27
27
  _CACHE_MARKERS = frozenset({"cache_control", "prompt_cache_breakpoint"})
28
- _SCHEMA_KEYS = frozenset({"input_schema", "parameters", "json_schema"})
29
28
  _ANTHROPIC_BLOCK_TYPES = frozenset({"text", "image", "tool_result", "document"})
30
29
 
31
30
 
verifiers/v1/env.py CHANGED
@@ -68,16 +68,6 @@ class RunSlot:
68
68
  done: bool = False
69
69
  started: float | None = None
70
70
 
71
- @classmethod
72
- def finished(cls, episode: Episode) -> "RunSlot":
73
- return cls(
74
- task=Task(episode.task.data),
75
- id=episode.id,
76
- traces=list(episode.traces),
77
- episode=episode,
78
- done=True,
79
- )
80
-
81
71
 
82
72
  ConfigT = TypeVar("ConfigT", bound=EnvConfig)
83
73
 
@@ -40,9 +40,6 @@ from verifiers.v1.utils.scope import run_scope
40
40
 
41
41
  logger = get_logger(__name__)
42
42
 
43
- EFFECTIVELY_UNBOUNDED_SECONDS = 30 * 24 * 60 * 60
44
- """Safety deadline for APIs that require a finite bound. Normal execution remains
45
- bounded by idle detection or rollout cancellation; 30 days is above any real run."""
46
43
  _OUTPUT_TAIL_BYTES = 10 * 1024 * 1024
47
44
  """Maximum retained bytes per command output stream."""
48
45
  _PUBLIC_DOMAIN = "sandbox-v2-prod.pinfra.io"
@@ -1,12 +1,4 @@
1
- """Compact human-readable formatting for display (durations, counts, headline reward)."""
2
-
3
- from __future__ import annotations
4
-
5
- from collections.abc import Callable
6
- from typing import TYPE_CHECKING
7
-
8
- if TYPE_CHECKING:
9
- from verifiers.v1.trace import Trace
1
+ """Compact human-readable duration formatting for display."""
10
2
 
11
3
 
12
4
  def format_time(seconds: float) -> str:
@@ -23,51 +15,3 @@ def format_time(seconds: float) -> str:
23
15
  return f"{int(h)}h {int(rem // 60)}m"
24
16
  d, rem = divmod(seconds, 86400)
25
17
  return f"{int(d)}d {int(rem // 3600)}h"
26
-
27
-
28
- def format_count(n: int) -> str:
29
- """A compact count (mirrors prime-rl): 936 / 4.8K / 1.5M."""
30
- if n < 1_000:
31
- return str(n)
32
- if n < 1_000_000:
33
- return f"{n / 1e3:.1f}K"
34
- return f"{n / 1e6:.1f}M"
35
-
36
-
37
- MAX_OVERRIDE_CHARS = 72
38
-
39
-
40
- def format_override(value: object) -> str:
41
- """A value as one compact segment: dict `{k=v,k=v}`, list/tuple `[a,b]`, else `str`;
42
- whitespace collapsed and cut to MAX_OVERRIDE_CHARS."""
43
- if isinstance(value, dict):
44
- text = "{" + ",".join(f"{k}={v}" for k, v in value.items()) + "}"
45
- elif isinstance(value, (list, tuple)):
46
- text = "[" + ",".join(str(v) for v in value) + "]"
47
- else:
48
- text = str(value)
49
- text = " ".join(text.split())
50
- return (
51
- text
52
- if len(text) <= MAX_OVERRIDE_CHARS
53
- else text[: MAX_OVERRIDE_CHARS - 1] + "…"
54
- )
55
-
56
-
57
- def format_mean(
58
- traces: list[Trace], value: Callable[[Trace], float], digits: int = 2
59
- ) -> str:
60
- """Mean of `value` over completed, non-dropped `traces`: the mean over the non-errored
61
- ones (error-corrected). When some errored, also append the global mean — over *all*
62
- completed, an errored trace's value counting as 0 — in parens, so both the error-corrected
63
- and the raw mean are visible. "—" when nothing has completed (or all errored or dropped)."""
64
- traces = [t for t in traces if not t.is_dropped]
65
- if not traces:
66
- return "—"
67
- clean = [t for t in traces if not t.has_error]
68
- if not clean:
69
- return "—"
70
- mean = f"{sum(value(t) for t in clean) / len(clean):.{digits}f}"
71
- if len(clean) < len(traces): # some errored → show the raw global avg alongside
72
- mean += f" ({sum(value(t) for t in traces) / len(traces):.{digits}f})"
73
- return mean
@@ -3,13 +3,12 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import asyncio
6
- import json
7
6
  from functools import cache
8
7
  from pathlib import Path
9
8
 
10
9
  from pydantic import TypeAdapter
11
10
 
12
- from verifiers.v1.episode import EnvInfo, Episode, WireEpisode
11
+ from verifiers.v1.episode import EnvInfo, Episode
13
12
  from verifiers.v1.state import StateT
14
13
  from verifiers.v1.task import DataT
15
14
  from verifiers.v1.trace import AgentConfigT, Trace
@@ -42,25 +41,6 @@ def write_episode(
42
41
  f.write(data + b"\n")
43
42
 
44
43
 
45
- def read_episodes(results_dir: Path, trace_type: type) -> list[WireEpisode]:
46
- """Load a run's saved rollouts from `traces.jsonl` with traces typed as
47
- `trace_type` (`Trace[WireTaskData, ...]` reads any taskset's file without
48
- importing it)."""
49
- trace_adapter = type_adapter(trace_type)
50
- episodes: list[WireEpisode] = []
51
- with (results_dir / TRACES_FILE).open(encoding="utf-8") as f:
52
- for line in f:
53
- if not line.strip():
54
- continue
55
- row = json.loads(line)
56
- record = WireEpisode.model_validate({**row, "traces": []})
57
- record.traces = [
58
- trace_adapter.validate_python(trace) for trace in row["traces"]
59
- ]
60
- episodes.append(record)
61
- return episodes
62
-
63
-
64
44
  async def append_episode(
65
45
  results_dir: Path,
66
46
  episode: Episode[DataT, StateT, AgentConfigT],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.4.2.dev82
3
+ Version: 0.4.2.dev83
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
@@ -2,7 +2,7 @@ verifiers/__init__.py,sha256=F5IVMw6mhGaPBMCw7QKk0la_r5mMwydP2hdTTdQucik,352
2
2
  verifiers/v1/__init__.py,sha256=7JZopLlXRErCQc-x1t-bSzwuenwlbh4-ayh3JrwOd7M,18991
3
3
  verifiers/v1/agent.py,sha256=zhg7rn8MjU_57QS_kKTz_UKAG8TwYEPn8nt-ebHuv8A,54286
4
4
  verifiers/v1/delta.py,sha256=23USfU7G5L3TBnV3apyuOa0M_uQAgvTo6a4Ke4msRV0,12205
5
- verifiers/v1/env.py,sha256=UA1FdNd64XywIevJliNyL54afa2StN1ND6ro9HrjlVo,20566
5
+ verifiers/v1/env.py,sha256=1tcWqUEd5GffiJ3aEx_V0WxbzsuzgZd5t-3cOGtf5rM,20302
6
6
  verifiers/v1/episode.py,sha256=ExeTkNEBsDuG40m6VogV6Gd4IHdO4SMPIzQSpt_V96U,6984
7
7
  verifiers/v1/errors.py,sha256=OieUBIOZ6FW7oKygbXIRoag6RrPxKYpMPfEYPcCnVVE,5863
8
8
  verifiers/v1/grading.py,sha256=RV-j71EIeQNC1AeKIDQkS1Y_KTtjJg9x8zF7n2cWr_Y,10100
@@ -31,7 +31,7 @@ verifiers/v1/clients/__init__.py,sha256=3rXv205sRheGvG8yNDmFwpq8qK9dlt7S_ia1zGWh
31
31
  verifiers/v1/clients/base.py,sha256=C0G5lRm3nxt1xmPoA2cweBgCnN2KcLepmCYq1vdDrnU,1691
32
32
  verifiers/v1/clients/client.py,sha256=STtNVV8h-ZOtBtr1JH-NxXfuiY7Fehiw-l8hFmUTnq4,7880
33
33
  verifiers/v1/clients/eval.py,sha256=GgpHZGh4IW3gC-tOZiFPp62MCL4aHik0b4afz2g3-Qo,8729
34
- verifiers/v1/clients/prompt_cache.py,sha256=shJhbTUwKwao6m3DsYDyHPWmhXSJJnXk3wYQhzXFsnY,11849
34
+ verifiers/v1/clients/prompt_cache.py,sha256=-OtG21T3s_ZKeZ5XKlFC7lXqvL44uDL-aoc7C3FOJrs,11777
35
35
  verifiers/v1/clients/train.py,sha256=L6XDRUbOxkhtN6nt3sGqeAiHTfqNYdXdQewY9tQ6f8k,21134
36
36
  verifiers/v1/configs/__init__.py,sha256=X7u6X7B3ieD1HZl79Tv1kg-yPHbT0QLvAebaGqxVtvA,317
37
37
  verifiers/v1/configs/agent.py,sha256=xn9j1WcBIGz7LjgW8WOWDvSvk7vPLztisSLVcT2foxk,7530
@@ -150,7 +150,7 @@ verifiers/v1/runtimes/runtime.py,sha256=U_0G8DkeTPoyxQRN6Qmjll6FZ0bDwlijW4cC11wM
150
150
  verifiers/v1/runtimes/strategies.py,sha256=WtIrIpKmvjvqpUfwLUwDNJcgRLE8d-2sx7reks2S2PA,8765
151
151
  verifiers/v1/runtimes/backends/custom.py,sha256=Iz1Brd4dBTpO1zYVc2KA0u5sxz5ZUROY_Cdme5W33hM,2875
152
152
  verifiers/v1/runtimes/backends/docker.py,sha256=k-xjN6m72LH_FUeQ0rCySpYSxtk__3ZwHhOHA5HQ5Zk,32362
153
- verifiers/v1/runtimes/backends/prime.py,sha256=-AAPG0aUvyK8G-7Y6xII5Uwwod537HfL_0isdxs3Oxw,25188
153
+ verifiers/v1/runtimes/backends/prime.py,sha256=LGqWsGSsxZGirdIKL7IJPVOWQT9Go5nzZ1vr-0ipHg4,24971
154
154
  verifiers/v1/runtimes/backends/subprocess.py,sha256=naOWJGmcaOlu2ZdRbUwhJicJdxASDRAUhDT0jzDff3w,8591
155
155
  verifiers/v1/tasksets/__init__.py,sha256=2ijE3qIlLoUA02g6iysOwWQylyBBQL1GhSpjv8_bp0w,521
156
156
  verifiers/v1/tasksets/harbor/__init__.py,sha256=FjW4tM3rgGALMK-8p7ux26G4-d4ZFVmaAmO6Fni6e_g,214
@@ -172,7 +172,7 @@ verifiers/v1/utils/compile.py,sha256=J5PzohCTCj9UQ1d6rmQB-pTJKLYa_f6-0YMZ9y3yWoA
172
172
  verifiers/v1/utils/decorators.py,sha256=LbHW0bPkFy-l_TNp48HDDB_PZVr7wvJuVfuo3Qctcbo,5608
173
173
  verifiers/v1/utils/env.py,sha256=tMqfwFNRcJPijzrjkbE2VYvBH8eONRtYCWVkXHKpGZQ,1023
174
174
  verifiers/v1/utils/eval.py,sha256=lXBsir3rastL31CuXkJi522v6ypAI1ZGQ82IoTkm8IQ,1237
175
- verifiers/v1/utils/format.py,sha256=zk6p_UrzIK5Rx7_lvgVuAxjlST35I9vwVDc6GCieo1o,2551
175
+ verifiers/v1/utils/format.py,sha256=ij6sMMitJL7JCfGPSJp60gBZPYRVOpMGlTaiiV_UPag,594
176
176
  verifiers/v1/utils/generic.py,sha256=lKIzu5rvwnuSlr_kTFdupf-ElubjjvOo0vnBHYMUpC4,5036
177
177
  verifiers/v1/utils/git.py,sha256=LJGHrIxZs7eg58e_W7TiNYbZQCXMBERgkP42F4IOk9A,8363
178
178
  verifiers/v1/utils/image.py,sha256=OFw_wdwVtbdwa8uJ3X3vYfhpUAi0CTH5HMBupjVsRRQ,282
@@ -186,10 +186,10 @@ verifiers/v1/utils/prime.py,sha256=wXc7ThzQKYCUBUPdlW7fol7yubQv5xBuW-_CXi7EHYw,9
186
186
  verifiers/v1/utils/retries.py,sha256=cEOrD5m59NJUzBsU9jd6p5uq1rtnbGrptd20MWOVlB0,6169
187
187
  verifiers/v1/utils/scope.py,sha256=zbs4pj6AVk4jywlAJ3AX0Q0_kzB9dBB02nY-9H4ELdQ,855
188
188
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
189
- verifiers/v1/utils/trace_store.py,sha256=Qo9qvsJAl8PoRUavjQAfUB2VNxmUtYQtU2ejLKPzY9c,3382
189
+ verifiers/v1/utils/trace_store.py,sha256=V7lBiwyuSoYP6VYwjIR1woF_zf6fKqM8t9Mz2okPBV4,2587
190
190
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
191
- verifiers-0.4.2.dev82.dist-info/METADATA,sha256=W02wskRhknMB3PwW3eJ_VWrIyDceEMZU_87rxMPWw3w,5116
192
- verifiers-0.4.2.dev82.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
193
- verifiers-0.4.2.dev82.dist-info/entry_points.txt,sha256=qdMg7ajiFpDsHf7tuPMRclJXizu1J6LTWawS5YS0B0I,137
194
- verifiers-0.4.2.dev82.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
195
- verifiers-0.4.2.dev82.dist-info/RECORD,,
191
+ verifiers-0.4.2.dev83.dist-info/METADATA,sha256=bO__r6GkL3X63FOdDxNkJbc4mtATU6qdaQsSf1EftaM,5116
192
+ verifiers-0.4.2.dev83.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
193
+ verifiers-0.4.2.dev83.dist-info/entry_points.txt,sha256=qdMg7ajiFpDsHf7tuPMRclJXizu1J6LTWawS5YS0B0I,137
194
+ verifiers-0.4.2.dev83.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
195
+ verifiers-0.4.2.dev83.dist-info/RECORD,,