chore(perception): freeze vegetation candidates
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -14,6 +15,12 @@ REPOSITORY_ROOT = Path(__file__).resolve().parents[1]
|
||||
POLICY_PATH = (
|
||||
REPOSITORY_ROOT / "config" / "perception" / "lab-v1-vegetation-mission-policy-v1.json"
|
||||
)
|
||||
CANDIDATE_MANIFEST_PATH = (
|
||||
REPOSITORY_ROOT
|
||||
/ "config"
|
||||
/ "perception"
|
||||
/ "lab-v1-vegetation-candidate-manifest-v1.json"
|
||||
)
|
||||
|
||||
|
||||
def _policy() -> dict[str, object]:
|
||||
@@ -117,3 +124,26 @@ def test_unknown_material_is_treated_as_unknown_vegetation() -> None:
|
||||
assert decision.material_class == "vegetation_unknown"
|
||||
assert decision.effective_action == "NO_GO"
|
||||
assert decision.safety_reason == "hard_safety_interlock:vegetation_unknown"
|
||||
|
||||
|
||||
def test_candidate_manifest_freezes_unique_assets_sources_and_no_authority() -> None:
|
||||
manifest = json.loads(CANDIDATE_MANIFEST_PATH.read_text(encoding="utf-8"))
|
||||
assert manifest["schema_version"] == "missioncore.vegetation-candidate-manifest/v1"
|
||||
assert manifest["worker"]["canonical_runtime_mutation_allowed"] is False
|
||||
|
||||
sources = manifest["upstream_sources"]
|
||||
assert {source["source_id"] for source in sources} == {
|
||||
"wildscenes",
|
||||
"rellis-3d",
|
||||
"orfd-offnet",
|
||||
}
|
||||
assert all(len(source["revision"]) == 40 for source in sources)
|
||||
|
||||
candidates = manifest["candidate_assets"]
|
||||
candidate_ids = [candidate["candidate_id"] for candidate in candidates]
|
||||
assert len(candidate_ids) == len(set(candidate_ids)) == 10
|
||||
assert all(candidate["size_bytes"] > 0 for candidate in candidates)
|
||||
assert all(len(candidate["sha256"]) == 64 for candidate in candidates)
|
||||
assert manifest["invariants"]["missing_or_unknown_is_free"] is False
|
||||
assert manifest["invariants"]["navigation_authority"] is False
|
||||
assert manifest["invariants"]["actuation_authority"] is False
|
||||
|
||||
Reference in New Issue
Block a user