verifiers 0.3.1.dev67__py3-none-any.whl → 0.3.1.dev68__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.
@@ -31,7 +31,7 @@ logger = logging.getLogger(__name__)
31
31
 
32
32
  USAGE = (
33
33
  "usage: uv run eval [<taskset-id>] [--env.id <id>] [options] [@ file.toml]\n"
34
- " uv run eval @ <run-dir>/configs/eval.json --resume (re-run the run's missing/errored rollouts)"
34
+ " uv run eval @ <run-dir>/configs/resolved/eval.json --resume (re-run the run's missing/errored rollouts)"
35
35
  )
36
36
 
37
37
 
@@ -140,7 +140,6 @@ async def _server(
140
140
  async def run_eval(config: EvalConfig) -> list[Episode]:
141
141
  from verifiers.v1.utils.loaders import load_environment, load_taskset
142
142
 
143
- logger.info("eval config:\n%s", config.model_dump_json(indent=2))
144
143
  # The env comes up in this process only for an in-process run; a served run's
145
144
  # workers each load their own, and this process owns just the taskset.
146
145
  env = None if config.serve is not None else load_environment(config.env)
@@ -28,9 +28,13 @@ TRACES_FILE = "traces.jsonl"
28
28
  """Filename a run's rollout episodes are written to (one JSON episode per line)."""
29
29
 
30
30
  CONFIG_DIR = "configs"
31
- """Directory inside a run dir holding its resolved config (one `<cli>.json`, re-runnable
32
- via `@ <run-dir>/configs/<cli>.json`). Resolved configs are JSON, not TOML: JSON keeps
33
- nulls, so explicit None settings round-trip exactly on re-parse."""
31
+ """Directory inside a run dir holding its configs: the launch TOML copied verbatim to
32
+ `configs/<cli>.toml`, and the resolved config at `configs/resolved/<cli>.json`
33
+ (re-runnable via `@ <run-dir>/configs/resolved/<cli>.json`). Resolved configs are JSON,
34
+ not TOML: JSON keeps nulls, so explicit None settings round-trip exactly on re-parse."""
35
+
36
+ RESOLVED_DIR = "resolved"
37
+ """Subdirectory of `configs/` holding the resolved per-component JSON dumps."""
34
38
 
35
39
 
36
40
  def create_attempt_log_dir(run_dir: Path) -> Path:
@@ -68,13 +72,13 @@ def attempt_log_file(run_dir: Path) -> Path:
68
72
 
69
73
 
70
74
  def saved_config_path(run_dir: Path) -> Path | None:
71
- """The run's saved resolved config (`configs/<cli>.json`), None if absent."""
72
- candidates = (
73
- sorted((run_dir / CONFIG_DIR).glob("*.json"))
74
- if (run_dir / CONFIG_DIR).is_dir()
75
- else []
76
- )
77
- return candidates[0] if candidates else None
75
+ """The run's saved resolved config (`configs/resolved/<cli>.json`; legacy runs
76
+ kept it at `configs/<cli>.json`), None if absent."""
77
+ for config_dir in (run_dir / CONFIG_DIR / RESOLVED_DIR, run_dir / CONFIG_DIR):
78
+ candidates = sorted(config_dir.glob("*.json")) if config_dir.is_dir() else []
79
+ if candidates:
80
+ return candidates[0]
81
+ return None
78
82
 
79
83
 
80
84
  # Compiling an adapter is the expensive part; run output reuses only a few model classes.
@@ -92,22 +96,52 @@ def output_path(config: EvalConfig) -> Path:
92
96
  def write_config(
93
97
  config: BaseModel, results_dir: Path, filename: str = "eval.json"
94
98
  ) -> Path:
95
- """Write the run's resolved config to `configs/<filename>` (re-readable via
99
+ """Write the run's resolved config to `configs/resolved/<filename>` (re-readable via
96
100
  `@ <path>`); return its path. The full model dump is written, nulls included, so the
