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
+38
View File
@@ -9,6 +9,7 @@ from pathlib import Path
import numpy as np
import pytest
from k1link.compute.live_perception import LivePerceptionResultFrame
from k1link.data_plane import DecodedDataPlaneView, NormalizationError
from k1link.device_plugins.xgrids_k1.mqtt.capture import FRAME_HEADER, RAW_MAGIC
from k1link.device_plugins.xgrids_k1.protocol.normalizer import normalize_k1_message
@@ -138,6 +139,43 @@ def test_live_blueprint_follows_stream_time_without_frontend_cursor_writes() ->
assert panel.state == "hidden"
def test_live_perception_logs_original_mask_2d_distance_and_3d_cuboid() -> None:
recording = FakeRecording()
bridge = RerunBridge(recording_factory=lambda _: recording) # type: ignore[arg-type]
mask = np.zeros((600, 800), dtype=np.uint8)
mask[20:30, 40:50] = 4
bridge.process_perception(
LivePerceptionResultFrame(
frame_index=3,
source_frame_index=30,
session_seconds=1.0,
captured_at_epoch_ns=1_784_124_315_186_225_000,
image_jpeg=b"\xff\xd8test\xff\xd9",
segmentation_mask=mask,
objects=(
{
"track_id": 9,
"label": "car",
"score": 0.9,
"bbox_xyxy": [10.0, 20.0, 110.0, 80.0],
"distance_m": 6.2,
"cuboid_center_map": [1.0, 2.0, 0.5],
"cuboid_half_size": [2.25, 0.925, 0.775],
"cuboid_quaternion_xyzw": [0.0, 0.0, 0.0, 1.0],
},
),
delivery={"health": "healthy"},
)
)
paths = [path for path, _, _ in recording.logs]
assert "/perception/camera/image" in paths
assert "/perception/camera/segmentation" in paths
assert "/perception/camera/detections" in paths
assert "/world/perception/boxes3d" in paths
def test_constructor_disconnects_recording_after_partial_setup_failure() -> None:
recording = BlueprintFailureRecording()