defaults:
  component: process_v2_router_plus_retrieval_policy

cases:
  - id: strict-general-overview
    query: "Общий обзор сервиса"
    expected:
      router:
        domain: GENERAL
        intent: GENERAL_QA
        sub_intent: SUMMARY
      route:
        anchors:
          endpoint_paths_not_contains: ["/health"]
          file_names_not_contains: ["/health"]
      retrieval_plan:
        profile: general_qa_grounded_summary
        layers_contains: [D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS]
        limit: 8
        filters:
          prefer_path_prefixes_contains: [docs/architecture/, docs/]
          path_prefixes: absent

  - id: strict-api-summary-health
    query: "Объясни endpoint /health"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: SUMMARY
      route:
        anchors:
          endpoint_paths_contains: ["/health"]
          file_names_not_contains: ["/health"]
      retrieval_plan:
        profile: docs_summary_api_endpoint
        filters:
          path_prefixes_contains: [docs/api/]
          prefer_path_prefixes_contains: [docs/api/]

  - id: strict-find-files-health-described
    query: "Где описан endpoint /health"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      route:
        anchors:
          endpoint_paths_contains: ["/health"]
          file_names_not_contains: ["/health"]
      retrieval_plan:
        profile: file_lookup
        layers_contains: [D1_DOCUMENT_CATALOG, D3_ENTITY_CATALOG]
        limit: 12
        filters:
          path_prefixes_contains: [docs/api/]
          prefer_path_prefixes_contains: [docs/api/]

  - id: strict-find-files-health-show-file
    query: "Покажи файл с описанием /health"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      route:
        anchors:
          endpoint_paths_contains: ["/health"]
      retrieval_plan:
        profile: file_lookup
        filters:
          path_prefixes_contains: [docs/api/]

  - id: strict-runtime-health-find-files
    query: "Где описан runtime health"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      retrieval_plan:
        profile: file_lookup
        filters:
          path_prefixes_contains_any: [docs/domains/, docs/]

  - id: strict-noisy-runtime-health-find-files
    query: "runtime health где описано в docs"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      retrieval_plan:
        profile: file_lookup

  - id: strict-doc-path-is-file-lookup
    query: "docs/api/health-endpoint.md"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      route:
        anchors:
          file_names_contains: ["docs/api/health-endpoint.md"]
          endpoint_paths_not_contains: ["/api/health-endpoint.md"]
      retrieval_plan:
        profile: file_lookup
        filters:
          path_prefixes_contains: [docs/api/]

  - id: strict-file-token-is-file-lookup
    query: "health-endpoint.md"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      route:
        anchors:
          file_names_contains: ["health-endpoint.md"]
          endpoint_paths_not_contains: ["health-endpoint.md"]
      retrieval_plan:
        profile: file_lookup

  - id: strict-noisy-english-show-doc
    query: "pls show doc for /health"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      route:
        anchors:
          endpoint_paths_contains: ["/health"]
          file_names_not_contains: ["/health"]
        target_terms_not_contains: [pls, show, doc, for]
      retrieval_plan:
        profile: file_lookup
        filters:
          path_prefixes_contains: [docs/api/]

  - id: strict-bare-endpoint-anchor-invariant
    query: "/health"
    expected:
      route:
        routing_domain_equals_any: [GENERAL, DOCS]
        intent_equals_any: [GENERAL_QA, DOC_EXPLAIN]
        subintent: SUMMARY
        anchors:
          endpoint_paths_contains: ["/health"]
          file_names_not_contains: ["/health"]

  - id: strict-find-files-dominates-health-question
    query: "В каком файле описан `/health`?"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      retrieval_plan:
        profile: file_lookup

  - id: strict-runtime-health-summary-not-file-lookup
    query: "Что делает runtime health"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: SUMMARY
      retrieval_plan:
        profile_equals_any: [docs_summary_domain_entity, docs_summary_generic]

  - id: strict-general-purpose
    query: "Зачем нужен этот сервис?"
    expected:
      route:
        routing_domain_equals_any: [GENERAL, DOCS]
        intent_equals_any: [GENERAL_QA, DOC_EXPLAIN]
        subintent: SUMMARY
      retrieval_plan:
        profile_equals_any: [general_qa_grounded_summary, docs_summary_generic]

  - id: strict-conflict-summary-goes-generic
    query: "Как устроена архитектура endpoint /send"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: SUMMARY
      retrieval_plan:
        profile: docs_summary_generic
        filters:
          path_prefixes_contains: [docs/api/]
          prefer_path_prefixes_contains: [docs/api/, docs/architecture/]

  - id: strict-find-files-dominates-mixed-signals
    query: "В каком файле описан architecture flow отправки уведомлений"
    expected:
      router:
        domain: DOCS
        intent: DOC_EXPLAIN
        sub_intent: FIND_FILES
      retrieval_plan:
        profile: file_lookup
