from __future__ import annotations import json import re from pathlib import Path def test_checked_in_legacy_capture_manifest_is_complete_and_bounded() -> None: path = Path(__file__).parent / "fixtures" / "legacy_http_goldens_manifest.json" manifest = json.loads(path.read_text(encoding="utf-8")) assert manifest["schema_version"] == "legacy-http-golden-manifest/v1" assert manifest["host_baseline_commit"] == "1495d063" assert manifest["legacy_source"]["source_commit"] assert manifest["redaction"]["rules"] captures = manifest["captures"] assert {item["name"] for item in captures} == {"run-454-detail", "run-454-log"} for capture in captures: assert capture["method"] == "GET" assert capture["route"].startswith("/api/pattern/script_builds/454") assert capture["status"] == 200 assert re.fullmatch(r"[0-9a-f]{64}", capture["sha256"]) assert capture["comparison"] in { "exact", "legacy-fields-exact-overlay-declared", } assert len(capture["legacy_top_level_fields"]) == len( set(capture["legacy_top_level_fields"]) )