refactor(lab): перевести RAV004 на канонический Rerun pipeline

This commit is contained in:
DCCONSTRUCTIONS
2026-08-30 12:59:16 +03:00
parent e9ffb829c9
commit f5ee42751d
30 changed files with 1425 additions and 288 deletions
+46
View File
@@ -18,6 +18,11 @@ import k1link.laboratory.vegetation_policy_review as policy_review_module
import k1link.laboratory.vegetation_policy_video as policy_video_module
import k1link.laboratory.vegetation_shadow_lab as vegetation_lab_module
from k1link.laboratory import LaboratoryEvidenceRegistry
from k1link.laboratory.canonical_rerun_overlay import (
CanonicalLabOverlayArtifact,
_artifact_is_regular,
_video_reference_timestamps,
)
from k1link.laboratory.evidence_report import verify_laboratory_evidence_result
from k1link.laboratory.vegetation_policy_review import seal_vegetation_policy_review
from k1link.laboratory.vegetation_shadow_lab import seal_vegetation_shadow_lab
@@ -43,6 +48,47 @@ def test_semantic_component_boxes_keep_distinct_objects_separate() -> None:
]
def test_canonical_video_references_hold_only_missing_source_samples() -> None:
session_times = np.arange(10, dtype=np.int64) * 100_000_000 + 39_000_000_000
video_times = np.array(
[0, 100, 200, 300, 400, 500, 600, 700, 900],
dtype=np.int64,
) * 1_000_000
references = _video_reference_timestamps(video_times, session_times)
assert references.tolist() == [
0,
100_000_000,
200_000_000,
300_000_000,
400_000_000,
500_000_000,
600_000_000,
700_000_000,
700_000_000,
900_000_000,
]
def test_canonical_overlay_memory_cache_rejects_same_size_tampering(
tmp_path: Path,
) -> None:
path = tmp_path / "overlay.rrd"
path.write_bytes(b"RRF2-original")
artifact = CanonicalLabOverlayArtifact(
path=path,
byte_length=path.stat().st_size,
sha256=_sha256(path),
)
assert _artifact_is_regular(artifact)
path.write_bytes(b"RRF2-tampered")
assert path.stat().st_size == artifact.byte_length
assert not _artifact_is_regular(artifact)
def test_route_playback_chunk_descriptor_seals_only_requested_binary_window() -> None:
points = np.arange(18, dtype="<f4").reshape(6, 3)
descriptor = _canonical_route_playback_chunk_descriptor(