feat(perception): integrate calibrated operator pipeline
Add calibrated K1 projection, recorded and near-live perception qualification, unified Rerun operator layers, bounded replay admission, audited viewer controls, worker experiments, and lab evidence.
This commit is contained in:
@@ -20,6 +20,7 @@ from pydantic import ValidationError
|
||||
|
||||
import k1link.web.device_plugin_composition as plugin_composition
|
||||
from k1link.device_plugins.xgrids_k1.facade import (
|
||||
ACTION_DEVICE_CALIBRATION_SNAPSHOT_READ,
|
||||
ACTION_DISCOVERY_SCAN,
|
||||
ACTION_NETWORK_PROVISION,
|
||||
ACTION_STREAM_START_LIVE,
|
||||
@@ -59,6 +60,10 @@ class FakeXgridsService:
|
||||
self.calls.append(("state", None))
|
||||
return {"phase": "idle"}
|
||||
|
||||
def read_device_calibration_snapshot(self) -> dict[str, Any]:
|
||||
self.calls.append(("calibration", None))
|
||||
return {"status": "available", "snapshot_id": "fixture-snapshot"}
|
||||
|
||||
async def scan_ble(self, duration_seconds: float) -> dict[str, Any]:
|
||||
self.calls.append(("scan", duration_seconds))
|
||||
return {"phase": "idle", "devices": []}
|
||||
@@ -71,7 +76,7 @@ class FakeXgridsService:
|
||||
self,
|
||||
project_name: str,
|
||||
host: str | None,
|
||||
duration_seconds: float,
|
||||
duration_seconds: float | None,
|
||||
compatibility_attestation: CompatibilityAttestationRequest,
|
||||
) -> dict[str, Any]:
|
||||
self.calls.append(
|
||||
@@ -135,6 +140,24 @@ def test_manifest_and_runtime_facade_declare_identical_actions() -> None:
|
||||
assert {action.id for action in manifest.spec.actions} == XgridsK1PluginFacade.action_ids
|
||||
|
||||
|
||||
def test_calibration_snapshot_action_calls_the_read_only_service_method() -> None:
|
||||
service = FakeXgridsService()
|
||||
dispatcher = DevicePluginDispatcher(
|
||||
[_in_process_runtime(XgridsK1PluginFacade(service))]
|
||||
)
|
||||
|
||||
result = asyncio.run(
|
||||
dispatcher.invoke(
|
||||
XGRIDS_K1_PLUGIN_ID,
|
||||
ACTION_DEVICE_CALIBRATION_SNAPSHOT_READ,
|
||||
{},
|
||||
)
|
||||
)
|
||||
|
||||
assert result == {"status": "available", "snapshot_id": "fixture-snapshot"}
|
||||
assert service.calls == [("calibration", None)]
|
||||
|
||||
|
||||
def test_repository_runtime_composition_exactly_matches_catalog() -> None:
|
||||
repository_root = Path(__file__).resolve().parents[1]
|
||||
environment = load_installed_device_plugins(repository_root)
|
||||
|
||||
Reference in New Issue
Block a user