# v4-general

- 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
Что описано в документации?

## Actual
{
  "intent": "GENERAL_QA",
  "sub_intent": "GENERIC_QA",
  "graph_id": "DocsQAGraph",
  "conversation_mode": "START",
  "rag_count": 8,
  "llm_answer": "Документация описывает структуру проекта, включая разделы об архитектуре, HTTP API, бизнес-логике и ключевых сущностях. Конкретно представлен endpoint `/actions/{action}`, который управляет контрольными действиями и поддерживает операции start, stop и status.",
  "answer_mode": "answered",
  "path_scope": [],
  "doc_scope": [
    "docs/README.md",
    "api.control_actions_endpoint",
    "api.actions_endpoint",
    "api.health_endpoint",
    "api.send_message_endpoint"
  ],
  "entity_candidates": [],
  "symbol_candidates": [],
  "layers": [
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "filters": {
    "doc_type": null
  },
  "pipeline_mode": "full",
  "gate_decision": "allow",
  "prompt_used": "docs_general_answer",
  "llm_mode": "prose",
  "degraded_reason": null,
  "code_intents_stubbed": true
}

## Pipeline Steps
### input_query
```json
{
  "input": {
    "query": "Что описано в документации?"
  },
  "output": {
    "query": "Что описано в документации?"
  }
}
```

### router
```json
{
  "input": {
    "query": "Что описано в документации?"
  },
  "output": {
    "intent": "GENERAL_QA",
    "sub_intent": "GENERIC_QA",
    "graph_id": "DocsQAGraph",
    "conversation_mode": "START"
  }
}
```

### docs_pipeline
```json
{
  "input": {
    "query": "Что описано в документации?"
  },
  "output": {
    "answer_mode": "answered",
    "prompt_name": "docs_general_answer",
    "llm_request": {
      "prompt_name": "docs_general_answer",
      "log_context": "graph.project_qa.docs.answer",
      "prompt_stats": {
        "system_chars": 345,
        "user_chars": 4499,
        "tokens_in_estimate": 1211
      }
    },
    "degraded_reason": ""
  }
}
```

## Diagnostics
{
  "intent": "GENERAL_QA",
  "sub_intent": "GENERIC_QA",
  "layers_used": [
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "documents_found": 2,
  "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_general_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": [
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "docs_layers_with_hits": [
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "planned_layers": [
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "executed_layers": [
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "non_empty_layers": [
    "D1_DOCUMENT_CATALOG",
    "D0_DOC_CHUNKS"
  ],
  "layer_diagnostics": {
    "D1_DOCUMENT_CATALOG": {
      "hits": 4,
      "top_ids": [
        "docs/README.md",
        "api.control_actions_endpoint",
        "api.health_endpoint",
        "api.send_message_endpoint"
      ],
      "top_sections": [
        "Readme",
        "HTTP API /actions/{action}",
        "HTTP API /health",
        "HTTP API /send"
      ]
    },
    "D0_DOC_CHUNKS": {
      "hits": 4,
      "top_ids": [
        "docs/README.md"
      ],
      "top_sections": [
        "docs/README.md:Структура",
        "docs/README.md:Навигация",
        "docs/README.md:Правила и шаблоны",
        "docs/README.md:Project Docs"
      ]
    }
  },
  "query_entity_candidates": [],
  "resolved_entity_candidates": [],
  "query_anchor_candidates": [],
  "resolved_anchor_candidates": [
    "docs/README.md",
    "api.control_actions_endpoint",
    "docs/documentation/api/control-actions-endpoint.md",
    "api.health_endpoint",
    "docs/documentation/api/health-endpoint.md",
    "api.send_message_endpoint",
    "docs/documentation/api/send-message-endpoint.md"
  ],
  "anchor_candidates": [],
  "selected_anchor": null,
  "anchor_selection_reason": "",
  "anchor_match_type": "",
  "doc_ids": [
    "docs/README.md",
    "api.control_actions_endpoint",
    "api.actions_endpoint",
    "api.health_endpoint",
    "api.send_message_endpoint"
  ],
  "doc_paths": [
    "docs/README.md",
    "docs/documentation/api/control-actions-endpoint.md",
    "docs/documentation/api/health-endpoint.md",
    "docs/documentation/api/send-message-endpoint.md"
  ],
  "doc_titles": [
    "Readme",
    "HTTP API /actions/{action}",
    "HTTP API /health",
    "HTTP API /send",
    "docs/README.md:Структура",
    "docs/README.md:Навигация",
    "docs/README.md:Правила и шаблоны",
    "docs/README.md:Project Docs"
  ],
  "relation_hits_count": 0,
  "relation_targets": [],
  "selected_doc_ids": [
    "docs/README.md",
    "api.control_actions_endpoint"
  ],
  "selected_fact_ids": [],
  "selected_relation_ids": [],
  "selected_chunk_ids": [
    "docs/README.md"
  ],
  "selected_entity_ids": [],
  "selected_workflow_ids": [],
  "fallback_doc_hits_count": 3,
  "fallback_used": false,
  "fact_hits": 0,
  "entity_hits": 0,
  "evidence_summary": {
    "documents": 2,
    "facts": 0,
    "entities": 0,
    "workflows": 0,
    "relations": 0,
    "chunks": 1,
    "selected_doc_ids": [
      "docs/README.md",
      "api.control_actions_endpoint"
    ],
    "selected_fact_ids": [],
    "selected_relation_ids": [],
    "selected_chunk_ids": [
      "docs/README.md"
    ],
    "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_general_answer
- log_context: graph.project_qa.docs.answer

### Prompt Stats
```json
{
  "system_chars": 345,
  "user_chars": 4499,
  "tokens_in_estimate": 1211
}
```

### System Prompt
```text
Ты отвечаешь на общий вопрос по документации проекта.

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

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

### User Prompt
```json
{
  "question": "Что описано в документации?",
  "intent": "GENERAL_QA",
  "sub_intent": "GENERIC_QA",
  "documents": [
    {
      "layer": "D1_DOCUMENT_CATALOG",
      "path": "docs/README.md",
      "title": "Readme",
      "content": "Readme",
      "metadata": {
        "name": "",
        "tags": [],
        "type": "",
        "layer": "",
        "links": [],
        "owner": null,
        "title": "Readme",
        "doc_id": null,
        "module": "",
        "parent": null,
        "status": null,
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6",
        "children": [],
        "doc_kind": "readme",
        "entities": [],
        "updated_at": null,
        "doc_version": null,
        "document_id": "docs/README.md",
        "source_path": "docs/README.md",
        "summary_text": "",
        "artifact_type": null,
        "last_modified": null,
        "staleness_score": null,
        "system_component": null
      }
    },
    {
      "layer": "D1_DOCUMENT_CATALOG",
      "path": "docs/documentation/api/control-actions-endpoint.md",
      "title": "HTTP API /actions/{action}",
      "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.",
      "metadata": {
        "name": "control_actions_endpoint",
        "tags": [
          "api",
          "control-plane",
          "lifecycle"
        ],
        "type": "api_method",
        "layer": "application",
        "links": [
          {
            "type": "part_of",
            "target": "architecture.telegram_notify_app"
          },
          {
            "type": "related_api",
            "target": "api.health_endpoint"
          },
          {
            "type": "related_logic",
            "target": "logic.telegram_notification_loop"
          }
        ],
        "owner": null,
        "title": "HTTP API /actions/{action}",
        "doc_id": null,
        "module": "telegram_notify_app",
        "parent": "architecture.telegram_notify_app",
        "status": "draft",
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e",
        "children": [],
        "doc_kind": "misc",
        "entities": [
          "TelegramControlChannel",
          "ControlActionSet",
          "JSONResponse"
        ],
        "updated_at": "2026-03-20",
        "doc_version": null,
        "document_id": "api.control_actions_endpoint",
        "source_path": "docs/documentation/api/control-actions-endpoint.md",
        "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.",
        "artifact_type": null,
        "last_modified": null,
        "staleness_score": null,
        "system_component": null
      }
    }
  ],
  "facts": [],
  "entities": [],
  "workflows": [],
  "relations": [],
  "chunks": [
    {
      "layer": "D0_DOC_CHUNKS",
      "path": "docs/README.md",
      "title": "docs/README.md:Структура",
      "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.",
      "metadata": {
        "tags": [],
        "type": null,
        "order": 2,
        "owner": null,
        "doc_id": null,
        "module": null,
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6",
        "doc_kind": "readme",
        "doc_version": null,
        "document_id": "docs/README.md",
        "source_path": "docs/README.md",
        "section_path": "Project Docs > Структура",
        "artifact_type": null,
        "last_modified": null,
        "section_title": "Структура",
        "staleness_score": null,
        "system_component": null
      }
    }
  ]
}
```

### User Prompt Overview
- question: Что описано в документации?
- intent: GENERAL_QA
- sub_intent: GENERIC_QA
- documents: 2 | samples: Readme, HTTP API /actions/{action}
- facts: 0
- relations: 0

## Mismatches
- none