Download scripts/validate_viewer_split.py from msaleme/mcp-sandbox-authority-boundary-profile: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/datasets/msaleme/mcp-sandbox-authority-boundary-profile/resolve/ff61273e4af33392d322d4957102e2d3db43d1b5/scripts/validate_viewer_split.py
- Command line
-
hf download hf://datasets/msaleme/mcp-sandbox-authority-boundary-profile@ff61273e4af33392d322d4957102e2d3db43d1b5/scripts/validate_viewer_split.py
-
curl -L -o validate_viewer_split.py https://huggingface.co/datasets/msaleme/mcp-sandbox-authority-boundary-profile/resolve/ff61273e4af33392d322d4957102e2d3db43d1b5/scripts/validate_viewer_split.py
1.29 kB
| #!/usr/bin/env python3 | |
| """Ensure viewer rows remain a lossless flat index of the released synthetic run.""" | |
| from __future__ import annotations | |
| import json | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| run = json.loads((ROOT / "examples" / "synthetic-characterization.json").read_text()) | |
| rows = [json.loads(line) for line in (ROOT / "data" / "authority_boundary_cases.jsonl").read_text().splitlines() if line] | |
| observations = {item["case"]["id"]: item for item in run["observations"]} | |
| assert set(row["case_id"] for row in rows) == set(observations) | |
| assert len(rows) == len(observations) == 9 | |
| for row in rows: | |
| source = observations[row["case_id"]] | |
| assert row["declared_authority"] == source["declared_authority"]["summary"] | |
| assert row["observed_effective_authority"] == source["observed_effective_authority"]["summary"] | |
| assert row["synthetic_action"] == source["action"] | |
| assert row["expected_outcome"] == source["expected_outcome"] | |
| assert row["observed_outcome"] == source["actual_outcome"] | |
| assert row["result_state"] == source["result"]["state"] | |
| assert row["evidence_digest"] == source["evidence"]["digest"] | |
| assert row["classification"] == run["classification"] | |
| print(f"valid: {len(rows)} flat viewer rows bound to the synthetic run") | |