"""
RAG Judge Types - Data classes for RAG evaluation results
"""
from dataclasses import dataclass
from typing import Literal, List


@dataclass
class RAGRetrievalResult:
    """Result from RAG retrieval evaluation."""
    retrieval_precision: int  # 0-100
    faithfulness: int  # 1-5
    relevance: int  # 1-5
    citation_accuracy: int  # 1-5
    reasoning: str
    composite_score: float


@dataclass
class RAGOperatorResult:
    """Result from operator alignment evaluation."""
    operator_alignment: int  # 0-100
    faithfulness: int  # 1-5
    completeness: int  # 1-5
    detected_afb: str  # I, II, III
    reasoning: str
    composite_score: float


@dataclass
class RAGHallucinationResult:
    """Result from hallucination control evaluation."""
    grounding_score: int  # 0-100
    invention_detection: Literal["pass", "fail"]
    source_attribution: int  # 1-5
    hallucinated_claims: List[str]
    reasoning: str
    composite_score: float


@dataclass
class RAGPrivacyResult:
    """Result from privacy compliance evaluation."""
    privacy_compliance: Literal["pass", "fail"]
    anonymization: int  # 1-5
    dsgvo_compliance: Literal["pass", "fail"]
    detected_pii: List[str]
    reasoning: str
    composite_score: float


@dataclass
class RAGNamespaceResult:
    """Result from namespace isolation evaluation."""
    namespace_compliance: Literal["pass", "fail"]
    cross_tenant_leak: Literal["pass", "fail"]
    school_sharing_compliance: int  # 1-5
    detected_leaks: List[str]
    reasoning: str
    composite_score: float
