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:
@@ -1,7 +1,14 @@
|
||||
import asyncio
|
||||
|
||||
from bleak.backends.device import BLEDevice
|
||||
from bleak.backends.scanner import AdvertisementData
|
||||
from pytest import MonkeyPatch
|
||||
|
||||
from k1link.device_plugins.xgrids_k1.ble.scanner import advertisement_record
|
||||
from k1link.device_plugins.xgrids_k1.ble.scanner import (
|
||||
advertisement_record,
|
||||
discovered_device,
|
||||
scan,
|
||||
)
|
||||
|
||||
|
||||
def test_advertisement_record_marks_k1_candidate() -> None:
|
||||
@@ -37,3 +44,31 @@ def test_advertisement_record_marks_synthetic_xgr_name_as_k1_candidate() -> None
|
||||
|
||||
record = advertisement_record(device, advertisement)
|
||||
assert record["k1_name_candidate"] is True
|
||||
|
||||
|
||||
def test_scan_retains_the_live_corebluetooth_handle(
|
||||
monkeypatch: MonkeyPatch,
|
||||
) -> None:
|
||||
device = BLEDevice("LIVE-UUID", "XGR-LIVE", details=object())
|
||||
advertisement = AdvertisementData(
|
||||
local_name="XGR-LIVE",
|
||||
manufacturer_data={},
|
||||
service_data={},
|
||||
service_uuids=[],
|
||||
tx_power=0,
|
||||
rssi=-41,
|
||||
platform_data=(),
|
||||
)
|
||||
|
||||
async def fake_discover(**_kwargs: object) -> dict[str, tuple[BLEDevice, AdvertisementData]]:
|
||||
return {"LIVE-UUID": (device, advertisement)}
|
||||
|
||||
monkeypatch.setattr(
|
||||
"k1link.device_plugins.xgrids_k1.ble.scanner.BleakScanner.discover",
|
||||
fake_discover,
|
||||
)
|
||||
|
||||
result = asyncio.run(scan(1.0))
|
||||
|
||||
assert result["devices"][0]["macos_uuid"] == "LIVE-UUID"
|
||||
assert discovered_device("LIVE-UUID") is device
|
||||
|
||||
Reference in New Issue
Block a user