Add documented KoKonna failure policy, bounded retries and durable recovery escalation [skip ci]

This commit is contained in:
渡口浪人
2026-10-16 12:25:16 +08:00
parent d2f02d8054
commit a843d4de9b
17 changed files with 873 additions and 70 deletions
@@ -59,6 +59,12 @@ class UploadReconciliation:
candidates.append(image)
# Ambiguous matches never release a write lock.
if len(candidates) != 1:
service.recovery.observe(
op,
"gallery_match_missing"
if not candidates
else "gallery_match_ambiguous",
)
return None
expected = candidates[0].image_id
data = driver.download(expected)
@@ -66,6 +72,7 @@ class UploadReconciliation:
len(data) != intent["size"]
or hashlib.sha256(data).hexdigest() != intent["sha256"]
):
service.recovery.observe(op, "content_mismatch")
return None
result["image_id"] = expected
result["upload_confirmed"] = True