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:
@@ -10,6 +10,8 @@ from contextlib import suppress
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
from k1link.cache_budget import CacheCapacityError, cache_publication
|
||||
|
||||
from .media import RecordedMediaEpoch, RecordedMediaInspector, RecordedMediaManifest
|
||||
from .models import SessionIntegrityError
|
||||
from .store import SessionStore
|
||||
@@ -133,7 +135,14 @@ class RecordedCameraFrameService:
|
||||
return cached
|
||||
self._require_latest(lane, ticket)
|
||||
frame = self._decode(manifest, epoch, sequence)
|
||||
_publish_cached_jpeg(cache_path, frame.payload)
|
||||
try:
|
||||
with cache_publication(
|
||||
self._cache_root, len(frame.payload), kind="camera-frame-cache"
|
||||
):
|
||||
_publish_cached_jpeg(cache_path, frame.payload)
|
||||
except CacheCapacityError:
|
||||
# The validated decoded frame is still usable without a disk copy.
|
||||
pass
|
||||
self._require_latest(lane, ticket)
|
||||
return frame
|
||||
finally:
|
||||
|
||||
@@ -15,6 +15,7 @@ from pathlib import Path
|
||||
from typing import Any, TypeGuard
|
||||
|
||||
from k1link import media_fragments as _fragment_timing
|
||||
from k1link.cache_budget import CacheCapacityError, cache_publication
|
||||
|
||||
from .models import RecordedMediaArtifact, ReplayCommand, SessionIntegrityError
|
||||
|
||||
@@ -255,11 +256,15 @@ class RecordedMediaInspector:
|
||||
if root is None:
|
||||
return
|
||||
payload = _encode_prepared_sidecar(manifest, identity)
|
||||
_write_sidecar_atomic(
|
||||
root,
|
||||
_sidecar_name(manifest.session_id, manifest.artifact_id),
|
||||
payload,
|
||||
)
|
||||
try:
|
||||
with cache_publication(root, len(payload), kind="camera-media-index"):
|
||||
_write_sidecar_atomic(
|
||||
root,
|
||||
_sidecar_name(manifest.session_id, manifest.artifact_id),
|
||||
payload,
|
||||
)
|
||||
except CacheCapacityError:
|
||||
pass
|
||||
|
||||
def get_prepared(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user