fix(lab): restore canonical RAV004 replay

This commit is contained in:
DCCONSTRUCTIONS
2026-08-29 21:08:49 +03:00
parent c30d77572e
commit 525ab74168
8 changed files with 594 additions and 14 deletions
+20 -8
View File
@@ -152,10 +152,10 @@ def test_advanced_index_projects_one_most_mature_lifecycle_phase(tmp_path: Path)
]
def test_advanced_index_skips_noncanonical_vegetation_viewers(tmp_path: Path) -> None:
def test_advanced_index_prefers_canonical_rav004_full_review(tmp_path: Path) -> None:
root = tmp_path / "vegetation"
def publish(digest: str, *, canonical: bool) -> Path:
def publish(digest: str, *, publication: str) -> Path:
result_id = f"lab-v1-vegetation-shadow-{digest}"
candidate = root / result_id
candidate.mkdir(parents=True)
@@ -167,7 +167,17 @@ def test_advanced_index_skips_noncanonical_vegetation_viewers(tmp_path: Path) ->
"mode": "synchronised-multilayer-review",
"pixel_raster_fusion": False,
},
} if canonical else None
} if publication == "rav00" else None
route_full_review = {
"source_id": "RAVNOVES004TREE",
"session_id": "20260828T130511Z_viewer_live",
"frame_count": 6830,
"linked_route_review_result_id": (
f"lab-v1-vegetation-shadow-{'4' * 64}"
if publication == "rav004"
else None
),
} if publication != "rav00" else None
(candidate / "manifest.json").write_text(
json.dumps(
{
@@ -184,17 +194,19 @@ def test_advanced_index_skips_noncanonical_vegetation_viewers(tmp_path: Path) ->
"ground_truth": False,
"route_video": route_video,
"route_review": None,
"route_full_review": None if canonical else {"frame_count": 6830},
"route_full_review": route_full_review,
}
),
encoding="utf-8",
)
return candidate
canonical = publish("a" * 64, canonical=True)
incomplete = publish("b" * 64, canonical=False)
os.utime(canonical, ns=(10_000_000_000, 10_000_000_000))
rav00 = publish("a" * 64, publication="rav00")
incomplete = publish("b" * 64, publication="incomplete")
rav004 = publish("c" * 64, publication="rav004")
os.utime(rav00, ns=(10_000_000_000, 10_000_000_000))
os.utime(incomplete, ns=(20_000_000_000, 20_000_000_000))
os.utime(rav004, ns=(30_000_000_000, 30_000_000_000))
registry = _evidence_registry(
root,
work_id="lab-v1-vegetation-shadow",
@@ -211,7 +223,7 @@ def test_advanced_index_skips_noncanonical_vegetation_viewers(tmp_path: Path) ->
assert index["items"] == [ # type: ignore[index]
{
"work_id": "lab-v1-vegetation-shadow",
"result_id": canonical.name,
"result_id": rav004.name,
"created_at_utc": "2026-08-29T10:00:00Z",
"access": "read-only",
}