# docs-v2-negative-missing-entity

- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml
- runner: agent_runtime
- mode: full_chain
- passed: True

## Query
Что такое сущность PaymentTransaction?

## Actual
{
  "intent": "DOCUMENTATION_EXPLAIN",
  "sub_intent": "ENTITY_EXPLAIN",
  "graph_id": "DocsQAGraph",
  "conversation_mode": "START",
  "rag_count": 0,
  "llm_answer": "",
  "answer_mode": "degraded",
  "path_scope": [],
  "doc_scope": [],
  "entity_candidates": [
    "PaymentTransaction"
  ],
  "symbol_candidates": [],
  "layers": [
    "D3_ENTITY_CATALOG",
    "D1_DOCUMENT_CATALOG",
    "D5_RELATION_GRAPH",
    "D0_DOC_CHUNKS"
  ],
  "filters": {
    "doc_type": null
  },
  "pipeline_mode": "pre_llm_only",
  "gate_decision": "reject",
  "prompt_used": "docs_explain_answer",
  "llm_mode": "prose",
  "degraded_reason": "not_found_exact_anchor",
  "code_intents_stubbed": true
}

## Pipeline Steps
### input_query
```json
{
  "input": {
    "query": "Что такое сущность PaymentTransaction?"
  },
  "output": {
    "query": "Что такое сущность PaymentTransaction?"
  }
}
```

### router
```json
{
  "input": {
    "query": "Что такое сущность PaymentTransaction?"
  },
  "output": {
    "intent": "DOCUMENTATION_EXPLAIN",
    "sub_intent": "ENTITY_EXPLAIN",
    "graph_id": "DocsQAGraph",
    "conversation_mode": "START"
  }
}
```

### docs_pipeline
```json
{
  "input": {
    "query": "Что такое сущность PaymentTransaction?"
  },
  "output": {
    "answer_mode": "degraded",
    "prompt_name": "docs_explain_answer",
    "llm_request": {
      "prompt_name": "docs_explain_answer",
      "log_context": "graph.project_qa.docs.answer",
      "prompt_stats": {
        "system_chars": 393,
        "user_chars": 182,
        "tokens_in_estimate": 144
      }
    },
    "degraded_reason": "not_found_exact_anchor"
  }
}
```

