defaults:
  runner: runtime
  mode: full_chain
  input:
    rag_session_id: "7d11da21-faa0-4cea-aede-aeabe069164c"

cases:
  # OPEN_FILE
  - id: plba-v2-open-file-runtime
    query: "Открой файл src/app_runtime/core/runtime.py"
    expected:
      router:
        intent: CODE_QA
        sub_intent: OPEN_FILE
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        path_scope_contains: ["src/app_runtime/core/runtime.py"]
        layers_include: ["C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-open-file-public-api
    query: "Открой файл src/plba/__init__.py"
    expected:
      router:
        intent: CODE_QA
        sub_intent: OPEN_FILE
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        path_scope_contains: ["src/plba/__init__.py"]
        layers_include: ["C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        excludes: ["из различных подпакетов", "ответ основан исключительно"]

  # EXPLAIN
  - id: plba-v2-explain-runtime-manager
    query: "Объясни как работает класс RuntimeManager"
    expected:
      router:
        intent: CODE_QA
        sub_intent: EXPLAIN
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["RuntimeManager"]
        layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C2_DEPENDENCY_GRAPH"]
      llm:
        non_empty: true
        excludes: ["ряд аргументов", "основные службы"]

  - id: plba-v2-explain-trace-service
    query: "Объясни как работает класс TraceService"
    expected:
      router:
        intent: CODE_QA
        sub_intent: EXPLAIN
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["TraceService"]
        layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C2_DEPENDENCY_GRAPH"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-explain-create-runtime
    query: "Что делает функция create_runtime?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: EXPLAIN
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["create_runtime"]
        layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-explain-local-http-channel
    query: "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: EXPLAIN_LOCAL
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        path_scope_contains: ["src/app_runtime/control/http_channel.py"]
        symbol_candidates_contain: ["HttpControlChannel"]
        layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C2_DEPENDENCY_GRAPH"]
      llm:
        non_empty: true
        answer_mode: answered

  # FIND_TESTS
  - id: plba-v2-find-tests-runtime-manager
    query: "Где тесты для RuntimeManager?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: FIND_TESTS
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["RuntimeManager"]
        layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-find-tests-trace-service
    query: "Где тесты для TraceService?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: FIND_TESTS
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["TraceService"]
        layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-find-tests-create-runtime
    query: "Где тесты для create_runtime?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: FIND_TESTS
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["create_runtime"]
        layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-find-tests-workflow-runtime-factory-negative
    query: "Где тесты для WorkflowRuntimeFactory?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: FIND_TESTS
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        direct_symbol_test_hits_max: 0
        symbol_candidates_contain: ["WorkflowRuntimeFactory"]
        layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true

  # FIND_ENTRYPOINTS
  - id: plba-v2-find-entrypoints-control-plane
    query: "Найди точки входа HTTP control plane"
    expected:
      router:
        intent: CODE_QA
        sub_intent: FIND_ENTRYPOINTS
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        layers_include: ["C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-find-entrypoints-health-endpoint
    query: "Где health endpoint?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: FIND_ENTRYPOINTS
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        layers_include: ["C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        contains_all: ["GET /health"]
        excludes: ["нет явных неподтвержденных кандидатов", "кандидаты на health-endpoint"]

  # TRACE_FLOW
  - id: plba-v2-trace-flow-runtime-start
    query: "Покажи поток выполнения при запуске RuntimeManager"
    expected:
      router:
        intent: CODE_QA
        sub_intent: TRACE_FLOW
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["RuntimeManager"]
        layers_include: ["C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-trace-flow-health-endpoint
    query: "Покажи как проходит запрос /health в HttpControlAppFactory"
    expected:
      router:
        intent: CODE_QA
        sub_intent: TRACE_FLOW
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["HttpControlAppFactory"]
        layers_include: ["C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  # ARCHITECTURE
  - id: plba-v2-architecture-runtime-manager
    query: "Какие компоненты участвуют в RuntimeManager?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: ARCHITECTURE
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["RuntimeManager"]
        layers_include: ["C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  - id: plba-v2-architecture-control-plane
    query: "Какие компоненты участвуют в ControlPlaneService?"
    expected:
      router:
        intent: CODE_QA
        sub_intent: ARCHITECTURE
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: true
        symbol_candidates_contain: ["ControlPlaneService"]
        layers_include: ["C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        answer_mode: answered

  # NEGATIVE / NOT FOUND
  - id: plba-v2-explain-nonexistent-symbol
    query: "Объясни класс RuntimeFactoryManager"
    expected:
      router:
        intent: CODE_QA
        sub_intent: EXPLAIN
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: false
        symbol_candidates_contain: ["RuntimeFactoryManager"]
        layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        contains_all: ["не найдена"]
        excludes: ["исходя из названия", "вероятно этот класс", "возможное предназначение"]
      pipeline:
        answer_mode: degraded

  - id: plba-v2-open-file-nonexistent
    query: "Открой файл src/app_runtime/core/missing_runtime.py"
    expected:
      router:
        intent: CODE_QA
        sub_intent: OPEN_FILE
        graph_id: CodeQAGraph
        conversation_mode: START
      retrieval:
        non_empty: false
        path_scope_contains: ["src/app_runtime/core/missing_runtime.py"]
        layers_include: ["C0_SOURCE_CHUNKS"]
      llm:
        non_empty: true
        contains_all: ["Файл src/app_runtime/core/missing_runtime.py не найден."]
      pipeline:
        answer_mode: degraded
