mcp-sandbox-authority-boundary-profile / scripts /build_distribution_artifacts.py
msaleme's picture
Release v0.1.4 verifiable fixture bundle
ff61273 verified
Raw History Blame
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()