#!/usr/bin/env -S uv run --script # /// script # requires-python = ">=3.11" # dependencies = [] # /// """Inspect one fictional row and validate every local split without network access.""" import argparse import hashlib import json from pathlib import Path HERE=Path(__file__).absolute().parent def main(): parser=argparse.ArgumentParser() parser.add_argument("--self-test",action="store_true") args=parser.parse_args() meta=json.loads((HERE/"provenance.json").read_text()) texts=set() families=set() for split,counts in meta["splits"].items(): path=HERE/"data"/(split+".jsonl") assert hashlib.sha256(path.read_bytes()).hexdigest()==counts["sha256"] rows=[json.loads(line) for line in path.read_text().splitlines()] if not args.self_test: print(json.dumps(rows[0],indent=2,ensure_ascii=False)) return assert len(rows)==counts["rows"] current={r["scenario"] for r in rows} assert not families & current families.update(current) for r in rows: key=" ".join(r["text"].casefold().split()) assert key not in texts texts.add(key) if meta["task"]=="pii": end=0 for s in r["gold"]: assert end<=s["start"]