97
101
  file round-trips exactly."""
98
- config_dir = results_dir / CONFIG_DIR
102
+ config_dir = results_dir / CONFIG_DIR / RESOLVED_DIR
99
103
  config_dir.mkdir(parents=True, exist_ok=True)
100
104
  config_path = config_dir / filename
101
105
  config_path.write_text(json.dumps(config.model_dump(mode="json"), indent=2))
102
106
  return config_path
103
107
 
104
108
 
109
+ def write_launch_toml(results_dir: Path, name: str = "eval") -> None:
110
+ """Copy the launch `@` TOML file(s) verbatim to `configs/<name>.toml`."""
111
+ import sys
112
+
113
+ argv = sys.argv[1:]
114
+ paths = []
115
+ for i, arg in enumerate(argv):
116
+ # root config references only: `@ file`; a `--flag @ file` / `--flag @file`
117
+ # is a nested reference and belongs under its flag, not in the launch copy
118
+ if (
119
+ arg == "@"
120
+ and i + 1 < len(argv)
121
+ and (i == 0 or not argv[i - 1].startswith("--"))
122
+ ):
123
+ paths.append(Path(argv[i + 1]))
124
+ tomls = [(p, p.read_text()) for p in paths if p.suffix == ".toml" and p.is_file()]
125
+ if not tomls:
126
+ return
127
+ texts = (
128
+ [text for _, text in tomls]
129
+ if len(tomls) == 1
130
+ else [f"# @ {p}\n{text}" for p, text in tomls]
131
+ )
132
+ config_dir = results_dir / CONFIG_DIR
133
+ config_dir.mkdir(parents=True, exist_ok=True)
134
+ (config_dir / f"{name}.toml").write_text("\n".join(texts))
135
+
136
+
105
137
  def save_config(
106
138
  config: BaseModel, results_dir: Path, filename: str = "eval.json"
107
139
  ) -> None:
108
- """Set up the run's output dir: write the resolved config and start a fresh (empty)
109
- `traces.jsonl`. Call once up front, before episodes start landing."""
140
+ """Set up the run's output dir: write the resolved config, copy the launch TOML,
141
+ and start a fresh (empty) `traces.jsonl`. Call once up front, before episodes start
142
+ landing."""
110
143
  write_config(config, results_dir, filename)
144
+ write_launch_toml(results_dir, Path(filename).stem)
111
145
  (results_dir / TRACES_FILE).write_text(
112
146
  ""
113
147
  ) # fresh; appended to as rollouts complete
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.1.dev67
3
+ Version: 0.3.1.dev68
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
@@ -189,7 +189,7 @@ verifiers/v1/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
189
189
  verifiers/v1/cli/debug.py,sha256=x3bqOwwbwwfwQQpxHrZeKdxsW3ZVtUT9cAn_r4aOro4,11631
190
190
  verifiers/v1/cli/gepa.py,sha256=7YpppEMeuY2m1X5szGkybzTHztnIs83CvnSizhiEC-w,4210
191
191
  verifiers/v1/cli/init.py,sha256=LFF_1e2XTdgIKjWoqq_IAlOzAXcARPEroblcEGv0fCU,7599
192
- verifiers/v1/cli/output.py,sha256=CdwOC5WUA3ir_YSVG9OtiOZ7yYrvOH8L_8h9Bel_O4Q,7027
192
+ verifiers/v1/cli/output.py,sha256=HZbkHw662ppVdpTGutrKuQOSeBvtsAj5qjUokCkwkv0,8457
193
193
  verifiers/v1/cli/replay.py,sha256=JhhI_O8PLhtHbgLie5dG03RrTynvZtsEPX-MLY3KQy4,10240
194
194
  verifiers/v1/cli/resolve.py,sha256=Q1EHM7wWQo0YkwJA898qtZbYLaIkjIVq3Q7kUp2YIxs,4346
195
195
  verifiers/v1/cli/resume.py,sha256=hqV5AxxqeIInJeEZQerQznuijhMNijFEFcHZIltfLdE,470
@@ -200,9 +200,9 @@ verifiers/v1/cli/dashboard/eval.py,sha256=IgyEVBfTcyuKw_rXaHrRRFX4ESlwsekaPi-bxD
200
200
  verifiers/v1/cli/dashboard/replay.py,sha256=_X5up9MJsRbd_sWe4LgNTPNT8k1ip4xNpo50hxI3Ljk,2697
201
201
  verifiers/v1/cli/dashboard/validate.py,sha256=rLsQ_31DjTIZpC_VO7zSG41ncUEBxqCx8mL9nTnGiMc,3650
202
202
  verifiers/v1/cli/eval/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
203
- verifiers/v1/cli/eval/main.py,sha256=O9U391WdUwhAcuZhs3EXm53SrVjjufyYiRGZdC3u80I,6312
203
+ verifiers/v1/cli/eval/main.py,sha256=D5-lth_F04iAZYTHglzPufdh-P9lBivD7-GgfFvWmz8,6321
204
204
  verifiers/v1/cli/eval/resume.py,sha256=fYkWa0Fudq--IWfk25j_McLm67bXYWvksWmJR4u4QAU,3811
205
- verifiers/v1/cli/eval/runner.py,sha256=yFJWO5TZVUn5of3gU8YgNCLBBGO9o9LfThvEbhaDk-Y,10085
205
+ verifiers/v1/cli/eval/runner.py,sha256=tZDPWzd6U7-5N43HGRlV7p-RnUiDleYwMUBVHzWH7mk,10015
206
206
  verifiers/v1/clients/__init__.py,sha256=Ysig0tE_0E4Jsfgfes1XHN-fK1s_RCXdqZD6E7lK4PU,507
207
207
  verifiers/v1/clients/base.py,sha256=PoDw4GMqrfuPTFVK6n2jDmlD0_lJ5zTrYcNio5yq6K8,1691
208
208
  verifiers/v1/clients/client.py,sha256=zqC_AkiD9pl0kxxIbupNiehbS-YnVdp3EMZ0LOHTd8U,3125
@@ -348,8 +348,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
348
348
  verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
349
349
  verifiers/v1/utils/score.py,sha256=-R5Cog14r_tJ6Q_oOfGr5VPAm2CCUhofYZB6B9lm4wM,5787
350
350
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
351
- verifiers-0.3.1.dev67.dist-info/METADATA,sha256=1_PJFEilgXQoOIULqehpa2IPH-BsNBZ3xyCXBzwaeCk,4654
352
- verifiers-0.3.1.dev67.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
353
- verifiers-0.3.1.dev67.dist-info/entry_points.txt,sha256=hZ5wDc1T8y-EvOziw7kQqatBJ6PbdSu2ygP5rjANl7c,564
354
- verifiers-0.3.1.dev67.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
355
- verifiers-0.3.1.dev67.dist-info/RECORD,,
351
+ verifiers-0.3.1.dev68.dist-info/METADATA,sha256=ZvWxxVxXUN4etE7hkpGqycSo-Ta9ohAlwqjHHjeE0Xg,4654
352
+ verifiers-0.3.1.dev68.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
353
+ verifiers-0.3.1.dev68.dist-info/entry_points.txt,sha256=hZ5wDc1T8y-EvOziw7kQqatBJ6PbdSu2ygP5rjANl7c,564
354
+ verifiers-0.3.1.dev68.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
355
+ verifiers-0.3.1.dev68.dist-info/RECORD,,