fix(lab): restore canonical vegetation evidence layers
This commit is contained in:
@@ -75,6 +75,8 @@ _E37_RESULT_ID = re.compile(r"^e37-ravnoves-acceptance-[a-f0-9]{64}$")
|
||||
_E38_RESULT_ID = re.compile(r"^e38-perception-baseline-[a-f0-9]{64}$")
|
||||
_E39_RESULT_ID = re.compile(r"^e39-perception-refinement-[a-f0-9]{64}$")
|
||||
_E40_RESULT_ID = re.compile(r"^e40-perception-product-gate-[a-f0-9]{64}$")
|
||||
_M4_RESULT_ID = re.compile(r"^m4-threat-replay-[a-f0-9]{64}$")
|
||||
_M49_TGS_RESULT_ID = re.compile(r"^m49-tgs-full-shadow-[a-f0-9]{64}$")
|
||||
|
||||
RootProvider = Callable[[], Path | None]
|
||||
|
||||
@@ -245,6 +247,7 @@ def _advanced_index_item(
|
||||
raise ValueError("advanced LAB authority is invalid")
|
||||
if document.get("ground_truth") not in (None, False):
|
||||
raise ValueError("advanced LAB ground-truth claim is invalid")
|
||||
_validate_product_publication_shape(document, work_id=work_id)
|
||||
created_at_utc = document.get("created_at_utc")
|
||||
if not isinstance(created_at_utc, str) or not created_at_utc.strip():
|
||||
raise ValueError("advanced LAB creation time is invalid")
|
||||
@@ -256,6 +259,30 @@ def _advanced_index_item(
|
||||
}
|
||||
|
||||
|
||||
def _validate_product_publication_shape(
|
||||
document: dict[str, Any],
|
||||
*,
|
||||
work_id: str,
|
||||
) -> None:
|
||||
if work_id != "lab-v1-vegetation-shadow":
|
||||
return
|
||||
route = document.get("route_video")
|
||||
fusion = route.get("fusion") if isinstance(route, dict) else None
|
||||
if (
|
||||
not isinstance(route, dict)
|
||||
or route.get("view_kind") != "coarse-material-policy-review"
|
||||
or _M4_RESULT_ID.fullmatch(str(route.get("base_m4_result_id", ""))) is None
|
||||
or _M49_TGS_RESULT_ID.fullmatch(str(route.get("linked_tgs_result_id", "")))
|
||||
is None
|
||||
or not isinstance(fusion, dict)
|
||||
or fusion.get("mode") != "synchronised-multilayer-review"
|
||||
or fusion.get("pixel_raster_fusion") is not False
|
||||
or document.get("route_review") is not None
|
||||
or document.get("route_full_review") is not None
|
||||
):
|
||||
raise ValueError("vegetation LAB has no canonical M4/M4.9 publication shape")
|
||||
|
||||
|
||||
def _advanced_index(
|
||||
specs: tuple[_AdvancedIndexSpec, ...],
|
||||
) -> dict[str, object]:
|
||||
|
||||
Reference in New Issue
Block a user