chore(storage): bound build retention, caches and test resources

Track build ownership, qualified pins and bounded cache/log lifecycles. Move Vite fixtures to a job-owned server helper and preserve private outputs outside Git.
This commit is contained in:
DCCONSTRUCTIONS
2026-10-29 09:09:58 +03:00
parent 55f64f195b
commit 70ef3f9f1c
119 changed files with 3128 additions and 331 deletions
+48
View File
@@ -753,3 +753,51 @@ def test_e10_projection_keeps_only_nearest_point_per_pixel() -> None:
assert pixels.shape == (1, 2)
assert depths.tolist() == [2.0]
assert source.tolist() == [0]
def test_sealed_overlay_still_recovers_when_cache_is_over_quota(tmp_path, monkeypatch):
from k1link.cache_budget import LIMITS
roots = [tmp_path / name for name in ("jobs", "results", "lidar")]
for root in roots:
root.mkdir()
result = _write_result_descriptor(
roots[1], session_id="session-1", created_at_utc="2026-07-29T12:00:00Z"
)
cache_root = tmp_path / "cache"
cached = cache_root / "session-1" / result.name
cached.mkdir(parents=True)
output = cached / "recording-1.rrd"
payload = b"RRF2sealed-overlay"
output.write_bytes(payload)
(cached / "recording-1.rrd.cache.json").write_text(
json.dumps(
{
"schema_version": integrated_module.OVERLAY_CACHE_SCHEMA,
"renderer_version": integrated_module.OVERLAY_RENDERER_VERSION,
"result_id": result.name,
"recording_id": "recording-1",
"byte_length": len(payload),
"sha256": hashlib.sha256(payload).hexdigest(),
}
)
)
monkeypatch.setitem(LIMITS, "integrated-perception-overlays", 1)
monkeypatch.setattr(
integrated_module,
"validate_integrated_perception_result",
lambda *a, **k: pytest.fail("must reuse sealed evidence"),
)
store = IntegratedPerceptionOverlayStore(
jobs_root=roots[0],
results_root=roots[1],
lidar_packs_root=roots[2],
cache_root=cache_root,
ffmpeg_path=tmp_path / "ffmpeg",
)
result = store.materialize(
"session-1", application_id="nodedc_mission_core_recorded", recording_id="recording-1"
)
assert result.path == output.resolve()
assert output.read_bytes() == payload
assert not (cache_root / "session-1" / "admission.json").exists()