fix: tolerate absent annotations when digesting schema index artifacts

This commit is contained in:
2026-08-11 19:39:30 +02:00
parent ca552451a4
commit 0be6549b31
+6 -1
View File
@@ -14,7 +14,12 @@ vector_app = typer.Typer(help="Indice semantico Qdrant (derivato, rigenerabile)"
def _artifact_digest(path: Path) -> str: def _artifact_digest(path: Path) -> str:
return "sha256:" + hashlib.sha256(path.read_bytes()).hexdigest() try:
contents = path.read_bytes()
except FileNotFoundError:
# An absent annotations file is valid (empty curation); digest the empty artifact.
contents = b""
return "sha256:" + hashlib.sha256(contents).hexdigest()
def _emit_json(payload: dict) -> None: def _emit_json(payload: dict) -> None: