"""Closed state vocabularies + supported contract versions — the single source for code.

The JSON schemas (``schemas/_common.schema.json``) are the wire authority; these
mirror the load-bearing enums for Python use and are kept in lock-step by a test.
"""

from __future__ import annotations

from enum import StrEnum

SUPPORTED_SCHEMA_VERSION = "0.1"
SUPPORTED_WIRE_VERSION = "0.1"


class SyncState(StrEnum):
    """The first-class sync states — shown everywhere, never blank (honest-absence)."""

    IN_SYNC = "IN_SYNC"
    STALE = "STALE"
    TAMPERED = "TAMPERED"
    UNKNOWN = "UNKNOWN"
    UNREADABLE = "UNREADABLE"
    CHECKING = "CHECKING"
    SYNCING = "SYNCING"
    ERROR = "ERROR"


SYNC_STATES: tuple[str, ...] = tuple(s.value for s in SyncState)
# PAPER-04: widened (additive) with the supervisor's full outcome vocabulary —
# "crashed", "hung", "quarantined" — so run-records carry the verbatim outcome
# natively instead of a flattened projection; "unknown" stays the loud fallback.
TEST_STATUS_VALUES: tuple[str, ...] = (
    "pass",
    "fail",
    "error",
    "skipped",
    "crashed",
    "hung",
    "quarantined",
    "unknown",
)
