# docs-v2-openapi-fragment-send-request

- 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
Сгенерируй request schema для endpoint /send

## Actual
{
  "intent": "OPENAPI_GENERATION",
  "sub_intent": "OPENAPI_FRAGMENT_GENERATE",
  "graph_id": "DocsQAGraph",
  "conversation_mode": "START",
  "rag_count": 1,
  "llm_answer": "",
  "answer_mode": "structured_spec",
  "path_scope": [],
  "doc_scope": [
    "api.send_message_endpoint"
  ],
  "entity_candidates": [],
  "symbol_candidates": [],
  "layers": [
    "D1_DOCUMENT_CATALOG",
    "D2_FACT_INDEX",
    "D0_DOC_CHUNKS"
  ],
  "filters": {
    "doc_type": "api_method"
  },
  "pipeline_mode": "pre_llm_only",
  "gate_decision": "partial",
  "prompt_used": "docs_openapi_fragment_answer",
  "llm_mode": "yaml",
  "degraded_reason": "fragment_payload_only",
  "code_intents_stubbed": true
}

## Pipeline Steps
### input_query
```json
{
  "input": {
    "query": "Сгенерируй request schema для endpoint /send"
  },
  "output": {
    "query": "Сгенерируй request schema для endpoint /send"
  }
}
```

### router
```json
{
  "input": {
    "query": "Сгенерируй request schema для endpoint /send"
  },
  "output": {
    "intent": "OPENAPI_GENERATION",
    "sub_intent": "OPENAPI_FRAGMENT_GENERATE",
    "graph_id": "DocsQAGraph",
    "conversation_mode": "START"
  }
}
```

### docs_pipeline
```json
{
  "input": {
    "query": "Сгенерируй request schema для endpoint /send"
  },
  "output": {
    "answer_mode": "ready_partial",
    "prompt_name": "docs_openapi_fragment_answer",
    "llm_request": {
      "prompt_name": "docs_openapi_fragment_answer",
      "log_context": "graph.project_qa.docs.openapi",
      "prompt_stats": {
        "system_chars": 319,
        "user_chars": 2748,
        "tokens_in_estimate": 767
      }
    },
    "degraded_reason": "fragment_payload_only"
  }
}
```

## Diagnostics
{
  "intent": "OPENAPI_GENERATION",
  "sub_intent": "OPENAPI_FRAGMENT_GENERATE",
  "layers_used": [
    "D1_DOCUMENT_CATALOG",
    "D2_FACT_INDEX",
    "D0_DOC_CHUNKS"
  ],
  "documents_found": 1,
  "facts_found": 0,
  "relations_found": 0,
  "openapi_fields_extracted": 0,
  "missing_required_fields": [
    "method",
    "schema_fragment"
  ],
  "openapi_status": {
    "has_path": true,
    "has_method": false,
    "has_request": false,
    "has_response": false
  },
  "prompt_used": "docs_openapi_fragment_answer",
  "llm_mode": "yaml",
  "output_valid": true,
  "matched_intent_source": "deterministic",
  "matched_anchor_type": "endpoint",
  "matched_anchor_value": "/send",
  "exact_anchor_match": true,
  "docs_layers_requested": [
    "D1_DOCUMENT_CATALOG",
    "D2_FACT_INDEX",
    "D0_DOC_CHUNKS"
  ],
  "docs_layers_with_hits": [
    "D1_DOCUMENT_CATALOG",
    "D2_FACT_INDEX",
    "D0_DOC_CHUNKS"
  ],
  "planned_layers": [
    "D1_DOCUMENT_CATALOG",
    "D2_FACT_INDEX",
    "D0_DOC_CHUNKS"
  ],
  "executed_layers": [
    "D1_DOCUMENT_CATALOG",
    "D2_FACT_INDEX",
    "D0_DOC_CHUNKS"
  ],
  "non_empty_layers": [
    "D1_DOCUMENT_CATALOG",
    "D2_FACT_INDEX",
    "D0_DOC_CHUNKS"
  ],
  "layer_diagnostics": {
    "D1_DOCUMENT_CATALOG": {
      "hits": 7,
      "top_ids": [
        "api.send_message_endpoint",
        "api.control_actions_endpoint",
        "api.health_endpoint",
        "architecture.telegram_notify_app",
        "docs/README.md"
      ]
    },
    "D2_FACT_INDEX": {
      "hits": 8,
      "top_ids": [
        "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0",
        "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75",
        "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3",
        "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3",
        "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f"
      ]
    },
    "D0_DOC_CHUNKS": {
      "hits": 6,
      "top_ids": [
        "api.control_actions_endpoint"
      ]
    }
  },
  "query_entity_candidates": [],
  "resolved_entity_candidates": [],
  "query_anchor_candidates": [
    "/send"
  ],
  "resolved_anchor_candidates": [
    "api.send_message_endpoint",
    "docs/documentation/api/send-message-endpoint.md"
  ],
  "anchor_candidates": [],
  "selected_anchor": null,
  "anchor_selection_reason": "",
  "anchor_match_type": "",
  "doc_ids": [
    "api.send_message_endpoint"
  ],
  "doc_paths": [
    "docs/documentation/api/send-message-endpoint.md"
  ],
  "doc_titles": [
    "HTTP API /send"
  ],
  "relation_hits_count": 0,
  "relation_targets": [],
  "fallback_doc_hits_count": 1,
  "fallback_used": false,
  "fact_hits": 0,
  "entity_hits": 0,
  "evidence_summary": {
    "documents": 1,
    "facts": 0,
    "relations": 0,
    "chunks": 0,
    "entity_hits": 0,
    "openapi_signals": {
      "path_found": true,
      "method_found": false,
      "request_schema": false,
      "response_schema": false,
      "status_codes": false,
      "payload_description": true
    }
  },
  "gate_decision": "partial",
  "gate_decision_reason": "fragment_payload_only",
  "gate_missing_requirements": [
    "http_method_found",
    "contract_fields_found",
    "status_codes_found"
  ],
  "gate_satisfied_requirements": [
    "retrieval_non_empty",
    "exact_anchor_match",
    "path_found",
    "payload_description_found",
    "api_method_filter"
  ],
  "openapi_evidence": {
    "path_found": true,
    "method_found": false,
    "request_schema": false,
    "response_schema": false,
    "status_codes": false,
    "payload_description": true
  },
  "requested_fragment_type": "request_schema",
  "fragment_evidence_found": [
    "path",
    "payload_description"
  ],
  "fragment_missing_requirements": [],
  "answer_mode": "ready_partial",
  "degrade_reason": "fragment_payload_only",
  "degraded_reason": "fragment_payload_only",
  "code_intents_stubbed": false
}

