Files
NODEDC_MISSION_CORE/tests/test_geometry_replay_result.py

62 lines
2.2 KiB
Python

from __future__ import annotations
from pathlib import Path
from k1link.perception.geometry_replay import read_geometry_replay_result
REPOSITORY_ROOT = Path(__file__).resolve().parents[1]
RESULT_ROOT = (
REPOSITORY_ROOT
/ ".runtime/perception-m4/geometry-results"
/ "m4-geometry-replay-b7d72e9e411fd576243d10ab39717e90daa10703b67c6e32ab284f6bd78d344a"
)
def test_full_source_geometry_result_closes_m4_4_contract() -> None:
result = read_geometry_replay_result(RESULT_ROOT)
assert result.accepted is True
assert result.metrics["frames"] == {
"failed": 0,
"source_available": 3928,
"source_unavailable": 561,
"total": 4489,
}
proposals = result.metrics["proposals"]
assert isinstance(proposals, dict)
assert proposals["total"] == 15499
assert proposals["with_range"] == 5341
assert proposals["eligible_for_range"] == 13298
assert proposals["ownership_collision"] == 146
assert result.metrics["geometry_only_observations"] == 22740
assert result.metrics["published_source_point_rows"] == 2173778
def test_geometry_result_binds_the_accepted_m4_3_e32_and_e53_evidence() -> None:
result = read_geometry_replay_result(RESULT_ROOT)
identity = result.manifest["identity"]
assert isinstance(identity, dict)
assert identity["detector_result_id"] == (
"m4-detector-replay-11f83f2e0b81758ac2a5a5fc54e9d293b501678df5f6ef97b5c6069ba08605c5"
)
assert identity["geometry_profile_sha256"] == (
"cc666c9389a5e221957faddec89584709b66918d14abaf646f1832e001421999"
)
assert identity["historical_references"] == {
"e32": {
"manifest_sha256": ("f4b57c9f7619c43414adf1d10488b05df466226a523a0c001671102ced0e9ab8"),
"result_id": (
"e32-track-geometry-"
"a14ca0e7fb3850ca0dfa3c41634e1b490a2d58ab74d101afc6d6921fbdb0e6fd"
),
},
"e53": {
"manifest_sha256": ("fc5b4ae69aae0098b7075c539d25b563dff1bbb09209a49030edda6cba9ee544"),
"result_id": (
"e53-camera-first-shadow-"
"e6f03cf8bfb15db86100239b060e13f914532618b7b99e811866e4e6a555186c"
),
},
}