## Diagnostics
{
  "intent": "DOCUMENTATION_EXPLAIN",
  "sub_intent": "ENTITY_EXPLAIN",
  "layers_used": [
    "D3_ENTITY_CATALOG",
    "D1_DOCUMENT_CATALOG",
    "D5_RELATION_GRAPH",
    "D0_DOC_CHUNKS"
  ],
  "documents_found": 0,
  "facts_found": 0,
  "relations_found": 0,
  "openapi_fields_extracted": 0,
  "missing_required_fields": [],
  "openapi_status": {
    "has_path": false,
    "has_method": false,
    "has_request": false,
    "has_response": false
  },
  "prompt_used": "docs_explain_answer",
  "llm_mode": "prose",
  "output_valid": false,
  "matched_intent_source": "deterministic",
  "matched_anchor_type": "entity",
  "matched_anchor_value": "PaymentTransaction",
  "exact_anchor_match": false,
  "docs_layers_requested": [
    "D3_ENTITY_CATALOG",
    "D1_DOCUMENT_CATALOG",
    "D5_RELATION_GRAPH",
    "D0_DOC_CHUNKS"
  ],
  "docs_layers_with_hits": [
    "D3_ENTITY_CATALOG",
    "D1_DOCUMENT_CATALOG",
    "D5_RELATION_GRAPH",
    "D0_DOC_CHUNKS"
  ],
  "planned_layers": [
    "D3_ENTITY_CATALOG",
    "D1_DOCUMENT_CATALOG",
    "D5_RELATION_GRAPH",
    "D0_DOC_CHUNKS"
  ],
  "executed_layers": [
    "D3_ENTITY_CATALOG",
    "D1_DOCUMENT_CATALOG",
    "D5_RELATION_GRAPH",
    "D0_DOC_CHUNKS"
  ],
  "non_empty_layers": [
    "D3_ENTITY_CATALOG",
    "D1_DOCUMENT_CATALOG",
    "D5_RELATION_GRAPH",
    "D0_DOC_CHUNKS"
  ],
  "layer_diagnostics": {
    "D3_ENTITY_CATALOG": {
      "hits": 8,
      "top_ids": [
        "api.control_actions_endpoint",
        "api.health_endpoint"
      ]
    },
    "D1_DOCUMENT_CATALOG": {
      "hits": 6,
      "top_ids": [
        "docs/README.md",
        "api.control_actions_endpoint",
        "api.health_endpoint",
        "api.send_message_endpoint",
        "architecture.telegram_notify_app"
      ]
    },
    "D5_RELATION_GRAPH": {
      "hits": 6,
      "top_ids": [
        "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd",
        "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1",
        "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0",
        "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa",
        "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a"
      ]
    },
    "D0_DOC_CHUNKS": {
      "hits": 6,
      "top_ids": [
        "docs/README.md",
        "api.control_actions_endpoint"
      ]
    }
  },
  "query_entity_candidates": [
    "PaymentTransaction"
  ],
  "resolved_entity_candidates": [],
  "query_anchor_candidates": [
    "PaymentTransaction"
  ],
  "resolved_anchor_candidates": [],
  "anchor_candidates": [],
  "selected_anchor": null,
  "anchor_selection_reason": "",
  "anchor_match_type": "",
  "doc_ids": [],
  "doc_paths": [],
  "doc_titles": [],
  "relation_hits_count": 0,
  "relation_targets": [],
  "fallback_doc_hits_count": 0,
  "fallback_used": false,
  "fact_hits": 0,
  "entity_hits": 0,
  "evidence_summary": {
    "documents": 0,
    "facts": 0,
    "relations": 0,
    "chunks": 0,
    "entity_hits": 0,
    "openapi_signals": {
      "path_found": false,
      "method_found": false,
      "request_schema": false,
      "response_schema": false,
      "status_codes": false,
      "payload_description": false
    }
  },
  "gate_decision": "reject",
  "gate_decision_reason": "not_found_exact_anchor",
  "gate_missing_requirements": [
    "retrieval_non_empty",
    "exact_anchor_match"
  ],
  "gate_satisfied_requirements": [],
  "openapi_evidence": {
    "path_found": false,
    "method_found": false,
    "request_schema": false,
    "response_schema": false,
    "status_codes": false,
    "payload_description": false
  },
  "requested_fragment_type": null,
  "fragment_evidence_found": [],
  "fragment_missing_requirements": [],
  "answer_mode": "degraded",
  "degrade_reason": "not_found_exact_anchor",
  "degraded_reason": "not_found_exact_anchor",
  "code_intents_stubbed": false
}

## LLM Request
- prompt_name: docs_explain_answer
- log_context: graph.project_qa.docs.answer

### Prompt Stats
```json
{
  "system_chars": 393,
  "user_chars": 182,
  "tokens_in_estimate": 144
}
```

### System Prompt
```text
Ты объясняешь документацию системы.

На вход приходит JSON с полями:
- question
- intent
- sub_intent
- documents
- facts
- relations

Правила:
- Используй только предоставленные факты
- Не додумывай
- Если данных недостаточно, скажи это явно
- Объясняй структурировано

Формат ответа:
1. Краткое описание
2. Основные элементы
3. Как это работает
4. Связи с другими частями системы (если есть)
```

### User Prompt
```json
{
  "question": "Что такое сущность PaymentTransaction?",
  "intent": "DOCUMENTATION_EXPLAIN",
  "sub_intent": "ENTITY_EXPLAIN",
  "documents": [],
  "facts": [],
  "relations": []
}
```

### User Prompt Overview
- question: Что такое сущность PaymentTransaction?
- intent: DOCUMENTATION_EXPLAIN
- sub_intent: ENTITY_EXPLAIN
- documents: 0
- facts: 0
- relations: 0

## Mismatches
- none