## LLM Request
- prompt_name: docs_openapi_fragment_answer
- log_context: graph.project_qa.docs.openapi

### Prompt Stats
```json
{
  "system_chars": 319,
  "user_chars": 2748,
  "tokens_in_estimate": 767
}
```

### System Prompt
```text
Ты генерируешь часть OpenAPI schema по документации API.

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

Правила:
- Только schema
- Без полного OpenAPI документа
- Используй только данные из payload
- Не придумывай поля
- Верни ТОЛЬКО YAML без пояснений
```

### User Prompt
```json
{
  "question": "Сгенерируй request schema для endpoint /send",
  "intent": "OPENAPI_GENERATION",
  "sub_intent": "OPENAPI_FRAGMENT_GENERATE",
  "documents": [
    {
      "layer": "D1_DOCUMENT_CATALOG",
      "path": "docs/documentation/api/send-message-endpoint.md",
      "title": "HTTP API /send",
      "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.",
      "metadata": {
        "name": "send_message_endpoint",
        "tags": [
          "api",
          "telegram",
          "manual-send"
        ],
        "type": "api_method",
        "layer": "application",
        "links": [
          {
            "type": "part_of",
            "target": "architecture.telegram_notify_app"
          },
          {
            "type": "depends_on",
            "target": "logic.telegram_notification_loop"
          }
        ],
        "owner": null,
        "title": "HTTP API /send",
        "doc_id": null,
        "module": "telegram_notify_app",
        "parent": "architecture.telegram_notify_app",
        "status": "draft",
        "repo_id": "test_echo_app",
        "section": null,
        "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d",
        "children": [],
        "doc_kind": "misc",
        "entities": [
          "TelegramControlAppFactory",
          "TelegramSendService",
          "TelegramNotifyWorker"
        ],
        "updated_at": "2026-03-20",
        "doc_version": null,
        "document_id": "api.send_message_endpoint",
        "source_path": "docs/documentation/api/send-message-endpoint.md",
        "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.",
        "artifact_type": null,
        "last_modified": null,
        "staleness_score": null,
        "system_component": null
      }
    }
  ],
  "facts": [],
  "relations": [],
  "api_contract": {
    "path": "/send",
    "method": "",
    "request_schema": null,
    "response_schema": null,
    "diagnostics": {
      "has_path": true,
      "has_method": false,
      "has_request": false,
      "has_response": false,
      "status_codes_found": false,
      "payload_description_found": true,
      "missing_required_fields": [
        "method",
        "schema_fragment"
      ]
    }
  }
}
```

### User Prompt Overview
- question: Сгенерируй request schema для endpoint /send
- intent: OPENAPI_GENERATION
- sub_intent: OPENAPI_FRAGMENT_GENERATE
- documents: 1 | samples: HTTP API /send
- facts: 0
- relations: 0
- api_contract:
  path: /send
  method: —
  has_request_schema: False
  has_response_schema: False

## Mismatches
- none