feat: add safe distributed checkpoint intake and preflight

This commit is contained in:
Joseph Magly
2026-09-04 19:43:53 -04:00
parent 5cc43c6e52
commit 985c9e9363
108 changed files with 21726 additions and 92 deletions
+38
View File
@@ -0,0 +1,38 @@
"""Stable runtime failures remain aligned with the accepted error registry."""
from __future__ import annotations
import json
from pathlib import Path
from obliteratus.checkpoint_errors import CheckpointContractError
ROOT = Path(__file__).resolve().parents[1]
def test_runtime_error_contract_covers_every_registered_code_exactly():
registry = json.loads(
(
ROOT / "docs/checkpoints/schemas/checkpoint-error-codes-v1.json"
).read_text()
)
for entry in registry["entries"]:
error = CheckpointContractError(
entry["code"],
detail="bounded_detail",
affected_refs=("b", "a", "a"),
)
assert error.code == entry["code"]
assert error.category == entry["category"]
assert error.phase == entry["phase"]
assert error.affected_refs == ("a", "b")
assert set(error.to_blocker()) == {
"code",
"category",
"phase",
"affected_refs",
"retryable",
"next_action",
}