verifiers 0.3.2.dev13__py3-none-any.whl → 0.3.2.dev15__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.
@@ -21,6 +21,7 @@ _STYLE = {
21
21
  "running": "cyan",
22
22
  "valid": "green",
23
23
  "invalid": "yellow",
24
+ "unchecked": "dim",
24
25
  "error": "red",
25
26
  "timeout": "red",
26
27
  }
@@ -29,7 +30,7 @@ _MARK_WIDTH = max(len(state) for state in _STYLE)
29
30
  # the name left-aligned inside — the outcome reads at a glance. `escape` keeps the brackets
30
31
  # literal: Rich parses `[name]` in a cell as markup and would otherwise drop it.
31
32
  _MARK = {state: escape(f"[{state:<{_MARK_WIDTH}}]") for state in _STYLE}
32
- _DONE = ("valid", "invalid", "error", "timeout")
33
+ _DONE = ("valid", "invalid", "unchecked", "error", "timeout")
33
34
  # State -> (visible label, color); insertion order is the summary order.
34
35
  _OUTCOMES = {state: (state, _STYLE[state]) for state in _DONE}
35
36
 
@@ -43,8 +43,8 @@ logger = logging.getLogger(__name__)
43
43
  RESULTS_FILE = "results.jsonl"
44
44
  SUMMARY_FILE = "summary.json"
45
45
  LOG_FILE = "logs/validate.log"
46
- FINAL_REASONS = frozenset({"valid", "invalid"})
47
- REASONS = ("valid", "invalid", "error", "timeout")
46
+ FINAL_VALUES = {"valid": True, "invalid": False, "unchecked": None}
47
+ REASONS = ("valid", "invalid", "unchecked", "error", "timeout")
48
48
 
49
49
  ResultRow = dict[str, Any]
50
50
 
@@ -99,8 +99,8 @@ def _is_final(row: object, key: str, mode: str) -> bool:
99
99
  return (
100
100
  row.get("task_key") == key
101
101
  and row.get("mode") == mode
102
- and reason in FINAL_REASONS
103
- and row.get("valid") is (reason == "valid")
102
+ and reason in FINAL_VALUES
103
+ and row.get("valid") is FINAL_VALUES[reason]
104
104
  )
105
105
 
106
106
 
