# Runtime Trace: 20260410-130611-31bb5d20c67b

- active_rag_session_id: 0ae059fe-076a-4aa4-abd4-31bb5d20c67b

## request
```json
{
  "request_id": "req_a14d483fd13b44fa98eb81dd6dd3ccdc",
  "session_id": "as_90d274870b1247d19694bbef1afa389a",
  "active_rag_session_id": "0ae059fe-076a-4aa4-abd4-31bb5d20c67b",
  "process_version": "v2",
  "created_at": "2026-04-10T13:06:11.385561+00:00",
  "message": "Какие методы апи есть в проекте"
}
```

## process.v2
```json
{
  "event": "intent_routed",
  "routing_domain": "DOCS",
  "intent": "DOC_EXPLAIN",
  "subintent": "API_EXPOSED",
  "normalized_query": "Какие методы апи есть в проекте",
  "target_terms": [],
  "anchors": {
    "entity_names": [],
    "file_names": [],
    "endpoint_paths": [],
    "target_doc_hints": [],
    "matched_aliases": [],
    "process_domain": null,
    "process_subdomain": null,
    "scope_type": "global",
    "candidate_domains": [],
    "candidate_subdomains": [],
    "candidate_entities": [],
    "candidate_apis": [],
    "signal_types": []
  },
  "confidence": 0.8500000000000001,
  "routing_mode": "llm_default",
  "llm_router_used": true,
  "reason_short": "Запрос явно касается перечисления доступных API-методов.",
  "rag_session_id": "0ae059fe-076a-4aa4-abd4-31bb5d20c67b"
}
```

## process.v2.pipeline
```json
{
  "event": "router_resolved",
  "domain": "DOCS",
  "intent": "DOC_EXPLAIN",
  "subintent": "API_EXPOSED",
  "confidence": 0.8500000000000001
}
```

## process.v2.pipeline
```json
{
  "event": "anchors_extracted",
  "signal_types": [],
  "endpoint_paths": [],
  "target_doc_hints": [],
  "matched_aliases": [],
  "target_terms": []
}
```

## process.v2.pipeline
```json
{
  "event": "alias_resolution",
  "resolved_aliases": [],
  "target_doc_hints": []
}
```

## workflow.v2.api_exposed
```json
{
  "event": "workflow_started",
  "workflow_id": "v2.docs_explain.api_exposed"
}
```

## workflow.v2.api_exposed
```json
{
  "event": "workflow_step_traced",
  "workflow_id": "v2.docs_explain.api_exposed",
  "step": {
    "id": "require_rag_session",
    "title": "Проверка RAG-сессии"
  },
  "input": {},
  "output": {
    "has_rag_session": true
  }
}
```

## process.v2.retrieval_policy
```json
{
  "event": "retrieval_plan_resolved",
  "profile": "api_exposed",
  "layers": [
    "D1_DOCUMENT_CATALOG"
  ],
  "limit": 400,
  "filters": {
    "metadata.type": "api_method",
    "prefer_path_prefixes": [
      "docs/api/",
      "docs/endpoints/",
      "docs/methods/",
      "api/",
      "endpoints/",
      "methods/"
    ],
    "target_doc_hints": [],
    "prefer_like_patterns": [
      "%api%",
      "%endpoint%",
      "%method%",
      "%эндпоинт%",
      "%метод%"
    ]
  }
}
```

## process.v2.pipeline
```json
{
  "event": "retrieval_profile_selected",
  "profile": "api_exposed",
  "layers": [
    "D1_DOCUMENT_CATALOG"
  ],
  "filters": {
    "metadata.type": "api_method",
    "prefer_path_prefixes": [
      "docs/api/",
      "docs/endpoints/",
      "docs/methods/",
      "api/",
      "endpoints/",
      "methods/"
    ],
    "target_doc_hints": [],
    "prefer_like_patterns": [
      "%api%",
      "%endpoint%",
      "%method%",
      "%эндпоинт%",
      "%метод%"
    ]
  }
}
```

## workflow.v2.api_exposed
```json
{
  "event": "workflow_step_traced",
  "workflow_id": "v2.docs_explain.api_exposed",
  "step": {
    "id": "resolve_retrieval_plan",
    "title": "Выбор retrieval-плана"
  },
  "input": {},
  "output": {
    "profile": "api_exposed"
  }
}
```

## workflow.v2.api_exposed
```json
{
  "event": "workflow_step_traced",
  "workflow_id": "v2.docs_explain.api_exposed",
  "step": {
    "id": "fetch_rag_rows",
    "title": "Получение строк из RAG"
  },
  "input": {},
  "output": {
    "retrieved_row_count": 3
  }
}
```

## process.v2.evidence
```json
{
  "event": "evidence_assembled",
  "mode": "api_exposed",
  "endpoint_count": 3,
  "endpoints": [
    "GET /api/v1/clients/contacts-dgr",
    "GET /api/v1/clients/contacts-dgr/{contactid}",
    "POST /api/v1/clients/contacts-dgr"
  ]
}
```

## process.v2.pipeline
```json
{
  "event": "evidence_assembled",
  "mode": "api_exposed",
  "endpoint_count": 3
}
```

## workflow.v2.api_exposed
```json
{
  "event": "workflow_step_traced",
  "workflow_id": "v2.docs_explain.api_exposed",
  "step": {
    "id": "build_api_exposed_evidence",
    "title": "Сборка списка API"
  },
  "input": {},
  "output": {
    "endpoint_count": 3
  }
}
```

## workflow.v2.api_exposed
```json
{
  "event": "workflow_step_traced",
  "workflow_id": "v2.docs_explain.api_exposed",
  "step": {
    "id": "finalize_api_exposed_answer",
    "title": "Формирование ответа со списком API"
  },
  "input": {},
  "output": {
    "answer_length": 111
  }
}
```

## workflow.v2.api_exposed
```json
{
  "event": "workflow_trace_flushed",
  "workflow_id": "v2.docs_explain.api_exposed",
  "steps": [
    {
      "step_id": "require_rag_session",
      "title": "Проверка RAG-сессии",
      "input": {},
      "output": {
        "has_rag_session": true
      }
    },
    {
      "step_id": "resolve_retrieval_plan",
      "title": "Выбор retrieval-плана",
      "input": {},
      "output": {
        "profile": "api_exposed"
      }
    },
    {
      "step_id": "fetch_rag_rows",
      "title": "Получение строк из RAG",
      "input": {},
      "output": {
        "retrieved_row_count": 3
      }
    },
    {
      "step_id": "build_api_exposed_evidence",
      "title": "Сборка списка API",
      "input": {},
      "output": {
        "endpoint_count": 3
      }
    },
    {
      "step_id": "finalize_api_exposed_answer",
      "title": "Формирование ответа со списком API",
      "input": {},
      "output": {
        "answer_length": 111
      }
    }
  ]
}
```

## workflow.v2.api_exposed
```json
{
  "event": "workflow_completed",
  "workflow_id": "v2.docs_explain.api_exposed"
}
```

## process.v2.pipeline
```json
{
  "event": "answer_generated",
  "answer_mode": "deterministic",
  "answer_length": 111
}
```

## result
```json
{
  "status": "done",
  "answer": "GET /api/v1/clients/contacts-dgr\nGET /api/v1/clients/contacts-dgr/{contactid}\nPOST /api/v1/clients/contacts-dgr",
  "completed_at": "2026-04-10T13:06:13.326341+00:00"
}
```
