DELETE /artifacts/{digest}: superuser only, 409 while referenced

The keep-set the hourly sweep uses is now referenced_artifacts, shared by
the sweep and the route. The volatile ring is not touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-15 10:48:59 +02:00
co-authored by Claude Opus 5.5
parent b4d7ffb982
commit 3c9aec0982
7 changed files with 144 additions and 15 deletions
+13
View File
@@ -160,6 +160,19 @@ class ArtifactStore:
self.put_file(source)
return True
def delete(self, digest: str) -> bool:
"""Remove one artifact's bytes. Returns whether this store had them.
The ring is not looked in: its frames fall out on their own.
"""
if not valid_digest(digest):
return False
try:
self._path(digest).unlink()
except FileNotFoundError:
return False
return True
def read(self, digest: str) -> Iterator[bytes]:
target = self.path(digest)
if target is None: