mirror of
https://github.com/elder-plinius/OBLITERATUS.git
synced 2026-08-30 14:40:38 +02:00
18 lines
474 B
Python
18 lines
474 B
Python
"""Pure persistence contracts for tournament orchestration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
from typing import Any
|
|
|
|
|
|
def parse_checkpoint_document(raw: str) -> dict[str, Any] | None:
|
|
"""Return a supported checkpoint object, or ``None`` for invalid input."""
|
|
try:
|
|
data = json.loads(raw)
|
|
except json.JSONDecodeError:
|
|
return None
|
|
if not isinstance(data, dict) or data.get("version") != 1:
|
|
return None
|
|
return data
|