"""Routing reason enums for the deterministic routing engine.

RoutingReason captures *why* a document was routed to adjudication or accepted
on the fast path. RouteDecision is the binary outcome.
"""

from __future__ import annotations

from enum import Enum


class RoutingReason(str, Enum):
    """Structured reason codes explaining a routing decision.

    Any triggered reason (except FAST_PATH_ACCEPTED) forces adjudication.
    These codes are stored in the database as TEXT[] and must remain stable
    across versions for audit queries.
    """

    UNRESOLVED_ALIAS = "UNRESOLVED_ALIAS"
    MULTIPLE_PRIMARY_COMPANIES = "MULTIPLE_PRIMARY_COMPANIES"
    CONTRADICTORY_NUMERIC_FACTS = "CONTRADICTORY_NUMERIC_FACTS"
    CONFLICTING_SENTIMENT = "CONFLICTING_SENTIMENT"
    IMPLIED_CAUSAL_IMPACT = "IMPLIED_CAUSAL_IMPACT"
    GUIDANCE_VS_CONSENSUS_REQUIRES_REASONING = (
        "GUIDANCE_VS_CONSENSUS_REQUIRES_REASONING"
    )
    MATERIAL_FIELD_MISSING = "MATERIAL_FIELD_MISSING"
    EVIDENCE_COVERAGE_BELOW_THRESHOLD = "EVIDENCE_COVERAGE_BELOW_THRESHOLD"
    CALIBRATED_CONFIDENCE_BELOW_THRESHOLD = "CALIBRATED_CONFIDENCE_BELOW_THRESHOLD"
    LONG_DOCUMENT_CROSS_CHUNK_RELATION = "LONG_DOCUMENT_CROSS_CHUNK_RELATION"
    FAST_PATH_ACCEPTED = "FAST_PATH_ACCEPTED"


class RouteDecision(str, Enum):
    """Binary routing outcome."""

    FAST_PATH = "fast_path"
    ADJUDICATION = "adjudication"
