Download scripts/build_distribution_artifacts.py from msaleme/mcp-sandbox-authority-boundary-profile: direct link, hf CLI and curl.
- Browser
- Download file 3.37 kB
-
https://huggingface.co/datasets/msaleme/mcp-sandbox-authority-boundary-profile/resolve/ff61273e4af33392d322d4957102e2d3db43d1b5/scripts/build_distribution_artifacts.py
- Command line
-
hf download hf://datasets/msaleme/mcp-sandbox-authority-boundary-profile@ff61273e4af33392d322d4957102e2d3db43d1b5/scripts/build_distribution_artifacts.py
-
curl -L -o build_distribution_artifacts.py https://huggingface.co/datasets/msaleme/mcp-sandbox-authority-boundary-profile/resolve/ff61273e4af33392d322d4957102e2d3db43d1b5/scripts/build_distribution_artifacts.py
3.37 kB
| #!/usr/bin/env python3 | |
| """Build reproducible, synthetic-only distribution artifacts for v0.1.4.""" | |
| from __future__ import annotations | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| from zipfile import ZIP_DEFLATED, ZipFile | |
| ROOT = Path(__file__).resolve().parents[1] | |
| OUT = ROOT / "artifacts" | |
| RELEASE = "v0.1.4" | |
| FILES = ( | |
| "profile/sandbox-boundary-profile-v0.1.json", | |
| "schemas/observation.schema.json", | |
| "examples/synthetic-characterization.json", | |
| "examples/coverage-matrix.md", | |
| "data/authority_boundary_cases.jsonl", | |
| "scripts/validate_profile.py", | |
| "scripts/validate_viewer_split.py", | |
| "scripts/verify_bundle_manifest.py", | |
| "scripts/build_distribution_artifacts.py", | |
| "CITATION.cff", | |
| "REVIEW.md", | |
| "README.md", | |
| "LICENSE", | |
| ) | |
| def digest(path: Path) -> str: | |
| return hashlib.sha256(path.read_bytes()).hexdigest() | |
| def entry(relative_path: str) -> dict[str, object]: | |
| path = ROOT / relative_path | |
| return { | |
| "path": relative_path, | |
| "sha256": digest(path), | |
| "bytes": path.stat().st_size, | |
| } | |
| def main() -> None: | |
| OUT.mkdir(exist_ok=True) | |
| entries = [entry(relative_path) for relative_path in FILES] | |
| passport = { | |
| "artifact": "MCP Sandbox Authority Boundary Profile Evidence Passport", | |
| "release": RELEASE, | |
| "profile_schema_version": "0.1.0", | |
| "output_type": "characterization", | |
| "classification": "synthetic-only distribution artifact", | |
| "claim_ceiling": ( | |
| "This release documents a synthetic characterization profile only. " | |
| "It is not a certification, conformance determination, provider " | |
| "finding, or statement about an untested environment." | |
| ), | |
| "canonical_artifacts": entries, | |
| "validators": [ | |
| "python3 scripts/verify_bundle_manifest.py", | |
| "python3 scripts/validate_profile.py", | |
| "python3 scripts/validate_viewer_split.py", | |
| ], | |
| "reproduction": "python3 scripts/build_distribution_artifacts.py", | |
| "limitations": [ | |
| "The passport verifies published artifact bytes, not an external target.", | |
| "Evidence digests identify supplied evidence; they do not make evidence retrievable.", | |
| "Independent review and target authorization remain separate requirements.", | |
| ], | |
| } | |
| passport_path = OUT / "evidence-passport-v0.1.4.json" | |
| passport_path.write_text(json.dumps(passport, indent=2) + "\n") | |
| bundle_manifest = { | |
| "bundle": "authority-boundary-synthetic-fixture-bundle", | |
| "release": RELEASE, | |
| "classification": "synthetic-only", | |
| "files": entries, | |
| "verify": [ | |
| "python3 scripts/verify_bundle_manifest.py", | |
| "python3 scripts/validate_profile.py", | |
| "python3 scripts/validate_viewer_split.py", | |
| ], | |
| } | |
| bundle_path = OUT / "authority-boundary-synthetic-fixture-bundle-v0.1.4.zip" | |
| with ZipFile(bundle_path, "w", compression=ZIP_DEFLATED) as bundle: | |
| for relative_path in FILES: | |
| bundle.write(ROOT / relative_path, relative_path) | |
| bundle.writestr("bundle-manifest.json", json.dumps(bundle_manifest, indent=2) + "\n") | |
| print(f"built: {passport_path.relative_to(ROOT)}") | |
| print(f"built: {bundle_path.relative_to(ROOT)}") | |
| if __name__ == "__main__": | |
| main() | |