# Runtime Trace: 20260407-183339-3284d16c6cb0 - active_rag_session_id: 0fbd48e9-a592-4a64-ac17-3284d16c6cb0 ## request ```json { "request_id": "req_33518d79abdf4bafa39ab6dfc6064b75", "session_id": "as_2db6661985714aea88660112c9cfe0ba", "active_rag_session_id": "0fbd48e9-a592-4a64-ac17-3284d16c6cb0", "process_version": "v2", "created_at": "2026-04-07T18:33:39.489400+00:00", "message": "Как работает метод health?" } ``` ## process.v2 ```json { "event": "intent_routed", "routing_domain": "DOCS", "intent": "DOC_EXPLAIN", "subintent": "SUMMARY", "normalized_query": "Как работает метод health?", "target_terms": [ "/health", "health" ], "anchors": { "entity_names": [], "file_names": [], "endpoint_paths": [ "/health" ], "target_doc_hints": [ "/health", "health", "health-endpoint", "health endpoint", "docs/api/health-endpoint.md" ], "matched_aliases": [], "process_domain": null, "process_subdomain": null, "signal_types": [ "API_ENDPOINT" ] }, "confidence": 0.9500000000000001, "routing_mode": "llm_default", "llm_router_used": true, "reason_short": "Запрос явно касается объяснения работы конкретного метода (health), что предполагает обзор документации по данному endpoint'у.", "rag_session_id": "0fbd48e9-a592-4a64-ac17-3284d16c6cb0" } ``` ## process.v2.pipeline ```json { "event": "router_resolved", "domain": "DOCS", "intent": "DOC_EXPLAIN", "subintent": "SUMMARY", "confidence": 0.9500000000000001 } ``` ## process.v2.pipeline ```json { "event": "anchors_extracted", "signal_types": [ "API_ENDPOINT" ], "endpoint_paths": [ "/health" ], "target_doc_hints": [ "/health", "health", "health-endpoint", "health endpoint", "docs/api/health-endpoint.md" ], "matched_aliases": [], "target_terms": [ "/health", "health" ] } ``` ## process.v2.pipeline ```json { "event": "alias_resolution", "resolved_aliases": [], "target_doc_hints": [ "/health", "health", "health-endpoint", "health endpoint", "docs/api/health-endpoint.md" ] } ``` ## process.v2.retrieval_policy ```json { "event": "retrieval_plan_resolved", "profile": "docs_api_method_explain", "layers": [ "D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS" ], "limit": 10, "filters": { "target_doc_hints": [ "/health", "health", "health-endpoint", "health endpoint", "docs/api/health-endpoint.md" ], "path_prefixes": [ "docs/api/", "docs/endpoints/", "docs/methods/", "api/", "endpoints/", "methods/" ], "prefer_path_prefixes": [ "docs/api/", "docs/endpoints/", "docs/methods/", "api/", "endpoints/", "methods/" ], "prefer_like_patterns": [ "%health%", "%health-endpoint%", "%health endpoint%", "%health-endpoint.md%", "%/health%", "%docs/api/health-endpoint.md%" ] } } ``` ## process.v2.pipeline ```json { "event": "retrieval_profile_selected", "profile": "docs_api_method_explain", "layers": [ "D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS" ], "filters": { "target_doc_hints": [ "/health", "health", "health-endpoint", "health endpoint", "docs/api/health-endpoint.md" ], "path_prefixes": [ "docs/api/", "docs/endpoints/", "docs/methods/", "api/", "endpoints/", "methods/" ], "prefer_path_prefixes": [ "docs/api/", "docs/endpoints/", "docs/methods/", "api/", "endpoints/", "methods/" ], "prefer_like_patterns": [ "%health%", "%health-endpoint%", "%health endpoint%", "%health-endpoint.md%", "%/health%", "%docs/api/health-endpoint.md%" ] } } ``` ## process.v2.rag_retrieval ```json { "event": "rag_rows_fetched", "profile": "docs_api_method_explain", "row_count": 40, "rows": [ { "layer": "D3_ENTITY_CATALOG", "path": "docs/api/health-endpoint.md", "title": "TelegramControlChannel", "document_id": "api.health_endpoint", "entity_name": "TelegramControlChannel", "summary_text": "", "section_path": "", "content_preview": "TelegramControlChannel" }, { "layer": "D1_DOCUMENT_CATALOG", "path": "docs/api/health-endpoint.md", "title": "HTTP API /health", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md).", "section_path": "", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Summary", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Summary", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Описание", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Описание", "content_preview": "Endpoint отдает текущее состояние runtime и его компонентов. Метод нужен для readiness/liveness-проверок, мониторинга и диагностики worker'а `telegram_notify`." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Сценарий", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Сценарий", "content_preview": "**Название:** Получение агрегированного состояния runtime\n\n**Предусловия:**\n- HTTP control plane запущен через `TelegramControlChannel`.\n- Для канала зарегистрирован `health_provider`.\n\n**Триггер:**\n- Внешний клиент отправляет `GET /health`.\n\n**Основной сценарий:**\n1. Endpoint принимает HTTP-запрос без path, query и body параметров.\n2. `TelegramControlChannel` вызывает асинхронный `health_provider" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Функциональные требования", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Функциональные требования", "content_preview": "- `FR-1`: Метод должен использовать `health_provider` как единственный источник истины для ответа.\n- `FR-2`: Endpoint не должен модифицировать структуру полей, полученных от runtime.\n- `FR-3`: Метод должен возвращать HTTP `200`, если `payload.status == \"ok\"`, и HTTP `503` во всех остальных случаях.\n- `FR-4`: Ответ должен включать компонентный health, в том числе состояние worker'а `telegram_notify" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Нефункциональные требования", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Нефункциональные требования", "content_preview": "- `NFR-1`: Метод не должен запускать новые бизнес-операции и обязан работать только с текущим состоянием runtime.\n- `NFR-2`: Формат ответа должен быть стабильным для monitoring-систем и health probes.\n- `NFR-3`: Вызов должен укладываться в timeout control channel `5000 ms` при штатной работе runtime." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Метаданные вызова", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Контракт > Метаданные вызова", "content_preview": "- Method: `GET`\n- Auth: `none`\n- Idempotency: повторный вызов безопасен и не меняет состояние runtime\n- Retry: допустим со стороны клиента, так как endpoint read-only\n- Timeout: `5000 ms`" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Входные параметры", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Контракт > Входные параметры", "content_preview": "| Параметр | Где передается | Тип | Обязательность | Ограничения | Описание |\n|---|---|---|---|---|---|\n| отсутствуют | - | - | - | - | Endpoint не принимает path, query или body параметры |" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Выходные параметры", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Контракт > Выходные параметры", "content_preview": "**HTTP 200 / 503**\n\n| Поле | Тип | Обязательность | Ограничения | Описание | Заполнение | Пример |\n|---|---|---|---|---|---|---|\n| `status` | `string` | обязательно | `ok`, `degraded`, `unhealthy`, `unknown` | Общий статус runtime | Берется из health payload | `ok` |\n| `detail` | `string` | опционально | произвольная строка | Диагностическое описание уровня runtime | Передается из health payload, " }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Пример ответа", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Контракт > Пример ответа", "content_preview": "```json\n{\n \"status\": \"ok\",\n \"components\": [\n {\n \"name\": \"telegram_notify\",\n \"status\": \"ok\",\n \"meta\": {\n \"app_started_at\": \"2026-03-20T10:00:00.000000Z\",\n \"notifications_sent\": 3\n }\n }\n ]\n}\n```" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Runtime health provider", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Интеграции > Runtime health provider", "content_preview": "- target: runtime.health_provider\n- target_type: service\n- direction: outbound\n- interaction: depends_on\n- via: async callback `health_provider()`\n- purpose: получить агрегированный health runtime\n- details:\n - timeout_ms: 5000\n - response_type: `HealthPayload`" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Monitoring probe", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Интеграции > Monitoring probe", "content_preview": "- target: ext.health_probe\n- target_type: external_system\n- direction: inbound\n- interaction: calls\n- via: HTTP `GET /health`\n- purpose: readiness/liveness и внешняя диагностика сервиса\n- details:\n - http_ok: 200\n - http_not_ok: 503" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Ошибки", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Ошибки", "content_preview": "- `health.control_actions_not_configured` - runtime вернул `status: unhealthy`, HTTP `503`; см. [каталог ошибок](../errors/catalog.yaml).\n- `health.status_not_ok` - runtime вернул любой статус, отличный от `ok`, HTTP `503`; см. [каталог ошибок](../errors/catalog.yaml)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Связанный код", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Связанный код", "content_preview": "- `src/telegram_notify_app/control_api.py` - endpoint `/health`, вызов `health_provider()` и маппинг `status -> HTTP code`." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Связанные документы", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Связанные документы", "content_preview": "- [Архитектура Telegram Notify App](../architecture/telegram-notify-app-overview.md)\n- [Доменная модель runtime health](../domains/runtime-health-entity.md)\n- [Логика цикла отправки уведомлений](../logic/telegram-notification-loop.md)" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:История изменений", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > История изменений", "content_preview": "- `2026-04-03`: документ приведен к полному шаблону API из `_process`, добавлены структурированный сценарий, интеграции, ошибки и кодовые ссылки." }, { "layer": "D2_FACT_INDEX", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:mentions_entity", "document_id": "", "entity_name": "", "summary_text": "", "section_path": "", "content_preview": "api.health_endpoint mentions_entity TelegramControlChannel" }, { "layer": "D4_WORKFLOW_INDEX", "path": "docs/api/health-endpoint.md", "title": "Scenario", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "", "content_preview": "Scenario\nHTTP control plane запущен через `TelegramControlChannel`.\nДля канала зарегистрирован `health_provider`.\nВнешний клиент отправляет `GET /health`.\nEndpoint принимает HTTP-запрос без path, query и body параметров.\n`TelegramControlChannel` вызывает асинхронный `health_provider`.\nRuntime возвращает health payload с общим статусом и списком компонентов.\nEndpoint сопоставляет HTTP-код с `payloa" }, { "layer": "D5_RELATION_GRAPH", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:parent", "document_id": "", "entity_name": "", "summary_text": "", "section_path": "", "content_preview": "api.health_endpoint parent architecture.telegram_notify_app" }, { "layer": "D6_INTEGRATION_INDEX", "path": "docs/api/health-endpoint.md", "title": "Runtime health provider", "document_id": "", "entity_name": "", "summary_text": "", "section_path": "", "content_preview": "Runtime health provider | runtime.health_provider | depends_on | async callback `health_provider()` | получить агрегированный health runtime" }, { "layer": "D3_ENTITY_CATALOG", "path": "docs/domains/runtime-health-entity.md", "title": "WorkerStatus", "document_id": "domain.runtime_health", "entity_name": "WorkerStatus", "summary_text": "", "section_path": "", "content_preview": "WorkerStatus" }, { "layer": "D1_DOCUMENT_CATALOG", "path": "docs/domains/runtime-health-entity.md", "title": "Сущность runtime health", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "- Purpose: описать доменную модель наблюдаемости runtime и компонента `telegram_notify`.\n- Main consumer: [`/health`](../api/health-endpoint.md).\n- Main fields: общий `status`, список `components`, `app_started_at`, `notifications_sent`, `detail`.\n- State model: `ok`, `degraded`, `unhealthy`, `unknown`.\n- Source: `TelegramNotifyWorker.health()` и runtime health provider.", "section_path": "", "content_preview": "- Purpose: описать доменную модель наблюдаемости runtime и компонента `telegram_notify`.\n- Main consumer: [`/health`](../api/health-endpoint.md).\n- Main fields: общий `status`, список `components`, `app_started_at`, `notifications_sent`, `detail`.\n- State model: `ok`, `degraded`, `unhealthy`, `unknown`.\n- Source: `TelegramNotifyWorker.health()` и runtime health provider." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Summary", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Summary", "content_preview": "- Purpose: описать доменную модель наблюдаемости runtime и компонента `telegram_notify`.\n- Main consumer: [`/health`](../api/health-endpoint.md).\n- Main fields: общий `status`, список `components`, `app_started_at`, `notifications_sent`, `detail`.\n- State model: `ok`, `degraded`, `unhealthy`, `unknown`.\n- Source: `TelegramNotifyWorker.health()` и runtime health provider." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Описание", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Описание", "content_preview": "`runtime health` - техническая доменная модель, через которую runtime сообщает внешнему миру собственное состояние и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдаемости является worker `telegram_notify`." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Модель данных", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Модель данных", "content_preview": "| Поле | Тип | Описание | Источник заполнения |\n|---|---|---|---|\n| `status` | `string` | Общий статус runtime | Health provider runtime |\n| `components` | `array` | Список компонентных health-состояний | Health provider runtime |\n| `components[].name` | `string` | Имя компонента | `TelegramNotifyWorker.name` |\n| `components[].status` | `string` | Статус компонента | `TelegramNotifyWorker." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Состояния и инварианты", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Состояния и инварианты", "content_preview": "- Верхнеуровневый `status` отражает агрегированное состояние runtime и может быть `ok`, `degraded`, `unhealthy` или `unknown`.\n- Для компонента `telegram_notify` поле `meta.notifications_sent` всегда неотрицательное целое число.\n- `meta.app_started_at` заполняется после фактического вызова `TelegramNotifyWorker.start()`.\n- Если worker еще не стартовал, `health()` может вернуть `status: ok` c detai" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Технический use case", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Технический use case", "content_preview": "1. Worker обновляет внутренние поля `_app_started_at`, `_notifications_sent` и `_last_error`.\n2. При вызове `health()` worker строит `WorkerHealth` с учетом состояния потока, credentials и последней ошибки.\n3. Runtime агрегирует состояние worker'а в общий health payload.\n4. Endpoint [`/health`](../api/health-endpoint.md) публикует payload внешнему клиенту без изменения структуры." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Функциональные требования", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Функциональные требования", "content_preview": "- `FR-1`: Доменная модель должна позволять отделить общее состояние runtime от статуса отдельного компонента.\n- `FR-2`: Для компонента `telegram_notify` модель должна содержать минимум `name`, `status`, `detail` и `meta`.\n- `FR-3`: Поле `notifications_sent` должно отражать число успешных отправок с момента старта runtime.\n- `FR-4`: Поле `app_started_at` должно отражать UTC timestamp старта worker'" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Нефункциональные требования", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Нефункциональные требования", "content_preview": "- `NFR-1`: Модель должна быть достаточно стабильной для monitoring и troubleshooting.\n- `NFR-2`: Поля должны быть компактными и пригодными для сериализации в JSON.\n- `NFR-3`: Health-модель не должна требовать дополнительного запроса к внешним системам для базовой диагностики." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:HTTP health endpoint", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Интеграции > HTTP health endpoint", "content_preview": "- target: api.health_endpoint\n- target_type: api\n- direction: outbound\n- interaction: emits\n- via: payload response `/health`\n- purpose: опубликовать health-состояние runtime и worker'а внешнему клиенту\n- details:\n - transport: JSON over HTTP" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Worker lifecycle", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Интеграции > Worker lifecycle", "content_preview": "- target: logic.telegram_notification_loop\n- target_type: service\n- direction: inbound\n- interaction: depends_on\n- via: `TelegramNotifyWorker.health()`\n- purpose: формировать наблюдаемое состояние на основе выполнения worker workflow\n- details:\n - primary_fields:\n - app_started_at\n - notifications_sent\n - detail" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Ошибки и деградации", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Ошибки и деградации", "content_preview": "- `worker.credentials_missing` - у worker отсутствуют credentials, состояние `degraded`; см. [каталог ошибок](../errors/catalog.yaml).\n- `worker.delivery_failed` - последняя отправка завершилась ошибкой, состояние `degraded`; см. [каталог ошибок](../errors/catalog.yaml).\n- `worker.thread_not_running` - поток worker'а должен работать, но не жив, состояние `unhealthy`; см. [каталог ошибок](../errors" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Связанный код", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Связанный код", "content_preview": "- `src/telegram_notify_app/worker.py` - расчет `WorkerHealth`, `WorkerStatus` и метаданных worker'а.\n- `src/telegram_notify_app/control_api.py` - публикация payload наружу через `/health`." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:Связанные документы", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > Связанные документы", "content_preview": "- [Архитектура Telegram Notify App](../architecture/telegram-notify-app-overview.md)\n- [API /health](../api/health-endpoint.md)\n- [Логика цикла отправки уведомлений](../logic/telegram-notification-loop.md)" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:История изменений", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "Сущность runtime health > Details > История изменений", "content_preview": "- `2026-04-03`: frontmatter синхронизирован с `_process`, добавлены состояния, инварианты, интеграции и явные ссылки на каталог ошибок." }, { "layer": "D2_FACT_INDEX", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:mentions_entity", "document_id": "", "entity_name": "", "summary_text": "", "section_path": "", "content_preview": "domain.runtime_health mentions_entity WorkerHealth" }, { "layer": "D4_WORKFLOW_INDEX", "path": "docs/domains/runtime-health-entity.md", "title": "Scenario", "document_id": "domain.runtime_health", "entity_name": "", "summary_text": "", "section_path": "", "content_preview": "Scenario" }, { "layer": "D5_RELATION_GRAPH", "path": "docs/domains/runtime-health-entity.md", "title": "domain.runtime_health:parent", "document_id": "", "entity_name": "", "summary_text": "", "section_path": "", "content_preview": "domain.runtime_health parent architecture.telegram_notify_app" }, { "layer": "D6_INTEGRATION_INDEX", "path": "docs/domains/runtime-health-entity.md", "title": "HTTP health endpoint", "document_id": "", "entity_name": "", "summary_text": "", "section_path": "", "content_preview": "HTTP health endpoint | api.health_endpoint | emits | payload response `/health` | опубликовать health-состояние runtime и worker'а внешнему клиенту" } ] } ``` ## process.v2.pipeline ```json { "event": "candidate_generation", "query": "Как работает метод health?", "profile": "docs_api_method_explain", "details": { "target_doc_hints": [ "/health", "health", "health-endpoint", "health endpoint", "docs/api/health-endpoint.md" ], "candidates_before_ranking": [ "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/api/health-endpoint.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md", "docs/domains/runtime-health-entity.md" ] }, "resolved_aliases": [], "target_doc_hints": [ "/health", "health", "health-endpoint", "health endpoint", "docs/api/health-endpoint.md" ], "candidate_docs_before_ranking": [ { "layer": "D3_ENTITY_CATALOG", "path": "docs/api/health-endpoint.md", "title": "TelegramControlChannel", "document_id": "api.health_endpoint", "entity_name": "TelegramControlChannel", "summary_text": "", "section_path": "", "content_preview": "TelegramControlChannel" }, { "layer": "D1_DOCUMENT_CATALOG", "path": "docs/api/health-endpoint.md", "title": "HTTP API /health", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md).", "section_path": "", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Summary", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Summary", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Описание", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Описание", "content_preview": "Endpoint отдает текущее состояние runtime и его компонентов. Метод нужен для readiness/liveness-проверок, мониторинга и диагностики worker'а `telegram_notify`." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Сценарий", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Сценарий", "content_preview": "**Название:** Получение агрегированного состояния runtime\n\n**Предусловия:**\n- HTTP control plane запущен через `TelegramControlChannel`.\n- Для канала зарегистрирован `health_provider`.\n\n**Триггер:**\n- Внешний клиент отправляет `GET /health`.\n\n**Основной сценарий:**\n1. Endpoint принимает HTTP-запрос без path, query и body параметров.\n2. `TelegramControlChannel` вызывает асинхронный `health_provider" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Функциональные требования", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Функциональные требования", "content_preview": "- `FR-1`: Метод должен использовать `health_provider` как единственный источник истины для ответа.\n- `FR-2`: Endpoint не должен модифицировать структуру полей, полученных от runtime.\n- `FR-3`: Метод должен возвращать HTTP `200`, если `payload.status == \"ok\"`, и HTTP `503` во всех остальных случаях.\n- `FR-4`: Ответ должен включать компонентный health, в том числе состояние worker'а `telegram_notify" }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Нефункциональные требования", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Нефункциональные требования", "content_preview": "- `NFR-1`: Метод не должен запускать новые бизнес-операции и обязан работать только с текущим состоянием runtime.\n- `NFR-2`: Формат ответа должен быть стабильным для monitoring-систем и health probes.\n- `NFR-3`: Вызов должен укладываться в timeout control channel `5000 ms` при штатной работе runtime." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Метаданные вызова", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Контракт > Метаданные вызова", "content_preview": "- Method: `GET`\n- Auth: `none`\n- Idempotency: повторный вызов безопасен и не меняет состояние runtime\n- Retry: допустим со стороны клиента, так как endpoint read-only\n- Timeout: `5000 ms`" } ], "sources": { "seeded": [ { "layer": "D3_ENTITY_CATALOG", "path": "docs/api/health-endpoint.md", "title": "TelegramControlChannel", "document_id": "api.health_endpoint", "entity_name": "TelegramControlChannel", "summary_text": "", "section_path": "", "content_preview": "TelegramControlChannel" }, { "layer": "D1_DOCUMENT_CATALOG", "path": "docs/api/health-endpoint.md", "title": "HTTP API /health", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md).", "section_path": "", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Summary", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Summary", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Описание", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Описание", "content_preview": "Endpoint отдает текущее состояние runtime и его компонентов. Метод нужен для readiness/liveness-проверок, мониторинга и диагностики worker'а `telegram_notify`." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Сценарий", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Сценарий", "content_preview": "**Название:** Получение агрегированного состояния runtime\n\n**Предусловия:**\n- HTTP control plane запущен через `TelegramControlChannel`.\n- Для канала зарегистрирован `health_provider`.\n\n**Триггер:**\n- Внешний клиент отправляет `GET /health`.\n\n**Основной сценарий:**\n1. Endpoint принимает HTTP-запрос без path, query и body параметров.\n2. `TelegramControlChannel` вызывает асинхронный `health_provider" } ], "metadata_lookup": [ { "layer": "D3_ENTITY_CATALOG", "path": "docs/api/health-endpoint.md", "title": "TelegramControlChannel", "document_id": "api.health_endpoint", "entity_name": "TelegramControlChannel", "summary_text": "", "section_path": "", "content_preview": "TelegramControlChannel" } ], "semantic": [ { "layer": "D3_ENTITY_CATALOG", "path": "docs/api/health-endpoint.md", "title": "TelegramControlChannel", "document_id": "api.health_endpoint", "entity_name": "TelegramControlChannel", "summary_text": "", "section_path": "", "content_preview": "TelegramControlChannel" }, { "layer": "D1_DOCUMENT_CATALOG", "path": "docs/api/health-endpoint.md", "title": "HTTP API /health", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md).", "section_path": "", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Summary", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Summary", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Описание", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Описание", "content_preview": "Endpoint отдает текущее состояние runtime и его компонентов. Метод нужен для readiness/liveness-проверок, мониторинга и диагностики worker'а `telegram_notify`." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Сценарий", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Сценарий", "content_preview": "**Название:** Получение агрегированного состояния runtime\n\n**Предусловия:**\n- HTTP control plane запущен через `TelegramControlChannel`.\n- Для канала зарегистрирован `health_provider`.\n\n**Триггер:**\n- Внешний клиент отправляет `GET /health`.\n\n**Основной сценарий:**\n1. Endpoint принимает HTTP-запрос без path, query и body параметров.\n2. `TelegramControlChannel` вызывает асинхронный `health_provider" } ] } } ``` ## process.v2.pipeline ```json { "event": "retrieval_executed", "query": "Как работает метод health?", "profile": "docs_api_method_explain", "row_count": 40, "target_doc_hints": [ "/health", "health", "health-endpoint", "health endpoint", "docs/api/health-endpoint.md" ], "top_results": [ { "layer": "D3_ENTITY_CATALOG", "path": "docs/api/health-endpoint.md", "title": "TelegramControlChannel", "document_id": "api.health_endpoint", "entity_name": "TelegramControlChannel", "summary_text": "", "section_path": "", "content_preview": "TelegramControlChannel" }, { "layer": "D1_DOCUMENT_CATALOG", "path": "docs/api/health-endpoint.md", "title": "HTTP API /health", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md).", "section_path": "", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Summary", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Summary", "content_preview": "- Purpose: вернуть агрегированный health payload runtime без изменения состояния системы.\n- Actor: monitoring probe или оператор.\n- Trigger: HTTP `GET /health`.\n- Success rule: HTTP `200`, если `payload.status == \"ok\"`.\n- Degraded rule: HTTP `503`, если runtime вернул любой статус кроме `ok`.\n- Related domain: [runtime health](../domains/runtime-health-entity.md)." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Описание", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Описание", "content_preview": "Endpoint отдает текущее состояние runtime и его компонентов. Метод нужен для readiness/liveness-проверок, мониторинга и диагностики worker'а `telegram_notify`." }, { "layer": "D0_DOC_CHUNKS", "path": "docs/api/health-endpoint.md", "title": "api.health_endpoint:Сценарий", "document_id": "api.health_endpoint", "entity_name": "", "summary_text": "", "section_path": "HTTP API /health > Details > Сценарий", "content_preview": "**Название:** Получение агрегированного состояния runtime\n\n**Предусловия:**\n- HTTP control plane запущен через `TelegramControlChannel`.\n- Для канала зарегистрирован `health_provider`.\n\n**Триггер:**\n- Внешний клиент отправляет `GET /health`.\n\n**Основной сценарий:**\n1. Endpoint принимает HTTP-запрос без path, query и body параметров.\n2. `TelegramControlChannel` вызывает асинхронный `health_provider" } ] } ``` ## process.v2.evidence ```json { "event": "evidence_assembled", "mode": "summary", "document_count": 2, "documents": [ "docs/api/health-endpoint.md", "docs/domains/runtime-health-entity.md" ] } ``` ## process.v2.pipeline ```json { "event": "evidence_assembled", "mode": "summary", "primary_doc": "docs/api/health-endpoint.md", "document_count": 2 } ``` ## process.v2.pipeline ```json { "event": "ranking_explained", "doc": "docs/api/health-endpoint.md", "score_breakdown": { "semantic": 140, "path_match": 60, "filename_match": 600, "alias_match": 0, "anchor_boost": 360, "target_doc_boost": 1540, "specificity_boost": 460, "generic_penalty": 0 }, "score": 3160, "match_reason": "exact_path" } ``` ## process.v2.pipeline ```json { "event": "ranking_explained", "doc": "docs/domains/runtime-health-entity.md", "score_breakdown": { "semantic": 140, "path_match": 60, "filename_match": 600, "alias_match": 0, "anchor_boost": 0, "target_doc_boost": 0, "specificity_boost": 180, "generic_penalty": 0 }, "score": 980, "match_reason": "exact_title" } ``` ## process.v2.pipeline ```json { "event": "ranking_explained", "top_docs_after_ranking": [ { "doc": "docs/api/health-endpoint.md", "score": 3160, "match_reason": "exact_path" }, { "doc": "docs/domains/runtime-health-entity.md", "score": 980, "match_reason": "exact_title" } ], "ranking_score_breakdown": [ { "doc": "docs/api/health-endpoint.md", "score_breakdown": { "semantic": 140, "path_match": 60, "filename_match": 600, "alias_match": 0, "anchor_boost": 360, "target_doc_boost": 1540, "specificity_boost": 460, "generic_penalty": 0 } }, { "doc": "docs/domains/runtime-health-entity.md", "score_breakdown": { "semantic": 140, "path_match": 60, "filename_match": 600, "alias_match": 0, "anchor_boost": 0, "target_doc_boost": 0, "specificity_boost": 180, "generic_penalty": 0 } } ] } ``` ## process.v2.pipeline ```json { "event": "evidence_gate_checked", "passed": true, "reason": "target_doc_found", "answer_mode": "grounded_summary" } ``` ## workflow.v2.summary ```json { "event": "workflow_started", "workflow_id": "v2.docs_explain.summary" } ``` ## workflow.v2.summary.llm ```json { "event": "request", "prompt_name": "v2_docs_explain.summary_answer", "system_prompt": "Ты объясняешь документацию только на основе найденных SUMMARY-блоков.\nИспользуй только факты из входного контекста.\nЕсли информации мало, прямо скажи об этом и не додумывай детали.\nВ конце перечисли файлы, на которые ты опирался.", "user_prompt": "Запрос пользователя:\nКак работает метод health?\n\nСигналы запроса:\n{\n \"entity_names\": [],\n \"file_names\": [],\n \"endpoint_paths\": [\n \"/health\"\n ],\n \"target_doc_hints\": [\n \"/health\",\n \"health\",\n \"health-endpoint\",\n \"health endpoint\",\n \"docs/api/health-endpoint.md\"\n ],\n \"matched_aliases\": [],\n \"process_domain\": null,\n \"process_subdomain\": null,\n \"signal_types\": [\n \"API_ENDPOINT\"\n ]\n}\n\nНайденные SUMMARY-блоки:\n\n1. path: docs/api/health-endpoint.md\ntitle: TelegramControlChannel\nmatch_reason: exact_path\nsummary: TelegramControlChannel\n\n2. path: docs/domains/runtime-health-entity.md\ntitle: WorkerStatus\nmatch_reason: exact_title\nsummary: WorkerStatus", "log_context": "agent:req_33518d79abdf4bafa39ab6dfc6064b75" } ``` ## workflow.v2.summary.llm ```json { "event": "response", "text": "На основе предоставленных SUMMARY-блоков конкретной информации о том, как именно работает метод health, нет. Документ \"TelegramControlChannel\" в docs/api/health-endpoint.md содержит информацию, связанную с TelegramControlChannel, а \"WorkerStatus\" в docs/domains/runtime-health-entity.md описывает сущность WorkerStatus. Для получения детальной информации о работе метода health необходимо обратиться к полному содержанию указанных документов или предоставить дополнительную информацию.\n\nФайлы для ознакомления:\n- docs/api/health-endpoint.md\n- docs/domains/runtime-health-entity.md" } ``` ## workflow.v2.summary ```json { "event": "workflow_trace_flushed", "workflow_id": "v2.docs_explain.summary", "steps": [ { "step_id": "generate_summary_answer", "title": "Сборка ответа по summary", "input": {}, "output": { "answer_length": 580 } } ] } ``` ## workflow.v2.summary ```json { "event": "workflow_completed", "workflow_id": "v2.docs_explain.summary" } ``` ## process.v2.pipeline ```json { "event": "answer_generated", "answer_mode": "grounded_summary", "answer_length": 580 } ``` ## result ```json { "status": "done", "answer": "На основе предоставленных SUMMARY-блоков конкретной информации о том, как именно работает метод health, нет. Документ \"TelegramControlChannel\" в docs/api/health-endpoint.md содержит информацию, связанную с TelegramControlChannel, а \"WorkerStatus\" в docs/domains/runtime-health-entity.md описывает сущность WorkerStatus. Для получения детальной информации о работе метода health необходимо обратиться к полному содержанию указанных документов или предоставить дополнительную информацию.\n\nФайлы для ознакомления:\n- docs/api/health-endpoint.md\n- docs/domains/runtime-health-entity.md", "completed_at": "2026-04-07T18:33:43.746125+00:00" } ```