verifiers 0.3.2.dev169__py3-none-any.whl → 0.3.2.dev170__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.

Potentially problematic release.


This version of verifiers might be problematic. Click here for more details.

@@ -190,7 +190,17 @@ async def _tar_out(runtime: Runtime, artifact: Artifact, budget: int) -> bytes:
190
190
  )
191
191
  # The runtime enforces the remaining collection budget while transferring the
192
192
  # bytes, so replacing or growing the archive cannot race a separate size probe.
193
- return await runtime.read(path, max_bytes=budget)
193
+ archive, dropped = _drop_special_files(
194
+ await runtime.read(path, max_bytes=budget)
195
+ )
196
+ if dropped:
197
+ logger.warning(
198
+ "artifact %r: dropped %d FIFO or device node(s), e.g. %s",
199
+ artifact.source,
200
+ len(dropped),
201
+ dropped[:3],
202
+ )
203
+ return archive
194
204
  finally:
195
205
  # Best-effort: the box is about to be destroyed and the name is unique per call.
196
206
  try:
@@ -199,6 +209,32 @@ async def _tar_out(runtime: Runtime, artifact: Artifact, budget: int) -> bytes:
199
209
  logger.debug("failed to remove %s", path, exc_info=True)
200
210
 
201
211
 
212
+ def _drop_special_files(archive: bytes) -> tuple[bytes, list[str]]:
213
+ """Remove FIFOs and device nodes, plus hard links to them, from a collected archive.
214
+
215
+ They carry no content, and `restore` refuses them, so one an agent leaves in its
216
+ workspace (e.g. a named pipe it made to test streaming input) would otherwise fail
217
+ the whole restore. Returns the archive and the dropped member names."""
218
+ with tarfile.open(fileobj=io.BytesIO(archive), mode="r:") as source:
219
+ members = source.getmembers()
220
+ special = {m.name for m in members if m.isfifo() or m.ischr() or m.isblk()}
221
+ if not special:
222
+ return archive, []
223
+ dropped = [
224
+ m.name
225
+ for m in members
226
+ if m.name in special or (m.islnk() and m.linkname in special)
227
+ ]
228
+ out = io.BytesIO()
229
+ with tarfile.open(fileobj=out, mode="w:", format=source.format) as target:
230
+ for member in members:
231
+ if member.name in dropped:
232
+ continue
233
+ content = source.extractfile(member) if member.isfile() else None
234
+ target.addfile(member, content)
235
+ return out.getvalue(), dropped
236
+
237
+
202
238
  def _validate_restore(root: str, archive: bytes | None) -> None:
203
239
  """Reject archive content that could restore outside its declared root."""
204
240
  root_path = PurePosixPath(root)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.3.2.dev169
3
+ Version: 0.3.2.dev170
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
@@ -175,7 +175,7 @@ verifiers/v1/tasksets/textarena/__init__.py,sha256=Os2OlBY_pSH0B1DP32RitumgSLpq2
175
175
  verifiers/v1/tasksets/textarena/taskset.py,sha256=zGslerxmH2ZT7FJdP-72R6a9p71kr2pNS3r5_xnq1lQ,4406
176
176
  verifiers/v1/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
177
177
  verifiers/v1/utils/aio.py,sha256=0yNFOqB2oO6Qktc6NI_ZSAGuo1aHsIK_wuT1BtmoZ3I,1532
178
- verifiers/v1/utils/artifacts.py,sha256=3QL2ELwqXuek9OLwF4hJdzZb_hwfVjjenw8VjepdLlo,12855
178
+ verifiers/v1/utils/artifacts.py,sha256=1FHD0BQPB2NOSBphOGAODWbFQQlPKLmUIBPhFnfBtP8,14354
179
179
  verifiers/v1/utils/compile.py,sha256=5pxy31wx2Q-3pQjOO5B9SH6OT-wwb8r4F1LAl6HMeQA,5835
180
180
  verifiers/v1/utils/decorators.py,sha256=vhoN6YoKb15-Fkqmc9RaNlUIbt9WRvNK4zAn2bAxfS4,5367
181
181
  verifiers/v1/utils/format.py,sha256=yX160sGewMMZn9iJqTHRbYYt4Z9pHasjMlFT1dXrKD8,2446
@@ -194,8 +194,8 @@ verifiers/v1/utils/scope.py,sha256=bzUEiWDOVdbj7dXOwGOlzsQ_-Xu0j9NR5TalQB-8TS8,8
194
194
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
195
195
  verifiers/v1/utils/trace_store.py,sha256=RsCDonGR-bs-tvEstcppiJm3jFmAdIiG83fA5KtCbAw,2801
196
196
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
197
- verifiers-0.3.2.dev169.dist-info/METADATA,sha256=gGCq6PfSW4uT2QFaSSV4A2aFBRZ-J2_jssUE0-jZdpc,4227
198
- verifiers-0.3.2.dev169.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
199
- verifiers-0.3.2.dev169.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
200
- verifiers-0.3.2.dev169.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
201
- verifiers-0.3.2.dev169.dist-info/RECORD,,
197
+ verifiers-0.3.2.dev170.dist-info/METADATA,sha256=g1Gd_EgCwA-0xc4QtXPfFLMaFdLZ8ge7KxRGidGFbGI,4227
198
+ verifiers-0.3.2.dev170.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
199
+ verifiers-0.3.2.dev170.dist-info/entry_points.txt,sha256=iugElcdWPKbQM7uFF0lZ8iUpHsNr17-BwEAAjJWxV3U,259
200
+ verifiers-0.3.2.dev170.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
201
+ verifiers-0.3.2.dev170.dist-info/RECORD,,