data-gen-bpu/scripts/void_datasets.py

21 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Append-only invalidation of legacy ds* releases; never alter original manifests."""
import hashlib
import json
import time
from pathlib import Path
root = Path(__file__).resolve().parents[1] / 'datasets'
reason = 'VOID: legacy bench agent v1-v4 datasets may contain oracle/state leakage and stalled_killed trajectories; isolation and annotation/version export filters were incomplete. Do not train on this release. Re-export audited agent v5+ trajectories.'
for ds in sorted(root.glob('ds*')):
if not ds.is_dir():
continue
manifest = ds / 'manifest.json'
rec = {'dataset_id': ds.name, 'void': True, 'reason': reason, 'created_at': time.time(),
'original_manifest_sha256': hashlib.sha256(manifest.read_bytes()).hexdigest() if manifest.exists() else None}
for name, content in [('VOID', reason+'\n'), ('manifest.void.json', json.dumps(rec, indent=2)+'\n')]:
try:
with (ds / name).open('x') as f: f.write(content)
print('added', ds.name+'/'+name)
except FileExistsError:
print('already marked', ds.name+'/'+name)