{ "trace_id": "ti9EWEi85p-RnD", "timestamp": "2026-03-23T13:55:15.237Z", "model": "gpt-4o-mini", "prompt_version": "normalizer_v1", "schema_version": "v1", "user_question_raw": "Какое сальдо по 68.02 за июнь?", "context": { "period_hint": null, "business_context": null, "expected_route": "store_canonical" }, "request_payload_redacted": { "model": "gpt-4o-mini", "baseUrl": "https://api.openai.com/v1", "temperature": 0, "maxOutputTokens": 900, "systemPrompt": "Ты semantic-normalizer для бухгалтерского ассистента NDC.\nТвоя роль: только нормализация запроса пользователя в строгий JSON-контракт.\n\nЖесткие правила:\n1) Не давай бухгалтерский ответ по сути вопроса.\n2) Возвращай только JSON без markdown и пояснений.\n3) JSON обязан соответствовать переданной schema normalized_query_v1.\n4) Если период не указан, не выдумывай его; отмечай ambiguity.\n5) Для цепочек документов/проводок/оплат поднимай causal и cross-entity признаки.\n6) Для точечного object trace (номер/строка/ref) поднимай needs_exact_object_trace=true.\n7) Используй терминологию NDC.", "developerPrompt": "Классификация intent_class:\n- heavy_analytical: общий агрегированный риск-срез, рейтинг, приоритизация.\n- cross_entity: связки между документами/проводками/оплатами/договорами/контрагентами.\n- drilldown_explain: точечное объяснение причин по объекту или малому набору объектов.\n- rule_based_account_control: контрольные правила по счетам (ОС, 97, 10 и т.п.).\n- anomaly_probe: поиск нетипичных паттернов.\n- period_close_risk: фокус на предзакрытии периода.\n- ambiguous_human_query: широкая человеческая формулировка без точного scope.\n- simple_factual: простой факт без сложной аналитики.\n\nПравила route_hint:\n- live_mcp_drilldown: если точечный object trace.\n- hybrid_store_plus_live: если cross_entity + causal explain.\n- batch_refresh_then_store: если full-period heavy aggregate/ranking без готовой агрегации.\n- store_feature_risk: если тренд/аномалии/контроли, когда точечный runtime не обязателен.\n- store_canonical: простые факты и легкие запросы при достаточном контексте.\n\nПравила requires:\n- needs_cross_entity_join=true для связок между разными сущностями.\n- needs_causal_chain=true для формулировок \"почему\", \"чем подтверждается\", \"разложи цепочку\".\n- needs_exact_object_trace=true для конкретного документа/проводки/строки/номера/ref.\n- needs_period_cut=true если вопрос про конец периода или периодную сверку.\n- needs_evidence=true если требуется подтверждение документами/движениями/проводками.", "domainPrompt": "Домен бухгалтерии:\n- ключевые счета: 01, 02, 10, 41, 51, 60, 62, 68.02, 90, 97;\n- сущности: контрагент, договор, реализация, поступление, оплата, проводка, регистр;\n- типовые паттерны: \"не бьется\", \"хвост\", \"акт сверки\", \"закрывающие\", \"реализация без оплаты\";\n- товарные аномалии: \"продажа раньше прихода\", \"подозрительный остаток\";\n- ОС: \"амортизационная группа\", \"срок амортизации\", \"карточка ОС\";\n- банк: \"выписка\", \"движение по 51\", \"разрыв цепочки документ-проводка\";\n- периодная аналитика: предзакрытие, риск-срез, приоритизация ручных проверок.\n\nЕсли присутствуют одновременно риск-слова и document/payment/posting chain,\nне понижать сценарий до чистого risk-route автоматически.", "fewShotExamples": "Q: По каким покупателям у нас отгрузки без оплаты на конец июня, свяжи с реализациями, договорами и проводками.\nExpected:\n{\n \"intent_class\": \"cross_entity\",\n \"requires\": {\n \"needs_cross_entity_join\": true,\n \"needs_causal_chain\": true,\n \"needs_exact_object_trace\": false\n },\n \"expected_output_shape\": \"reconciliation_report\",\n \"route_hint\": \"hybrid_store_plus_live\"\n}\n\nQ: Сделай рейтинг самых рисковых счетов перед закрытием июня.\nExpected:\n{\n \"intent_class\": \"heavy_analytical\",\n \"requires\": {\n \"needs_ranking\": true,\n \"needs_period_cut\": true\n },\n \"expected_output_shape\": \"ranked_list\",\n \"route_hint\": \"batch_refresh_then_store\"\n}\n\nQ: Покажи документ №123 и проводку по нему, нужна точная строка.\nExpected:\n{\n \"intent_class\": \"drilldown_explain\",\n \"requires\": {\n \"needs_exact_object_trace\": true,\n \"needs_runtime_truth\": true\n },\n \"expected_output_shape\": \"evidence_chain\",\n \"route_hint\": \"live_mcp_drilldown\"\n}", "userQuestion": "Какое сальдо по 68.02 за июнь?", "context": { "expected_route": "store_canonical", "eval_label": "eval-YxrhL2dCcH" }, "useMock": false }, "raw_model_response": { "id": "resp_0d151a85e43b18810069c1463d1e0c8194be2d6b9f4ced45af", "object": "response", "created_at": 1774274109, "status": "completed", "background": false, "billing": { "payer": "developer" }, "completed_at": 1774274114, "error": null, "frequency_penalty": 0, "incomplete_details": null, "instructions": null, "max_output_tokens": 900, "max_tool_calls": null, "model": "gpt-4o-mini-2024-07-18", "output": [ { "id": "msg_0d151a85e43b18810069c1463d78a48194a522fc89b47e4d46", "type": "message", "status": "completed", "content": [ { "type": "output_text", "annotations": [], "logprobs": [], "text": "{\n \"schema_version\": \"normalized_query_v1\",\n \"user_question_raw\": \"Какое сальдо по 68.02 за июнь?\",\n \"normalized_question\": \"Какое сальдо по счету 68.02 за июнь?\",\n \"intent_class\": \"simple_factual\",\n \"business_problem_type\": \"сальдо по счету\",\n \"domain_entities\": [\"счет\"],\n \"accounts_mentioned\": [\"68.02\"],\n \"documents_mentioned\": [],\n \"registers_mentioned\": [],\n \"period_scope\": {\n \"type\": \"explicit\",\n \"value\": \"июнь\",\n \"confidence\": \"high\"\n },\n \"requires\": {\n \"needs_cross_entity_join\": false,\n \"needs_causal_chain\": false,\n \"needs_exact_object_trace\": false,\n \"needs_ranking\": false,\n \"needs_anomaly_summary\": false,\n \"needs_runtime_truth\": false,\n \"needs_period_cut\": false,\n \"needs_evidence\": false\n },\n \"expected_output_shape\": \"point_answer\",\n \"route_hint\": \"store_canonical\",\n \"ambiguities\": [],\n \"confidence\": {\n \"overall\": \"high\",\n \"intent_class\": \"high\",\n \"route_hint\": \"high\"\n }\n}" } ], "role": "assistant" } ], "parallel_tool_calls": true, "presence_penalty": 0, "previous_response_id": null, "prompt_cache_key": null, "prompt_cache_retention": null, "reasoning": { "effort": null, "summary": null }, "safety_identifier": null, "service_tier": "default", "store": true, "temperature": 0, "text": { "format": { "type": "json_schema", "description": null, "name": "normalized_query_v1", "schema": { "$id": "normalized_query_v1", "title": "Normalized Query V1", "type": "object", "additionalProperties": false, "required": [ "schema_version", "user_question_raw", "normalized_question", "intent_class", "business_problem_type", "domain_entities", "accounts_mentioned", "documents_mentioned", "registers_mentioned", "period_scope", "requires", "expected_output_shape", "route_hint", "ambiguities", "confidence" ], "properties": { "schema_version": { "type": "string", "const": "normalized_query_v1" }, "user_question_raw": { "type": "string", "minLength": 1 }, "normalized_question": { "type": "string", "minLength": 1 }, "intent_class": { "type": "string", "enum": [ "heavy_analytical", "cross_entity", "drilldown_explain", "rule_based_account_control", "anomaly_probe", "period_close_risk", "ambiguous_human_query", "simple_factual" ] }, "business_problem_type": { "type": "string", "minLength": 1 }, "domain_entities": { "type": "array", "items": { "type": "string" } }, "accounts_mentioned": { "type": "array", "items": { "type": "string" } }, "documents_mentioned": { "type": "array", "items": { "type": "string" } }, "registers_mentioned": { "type": "array", "items": { "type": "string" } }, "period_scope": { "type": "object", "additionalProperties": false, "required": [ "type", "value", "confidence" ], "properties": { "type": { "type": "string", "enum": [ "explicit", "inferred", "missing" ] }, "value": { "type": [ "string", "null" ] }, "confidence": { "type": "string", "enum": [ "high", "medium", "low" ] } } }, "requires": { "type": "object", "additionalProperties": false, "required": [ "needs_cross_entity_join", "needs_causal_chain", "needs_exact_object_trace", "needs_ranking", "needs_anomaly_summary", "needs_runtime_truth", "needs_period_cut", "needs_evidence" ], "properties": { "needs_cross_entity_join": { "type": "boolean" }, "needs_causal_chain": { "type": "boolean" }, "needs_exact_object_trace": { "type": "boolean" }, "needs_ranking": { "type": "boolean" }, "needs_anomaly_summary": { "type": "boolean" }, "needs_runtime_truth": { "type": "boolean" }, "needs_period_cut": { "type": "boolean" }, "needs_evidence": { "type": "boolean" } } }, "expected_output_shape": { "type": "string", "enum": [ "ranked_list", "evidence_chain", "anomaly_summary", "point_answer", "reconciliation_report", "prioritized_review_list" ] }, "route_hint": { "type": "string", "enum": [ "store_canonical", "store_feature_risk", "hybrid_store_plus_live", "live_mcp_drilldown", "batch_refresh_then_store" ] }, "ambiguities": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "field", "reason", "severity" ], "properties": { "field": { "type": "string" }, "reason": { "type": "string" }, "severity": { "type": "string", "enum": [ "low", "medium", "high" ] } } } }, "confidence": { "type": "object", "additionalProperties": false, "required": [ "overall", "intent_class", "route_hint" ], "properties": { "overall": { "type": "string", "enum": [ "high", "medium", "low" ] }, "intent_class": { "type": "string", "enum": [ "high", "medium", "low" ] }, "route_hint": { "type": "string", "enum": [ "high", "medium", "low" ] } } } } }, "strict": true }, "verbosity": "medium" }, "tool_choice": "auto", "tools": [], "top_logprobs": 0, "top_p": 1, "truncation": "disabled", "usage": { "input_tokens": 1561, "input_tokens_details": { "cached_tokens": 0 }, "output_tokens": 277, "output_tokens_details": { "reasoning_tokens": 0 }, "total_tokens": 1838 }, "user": null, "metadata": {} }, "parsed_normalized_json": { "schema_version": "normalized_query_v1", "user_question_raw": "Какое сальдо по 68.02 за июнь?", "normalized_question": "Какое сальдо по счету 68.02 за июнь?", "intent_class": "simple_factual", "business_problem_type": "сальдо по счету", "domain_entities": [ "счет" ], "accounts_mentioned": [ "68.02" ], "documents_mentioned": [], "registers_mentioned": [], "period_scope": { "type": "explicit", "value": "июнь", "confidence": "high" }, "requires": { "needs_cross_entity_join": false, "needs_causal_chain": false, "needs_exact_object_trace": false, "needs_ranking": false, "needs_anomaly_summary": false, "needs_runtime_truth": false, "needs_period_cut": false, "needs_evidence": false }, "expected_output_shape": "point_answer", "route_hint": "store_canonical", "ambiguities": [], "confidence": { "overall": "high", "intent_class": "high", "route_hint": "high" } }, "validation_result": { "passed": true, "errors": [] }, "route_hint": "store_canonical", "confidence": "high", "usage": { "input_tokens": 1561, "output_tokens": 277, "total_tokens": 1838 }, "latency_ms": 6231, "expected_route": "store_canonical", "eval_label": "eval-YxrhL2dCcH" }