# v4-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_v4-llm.yaml
- runner: agent_runtime
- mode: full_chain
- passed: True

## Query
Что такое runtime health?

## Actual
{
  "intent": "DOCUMENTATION_EXPLAIN",
  "sub_intent": "ENTITY_EXPLAIN",
  "graph_id": "DocsQAGraph",
  "conversation_mode": "START",
  "rag_count": 24,
  "llm_answer": "### Краткое описание\nRuntime Health – это доменная модель наблюдаемости сервиса, описывающая общее состояние runtime и отдельных его компонентов. Она используется для внешнего мониторинга здоровья приложения и внутренней диагностики.\n\n### Основные элементы\n- **Компоненты**: Главными объектами наблюдения являются компоненты, такие как `telegram_notify`.\n- **Параметры**: Важны параметры компонента, например, статус, время старта и количество успешных отправок.\n- **Модель**: Представляет собой набор метрик и состояний, отражающих текущую работоспособность сервиса.\n\n### Как это работает\nМодель Runtime Health собирает данные о состоянии различных компонентов сервиса и предоставляет их внешним системам мониторинга и внутренним диагностическим механизмам. Для тестового приложения `test_echo_app` основной наблюдаемый компонент - это `telegram_notify`. \n\nAPI endpoint `/health` предоставляет текущее состояние runtime и его компонентов без изменения текущего состояния системы. Это необходимо для мониторинга работоспособности приложения, проведения проверок готовности (readiness), жизнеспособности (liveness) и быстрой диагностики работы компонента `telegram_notify`.\n\n### Связи с другими частями системы\n- **Используется API**: Модель используется в методе API `/health`, который обеспечивает внешний мониторинг и диагностику.\n- **Связана с логикой**: Логика уведомления через Telegram (`logic.telegram_notification_loop`) связана с моделью Runtime Health и может использовать её данные для управления состоянием уведомлений.\n- **Часть архитектуры**: Модель является частью общей архитектуры приложения `telegram_notify_app` и интегрируется с другими компонентами этого приложения.",
  "answer_mode": "answered",
  "path_scope": [],
  "doc_scope": [
    "api.health_endpoint",
    "architecture.telegram_notify_app",
    "architecture.telegram_notify_app_overview",
    "domain.runtime_health",
    "api.control_actions_endpoint",
    "logic.telegram_notification_loop",
    "api.actions_endpoint"
  ],
  "entity_candidates": [
    "runtime health"
  ],
  "symbol_candidates": [],
  "layers": [
    "D3_ENTITY_CATALOG",
    "D5_RELATION_GRAPH",
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "filters": {
    "doc_type": null
  },
  "pipeline_mode": "full",
  "gate_decision": "allow",
  "prompt_used": "docs_explain_answer",
  "llm_mode": "prose",
  "degraded_reason": null,
  "code_intents_stubbed": true
}

## Pipeline Steps
### input_query
```json
{
  "input": {
    "query": "Что такое runtime health?"
  },
  "output": {
    "query": "Что такое runtime health?"
  }
}
```

### router
```json
{
  "input": {
    "query": "Что такое runtime health?"
  },
  "output": {
    "intent": "DOCUMENTATION_EXPLAIN",
    "sub_intent": "ENTITY_EXPLAIN",
    "graph_id": "DocsQAGraph",
    "conversation_mode": "START"
  }
}
```

### docs_pipeline
```json
{
  "input": {
    "query": "Что такое runtime health?"
  },
  "output": {
    "answer_mode": "answered",
    "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": 7572,
        "tokens_in_estimate": 1992
      }
    },
    "degraded_reason": ""
  }
}
```

## Diagnostics
{
  "intent": "DOCUMENTATION_EXPLAIN",
  "sub_intent": "ENTITY_EXPLAIN",
  "layers_used": [
    "D3_ENTITY_CATALOG",
    "D5_RELATION_GRAPH",
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "documents_found": 1,
  "facts_found": 0,
  "relations_found": 2,
  "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": true,
  "matched_intent_source": "deterministic",
  "matched_anchor_type": "none",
  "matched_anchor_value": null,
  "exact_anchor_match": false,
  "docs_layers_requested": [
    "D3_ENTITY_CATALOG",
    "D5_RELATION_GRAPH",
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "docs_layers_with_hits": [
    "D3_ENTITY_CATALOG",
    "D5_RELATION_GRAPH",
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "planned_layers": [
    "D3_ENTITY_CATALOG",
    "D5_RELATION_GRAPH",
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "executed_layers": [
    "D3_ENTITY_CATALOG",
    "D5_RELATION_GRAPH",
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "non_empty_layers": [
    "D3_ENTITY_CATALOG",
    "D5_RELATION_GRAPH",
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "layer_diagnostics": {
    "D3_ENTITY_CATALOG": {
      "hits": 8,
      "top_ids": [
        "api.health_endpoint",
        "architecture.telegram_notify_app",
        "domain.runtime_health"
      ],
      "top_sections": [
        "RuntimeManager",
        "WorkerStatus",
        "TelegramNotifyWorker",
        "TelegramControlChannel"
      ]
    },
    "D5_RELATION_GRAPH": {
      "hits": 8,
      "top_ids": [
        "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4",
        "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04",
        "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e",
        "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa",
        "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a"
      ],
      "top_sections": [
        "domain.runtime_health:used_by",
        "domain.runtime_health:related_logic",
        "domain.runtime_health:part_of",
        "api.health_endpoint:parent",
        "api.health_endpoint:part_of"
      ]
    },
    "D1_DOCUMENT_CATALOG": {
      "hits": 4,
      "top_ids": [
        "domain.runtime_health",
        "api.health_endpoint",
        "logic.telegram_notification_loop",
        "api.control_actions_endpoint"
      ],
      "top_sections": [
        "Сущность runtime health",
        "HTTP API /health",
        "Цикл отправки уведомлений в Telegram",
        "HTTP API /actions/{action}"
      ]
    },
    "D0_DOC_CHUNKS": {
      "hits": 4,
      "top_ids": [
        "api.health_endpoint"
      ],
      "top_sections": [
        "api.health_endpoint:Описание",
        "api.health_endpoint:Сценарий",
        "api.health_endpoint:Summary",
        "api.health_endpoint:Функциональные требования"
      ]
    }
  },
  "query_entity_candidates": [
    "runtime health"
  ],
  "resolved_entity_candidates": [],
  "query_anchor_candidates": [],
  "resolved_anchor_candidates": [
    "api.health_endpoint",
    "docs/documentation/api/health-endpoint.md",
    "architecture.telegram_notify_app",
    "docs/documentation/architecture/telegram-notify-app-overview.md",
    "domain.runtime_health",
    "docs/documentation/domain/runtime-health-entity.md",
    "docs/documentation/api/control-actions-endpoint.md",
    "logic.telegram_notification_loop",
    "docs/documentation/logic/telegram-notification-loop.md",
    "api.control_actions_endpoint"
  ],
  "anchor_candidates": [],
  "selected_anchor": null,
  "anchor_selection_reason": "",
  "anchor_match_type": "",
  "doc_ids": [
    "api.health_endpoint",
    "architecture.telegram_notify_app",
    "architecture.telegram_notify_app_overview",
    "domain.runtime_health",
    "api.control_actions_endpoint",
    "logic.telegram_notification_loop",
    "api.actions_endpoint"
  ],
  "doc_paths": [
    "docs/documentation/api/health-endpoint.md",
    "docs/documentation/architecture/telegram-notify-app-overview.md",
    "docs/documentation/domain/runtime-health-entity.md",
    "docs/documentation/api/control-actions-endpoint.md",
    "docs/documentation/logic/telegram-notification-loop.md"
  ],
  "doc_titles": [
    "RuntimeManager",
    "WorkerStatus",
    "TelegramNotifyWorker",
    "TelegramControlChannel",
    "WorkerHealth",
    "domain.runtime_health:used_by",
    "domain.runtime_health:related_logic",
    "domain.runtime_health:part_of",
    "api.health_endpoint:parent",
    "api.health_endpoint:part_of",
    "api.health_endpoint:depends_on",
    "domain.runtime_health:parent",
    "api.control_actions_endpoint:related_api",
    "Сущность runtime health",
    "HTTP API /health",
    "Цикл отправки уведомлений в Telegram",
    "HTTP API /actions/{action}",
    "api.health_endpoint:Описание",
    "api.health_endpoint:Сценарий",
    "api.health_endpoint:Summary",
    "api.health_endpoint:Функциональные требования"
  ],
  "relation_hits_count": 2,
  "relation_targets": [
    "domain.runtime_health:used_by",
    "domain.runtime_health:related_logic"
  ],
  "selected_doc_ids": [
    "domain.runtime_health",
    "api.health_endpoint",
    "architecture.telegram_notify_app"
  ],
  "selected_fact_ids": [],
  "selected_relation_ids": [
    "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4",
    "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04"
  ],
  "selected_chunk_ids": [
    "api.health_endpoint"
  ],
  "selected_entity_ids": [
    "api.health_endpoint",
    "architecture.telegram_notify_app"
  ],
  "selected_workflow_ids": [],
  "fallback_doc_hits_count": 2,
  "fallback_used": false,
  "fact_hits": 0,
  "entity_hits": 0,
  "evidence_summary": {
    "documents": 1,
    "facts": 0,
    "entities": 2,
    "workflows": 0,
    "relations": 2,
    "chunks": 1,
    "selected_doc_ids": [
      "domain.runtime_health",
      "api.health_endpoint",
      "architecture.telegram_notify_app"
    ],
    "selected_fact_ids": [],
    "selected_relation_ids": [
      "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4",
      "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04"
    ],
    "selected_chunk_ids": [
      "api.health_endpoint"
    ],
    "entity_hits": 0,
    "openapi_signals": {
      "path_found": false,
      "method_found": false,
      "operation_semantics_found": false,
      "request_payload_found": false,
      "request_schema": false,
      "request_fields_found": false,
      "response_payload_found": false,
      "response_schema": false,
      "response_fields_found": false,
      "status_codes": false,
      "content_type_found": false,
      "examples_found": false,
      "payload_description": false
    }
  },
  "gate_decision": "allow",
  "gate_decision_reason": "evidence_sufficient",
  "gate_missing_requirements": [],
  "gate_satisfied_requirements": [
    "retrieval_non_empty"
  ],
  "openapi_evidence": {
    "path_found": false,
    "method_found": false,
    "operation_semantics_found": false,
    "request_payload_found": false,
    "request_schema": false,
    "request_fields_found": false,
    "response_payload_found": false,
    "response_schema": false,
    "response_fields_found": false,
    "status_codes": false,
    "content_type_found": false,
    "examples_found": false,
    "payload_description": false
  },
  "requested_fragment_type": null,
  "fragment_evidence_found": [],
  "fragment_missing_requirements": [],
  "answer_mode": "answered",
  "degrade_reason": null,
  "degraded_reason": null,
  "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": 7572,
  "tokens_in_estimate": 1992
}
```

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

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

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

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

### User Prompt
```json
{
  "question": "Что такое runtime health?",
  "intent": "DOCUMENTATION_EXPLAIN",
  "sub_intent": "ENTITY_EXPLAIN",
  "documents": [
    {
      "layer": "D1_DOCUMENT_CATALOG",
      "path": "docs/documentation/domain/runtime-health-entity.md",
      "title": "Сущность runtime health",
      "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.",
      "metadata": {
        "name": "runtime_health",
        "tags": [
          "domain",
          "health",
          "observability"
        ],
        "type": "domain_entity",
        "layer": "domain",
        "links": [
          {
            "type": "part_of",
            "target": "architecture.telegram_notify_app"
          },
          {
            "type": "used_by",
            "target": "api.health_endpoint"
          },
          {
            "type": "related_logic",
            "target": "logic.telegram_notification_loop"
          }
        ],
        "owner": null,
        "title": "Сущность runtime health",
        "doc_id": null,
        "module": "telegram_notify_app",
        "parent": "architecture.telegram_notify_app",
        "status": "draft",
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87",
        "children": [],
        "doc_kind": "misc",
        "entities": [
          "WorkerHealth",
          "WorkerStatus",
          "TelegramNotifyWorker"
        ],
        "updated_at": "2026-03-20",
        "doc_version": null,
        "document_id": "domain.runtime_health",
        "source_path": "docs/documentation/domain/runtime-health-entity.md",
        "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.",
        "artifact_type": null,
        "last_modified": null,
        "staleness_score": null,
        "system_component": null
      }
    }
  ],
  "facts": [],
  "entities": [
    {
      "layer": "D3_ENTITY_CATALOG",
      "path": "docs/documentation/api/health-endpoint.md",
      "title": "RuntimeManager",
      "content": "RuntimeManager",
      "metadata": {
        "tags": [
          "api",
          "health",
          "control-plane"
        ],
        "owner": null,
        "doc_id": null,
        "module": "telegram_notify_app",
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f",
        "doc_version": null,
        "document_id": "api.health_endpoint",
        "entity_name": "RuntimeManager",
        "source_path": "docs/documentation/api/health-endpoint.md",
        "artifact_type": null,
        "document_type": "api_method",
        "last_modified": null,
        "staleness_score": null,
        "system_component": null
      }
    },
    {
      "layer": "D3_ENTITY_CATALOG",
      "path": "docs/documentation/architecture/telegram-notify-app-overview.md",
      "title": "RuntimeManager",
      "content": "RuntimeManager",
      "metadata": {
        "tags": [
          "architecture",
          "telegram",
          "plba",
          "runtime"
        ],
        "owner": null,
        "doc_id": null,
        "module": "telegram_notify_app",
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256",
        "doc_version": null,
        "document_id": "architecture.telegram_notify_app",
        "entity_name": "RuntimeManager",
        "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md",
        "artifact_type": null,
        "document_type": "architecture_overview",
        "last_modified": null,
        "staleness_score": null,
        "system_component": null
      }
    }
  ],
  "workflows": [],
  "relations": [
    {
      "layer": "D5_RELATION_GRAPH",
      "path": "docs/documentation/domain/runtime-health-entity.md",
      "title": "domain.runtime_health:used_by",
      "content": "domain.runtime_health used_by api.health_endpoint",
      "metadata": {
        "owner": null,
        "anchor": "frontmatter.links",
        "doc_id": null,
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87",
        "source_id": "domain.runtime_health",
        "target_id": "api.health_endpoint",
        "doc_version": null,
        "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4",
        "source_path": "docs/documentation/domain/runtime-health-entity.md",
        "artifact_type": null,
        "last_modified": null,
        "relation_type": "used_by",
        "staleness_score": null,
        "system_component": null
      }
    },
    {
      "layer": "D5_RELATION_GRAPH",
      "path": "docs/documentation/domain/runtime-health-entity.md",
      "title": "domain.runtime_health:related_logic",
      "content": "domain.runtime_health related_logic logic.telegram_notification_loop",
      "metadata": {
        "owner": null,
        "anchor": "frontmatter.links",
        "doc_id": null,
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87",
        "source_id": "domain.runtime_health",
        "target_id": "logic.telegram_notification_loop",
        "doc_version": null,
        "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04",
        "source_path": "docs/documentation/domain/runtime-health-entity.md",
        "artifact_type": null,
        "last_modified": null,
        "relation_type": "related_logic",
        "staleness_score": null,
        "system_component": null
      }
    }
  ],
  "chunks": [
    {
      "layer": "D0_DOC_CHUNKS",
      "path": "docs/documentation/api/health-endpoint.md",
      "title": "api.health_endpoint:Описание",
      "content": "Метод предоставляет текущее состояние runtime и его компонентов без изменения состояния системы. Он нужен для мониторинга, readiness/liveness-проверок и быстрой диагностики worker'а `telegram_notify`.",
      "metadata": {
        "tags": [
          "api",
          "health",
          "control-plane"
        ],
        "type": "api_method",
        "order": 3,
        "owner": null,
        "doc_id": null,
        "module": "telegram_notify_app",
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f",
        "doc_kind": "misc",
        "doc_version": null,
        "document_id": "api.health_endpoint",
        "source_path": "docs/documentation/api/health-endpoint.md",
        "section_path": "Details > Описание",
        "artifact_type": null,
        "last_modified": null,
        "section_title": "Описание",
        "staleness_score": null,
        "system_component": null
      }
    }
  ]
}
```

### User Prompt Overview
- question: Что такое runtime health?
- intent: DOCUMENTATION_EXPLAIN
- sub_intent: ENTITY_EXPLAIN
- documents: 1 | samples: Сущность runtime health
- facts: 0
- relations: 2 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic

## Mismatches
- none