NODEDC_1C/llm_normalizer/data/traces/mevf8cflx6G80P.json

469 lines
25 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"trace_id": "mevf8cflx6G80P",
"timestamp": "2026-03-23T18:08:16.744Z",
"model": "gpt-4o-mini",
"prompt_version": "normalizer_v2",
"schema_version": "v2",
"case_id": "BQ-005",
"user_question_raw": "Есть ли такие зависшие авансы, которые уже давно надо было либо закрыть, либо хотя бы перепроверить руками?",
"context": {
"period_hint": null,
"business_context": null,
"expected_route": null,
"case_id": "BQ-005",
"eval_mode": "single-pass-strict"
},
"request_payload_redacted": {
"model": "gpt-4o-mini",
"baseUrl": "https://api.openai.com/v1",
"temperature": 0,
"maxOutputTokens": 900,
"promptVersion": "normalizer_v2",
"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": "You are a decomposition-first semantic parser for accounting assistant NDC.\nReturn JSON only, strictly matching `normalized_query_v2`.\nDo not answer the accounting question itself.\n\nCore workflow:\n1) Detect if the user message is in company-specific accounting scope.\n2) Split message into meaningful task fragments.\n3) Discard obvious noise fragments.\n4) For each kept fragment, output semantic hints + flags + candidate_labels.\n5) Keep routing as indirect signals only (flags + labels). Final route is chosen by deterministic code.\n\nDomain gating policy:\n- `in_scope` only for requests about current company data and accounting ontology (documents, postings, balances, settlements, period close risks, anomalies, controls).\n- `out_of_scope` for generic accounting theory, legal questions, standards/laws, unrelated business or casual/offtopic chat.\n- `unclear` when intent may be accounting-related but insufficiently grounded in company context.\n\nbusiness_scope mapping:\n- `company_specific_accounting` for in-scope enterprise-data tasks.\n- `generic_accounting` for abstract accounting questions not tied to this company data.\n- `offtopic` for non-accounting content.\n- `unclear` when not enough signal.\n\nFragment policy:\n- Keep user wording in `raw_fragment_text`.\n- Make `normalized_fragment_text` concise and business-readable.\n- Populate `entity_hints/account_hints/document_hints/register_hints` only from message evidence.\n- `candidate_labels` can contain multiple labels. Do not force a single mandatory intent.\n- `fragment_id` must be stable and sequential: F1, F2, F3...\n\nFlag policy:\n- has_multi_entity_scope: requires linking multiple accounting entities/documents/payments/postings.\n- asks_for_chain_explanation: asks to explain “why”, “where chain breaks”, or causal reconstruction.\n- asks_for_ranking_or_top: asks top/ranking/prioritized ordering.\n- asks_for_period_summary: asks broad period/company summary or slice.\n- asks_for_rule_check: asks control/rule compliance checks.\n- asks_for_anomaly_scan: asks suspicious zones/anomaly search.\n- asks_for_exact_object_trace: asks exact object trace (document number/ref/line).\n- asks_for_evidence: asks documentary/proof evidence.\n- mentions_period_close_context: explicit pre-close/close/reporting deadline context.\n\nDiscard policy:\n- Put chatter/noise/meta filler into `discarded_fragments` with reason.\n- Do not discard valid accounting tasks, even if wording is slang-like.\n\nConfidence policy:\n- high only for clear, explicit fragment semantics.\n- medium for normal ambiguity.\n- low for unclear or weakly grounded fragments.\n- scope_confidence reflects whole-message domain certainty.\n\nglobal_notes policy:\n- needs_clarification=true when period/object/scope is missing for reliable execution.\n- clarification_reason should be concrete and short.\n\nStrictness:\n- Output only valid JSON object matching `normalized_query_v2`.\n- No markdown, no prose, no extra fields.",
"domainPrompt": "Контекст домена: бухгалтерия 1С/NDC.\n\nКлючевые счета:\n- 01, 02, 10, 41, 51, 60, 62, 68.02, 90, 97.\n\nТиповые сущности:\n- контрагент, договор, документ реализации, документ поступления, оплата, проводка, регистр, закрывающий документ.\n\nЛексика causal и сверки (сильные сигналы для cross_entity):\n- \"не бьется\", \"не сходится\", \"не видно\", \"не собралось\", \"повисло\", \"хвост\";\n- \"разложи по документам/оплатам/закрывающим\";\n- \"чем подтверждается\", \"где ошибка в цепочке\", \"что пошло криво\".\n\nЛексика точечного drilldown:\n- \"документ №...\", \"ref\", \"строка проводки\", \"покажи конкретную операцию\", \"точный source-of-record\".\n\nЛексика rule-based контроля:\n- \"проверь настройки\", \"ошибка срока/даты\", \"контроль 97/10/ОС\", \"нарушение правила учета\".\n\nЛексика обзорной аналитики:\n- \"рейтинг\", \"топ рисков\", \"в целом по компании\", \"перед закрытием периода\", \"приоритизация проверок\".\n\nВажное правило:\nЕсли в одном вопросе есть и риск-лексика, и цепочка document/payment/posting, не понижать задачу до чистого `store_feature_risk`.\nПриоритет у causal cross-entity семантики.",
"fewShotExamples": "Q:\nПо поставщикам на конец месяца где хвосты по взаиморасчетам, разложи где рвется цепочка документов и оплат.\n\nExpected (fragment-level shape):\n{\n \"message_in_scope\": true,\n \"contains_multiple_tasks\": false,\n \"fragments\": [\n {\n \"fragment_id\": \"F1\",\n \"domain_relevance\": \"in_scope\",\n \"business_scope\": \"company_specific_accounting\",\n \"account_hints\": [\"60\"],\n \"flags\": {\n \"has_multi_entity_scope\": true,\n \"asks_for_chain_explanation\": true,\n \"asks_for_ranking_or_top\": false,\n \"asks_for_period_summary\": false,\n \"asks_for_rule_check\": false,\n \"asks_for_anomaly_scan\": true,\n \"asks_for_exact_object_trace\": false,\n \"asks_for_evidence\": true,\n \"mentions_period_close_context\": true\n },\n \"candidate_labels\": [\"cross_entity\", \"anomaly_probe\"]\n }\n ]\n}\n\nQ:\nСкажи как вообще по ФСБУ правильно закрывать 97 счет, и еще проверь у нас по июню подозрительные РБП.\n\nExpected (fragment-level shape):\n{\n \"message_in_scope\": true,\n \"contains_multiple_tasks\": true,\n \"fragments\": [\n {\n \"fragment_id\": \"F1\",\n \"domain_relevance\": \"out_of_scope\",\n \"business_scope\": \"generic_accounting\",\n \"flags\": {\n \"asks_for_rule_check\": true,\n \"asks_for_anomaly_scan\": false\n },\n \"candidate_labels\": []\n },\n {\n \"fragment_id\": \"F2\",\n \"domain_relevance\": \"in_scope\",\n \"business_scope\": \"company_specific_accounting\",\n \"account_hints\": [\"97\"],\n \"flags\": {\n \"asks_for_rule_check\": true,\n \"asks_for_anomaly_scan\": true,\n \"asks_for_period_summary\": false\n },\n \"candidate_labels\": [\"rule_based_account_control\", \"anomaly_probe\"]\n }\n ],\n \"global_notes\": {\n \"needs_clarification\": false\n }\n}\n\nQ:\nДокумент TRX-88 покажи и связанную строку проводки, а еще где по банку повторяется паттерн подозрительных хвостов.\n\nExpected (fragment-level shape):\n{\n \"message_in_scope\": true,\n \"contains_multiple_tasks\": true,\n \"fragments\": [\n {\n \"fragment_id\": \"F1\",\n \"domain_relevance\": \"in_scope\",\n \"business_scope\": \"company_specific_accounting\",\n \"flags\": {\n \"asks_for_exact_object_trace\": true,\n \"asks_for_evidence\": true,\n \"has_multi_entity_scope\": false\n },\n \"candidate_labels\": [\"drilldown_explain\"]\n },\n {\n \"fragment_id\": \"F2\",\n \"domain_relevance\": \"in_scope\",\n \"business_scope\": \"company_specific_accounting\",\n \"flags\": {\n \"asks_for_anomaly_scan\": true,\n \"asks_for_ranking_or_top\": true,\n \"asks_for_period_summary\": true\n },\n \"candidate_labels\": [\"heavy_analytical\", \"anomaly_probe\"]\n }\n ]\n}",
"userQuestion": "Есть ли такие зависшие авансы, которые уже давно надо было либо закрыть, либо хотя бы перепроверить руками?",
"context": {
"eval_label": "eval-aOEoelkQb2",
"case_id": "BQ-005",
"eval_mode": "single-pass-strict"
},
"retryPolicy": "single-pass-strict",
"useMock": false
},
"raw_model_response": {
"id": "resp_0c586a71c2fffee00069c18182ff088195b885dc7e69826973",
"object": "response",
"created_at": 1774289283,
"status": "completed",
"background": false,
"billing": {
"payer": "developer"
},
"completed_at": 1774289296,
"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_0c586a71c2fffee00069c18185ec0c81959f82947dd23057fc",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "{\n \"schema_version\": \"normalized_query_v2\",\n \"user_message_raw\": \"Есть ли такие зависшие авансы, которые уже давно надо было либо закрыть, либо хотя бы перепроверить руками?\",\n \"message_in_scope\": true,\n \"scope_confidence\": \"high\",\n \"contains_multiple_tasks\": false,\n \"fragments\": [\n {\n \"fragment_id\": \"F1\",\n \"raw_fragment_text\": \"зависшие авансы, которые уже давно надо было либо закрыть, либо хотя бы перепроверить руками\",\n \"normalized_fragment_text\": \"проверка зависших авансов на закрытие или перепроверку\",\n \"domain_relevance\": \"in_scope\",\n \"business_scope\": \"company_specific_accounting\",\n \"entity_hints\": [],\n \"account_hints\": [\"51\", \"60\"],\n \"document_hints\": [],\n \"register_hints\": [],\n \"time_scope\": {\n \"type\": \"missing\",\n \"value\": null,\n \"confidence\": \"low\"\n },\n \"flags\": {\n \"has_multi_entity_scope\": false,\n \"asks_for_chain_explanation\": false,\n \"asks_for_ranking_or_top\": false,\n \"asks_for_period_summary\": false,\n \"asks_for_rule_check\": false,\n \"asks_for_anomaly_scan\": true,\n \"asks_for_exact_object_trace\": false,\n \"asks_for_evidence\": false,\n \"mentions_period_close_context\": false\n },\n \"candidate_labels\": [\"anomaly_probe\"]\n \n \t\t\n \t\t,\n \"confidence\": \"medium\"\n }\n ],\n \"discarded_fragments\": [],\n \"global_notes\": {\n \"needs_clarification\": true,\n \"clarification_reason\": \"не указаны конкретные сроки для проверки зависших авансов\"\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_v2",
"schema": {
"$id": "normalized_query_v2",
"title": "Normalized Query V2",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"user_message_raw",
"message_in_scope",
"scope_confidence",
"contains_multiple_tasks",
"fragments",
"discarded_fragments",
"global_notes"
],
"properties": {
"schema_version": {
"type": "string",
"const": "normalized_query_v2"
},
"user_message_raw": {
"type": "string",
"minLength": 1
},
"message_in_scope": {
"type": "boolean"
},
"scope_confidence": {
"type": "string",
"enum": [
"high",
"medium",
"low"
]
},
"contains_multiple_tasks": {
"type": "boolean"
},
"fragments": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"fragment_id",
"raw_fragment_text",
"normalized_fragment_text",
"domain_relevance",
"business_scope",
"entity_hints",
"account_hints",
"document_hints",
"register_hints",
"time_scope",
"flags",
"candidate_labels",
"confidence"
],
"properties": {
"fragment_id": {
"type": "string",
"minLength": 1
},
"raw_fragment_text": {
"type": "string",
"minLength": 1
},
"normalized_fragment_text": {
"type": "string",
"minLength": 1
},
"domain_relevance": {
"type": "string",
"enum": [
"in_scope",
"out_of_scope",
"unclear"
]
},
"business_scope": {
"type": "string",
"enum": [
"company_specific_accounting",
"generic_accounting",
"offtopic",
"unclear"
]
},
"entity_hints": {
"type": "array",
"items": {
"type": "string"
}
},
"account_hints": {
"type": "array",
"items": {
"type": "string"
}
},
"document_hints": {
"type": "array",
"items": {
"type": "string"
}
},
"register_hints": {
"type": "array",
"items": {
"type": "string"
}
},
"time_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"
]
}
}
},
"flags": {
"type": "object",
"additionalProperties": false,
"required": [
"has_multi_entity_scope",
"asks_for_chain_explanation",
"asks_for_ranking_or_top",
"asks_for_period_summary",
"asks_for_rule_check",
"asks_for_anomaly_scan",
"asks_for_exact_object_trace",
"asks_for_evidence",
"mentions_period_close_context"
],
"properties": {
"has_multi_entity_scope": {
"type": "boolean"
},
"asks_for_chain_explanation": {
"type": "boolean"
},
"asks_for_ranking_or_top": {
"type": "boolean"
},
"asks_for_period_summary": {
"type": "boolean"
},
"asks_for_rule_check": {
"type": "boolean"
},
"asks_for_anomaly_scan": {
"type": "boolean"
},
"asks_for_exact_object_trace": {
"type": "boolean"
},
"asks_for_evidence": {
"type": "boolean"
},
"mentions_period_close_context": {
"type": "boolean"
}
}
},
"candidate_labels": {
"type": "array",
"items": {
"type": "string",
"enum": [
"heavy_analytical",
"cross_entity",
"drilldown_explain",
"rule_based_account_control",
"anomaly_probe",
"period_close_risk",
"ambiguous_human_query",
"simple_factual"
]
}
},
"confidence": {
"type": "string",
"enum": [
"high",
"medium",
"low"
]
}
}
}
},
"discarded_fragments": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"raw_fragment_text",
"reason"
],
"properties": {
"raw_fragment_text": {
"type": "string",
"minLength": 1
},
"reason": {
"type": "string",
"minLength": 1
}
}
}
},
"global_notes": {
"type": "object",
"additionalProperties": false,
"required": [
"needs_clarification",
"clarification_reason"
],
"properties": {
"needs_clarification": {
"type": "boolean"
},
"clarification_reason": {
"type": [
"string",
"null"
]
}
}
}
}
},
"strict": true
},
"verbosity": "medium"
},
"tool_choice": "auto",
"tools": [],
"top_logprobs": 0,
"top_p": 1,
"truncation": "disabled",
"usage": {
"input_tokens": 2416,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 392,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 2808
},
"user": null,
"metadata": {}
},
"parsed_normalized_json": {
"schema_version": "normalized_query_v2",
"user_message_raw": "Есть ли такие зависшие авансы, которые уже давно надо было либо закрыть, либо хотя бы перепроверить руками?",
"message_in_scope": true,
"scope_confidence": "high",
"contains_multiple_tasks": false,
"fragments": [
{
"fragment_id": "F1",
"raw_fragment_text": "зависшие авансы, которые уже давно надо было либо закрыть, либо хотя бы перепроверить руками",
"normalized_fragment_text": "проверка зависших авансов на закрытие или перепроверку",
"domain_relevance": "in_scope",
"business_scope": "company_specific_accounting",
"entity_hints": [],
"account_hints": [
"51",
"60"
],
"document_hints": [],
"register_hints": [],
"time_scope": {
"type": "missing",
"value": null,
"confidence": "low"
},
"flags": {
"has_multi_entity_scope": false,
"asks_for_chain_explanation": false,
"asks_for_ranking_or_top": false,
"asks_for_period_summary": false,
"asks_for_rule_check": false,
"asks_for_anomaly_scan": true,
"asks_for_exact_object_trace": false,
"asks_for_evidence": false,
"mentions_period_close_context": false
},
"candidate_labels": [
"anomaly_probe"
],
"confidence": "medium"
}
],
"discarded_fragments": [],
"global_notes": {
"needs_clarification": true,
"clarification_reason": "не указаны конкретные сроки для проверки зависших авансов"
}
},
"validation_result": {
"passed": true,
"errors": []
},
"route_hint_summary": {
"mode": "deterministic_v2",
"message_in_scope": true,
"scope_confidence": "high",
"planner": {
"total_fragments": 1,
"in_scope_fragments": 1,
"out_of_scope_fragments": 0,
"discarded_fragments": 0,
"contains_multiple_tasks": false
},
"decisions": [
{
"fragment_id": "F1",
"domain_relevance": "in_scope",
"business_scope": "company_specific_accounting",
"candidate_labels": [
"anomaly_probe"
],
"decision_flags": {
"has_multi_entity_scope": false,
"asks_for_chain_explanation": false,
"asks_for_ranking_or_top": false,
"asks_for_period_summary": false,
"asks_for_rule_check": false,
"asks_for_anomaly_scan": true,
"asks_for_exact_object_trace": false,
"asks_for_evidence": false,
"mentions_period_close_context": false
},
"route": "store_feature_risk",
"reason": "Anomaly scan without heavy ranking or causal chain."
}
],
"fallback": {
"type": "clarification",
"message": "Могу проверить это в контуре компании, но нужно уточнить период, документ, счет или участок учета."
}
},
"route_hint": "store_feature_risk",
"confidence": "high",
"usage": {
"input_tokens": 2416,
"output_tokens": 392,
"total_tokens": 2808
},
"latency_ms": 14121,
"eval_label": "eval-aOEoelkQb2",
"eval_mode": "single-pass-strict",
"request_count_for_case": 1
}