@@ -157,7 +157,9 @@ def summarize(rows: Sequence[ResultRow], total: int, mode: str) -> dict[str, Any
157
157
  missing = max(0, total - len(rows))
158
158
  outcomes = {reason: counts[reason] for reason in REASONS}
159
159
  outcomes["missing"] = missing
160
- terminal = outcomes["valid"] + outcomes["invalid"]
160
+ checked = outcomes["valid"] + outcomes["invalid"]
161
+ rate_total = total - outcomes["unchecked"]
162
+ terminal = checked + outcomes["unchecked"]
161
163
  summary: dict[str, Any] = {
162
164
  "mode": mode,
163
165
  "total": total,
@@ -165,7 +167,7 @@ def summarize(rows: Sequence[ResultRow], total: int, mode: str) -> dict[str, Any
165
167
  "terminal": terminal,
166
168
  "owed": missing + outcomes["error"] + outcomes["timeout"],
167
169
  "outcomes": outcomes,
168
- "valid_rate": round(outcomes["valid"] / total, 6) if total else None,
170
+ "valid_rate": round(outcomes["valid"] / rate_total, 6) if checked else None,
169
171
  }
170
172
  if mode == "all":
171
173
  checks: dict[str, dict[str, int]] = {}
@@ -194,24 +196,26 @@ def save_run(config: ValidateConfig, results_dir: Path, total: int) -> None:
194
196
  write_summary(results_dir, summarize([], total, validation_mode(config)))
195
197
 
196
198
 
197
- def _classify(valid: bool, exc: BaseException | None) -> str:
198
- if valid:
199
+ def _classify(valid: bool | None, exc: BaseException | None) -> str:
200
+ if valid is True:
199
201
  return "valid"
200
202
  if isinstance(exc, asyncio.TimeoutError):
201
203
  return "timeout"
202
204
  if exc is not None:
203
205
  return "error"
206
+ if valid is None:
207
+ return "unchecked"
204
208
  return "invalid"
205
209
 
206
210
 
207
211
  def _row(
208
- task, mode: str, valid: bool, exc: BaseException | None, start: float
212
+ task, mode: str, valid: bool | None, exc: BaseException | None, start: float
209
213
  ) -> ResultRow:
210
214
  return {
211
215
  "index": task.data.idx,
212
216
  "name": task.data.name,
213
217
  "mode": mode,
214
- "valid": bool(valid),
218
+ "valid": valid,
215
219
  "reason": _classify(valid, exc),
216
220
  "elapsed": round(time.time() - start, 2),
217
221
  "error": str(exc) if exc is not None else None,
@@ -230,7 +234,8 @@ async def _run_check(task: Task, config: ValidateConfig, mode: str) -> ResultRow
230
234
  if config.timeout.setup is not None
231
235
  else task.data.timeout.setup
232
236
  )
233
- valid, exc = False, None
237
+ valid: bool | None = False
238
+ exc = None
234
239
  try:
235
240
  runtime.env = dict(task.runtime_env())
236
241
  trace = Trace(
@@ -275,11 +280,13 @@ def _all_reason(rows: list[ResultRow]) -> str:
275
280
  return "error"
276
281
  if "timeout" in reasons:
277
282
  return "timeout"
278
- return "invalid"
283
+ if "invalid" in reasons:
284
+ return "invalid"
285
+ return "unchecked"
279
286
 
280
287
 
281
288
  def _all_error(rows: list[ResultRow]) -> tuple[str | None, str | None]:
282
- failed = [row for row in rows if not row["valid"]]
289
+ failed = [row for row in rows if row["reason"] not in ("valid", "unchecked")]
283
290
  parts = [f"{row['mode']}: {row['error'] or row['reason']}" for row in failed]
284
291
  error_types = {str(row["error_type"]) for row in failed if row["error_type"]}
285
292
  return ("; ".join(parts) or None, "+".join(sorted(error_types)) or None)
@@ -290,13 +297,14 @@ async def _run_all(task: Task, config: ValidateConfig) -> ResultRow:
290
297
  gold = await _run_check(task, config, "gold")
291
298
  setup = await _run_check(task, config, "setup")
292
299
  rows = [gold, setup]
300
+ reason = _all_reason(rows)
293
301
  error, error_type = _all_error(rows)
294
302
  return {
295
303
  "index": task.data.idx,
296
304
  "name": task.data.name,
297
305
  "mode": "all",
298
- "valid": all(row["valid"] for row in rows),
299
- "reason": _all_reason(rows),
306
+ "valid": None if reason == "unchecked" else reason == "valid",
307
+ "reason": reason,
300
308
  "elapsed": round(time.time() - start, 2),
301
309
  "error": error,
302
310
  "error_type": error_type,
@@ -406,9 +414,7 @@ async def run_validate(config: ValidateConfig) -> list[dict]:
406
414
  )
407
415
  async with display:
408
416
  if not plan:
409
- logger.info(
410
- "nothing to resume: all %d task(s) are valid or invalid", len(tasks)
411
- )
417
+ logger.info("nothing to resume: all %d task(s) are terminal", len(tasks))
412
418
  return rows
413
419
  await asyncio.gather(
414
420
  *(_one(position, task, key) for position, task, key in plan)
verifiers/v1/task.py CHANGED
@@ -173,8 +173,9 @@ class Task(Generic[DataT, StateT, ConfigT]):
173
173
  async def finalize(self, trace: Trace, runtime: Runtime) -> None:
174
174
  return None
175
175
 
176
- async def validate(self, runtime: Runtime) -> bool:
177
- return True
176
+ async def validate(self, runtime: Runtime) -> bool | None:
177
+ """Check the ground truth, or return None when no model-free check exists."""
178
+ return None
178
179
 
179
180
  async def score(
180
181
  self,
@@ -126,11 +126,11 @@ class LeanTask(Task[LeanData, State, LeanTaskConfig]):
126
126
  trace.info["compile_output"] = output[-4000:]
127
127
  return 1.0 if compiled else 0.0
128
128
 
129
- async def validate(self, runtime: Runtime) -> bool:
129
+ async def validate(self, runtime: Runtime) -> bool | None:
130
130
  """Compile the gold proof; rows without one have nothing to preflight."""
131
131
  gold = (self.data.formal_proof or "").rstrip()
132
132
  if not gold:
133
- return True
133
+ return None
134
134
  content = build_starter_file(
135
135
  self.data.formal_statement,
136
136
  header=self.data.header,
@@ -83,6 +83,12 @@ async def collect(
83
83
  )
84
84
  entries.append(artifact)
85
85
 
86
+ seen: set[str] = set()
87
+ for artifact in entries:
88
+ if artifact.source in seen:
89
+ raise RuntimeError(f"artifact {artifact.source!r} declared more than once")
90
+ seen.add(artifact.source)
91
+
86
92
  collected: dict[str, bytes | None] = {}
87
93
  budget = MAX_ARTIFACT_BYTES
88
94
  for artifact in entries:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev13
3
+ Version: 0.3.2.dev15
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
@@ -179,7 +179,7 @@ verifiers/v1/judge.py,sha256=Pvr0C41ah1qkNSZ0WXdkDvBMfv5YSfY1REHncwlJ8cg,9346
179
179
  verifiers/v1/rollout.py,sha256=EnF3RuBfMyKNjJIs0LZaImkSvfe9LYLXc8dYP-1a2Ew,23628
180
180
  verifiers/v1/session.py,sha256=xM7JJJVJACk0JfH9RAN1Ts8gJJKr2tGGRiIgQTrdieY,18692
181
181
  verifiers/v1/state.py,sha256=EckF2bWp-vV4b1jYJ9sLI5xrfGuI5spIgYYwW926toI,595
182
- verifiers/v1/task.py,sha256=ZiAE5uGxgHWqz8UF5YJHs80RgSKhxGMGQo4lJusSRus,11375
182
+ verifiers/v1/task.py,sha256=vaVkBu00riiNU1Ke4NeeY2NQTXxOguz9d6NLe55hO_Q,11468
183
183
  verifiers/v1/taskset.py,sha256=fp2E0IEhL_Ybj9cegZwljfTmW27p_30zTWHFKw_kXE4,4374
184
184
  verifiers/v1/trace.py,sha256=gA0vYHsssYpoc2Kc5WXc-xRIR7xpY0njrNkTddmYMvQ,25095
185
185
  verifiers/v1/types.py,sha256=a1wqL8T7KQg9WxkaDIZpmOyU6xT2VeSr1K4SWiW8ef4,9660
@@ -193,12 +193,12 @@ verifiers/v1/cli/output.py,sha256=HZbkHw662ppVdpTGutrKuQOSeBvtsAj5qjUokCkwkv0,84
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
196
- verifiers/v1/cli/validate.py,sha256=xDvTTe5wVMnn1G5mSElS44D6klLMF1J5vKR6mcv1M-Y,16874
196
+ verifiers/v1/cli/validate.py,sha256=G3YXZTwxVDQIyR_ASapJceixOxRSJl69NnFPBqkF3N0,17173
197
197
  verifiers/v1/cli/dashboard/__init__.py,sha256=v-baMxQuWxOCsbU7-p_jj2Q9BUnTN-TWi1q2hK6rU2s,198
198
198
  verifiers/v1/cli/dashboard/base.py,sha256=kUP93zJSIVLptSbnWX6MOy8kGg63fpeAzPqakCpPyDc,3547
199
199
  verifiers/v1/cli/dashboard/eval.py,sha256=IgyEVBfTcyuKw_rXaHrRRFX4ESlwsekaPi-bxDDdDKY,36633
200
200
  verifiers/v1/cli/dashboard/replay.py,sha256=_X5up9MJsRbd_sWe4LgNTPNT8k1ip4xNpo50hxI3Ljk,2697
201
- verifiers/v1/cli/dashboard/validate.py,sha256=rLsQ_31DjTIZpC_VO7zSG41ncUEBxqCx8mL9nTnGiMc,3650
201
+ verifiers/v1/cli/dashboard/validate.py,sha256=xrpK3Y90JsoDCQYLLvvsnJ4CPRMvSSJIghfHK62E6FQ,3687
202
202
  verifiers/v1/cli/eval/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
203
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
@@ -321,7 +321,7 @@ verifiers/v1/tasksets/harbor/env.py,sha256=J3ggeLVD9Uyv0jRACsNb4jSMobpUcuT3EAqdI
321
321
  verifiers/v1/tasksets/harbor/taskset.py,sha256=idR4Yo1UJHLwBdAloAZ00BI-SaJxr6-to1wxKvQgqvQ,32277
322
322
  verifiers/v1/tasksets/lean/__init__.py,sha256=oyv-GbJQBvCyGwo7Ysxm2NjZW-aX4j1uDoHU0f-E7xQ,767
323
323
  verifiers/v1/tasksets/lean/scoring.py,sha256=sfzsT6MUK0zdMgAQ57_P_0CBaPHy3M7go71QMr5hDrs,10599
324
- verifiers/v1/tasksets/lean/taskset.py,sha256=XgUqX0uJvHC8sKFhbK92iu6nUGcPuXCUpI3ZBhDcb7c,9025
324
+ verifiers/v1/tasksets/lean/taskset.py,sha256=Rw0sMyvMcm2PTZi3fDrAIUUjldCVFNeWm83oDZwv04o,9032
325
325
  verifiers/v1/tasksets/nemo_gym/__init__.py,sha256=654gAvG3Wd_Z_nh6mypeKn4s_IIQ0Ge6vcZvxTHC2_E,306
326
326
  verifiers/v1/tasksets/nemo_gym/response.py,sha256=u_-qvmcyVHRC9fLJx5ED7BjCCUv5JttuTxM_GzZObkM,4382
327
327
  verifiers/v1/tasksets/nemo_gym/server.py,sha256=BTe9dk3uOR7H862ZvIIfCQ6ET17oA2SWkI2Ya-zl8sQ,1459
@@ -333,7 +333,7 @@ verifiers/v1/tasksets/textarena/__init__.py,sha256=Os2OlBY_pSH0B1DP32RitumgSLpq2
333
333
  verifiers/v1/tasksets/textarena/taskset.py,sha256=9fa_unlFiFZyuN4I02rW3x4qyRnFWXqwTUZTloQefu0,4433
334
334
  verifiers/v1/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
335
335
  verifiers/v1/utils/aio.py,sha256=0yNFOqB2oO6Qktc6NI_ZSAGuo1aHsIK_wuT1BtmoZ3I,1532
336
- verifiers/v1/utils/artifacts.py,sha256=vOzbPSuMirUecyylrhvLZ_vAcTd6JTJBztGPDQ0ANNk,6706
336
+ verifiers/v1/utils/artifacts.py,sha256=SPvC_N2scVlbYcCYH406TG57vliSTlNWFl5mnIHQ760,6921
337
337
  verifiers/v1/utils/compile.py,sha256=5pxy31wx2Q-3pQjOO5B9SH6OT-wwb8r4F1LAl6HMeQA,5835
338
338
  verifiers/v1/utils/decorators.py,sha256=vhoN6YoKb15-Fkqmc9RaNlUIbt9WRvNK4zAn2bAxfS4,5367
339
339
  verifiers/v1/utils/format.py,sha256=NfQo9M5KMzWCZpQaet5YtsJx56vCKAZPfbjZZJLJhhM,2187
@@ -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.dev13.dist-info/METADATA,sha256=BaMYvD9ki3pvJC9V1C0p_uA-2WDuDvOoEzvJor2Mgho,4654
354
- verifiers-0.3.2.dev13.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
355
- verifiers-0.3.2.dev13.dist-info/entry_points.txt,sha256=hZ5wDc1T8y-EvOziw7kQqatBJ6PbdSu2ygP5rjANl7c,564
356
- verifiers-0.3.2.dev13.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
357
- verifiers-0.3.2.dev13.dist-info/RECORD,,
353
+ verifiers-0.3.2.dev15.dist-info/METADATA,sha256=N9Uevo7iotzAnP6QU9WOBCN5HJHlduP3qlQ4d4otaZw,4654
354
+ verifiers-0.3.2.dev15.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
355
+ verifiers-0.3.2.dev15.dist-info/entry_points.txt,sha256=hZ5wDc1T8y-EvOziw7kQqatBJ6PbdSu2ygP5rjANl7c,564
356
+ verifiers-0.3.2.dev15.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
357
+ verifiers-0.3.2.dev15.dist-info/RECORD,,