forked from mtusi2026/mtusi2026lab4
fix(reconcile): карантин по контрольной сумме снимается только проходом с --verify-checksums
Найдено замером стоимости на чистом стенде: последующий --apply без проверки сумм видел совпадающий размер и снимал карантин checksum_mismatch как restored_object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
fc50362470
commit
6fb70de7ff
@@ -155,6 +155,14 @@ def test_checksum_mode_finds_same_size_corruption(api):
|
||||
assert report["cost"]["s3_get_bytes"] >= len(SAMPLE)
|
||||
assert findings_by_key(reconcile("--apply", "--verify-checksums", *GRACE))[k]["result"] == "applied"
|
||||
assert attachment_row(att["id"])["lost_reason"] == "checksum_mismatch"
|
||||
# A later pass WITHOUT checksums sees "same size" but cannot prove the bytes: the quarantine stays.
|
||||
assert k not in findings_by_key(reconcile("--apply", *GRACE))
|
||||
assert attachment_row(att["id"])["lost_reason"] == "checksum_mismatch"
|
||||
# Restoring the original and verifying lifts it.
|
||||
s3_put(k, SAMPLE)
|
||||
lifted = findings_by_key(reconcile("--apply", "--verify-checksums", *GRACE))[k]
|
||||
assert (lifted["kind"], lifted["result"]) == ("restored_object", "applied")
|
||||
assert attachment_row(att["id"])["lost_reason"] is None
|
||||
|
||||
|
||||
def test_safety_valve_refuses_mass_deletion():
|
||||
|
||||
Reference in New Issue
Block a user