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:
DCCONSTRUCTIONS
2026-07-23 00:23:28 +03:00
parent ada2a55ee6
commit b53d6d5a45
221 changed files with 55923 additions and 1357 deletions
+36 -1
View File
@@ -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