feat: qualify complete K1 replay on worker

This commit is contained in:
DCCONSTRUCTIONS
2026-07-26 10:11:56 +03:00
parent a1e2cb523f
commit 36ea7ea3d8
17 changed files with 1212 additions and 118 deletions
+42
View File
@@ -55,6 +55,48 @@ def test_camera_replay_loads_segments_lazily_and_checks_each_digest(tmp_path: Pa
next(events)
def test_camera_replay_complete_recording_mode_has_no_duration_cutoff(
tmp_path: Path,
) -> None:
module = _module(
"e28_complete_source_replay_test",
"experiments/perception/run_e12_shadow_transport_replay.py",
)
epoch = tmp_path / "epoch-1"
segments = epoch / "segments"
segments.mkdir(parents=True)
(epoch / "init.mp4").write_bytes(b"init")
rows = []
for sequence, epoch_ns in ((1, 100_000_000), (2, 2_100_000_000)):
payload = f"frame-{sequence}".encode()
path = segments / f"{sequence}.m4s"
path.write_bytes(payload)
rows.append(
{
"host_epoch_ns": epoch_ns,
"host_monotonic_ns": epoch_ns,
"length": len(payload),
"path": f"segments/{sequence}.m4s",
"sequence": sequence,
"sha256": hashlib.sha256(payload).hexdigest(),
}
)
(epoch / "index.jsonl").write_text(
"".join(json.dumps(row) + "\n" for row in rows),
encoding="utf-8",
)
bounded = list(module._camera_events(epoch, 1.0))
complete = list(module._camera_events(epoch, None))
assert [event.modality for event in bounded] == ["camera-init", "camera-frame"]
assert [event.modality for event in complete] == [
"camera-init",
"camera-frame",
"camera-frame",
]
def test_e21_trend_reports_accumulating_age_and_stable_memory() -> None:
module = _module(
"e21_analyzer_test",