from __future__ import annotations

from dataclasses import dataclass, field

from app.core.agent.runtime.execution_context import RuntimeExecutionContext
from app.core.agent.utils.process_v2.evidence.gate import EvidenceGateDecision
from app.core.agent.utils.process_v2.models import RetrievedFile, V2RouteResult
from app.core.rag.retrieval.session_retriever import RetrievalPlan


@dataclass(slots=True)
class DocExplainFindFilesContext:
    runtime: RuntimeExecutionContext
    route: V2RouteResult
    rag_session_id: str
    retrieval_plan: RetrievalPlan | None = None
    retrieved_rows: list[dict] = field(default_factory=list)
    rows: list[dict] = field(default_factory=list)
    files: list[RetrievedFile] = field(default_factory=list)
    gate_decision: EvidenceGateDecision | None = None
    answer: str = ""
    answer_generated_payload: dict[str, object] | None = None
