"""Schema fixtures only: these are not built image or publication evidence.""" import json import subprocess from pathlib import Path REPO_ROOT = Path(__file__).resolve().parents[1] def local_manifest_fixture(l2_commit=None): from scripts import validate_serviceification_bom as validator desired = json.loads((REPO_ROOT / "release/serviceification-d3-bom.json").read_text()) # Host-only unsigned Test3 does not publish or admit MCP. Keep this fixture # scoped to that supported topology when formal Staging selects MCP. desired["services"].pop("mcp_worker", None) desired["execution"]["topology"] = desired["execution"]["topology"].removesuffix(";mcp_worker>runtime_api") if l2_commit is not None: desired["l2_metadata"]["commit"] = l2_commit desired["frontend"]["l2_commit"] = l2_commit frontend = desired["frontend"] sources = { role: (frontend["nexuscrm_repository"], desired["l0_engine"]["version"].rsplit("-", 1)[-1] + "0" * 32) for role in ("runtime_api", "runtime_worker", "integration_service") } sources["sfcrm_app_service"] = (desired["services"]["sfcrm_app_service"]["source_repository"], desired["services"]["sfcrm_app_service"]["source_commit"]) sources["frontend"] = (frontend["l2_repository"], frontend["l2_commit"]) sources["catalog_reconcile"] = ("pingcap-inc/nexuscrm-controlplane", "a" * 40) candidate = { "schema_version": validator.LOCAL_TEST3_DEPLOYMENT_SCHEMA_VERSION, "release_class": validator.LOCAL_TEST3_RELEASE_CLASS, "controller_commit": subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=REPO_ROOT, text=True).strip(), "desired_bom": desired, "desired_bom_sha256": validator.canonical_json_sha256(desired), # Schema fixture only; no image availability or publication claim. "images": {role: {"image_id": "sha256:" + str(index) * 64, "source_repository": source[0], "source_commit": source[1]} for index, (role, source) in enumerate(sources.items(), 1)}, } return candidate