File size: 4,206 Bytes
e9f2926
45c2a8c
e9f2926
 
 
 
 
 
 
 
 
 
45c2a8c
e9f2926
 
 
 
 
 
45c2a8c
 
 
 
 
 
 
 
 
 
 
e9f2926
 
ff61273
7009c49
45c2a8c
 
ff61273
 
 
7009c49
 
e9f2926
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff61273
e9f2926
 
45c2a8c
 
e9f2926
 
 
 
45c2a8c
e9f2926
 
 
45c2a8c
e9f2926
 
 
 
 
 
 
 
ff61273
e9f2926
 
347662e
 
e9f2926
 
45c2a8c
e9f2926
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/env python3
"""Build reproducible, synthetic-only distribution artifacts for v0.2.0."""
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.2.0"
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",
    "evidence/evidence-index-v0.2.0.json",
    "evidence/target-configuration.synthetic.json",
    "evidence/payloads/RS-01.json",
    "evidence/payloads/RS-02.json",
    "evidence/payloads/CS-01.json",
    "evidence/payloads/LC-01.json",
    "evidence/payloads/ES-01.json",
    "evidence/payloads/SI-01.json",
    "evidence/payloads/CS-02.json",
    "evidence/payloads/EV-01.json",
    "evidence/payloads/CM-01.json",
    "scripts/validate_profile.py",
    "scripts/validate_viewer_split.py",
    "scripts/verify_bundle_manifest.py",
    "scripts/verify_replay_record.py",
    "scripts/verify_evidence_bindings.py",
    "scripts/test_evidence_bindings.py",
    "scripts/build_distribution_artifacts.py",
    "CITATION.cff",
    "REVIEW.md",
    "REPRODUCE.md",
    "review/replay-record.template.json",
    "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",
            "python3 scripts/verify_evidence_bindings.py",
            "python3 scripts/test_evidence_bindings.py",
        ],
        "reproduction": "python3 scripts/build_distribution_artifacts.py",
        "limitations": [
            "The passport verifies published artifact bytes, not an external target.",
            "All v0.2.0 evidence payloads and configuration manifests are synthetic fixtures only.",
            "Independent review and target authorization remain separate requirements.",
        ],
    }
    passport_path = OUT / "evidence-passport-v0.2.0.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",
            "python3 scripts/verify_evidence_bindings.py",
            "python3 scripts/test_evidence_bindings.py",
        ],
    }
    bundle_path = OUT / "authority-boundary-synthetic-fixture-bundle-v0.2.0.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()