From 44f1c1e11e48044975598b163b130eaa8612b468 Mon Sep 17 00:00:00 2001 From: dctouch Date: Fri, 17 Apr 2026 02:08:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=9E=D0=9C=D0=95=D0=9D=D0=AB=20-=20?= =?UTF-8?q?=D0=92=D0=9E=D0=9F=D0=A0=D0=9E=D0=A1=D0=AB=20-=20=D0=A1=D0=9A?= =?UTF-8?q?=D0=9B=D0=90=D0=94=20-=20=D0=A1=D0=B8=D1=81=D1=82=D0=B5=D0=BC?= =?UTF-8?q?=D0=B0=D1=82=D0=B8=D0=B7=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D1=8B=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D1=89=D0=B8=D0=BA=D1=83=20?= =?UTF-8?q?=D0=B1=D0=B5=D0=B7=20=D0=BF=D0=BE=D1=81=D1=82=D0=B0=D0=B2=D0=BE?= =?UTF-8?q?=D0=BA=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D0=B0=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D0=B7=20=D0=BE=D0=BF=D0=BB=D0=B0=D1=82=20=D0=B8=20?= =?UTF-8?q?=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- artifacts/tmp_backend_logs/backend_stderr.log | 2 + artifacts/tmp_backend_logs/backend_stdout.log | 41 + ...h_harness_targeted_counterparty_tails.json | 87 + .../dist/services/addressFilterExtractor.js | 57 +- .../dist/services/addressIntentResolver.js | 37 +- .../dist/services/addressNavigationState.js | 23 +- .../dist/services/addressQueryService.js | 504 +- .../dist/services/addressRecipeCatalog.js | 81 + .../services/address_runtime/composeStage.js | 161 +- .../address_runtime/decomposeStage.js | 70 +- .../services/address_runtime/resolveStage.js | 38 +- .../backend/dist/services/assistantService.js | 111 +- .../src/services/addressFilterExtractor.ts | 66 +- .../src/services/addressIntentResolver.ts | 52 +- .../src/services/addressNavigationState.ts | 36 +- .../src/services/addressQueryService.ts | 662 +- .../src/services/addressRecipeCatalog.ts | 102 + .../services/address_runtime/composeStage.ts | 188 +- .../address_runtime/decomposeStage.ts | 78 +- .../services/address_runtime/resolveStage.ts | 47 +- .../backend/src/services/assistantService.ts | 112 +- ...nterpartyItemFlowAndOpenItemsRoute.test.ts | 243 + ...fecycleOrganizationScopeRegression.test.ts | 40 +- .../addressFollowupTemporalRegression.test.ts | 56 + ...essInventorySaleTraceDocumentRoute.test.ts | 3 + .../tests/addressNavigationState.test.ts | 61 + .../tests/addressVatConfirmedRoute.test.ts | 8 +- .../assistantAddressFollowupContext.test.ts | 316 + ...assistantAddressLaneRuntimeAdapter.test.ts | 28 + .../data/autorun_generators/history.json | 55 + ...n_20260416182626_gen-mo1t93wq-jy0453e.json | 19089 ++++++++++++++++ ...s_20260416182626_gen-mo1t93wq-jy0453e.json | 117 + ..._saved_session_runtime_job-efdquR6lxo.json | 114 + 33 files changed, 22512 insertions(+), 173 deletions(-) create mode 100644 artifacts/tmp_backend_logs/backend_stderr.log create mode 100644 artifacts/tmp_backend_logs/backend_stdout.log create mode 100644 docs/orchestration/address_truth_harness_targeted_counterparty_tails.json create mode 100644 llm_normalizer/backend/tests/addressCounterpartyItemFlowAndOpenItemsRoute.test.ts create mode 100644 llm_normalizer/data/autorun_generators/saved_sessions/assistant_saved_session_20260416182626_gen-mo1t93wq-jy0453e.json create mode 100644 llm_normalizer/data/eval_cases/assistant_autogen_saved_user_sessions_20260416182626_gen-mo1t93wq-jy0453e.json create mode 100644 llm_normalizer/data/eval_cases/assistant_saved_session_runtime_job-efdquR6lxo.json diff --git a/artifacts/tmp_backend_logs/backend_stderr.log b/artifacts/tmp_backend_logs/backend_stderr.log new file mode 100644 index 0000000..44791ae --- /dev/null +++ b/artifacts/tmp_backend_logs/backend_stderr.log @@ -0,0 +1,2 @@ +[trace-completeness] trace_id=s94Q97I27ZGMIP schema=v1 issues=missing_parsed_normalized_json +[trace-completeness] trace_id=cbWexcMb4f6HXF schema=v1 issues=missing_parsed_normalized_json diff --git a/artifacts/tmp_backend_logs/backend_stdout.log b/artifacts/tmp_backend_logs/backend_stdout.log new file mode 100644 index 0000000..85a4443 --- /dev/null +++ b/artifacts/tmp_backend_logs/backend_stdout.log @@ -0,0 +1,41 @@ +{"timestamp":"2026-04-16T20:22:42.197Z","level":"info","service":"llm_normalizer_backend","message":"Backend started on http://localhost:8787"} +{"timestamp":"2026-04-16T20:23:11.956Z","level":"info","service":"assistant_loop","message":"assistant_address_tool_gate_skip","sessionId":"asst-tlR2M3uhVX","details":{"session_id":"asst-tlR2M3uhVX","user_message":"приветик - че как там дела","effective_address_user_message":"приветик - че как там дела","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_reason":"normalized_fragment_rejected_semantic_guard","address_fallback_rule_hit":null,"address_sanitized_user_message":"приветик - че как там дела","assistant_orchestration_contract_v1":{"schema_version":"assistant_orchestration_contract_v1","hard_meta_mode":"non_domain","address_mode":"unsupported","address_mode_confidence":"low","address_intent":"unknown","address_intent_confidence":"low","strong_data_signal_detected":false,"data_retrieval_signal_detected":false,"followup_context_detected":false,"unsupported_address_intent_fallback_to_deep":false,"final_decision":{"run_address_lane":false,"tool_gate_decision":"skip_address_lane","tool_gate_reason":"non_domain_query_indexed","living_mode":"chat","living_reason":"non_domain_query_indexed"}},"address_tool_gate_decision":"skip_address_lane","address_tool_gate_reason":"non_domain_query_indexed","address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"]}} +{"timestamp":"2026-04-16T20:23:13.980Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_chat","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-FACqSrjdcs","user_message":"приветик - че как там дела","living_router_mode":"chat","living_router_reason":"non_domain_query_indexed","assistant_reply":"Привет! 😊\nУ меня всё нормально — работаю, помогаю с 1С-данными, анализом и разбором вопросов. А у тебя как дела? Чем могу помочь сегодня? Всё по делу — без лишнего шума.","reply_type":"factual_with_explanation","trace_id":"chat-Ig_Pfgrm9V"}} +{"timestamp":"2026-04-16T20:23:28.514Z","level":"info","service":"assistant_loop","message":"assistant_address_tool_gate_skip","sessionId":"asst-tlR2M3uhVX","details":{"session_id":"asst-tlR2M3uhVX","user_message":"расскажи что можешь интересного","effective_address_user_message":"расскажи что можешь интересного","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_reason":"normalized_fragment_rejected_semantic_guard","address_fallback_rule_hit":null,"address_sanitized_user_message":"расскажи что можешь интересного","assistant_orchestration_contract_v1":{"schema_version":"assistant_orchestration_contract_v1","hard_meta_mode":"capability","address_mode":"unsupported","address_mode_confidence":"low","address_intent":"unknown","address_intent_confidence":"low","strong_data_signal_detected":false,"data_retrieval_signal_detected":false,"followup_context_detected":false,"unsupported_address_intent_fallback_to_deep":false,"final_decision":{"run_address_lane":false,"tool_gate_decision":"skip_address_lane","tool_gate_reason":"assistant_capability_query_detected","living_mode":"chat","living_reason":"assistant_capability_query_detected"}},"address_tool_gate_decision":"skip_address_lane","address_tool_gate_reason":"assistant_capability_query_detected","address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"]}} +{"timestamp":"2026-04-16T20:23:28.519Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_chat","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-42EMZkgIM1","user_message":"расскажи что можешь интересного","living_router_mode":"chat","living_router_reason":"assistant_capability_query_detected","assistant_reply":"Я ассистент по анализу данных 1С в режиме чтения.\nЧто умею по группам:\n1. НДС: Расчеты и аналитика по НДС на основании данных 1С. (например: vat_period_snapshot, vat_liability_confirmed_for_tax_period, vat_payable_confirmed_as_of_date).\n2. Контрагенты: Срезы активности, платежей и документов по контрагентам. (например: list_documents_by_counterparty, bank_operations_by_counterparty, list_contracts_by_counterparty).\n3. Задолженности и расчеты: Аналитика закрытия расчетов, сальдо и признаков незакрытых цепочек. (например: settlement_closure_state, advance_offset_state, open_items_snapshot).\n4. Деньги и остатки: Остатки и динамика по денежным счетам и кассе. (например: balance_snapshot, turnover_by_period).\n5. Товары и складские остатки: Подтвержденные срезы товарных остатков по складам и организациям на дату. (например: inventory_on_hand_as_of_date, inventory_positions_by_warehouse).\n6. Ограничения: Операции, которые ассистент не выполняет в этом рантайме. (например: explain_boundary, suggest_safe_next_step).\nЕсли хотите, раскрою любую группу точечно и дам готовую формулировку запроса.\nЧто не делаю: не настраиваю 1С, не меняю конфигурацию, не создаю и не провожу документы, не выполняю админ-действия на сервере.","reply_type":"factual_with_explanation","trace_id":"chat-vZZRSvIjhj"}} +{"timestamp":"2026-04-16T20:23:39.670Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-X1we_bddPr","user_message":"кайф - что там на складе по остаткам?","effective_address_user_message":"кайф - что там на складе по остаткам?","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"S1G8BmCNGVKnuP","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"кайф - что там на складе по остаткам?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"inventory_on_hand_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"inventory_on_hand_as_of_date","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"inventory_on_hand_as_of_date","extracted_filters":{"sort":"period_desc","warehouse":"по остаткам","as_of_date":"2026-04-16","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_on_hand_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"warehouse","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":11,"raw_rows_received":11,"rows_after_account_scope":11,"rows_after_recipe_filter":11,"rows_materialized":11,"rows_matched":11,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["as_of_date_defaulted_today","organization_grounded_from_observed_rows"],"assistant_reply":"На 16.04.2026 на складе подтверждено 11 позиций с остатком на 716.418,33 ₽.\n\nПозиции:\n1. Модуль прямоугольый 1400*110*750 | склад: Основной склад | количество: 22,000 | стоимость: 148.261,67 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n2. Конструкция трансформер рабочей станции 1300*900*2000 | склад: Основной склад | количество: 3,000 | стоимость: 498.472,50 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n3. Диван трехместный | склад: Основной склад | количество: 1,000 | стоимость: 34.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n4. Кресло орион | склад: Основной склад | количество: 1,000 | стоимость: 13.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n5. Зеркало для инвалидов поворотное травмобезопасное | склад: Основной склад | количество: 1,000 | стоимость: 7.250,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n6. Пуф арий | склад: Основной склад | количество: 1,000 | стоимость: 6.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n7. Столешница 600*3050*26 дуб ниагара | склад: Основной склад | количество: 1,000 | стоимость: 3.724,17 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n8. Столешница 600*3050*26 альмандин | склад: Основной склад | количество: 1,000 | стоимость: 3.075,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n9. Четки Пост (84*117) | склад: Основной склад | количество: 1,000 | стоимость: 833,33 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n10. Кромка с клеем 33 альмандин 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n11. Кромка с клеем 33 дуб ниагара 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n\nПодтверждение:\n- Дата среза: 16.04.2026.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 11.\n- Уникальных складов: 1.\n- Суммарное количество: 34,000.","reply_type":"factual","trace_id":"address-yk6CVVhDo_"}} +{"timestamp":"2026-04-16T20:23:51.314Z","level":"info","service":"assistant_loop","message":"assistant_address_tool_gate_skip","sessionId":"asst-tlR2M3uhVX","details":{"session_id":"asst-tlR2M3uhVX","user_message":"а исторические остатки на другие даты умеешь?","effective_address_user_message":"Проверка возможности получения исторических остатков по другим датам","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_reason":"normalized_fragment_applied","address_fallback_rule_hit":null,"address_sanitized_user_message":"а исторические остатки на другие даты умеешь?","assistant_orchestration_contract_v1":{"schema_version":"assistant_orchestration_contract_v1","hard_meta_mode":"capability","address_mode":"address_query","address_mode_confidence":"medium","address_intent":"unknown","address_intent_confidence":"low","strong_data_signal_detected":true,"data_retrieval_signal_detected":false,"followup_context_detected":true,"unsupported_address_intent_fallback_to_deep":false,"final_decision":{"run_address_lane":false,"tool_gate_decision":"skip_address_lane","tool_gate_reason":"inventory_history_capability_followup_detected","living_mode":"chat","living_reason":"inventory_history_capability_followup_detected"}},"address_tool_gate_decision":"skip_address_lane","address_tool_gate_reason":"inventory_history_capability_followup_detected","address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[]}} +{"timestamp":"2026-04-16T20:23:51.317Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_chat","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-2b5oUh5PsU","user_message":"а исторические остатки на другие даты умеешь?","living_router_mode":"chat","living_router_reason":"inventory_history_capability_followup_detected","assistant_reply":"Да, могу. Сейчас мы уже смотрели складской срез по компании «ООО \\Альтернатива Плюс\\» на 16.04.2026.\nМогу показать исторические остатки по компании «ООО \\Альтернатива Плюс\\» за нужный месяц, дату или год.\nНапример:\n- `на март 2020`\n- `на июнь 2016`\n- `за 2017 год`\n- `сравни июнь 2016 с текущим срезом`\nЕсли хочешь, сразу покажу нужный исторический период.","reply_type":"factual_with_explanation","trace_id":"chat-f8iAmrwRgu"}} +{"timestamp":"2026-04-16T20:24:03.036Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-rqe64vDlfI","user_message":"давай на июль 2017","effective_address_user_message":"давай на июль 2017","address_followup_context_applied":true,"address_followup_context_previous_intent":"inventory_on_hand_as_of_date","address_followup_context_previous_anchor":"Остатки на дату","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"NiOmdzrwbB-k0o","address_llm_predecompose_reason":"followup_raw_message_preferred_over_llm_rewrite","address_fallback_rule_hit":null,"address_sanitized_user_message":"давай на июль 2017","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"followup_context_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"inventory_on_hand_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"range","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":["unsupported_low_confidence_contract","rewrite_without_structured_gain"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"inventory_on_hand_as_of_date","extracted_filters":{"sort":"period_desc","period_from":"2017-07-01","period_to":"2017-07-31","as_of_date":"2017-07-31","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_on_hand_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":4,"raw_rows_received":4,"rows_after_account_scope":4,"rows_after_recipe_filter":4,"rows_materialized":4,"rows_matched":4,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["period_derived_from_month_phrase","as_of_date_derived_from_period_to","organization_from_followup_context"],"assistant_reply":"На 31.07.2017 на складе подтверждено 4 позиций с остатком на 1.048.998,35 ₽.\n\nПозиции:\n1. Секция отдельно-стоящая | склад: Основной склад | количество: 39,000 | стоимость: 224.349,15 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2017-07-31T23:59:59Z\n2. Шкаф для одежды 824*437*2010 | склад: Основной склад | количество: 11,000 | стоимость: 117.426,49 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2017-07-31T23:59:59Z\n3. Рабочая станция универсального специалиста (индивидуальное изготовление) | склад: Основной склад | количество: 3,000 | стоимость: 695.360,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2017-07-31T23:59:59Z\n4. Секция приставная для хранения документов из 2 модулей, Тип 4 | склад: Основной склад | количество: 2,000 | стоимость: 11.862,71 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2017-07-31T23:59:59Z\n\nПодтверждение:\n- Дата среза: 31.07.2017.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 4.\n- Уникальных складов: 1.\n- Суммарное количество: 55,000.","reply_type":"factual","trace_id":"address-Mzn4O6WC77"}} +{"timestamp":"2026-04-16T20:24:14.224Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-5QUSHInXpY","user_message":"март 2016","effective_address_user_message":"март 2016","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"B-RQtpqoUGhiVO","address_llm_predecompose_reason":"normalized_fragment_rejected_semantic_guard","address_fallback_rule_hit":null,"address_sanitized_user_message":"март 2016","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"followup_context_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"inventory_on_hand_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"range","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"inventory_on_hand_as_of_date","extracted_filters":{"sort":"period_desc","period_from":"2016-03-01","period_to":"2016-03-31","as_of_date":"2016-03-31","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_on_hand_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":2,"raw_rows_received":2,"rows_after_account_scope":2,"rows_after_recipe_filter":2,"rows_materialized":2,"rows_matched":2,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["period_derived_from_month_phrase","as_of_date_derived_from_period_to","organization_from_followup_context"],"assistant_reply":"На 31.03.2016 на складе подтверждено 2 позиций с остатком на 812.786,49 ₽.\n\nПозиции:\n1. Шкаф для одежды 824*437*2010 | склад: Основной склад | количество: 11,000 | стоимость: 117.426,49 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2016-03-31T23:59:59Z\n2. Рабочая станция универсального специалиста (индивидуальное изготовление) | склад: Основной склад | количество: 3,000 | стоимость: 695.360,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2016-03-31T23:59:59Z\n\nПодтверждение:\n- Дата среза: 31.03.2016.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 2.\n- Уникальных складов: 1.\n- Суммарное количество: 14,000.","reply_type":"factual","trace_id":"address-MBtVwhDr-h"}} +{"timestamp":"2026-04-16T20:24:26.428Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-75BIAjoy5M","user_message":"По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?","effective_address_user_message":"По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?","address_followup_context_applied":true,"address_followup_context_previous_intent":"inventory_on_hand_as_of_date","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"80inuIrB-oXoz2","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"по выбранному объекту \"рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"inventory_purchase_provenance_for_item","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"inventory_purchase_provenance_for_item","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"inventory_purchase_provenance_for_item","extracted_filters":{"sort":"period_desc","item":"Рабочая станция универсального специалиста (индивидуальное изготовление)","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_purchase_provenance_for_item_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"item","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":7,"raw_rows_received":7,"rows_after_account_scope":7,"rows_after_recipe_filter":7,"rows_materialized":7,"rows_matched":7,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_SUMMARY","limitations":["organization_from_followup_context"],"assistant_reply":"По позиции Рабочая станция универсального специалиста (индивидуальное изготовление) до 16.04.2026 однозначный поставщик не подтвержден: в документах встречаются Авант мебель, ООО; ПромЭлитКонсалт, ООО; ГТК-Интер, ООО.\n\nПодтверждение:\n- Первая найденная дата закупки: 05.02.2015.\n- Последняя найденная дата закупки: 22.07.2015.\n- Документов поступления: 7.\n- Операций поступления: 7.\n- Поставщики в найденных документах: Авант мебель, ООО; ПромЭлитКонсалт, ООО; ГТК-Интер, ООО.\n- Для ответа учтены закупочные документы не позже 16.04.2026.\n- Без партионного учета нельзя однозначно связать остаток на 16.04.2026 с одним конкретным поступлением.\n\nОпорные документы:\n1. Поступление товаров и услуг 00000000101 от 22.07.2015 12:00:02 | дата: 22.07.2015 | сумма: 695.360,00 ₽ | организация: ООО \\Альтернатива Плюс\\\n2. Поступление товаров и услуг 00000000047 от 24.02.2015 12:03:34 | дата: 24.02.2015 | сумма: 2.989.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: Авант мебель, ООО\n3. Поступление товаров и услуг 00000000025 от 24.02.2015 12:03:32 | дата: 24.02.2015 | сумма: 20.510.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: ПромЭлитКонсалт, ООО\n4. Поступление товаров и услуг 00000000024 от 17.02.2015 13:41:08 | дата: 17.02.2015 | сумма: 13.052.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: ПромЭлитКонсалт, ООО\n5. Поступление товаров и услуг 00000000045 от 06.02.2015 12:00:05 | дата: 06.02.2015 | сумма: 24.320.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: ГТК-Интер, ООО\n6. Поступление товаров и услуг 00000000028 от 05.02.2015 12:00:09 | дата: 05.02.2015 | сумма: 2.065.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\\n7. Поступление товаров и услуг 00000000023 от 05.02.2015 0:00:00 | дата: 05.02.2015 | сумма: 15.504.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: ГТК-Интер, ООО","reply_type":"factual","trace_id":"address-GR6MrqzFSG"}} +{"timestamp":"2026-04-16T20:24:40.363Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-B32-opUsmq","user_message":"а кому продали?","effective_address_user_message":"а кому продали?","address_followup_context_applied":true,"address_followup_context_previous_intent":"inventory_purchase_provenance_for_item","address_followup_context_previous_anchor":"Рабочая станция универсального специалиста (индивидуальное изготовление)","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"gUosC7cG1NYnFQ","address_llm_predecompose_reason":"followup_raw_message_preferred_over_llm_rewrite","address_fallback_rule_hit":null,"address_sanitized_user_message":"а кому продали?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_signal_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"inventory_purchase_provenance_for_item","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"inventory_sale_trace_for_item","extracted_filters":{"sort":"period_desc","organization":"ООО \\Альтернатива Плюс\\","item":"Рабочая станция универсального специалиста (индивидуальное изготовление)"},"selected_recipe":"address_inventory_sale_trace_for_item_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"item","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":7,"raw_rows_received":7,"rows_after_account_scope":7,"rows_after_recipe_filter":7,"rows_materialized":7,"rows_matched":7,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["organization_from_followup_context","item_from_followup_context"],"assistant_reply":"По товару Рабочая станция универсального специалиста (индивидуальное изготовление) покупатель в текущем exact-контуре не материализован.\n\nПодтверждение:\n- Первая найденная дата выбытия: 09.02.2015.\n- Последняя найденная дата выбытия: 14.08.2018.\n- Документов выбытия: 7.\n- Операций выбытия: 7.\n- Документы выбытия найдены, но покупатель не материализован отдельным полем в текущем exact-контуре.\n\nДокументы выбытия:\n1. Комплектация номенклатуры 00000000003 от 14.08.2018 12:00:02 | дата: 14.08.2018 | сумма: 695.360,00 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\\n2. Реализация товаров и услуг 00000000012 от 25.02.2015 12:00:00 | дата: 25.02.2015 | сумма: 9.957.203,39 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\\n3. Реализация товаров и услуг 00000000011 от 25.02.2015 11:59:34 | дата: 25.02.2015 | сумма: 9.957.203,39 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\\n4. Реализация товаров и услуг 00000000009 от 18.02.2015 12:48:00 | дата: 18.02.2015 | сумма: 11.061.016,95 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\\n5. Реализация товаров и услуг 00000000006 от 09.02.2015 12:00:42 | дата: 09.02.2015 | сумма: 13.235.665,07 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\\n6. Реализация товаров и услуг 00000000005 от 09.02.2015 12:00:34 | дата: 09.02.2015 | сумма: 9.342.822,40 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\\n7. Реализация товаров и услуг 00000000004 от 09.02.2015 12:00:14 | дата: 09.02.2015 | сумма: 13.235.665,07 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\","reply_type":"factual","trace_id":"address-ruko1S-ETc"}} +{"timestamp":"2026-04-16T20:25:00.244Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-Vt51of0tEV","user_message":"у тебя написано кто контрагент: рабочая станция - это ошибка?","effective_address_user_message":"Проверить, является ли 'рабочая станция' корректным значением для поля контрагент в документе","address_followup_context_applied":true,"address_followup_context_previous_intent":"inventory_sale_trace_for_item","address_followup_context_previous_anchor":"Рабочая станция универсального специалиста (индивидуальное изготовление)","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"g46iynYYG43JNU","address_llm_predecompose_reason":"normalized_fragment_applied","address_fallback_rule_hit":null,"address_sanitized_user_message":"у тебя написано кто контрагент: рабочая станция - это ошибка?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"list_documents_by_counterparty","address_retry_attempted":true,"address_retry_reason":"limited_result_retry_with_raw_message","address_retry_initial_limited_category":"missing_anchor","address_retry_result_category":null,"address_llm_predecompose_contract_intent":"list_documents_by_counterparty","address_llm_predecompose_contract_aggregation_profile":"list_lookup","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"VERIFY_FACTUAL","detected_intent":"list_documents_by_counterparty","extracted_filters":{"sort":"period_desc","limit":20,"counterparty":"в документе","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_documents_by_counterparty_v1","mcp_call_status_legacy":"materialized_but_not_matched","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"counterparty","resolver_confidence":"medium","match_failure_stage":"materialized_but_not_anchor_matched","match_failure_reason":"counterparty_anchor_not_matched_in_materialized_rows","mcp_call_status":"materialized_but_not_anchor_matched","rows_fetched":1000,"raw_rows_received":1000,"rows_after_account_scope":124,"rows_after_recipe_filter":0,"rows_materialized":124,"rows_matched":0,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":"missing_anchor","response_type":"LIMITED_WITH_REASON","limitations":["counterparty_anchor_not_matched_after_materialization"],"assistant_reply":"Чтобы ответ был точным, нужно чуть сильнее заякорить запрос.\n\nДля точного ответа нужен хотя бы один явный ориентир: контрагент, договор, счет или период.\n\nСигнал запроса: нужен срез документов/платежей по контрагенту.\n\nКонтекст запроса: организация ООО \\Альтернатива Плюс\\.\n\nЧто могу сделать сейчас: показать документы и платежи по контрагенту в документе; показать незакрытые договоры или хвосты на дату; уточните точное имя контрагента или добавьте ИНН.","reply_type":"partial_coverage","trace_id":"address-X-t7azK6cy"}} +{"timestamp":"2026-04-16T20:25:15.323Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-HjThCk7VYs","user_message":"ндс можешь прикинуть на дату покупки рабочей станции?","effective_address_user_message":"ндс можешь прикинуть на дату покупки рабочей станции?","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"q3qwahEvDMZ_fz","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_conflict","address_fallback_rule_hit":null,"address_sanitized_user_message":"ндс можешь прикинуть на дату покупки рабочей станции?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_intent_resolver_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"vat_payable_forecast","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"vat_payable_forecast","address_llm_predecompose_contract_aggregation_profile":"management_profile","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"vat_payable_forecast","extracted_filters":{"sort":"period_desc","period_to":"2026-04-16","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_vat_payable_forecast_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":4,"raw_rows_received":4,"rows_after_account_scope":4,"rows_after_recipe_filter":4,"rows_materialized":4,"rows_matched":4,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_SUMMARY","limitations":["period_to_defaulted_today_for_management_profile","organization_from_followup_context"],"assistant_reply":"Собран прогноз НДС к уплате: **0,00** ₽.\nПотенциальный перенос/переплата: **27.863,80** ₽.\nПериод оценки: не задан (использован доступный срез).\nРежим результата: предварительная оценка по проводкам 68.02*/19* (не подтвержденная сумма налога по декларации).\n\nБаза расчета:\n- Строк агрегата: **4**.\n- Оборот по кредиту 68*: **49.572.522,94** ₽.\n- Оборот по дебету 68*: **49.600.386,74** ₽.\n- Нетто НДС (**68** Кт - **68** Дт): -**27.863,80** ₽.\n- Справочно по 19*: дебет **44.507.658,46** ₽, кредит **44.506.925,13** ₽.\nВ выбранном окне дебет 68* превышает кредит 68*; сумма показана как перенос/переплата, к уплате **0,00** ₽.\n\nЧеклист проверки в 1С (почему к уплате **0**):\n1) Проверьте ОСВ/анализ счета по **68.02** и **19** за окно расчета.\n2) Проверьте наличие движений в РегистрБухгалтерии.Хозрасчетный по счетам 68.02*/19* (включая субсчета).\n3) Сверьте счета-фактуры, корректировки и момент принятия НДС к вычету (не попали ли в другой период).\n4) Сверьте книгу продаж/покупок и операции Помощника по учету НДС за тот же период.\n5) Убедитесь, что документы проведены, период закрыт корректно и нет неподтвержденных/неперепроведенных документов.","reply_type":"factual","trace_id":"address-_dIwiR6OUP"}} +{"timestamp":"2026-04-16T20:25:39.614Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-LLi56B9gqx","user_message":"а какой ндс мы должны сгрузить на март 2020?","effective_address_user_message":"Какой НДС необходимо сгрузить в марте 2020 года?","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"S0yv_gh2B5H4dk","address_llm_predecompose_reason":"normalized_fragment_applied","address_fallback_rule_hit":null,"address_sanitized_user_message":"а какой ндс мы должны сгрузить на март 2020?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_intent_resolver_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"vat_payable_confirmed_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"vat_payable_confirmed_as_of_date","address_llm_predecompose_contract_aggregation_profile":"balance_snapshot","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"vat_payable_confirmed_as_of_date","extracted_filters":{"sort":"period_desc","limit":20,"period_from":"2020-03-01","period_to":"2020-03-31","as_of_date":"2020-03-31","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_vat_payable_confirmed_as_of_date_v1","mcp_call_status_legacy":"no_raw_rows","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"no_raw_rows","rows_fetched":0,"raw_rows_received":0,"rows_after_account_scope":0,"rows_after_recipe_filter":0,"rows_materialized":0,"rows_matched":0,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["period_derived_from_month_phrase","as_of_date_derived_from_period_to","organization_from_followup_context"],"assistant_reply":"Итого подтвержденный НДС к уплате на 31.03.2020: **0,00** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез НДС к уплате по состоянию на дату.\n\nБлок **2**. Что учтено\n- Дата среза: 31.03.2020.\n- Контур: остатки по счетам НДС к уплате (68*).\n\nБлок **2.1**. MCP-проверка VAT-источников\n- VAT-объектов в метаданных 1С: **11** (документы: **0**, регистры: **11**).\n- Пробных прямых источников проверено: **4**.\n- Источников с движениями до даты среза: **4**.\n1. РегистрНакопления.НДСЗаписиКнигиПродаж (НДС Продажи) | есть движения | последнее движение: 2019-12-31T23:59:59Z | пример: Формирование записей книги продаж **00000000004** от 31.12.2019 23:59:59\n2. РегистрНакопления.НДСЗаписиКнигиПокупок (НДС Покупки) | есть движения | последнее движение: 2019-12-31T23:59:59Z | пример: Счет-фактура полученный **00000000078** от 31.12.2019 23:59:59\n3. РегистрНакопления.НДСПредъявленный (НДС предъявленный) | есть движения | последнее движение: 2020-03-31T12:00:02Z | пример: Поступление товаров и услуг **00000000003** от 31.03.2020 12:00:02\n4. РегистрНакопления.НДСВключенныйВСтоимость (НДС, включенный в стоимость) | есть движения | последнее движение: 2020-02-25T12:00:02Z | пример: Поступление товаров и услуг **00000000009** от 25.02.2020 12:00:02\n\nБлок **3**. Сводка\n- Строк в выборке: **0**.\n- Подтвержденных позиций по НДС: **0**.\n\nБлок **4**. Подтвержденные позиции\n- Подтвержденный остаток НДС к уплате на дату среза не найден.","reply_type":"factual","trace_id":"address-lxkWC18x-6"}} +{"timestamp":"2026-04-16T20:25:52.795Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-PRX99vRbcx","user_message":"прикинь какой ндс нам надо заплатить на февраль 2017","effective_address_user_message":"прикинь какой ндс нам надо заплатить на февраль 2017","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"kPinwF1-2GaBko","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"прикинь какой ндс нам надо заплатить на февраль 2017","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_intent_resolver_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"vat_payable_forecast","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"vat_payable_forecast","address_llm_predecompose_contract_aggregation_profile":"management_profile","address_llm_predecompose_contract_period_scope":"range","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"vat_payable_forecast","extracted_filters":{"sort":"period_desc","period_from":"2017-02-01","period_to":"2017-02-28","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_vat_payable_forecast_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":4,"raw_rows_received":4,"rows_after_account_scope":4,"rows_after_recipe_filter":4,"rows_materialized":4,"rows_matched":4,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_SUMMARY","limitations":["period_derived_from_month_phrase","organization_from_followup_context"],"assistant_reply":"Собран прогноз НДС к уплате: **0,00** ₽.\nПотенциальный перенос/переплата: **85.834,00** ₽.\nПериод оценки: 01.02.2017..28.02.2017.\nРежим результата: предварительная оценка по проводкам 68.02*/19* (не подтвержденная сумма налога по декларации).\n\nБаза расчета:\n- Строк агрегата: **4**.\n- Оборот по кредиту 68*: **0,00** ₽.\n- Оборот по дебету 68*: **85.834,00** ₽.\n- Нетто НДС (**68** Кт - **68** Дт): -**85.834,00** ₽.\n- Справочно по 19*: дебет **0,00** ₽, кредит **0,00** ₽.\nВ выбранном окне дебет 68* превышает кредит 68*; сумма показана как перенос/переплата, к уплате **0,00** ₽.\n\nЧеклист проверки в 1С (почему к уплате **0**):\n1) Проверьте ОСВ/анализ счета по **68.02** и **19** за окно 01.02.2017..28.02.2017.\n2) Проверьте наличие движений в РегистрБухгалтерии.Хозрасчетный по счетам 68.02*/19* (включая субсчета).\n3) Сверьте счета-фактуры, корректировки и момент принятия НДС к вычету (не попали ли в другой период).\n4) Сверьте книгу продаж/покупок и операции Помощника по учету НДС за тот же период.\n5) Убедитесь, что документы проведены, период закрыт корректно и нет неподтвержденных/неперепроведенных документов.","reply_type":"factual","trace_id":"address-11CmwowIMK"}} +{"timestamp":"2026-04-16T20:26:07.056Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-uWCqlgUY7z","user_message":"кто у нас самый доходный клиент за все время","effective_address_user_message":"кто у нас самый доходный клиент за все время","address_followup_context_applied":true,"address_followup_context_previous_intent":"vat_payable_forecast","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"jpqR3q0zrHo5If","address_llm_predecompose_reason":"normalized_fragment_applied","address_fallback_rule_hit":null,"address_sanitized_user_message":"кто у нас самый доходный клиент за все время","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_intent_resolver_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"customer_revenue_and_payments","address_retry_attempted":true,"address_retry_reason":"limited_result_retry_with_raw_message","address_retry_initial_limited_category":"missing_anchor","address_retry_result_category":null,"address_llm_predecompose_contract_intent":"customer_revenue_and_payments","address_llm_predecompose_contract_aggregation_profile":"management_profile","address_llm_predecompose_contract_period_scope":"all_time","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"customer_revenue_and_payments","extracted_filters":{"sort":"period_desc","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_customer_revenue_and_payments_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":20,"raw_rows_received":20,"rows_after_account_scope":20,"rows_after_recipe_filter":20,"rows_materialized":20,"rows_matched":20,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["period_to_defaulted_today_for_management_profile","counterparty_anchor_dropped_low_quality","organization_from_followup_context","period_cleared_by_all_time_followup"],"assistant_reply":"Топ-5 заказчиков по сумме поступлений:\nСобран профиль поступлений от заказчиков (bank-doc value aggregate).\nСтрок источника: 20.\nУникальных контрагентов: 5.\n1. Группа | сумма: 12224925 | операций: 16 | средний чек: 764057.81 | макс: 3248300\n2. НОРТОН | сумма: 2254115 | операций: 1 | средний чек: 2254115.00 | макс: 2254115\n3. МНН | сумма: 1699940 | операций: 1 | средний чек: 1699940.00 | макс: 1699940\n4. СервисКонсалт, ООО | сумма: 1200000 | операций: 1 | средний чек: 1200000.00 | макс: 1200000\n5. Чепурнов П.Д. | сумма: 890660 | операций: 1 | средний чек: 890660.00 | макс: 890660","reply_type":"factual","trace_id":"address-0bRw6dgaL1"}} +{"timestamp":"2026-04-16T20:26:19.226Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-WCYzv65ypb","user_message":"кто нам должен денег на май 2017","effective_address_user_message":"кто нам должен денег на май 2017","address_followup_context_applied":true,"address_followup_context_previous_intent":"customer_revenue_and_payments","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"cY9v7Hada-foGR","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"кто нам должен денег на май 2017","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"receivables_confirmed_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"receivables_confirmed_as_of_date","address_llm_predecompose_contract_aggregation_profile":"balance_snapshot","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"receivables_confirmed_as_of_date","extracted_filters":{"sort":"period_desc","limit":20,"period_from":"2017-05-01","period_to":"2017-05-31","as_of_date":"2017-05-31","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_receivables_confirmed_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":18,"raw_rows_received":18,"rows_after_account_scope":18,"rows_after_recipe_filter":18,"rows_materialized":18,"rows_matched":18,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["period_derived_from_month_phrase","as_of_date_derived_from_period_to","organization_from_followup_context"],"assistant_reply":"Итого подтвержденная дебиторская задолженность на 31.05.2017: **3.859.710,06** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез дебиторской задолженности.\n\nБлок **2**. Что учтено\n- Дата среза: 31.05.2017.\n- Контур: дебиторская задолженность по счетам 62/76.\n- В срез могут входить задолженности, возникшие до периода, если они оставались открытыми на дату среза.\n\nБлок **3**. Сводка\n- Строк в выборке: **18**.\n- Контрагентов с подтвержденным остатком к получению: **4**.\n\nБлок **4**. Категории дебиторской задолженности\n- покупатели/заказчики: **2**.\n- банки/финансовые: **1**.\n- бюджет/госорганы: **1**.\n- прочие: **0**.\n\nБлок **5**. Подтвержденные позиции к получению\n1. Комитет государственных услуг г. Москвы | категория: бюджет/госорганы | остаток к получению: **3.677.454,14** ₽ | операций: **14** | последнее движение: 2017-05-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки; Списание с расчетного счета **00000000015** от 27.01.2015 12:00:03\n\n2. Финансовое обеспечение заявки | категория: банки/финансовые | остаток к получению: **154.264,12** ₽ | операций: **2** | последнее движение: 2017-05-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Списание с расчетного счета **00000000253** от 29.10.2015 12:00:00\n\n3. ГКУ | категория: покупатели/заказчики | остаток к получению: **24.991,80** ₽ | операций: **1** | последнее движение: 2017-05-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ГКУ | документ: Остатки на дату | source refs: Финансовое обеспечение контракта; Списание с расчетного счета **00000000243** от 11.11.2016 11:54:48\n\n4. СервисКонсалт, ООО | категория: покупатели/заказчики | остаток к получению: **3.000,00** ₽ | операций: **1** | последнее движение: 2017-05-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: бух.обслуж-е 02/01УС от 09.01.17 | документ: Остатки на дату | source refs: Списание с расчетного счета **00000000073** от 16.05.2017 12:00:02","reply_type":"factual","trace_id":"address-Cwa_3f9lGQ"}} +{"timestamp":"2026-04-16T20:26:42.592Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-iMY2z6DoQR","user_message":"а какой ндс мы должны примерно заплатить за этот период?","effective_address_user_message":"а какой ндс мы должны примерно заплатить за этот период?","address_followup_context_applied":true,"address_followup_context_previous_intent":"receivables_confirmed_as_of_date","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"wp7IlrSgrZwBiZ","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"а какой ндс мы должны примерно заплатить за этот период?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"vat_payable_confirmed_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"vat_payable_confirmed_as_of_date","address_llm_predecompose_contract_aggregation_profile":"balance_snapshot","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"vat_payable_confirmed_as_of_date","extracted_filters":{"sort":"period_desc","limit":20,"as_of_date":"2017-05-31","organization":"ООО \\Альтернатива Плюс\\","period_from":"2017-05-01","period_to":"2017-05-31"},"selected_recipe":"address_vat_payable_confirmed_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":1,"raw_rows_received":1,"rows_after_account_scope":1,"rows_after_recipe_filter":1,"rows_materialized":1,"rows_matched":1,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["as_of_date_defaulted_today","organization_from_followup_context","period_from_from_followup_context","period_to_from_followup_context","as_of_date_from_followup_context"],"assistant_reply":"Итого подтвержденный НДС к уплате на 31.05.2017: **6.465,59** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез НДС к уплате по состоянию на дату.\n\nБлок **2**. Что учтено\n- Дата среза: 31.05.2017.\n- Контур: остатки по счетам НДС к уплате (68*).\n\nБлок **2.1**. MCP-проверка VAT-источников\n- VAT-объектов в метаданных 1С: **11** (документы: **0**, регистры: **11**).\n- Пробных прямых источников проверено: **4**.\n- Источников с движениями до даты среза: **4**.\n1. РегистрНакопления.НДСЗаписиКнигиПродаж (НДС Продажи) | есть движения | последнее движение: 2017-04-10T16:50:39Z | пример: Реализация товаров и услуг **00000000005** от 10.04.2017 16:50:39\n2. РегистрНакопления.НДСЗаписиКнигиПокупок (НДС Покупки) | есть движения | последнее движение: 2017-04-28T00:00:00Z | пример: Счет-фактура полученный **00000000005** от 28.04.2017 0:00:00\n3. РегистрНакопления.НДСПредъявленный (НДС предъявленный) | есть движения | последнее движение: 2017-05-31T12:00:01Z | пример: Поступление товаров и услуг **00000000020** от 31.05.2017 12:00:01\n4. РегистрНакопления.НДСВключенныйВСтоимость (НДС, включенный в стоимость) | есть движения | последнее движение: 2016-11-22T12:00:01Z | пример: Поступление товаров и услуг **00000000071** от 22.11.2016 12:00:01\n\nБлок **3**. Сводка\n- Строк в выборке: **1**.\n- Подтвержденных позиций по НДС: **1**.\n\nБлок **4**. Подтвержденные позиции\n1. **68.02** | остаток НДС к уплате: **6.465,59** ₽ | операций: **1** | последнее движение: 2017-05-31T23:59:59Z | source refs: Остатки на дату","reply_type":"factual","trace_id":"address-jy8eEIhWUp"}} +{"timestamp":"2026-04-16T20:26:54.820Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-szWKNIQ_TY","user_message":"мы должны комуто денег на сегодня?","effective_address_user_message":"мы должны комуто денег на сегодня?","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"KOjK5bcL7pw4vK","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_conflict","address_fallback_rule_hit":null,"address_sanitized_user_message":"мы должны комуто денег на сегодня?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"payables_confirmed_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"payables_confirmed_as_of_date","address_llm_predecompose_contract_aggregation_profile":"balance_snapshot","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"payables_confirmed_as_of_date","extracted_filters":{"sort":"period_desc","limit":20,"as_of_date":"2026-04-16","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_payables_confirmed_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":10,"raw_rows_received":10,"rows_after_account_scope":10,"rows_after_recipe_filter":10,"rows_materialized":10,"rows_matched":10,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["as_of_date_defaulted_today","organization_from_followup_context"],"assistant_reply":"Итого подтвержденный долг на 16.04.2026: **4.584.066,11** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез обязательств к оплате.\n\nБлок **2**. Что учтено\n- Дата среза: 16.04.2026.\n- Контур: обязательства по счетам 60/76.\n- В срез могут входить обязательства, возникшие до периода, если они оставались открытыми на дату среза.\n\nБлок **3**. Сводка\n- Строк в выборке: **10**.\n- Контрагентов с подтвержденным остатком к оплате: **7**.\n\nБлок **4**. Категории обязательств\n- поставщики/подрядчики: **5**.\n- банки/кредиты: **0**.\n- налоги/госорганы: **2**.\n- прочие: **0**.\n\nБлок **5**. Подтвержденные позиции к оплате\n1. Комитет государственных услуг г. Москвы | категория: налоги/госорганы | остаток: **3.677.454,14** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки\n\n2. ГКУ | категория: поставщики/подрядчики | остаток: **773.953,04** ₽ | операций: **2** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ГКУ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки; Финансовое обеспечение контракта\n\n3. Финансовое обеспечение заявки | категория: налоги/госорганы | остаток: **115.185,00** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату\n\n4. Авант мебель, ООО | категория: поставщики/подрядчики | остаток: **7.271,20** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **60**, коммерческий контрагент в аналитике | договор: Договор АМ-2/15 от 22.01.15 | документ: Остатки на дату | source refs: Поступление товаров и услуг **00000000047** от 24.02.2015 12:03:34\n\n5. Держава АКБ, ПАО | категория: поставщики/подрядчики | остаток: **6.200,00** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: Договор № БГ 155822/2017 от 08.11.17 заявка **145822** | документ: Остатки на дату | source refs: Поступление товаров и услуг **00000000036** от 14.11.2017 0:00:00\n\n6. Скартел, ООО | категория: поставщики/подрядчики | остаток: **3.173,23** ₽ | операций: **3** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Лицевой счет абонента № **1025043208**; Поступление товаров и услуг **00000000009** от 31.08.2022 12:00:00\n\n7. КОМПАНИЯ СИМПЛ, ООО | категория: поставщики/подрядчики | остаток: **829,50** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **60**, коммерческий контрагент в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: счет № SL11119332716 от 06.11.2019; Поступление товаров и услуг **00000000116** от 08.11.2019 12:00:02","reply_type":"factual","trace_id":"address-L-uJmm4ren"}} +{"timestamp":"2026-04-16T20:27:09.094Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-2NbJne_nB8","user_message":"а нам?","effective_address_user_message":"а нам?","address_followup_context_applied":true,"address_followup_context_previous_intent":"receivables_confirmed_as_of_date","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"supPatXcy7hxfa","address_llm_predecompose_reason":"followup_raw_message_preferred_over_llm_rewrite","address_fallback_rule_hit":null,"address_sanitized_user_message":"а нам?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_signal_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"receivables_confirmed_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":["unsupported_low_confidence_contract","rewrite_without_structured_gain"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"receivables_confirmed_as_of_date","extracted_filters":{"sort":"period_desc","limit":20,"as_of_date":"2026-04-16","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_receivables_confirmed_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":22,"raw_rows_received":22,"rows_after_account_scope":22,"rows_after_recipe_filter":22,"rows_materialized":22,"rows_matched":22,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["as_of_date_defaulted_today","organization_from_followup_context"],"assistant_reply":"Итого подтвержденная дебиторская задолженность на 16.04.2026: **14.204.897,08** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез дебиторской задолженности.\n\nБлок **2**. Что учтено\n- Дата среза: 16.04.2026.\n- Контур: дебиторская задолженность по счетам 62/76.\n- В срез могут входить задолженности, возникшие до периода, если они оставались открытыми на дату среза.\n\nБлок **3**. Сводка\n- Строк в выборке: **22**.\n- Контрагентов с подтвержденным остатком к получению: **6**.\n\nБлок **4**. Категории дебиторской задолженности\n- покупатели/заказчики: **3**.\n- банки/финансовые: **0**.\n- бюджет/госорганы: **3**.\n- прочие: **0**.\n\nБлок **5**. Подтвержденные позиции к получению\n1. Департамент капитального ремонта города Москвы. | категория: бюджет/госорганы | остаток к получению: **9.612.904,90** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: налог/госорган в аналитике | договор: ГК № 20ГК-ДКР/**19** от 13.05.2019 | документ: Остатки на дату | source refs: Списание с расчетного счета **00000000102** от 20.03.2020 12:00:00\n\n2. Комитет государственных услуг г. Москвы | категория: бюджет/госорганы | остаток к получению: **3.677.454,14** ₽ | операций: **14** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки; Списание с расчетного счета **00000000015** от 27.01.2015 12:00:03\n\n3. ГКУ | категория: покупатели/заказчики | остаток к получению: **773.953,04** ₽ | операций: **4** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ГКУ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки; Списание с расчетного счета **00000000099** от 26.06.2017 12:00:02\n\n4. Финансовое обеспечение заявки | категория: бюджет/госорганы | остаток к получению: **115.185,00** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Списание с расчетного счета **00000000253** от 29.10.2015 12:00:00\n\n5. Савва Офис Сервис | категория: покупатели/заказчики | остаток к получению: **19.200,00** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: договор **1** от 18.12.2018 | документ: Остатки на дату\n\n6. Держава АКБ, ПАО | категория: покупатели/заказчики | остаток к получению: **6.200,00** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: Договор № БГ 155822/2017 от 08.11.17 заявка **145822** | документ: Остатки на дату","reply_type":"factual","trace_id":"address-VbhXlmlkSz"}} +{"timestamp":"2026-04-16T20:27:21.272Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-x3Iyz8po3s","user_message":"какой у нас самый доходный год","effective_address_user_message":"какой у нас самый доходный год","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"sCT0i5LXfB8aF6","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"какой у нас самый доходный год","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"customer_revenue_and_payments","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"customer_revenue_and_payments","address_llm_predecompose_contract_aggregation_profile":"management_profile","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"customer_revenue_and_payments","extracted_filters":{"sort":"period_desc","period_to":"2026-04-16","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_customer_revenue_and_payments_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":20,"raw_rows_received":20,"rows_after_account_scope":20,"rows_after_recipe_filter":20,"rows_materialized":20,"rows_matched":20,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["period_to_defaulted_today_for_management_profile","organization_from_followup_context"],"assistant_reply":"Топ-3 лет по сумме поступлений:\nСобран профиль поступлений от заказчиков (bank-doc value aggregate).\nСтрок источника: 20.\nУникальных контрагентов: 5.\n1. 2021 | сумма: 8560025 | операций: 13 | контрагентов: 1 | макс: 1882400\n2. 2022 | сумма: 6044715 | операций: 4 | контрагентов: 4 | макс: 2254115\n3. 2020 | сумма: 3664900 | операций: 3 | контрагентов: 1 | макс: 3248300","reply_type":"factual","trace_id":"address-K44ysCu82Z"}} +{"timestamp":"2026-04-16T20:27:33.394Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-MmyLgif-gV","user_message":"а за 2017 мы скок заработали?","effective_address_user_message":"а за 2017 мы скок заработали?","address_followup_context_applied":true,"address_followup_context_previous_intent":"customer_revenue_and_payments","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"4qzeqwiVuU4Jem","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"а за 2017 мы скок заработали?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_intent_resolver_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"customer_revenue_and_payments","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"customer_revenue_and_payments","address_llm_predecompose_contract_aggregation_profile":"management_profile","address_llm_predecompose_contract_period_scope":"year","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"customer_revenue_and_payments","extracted_filters":{"sort":"period_desc","period_from":"2017-01-01","period_to":"2017-12-31","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_customer_revenue_and_payments_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":20,"raw_rows_received":20,"rows_after_account_scope":20,"rows_after_recipe_filter":20,"rows_materialized":20,"rows_matched":20,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_SUMMARY","limitations":["period_derived_from_year_phrase","organization_from_followup_context"],"assistant_reply":"За период 01.01.2017..31.12.2017 подтверждено 12.037.218,70 ₽ входящих поступлений. Это сумма денег, полученных от клиентов, а не чистая прибыль.\n\nПодтверждение:\n- Операций в выборке: 20.\n- Контрагентов в выборке: 6.\n- Самый сильный год по поступлениям: 2017 (12.037.218,70 ₽).\n- Крупнейший контрагент по потоку: ГКУ (11.158.349,58 ₽).","reply_type":"factual","trace_id":"address-NAMAenJzUa"}} +{"timestamp":"2026-04-16T20:27:44.620Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-PGF_SqWBqH","user_message":"сколько вообще денег мы заработали за все время?","effective_address_user_message":"сколько вообще денег мы заработали за все время?","address_followup_context_applied":true,"address_followup_context_previous_intent":"customer_revenue_and_payments","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"_h8ydtz2-lMM54","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"сколько вообще денег мы заработали за все время?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_intent_resolver_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"customer_revenue_and_payments","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"customer_revenue_and_payments","address_llm_predecompose_contract_aggregation_profile":"management_profile","address_llm_predecompose_contract_period_scope":"all_time","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"customer_revenue_and_payments","extracted_filters":{"sort":"period_desc","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_customer_revenue_and_payments_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":20,"raw_rows_received":20,"rows_after_account_scope":20,"rows_after_recipe_filter":20,"rows_materialized":20,"rows_matched":20,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_SUMMARY","limitations":["period_to_defaulted_today_for_management_profile","organization_from_followup_context","period_cleared_by_all_time_followup"],"assistant_reply":"За все доступное время подтверждено 18.269.640,00 ₽ входящих поступлений. Это сумма денег, полученных от клиентов, а не чистая прибыль.\n\nПодтверждение:\n- Операций в выборке: 20.\n- Контрагентов в выборке: 5.\n- Самый сильный год по поступлениям: 2021 (8.560.025,00 ₽).\n- Крупнейший контрагент по потоку: Группа (12.224.925,00 ₽).","reply_type":"factual","trace_id":"address-YMbHomsLjW"}} +{"timestamp":"2026-04-16T20:27:57.024Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-GqUv_A9c-A","user_message":"ты умеешь считать дельту по договорам?","effective_address_user_message":"проверить возможность расчета дельты по договорам","address_followup_context_applied":true,"address_followup_context_previous_intent":"customer_revenue_and_payments","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"v6BCEk7_nB6CKp","address_llm_predecompose_reason":"normalized_fragment_semantic_guard_raw_fragment_preferred","address_fallback_rule_hit":null,"address_sanitized_user_message":"ты умеешь считать дельту по договорам?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"list_documents_by_contract","address_retry_attempted":true,"address_retry_reason":"limited_result_retry_with_raw_message","address_retry_initial_limited_category":"missing_anchor","address_retry_result_category":"missing_anchor","address_llm_predecompose_contract_intent":"list_documents_by_contract","address_llm_predecompose_contract_aggregation_profile":"list_lookup","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["required_anchor_missing_for_intent"],"detected_mode":"address_query","query_shape":"VERIFY_FACTUAL","detected_intent":"list_documents_by_contract","extracted_filters":{"sort":"period_desc","limit":20,"organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_documents_by_contract_v1","mcp_call_status_legacy":"skipped","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"skipped","rows_fetched":0,"raw_rows_received":0,"rows_after_account_scope":0,"rows_after_recipe_filter":0,"rows_materialized":0,"rows_matched":0,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":"missing_anchor","response_type":"LIMITED_WITH_REASON","limitations":["missing_required_filters"],"assistant_reply":"Чтобы ответ был точным, нужно чуть сильнее заякорить запрос.\n\nДля точного ответа нужен хотя бы один явный ориентир: договор.\n\nСигнал запроса: нужен срез документов/платежей по договору.\n\nКонтекст запроса: организация ООО \\Альтернатива Плюс\\.\n\nЧто могу сделать сейчас: уточнить ориентир: договор; показать документы/платежи по контрагенту или договору; показать незакрытые договоры или хвосты на дату.","reply_type":"partial_coverage","trace_id":"address-n5KuuGhGkF"}} +{"timestamp":"2026-04-16T20:28:11.282Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-UaF0fGlO_k","user_message":"по чепурнову покажи все доки","effective_address_user_message":"показать все документы по контрагенту Чепурнов","address_followup_context_applied":true,"address_followup_context_previous_intent":"list_documents_by_contract","address_followup_context_previous_anchor":"ООО \\Альтернатива Плюс\\","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"F-rm19hds1M1q8","address_llm_predecompose_reason":"normalized_fragment_applied","address_fallback_rule_hit":null,"address_sanitized_user_message":"по чепурнову покажи все доки","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"list_documents_by_counterparty","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"list_documents_by_counterparty","address_llm_predecompose_contract_aggregation_profile":"list_lookup","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"DOCUMENT_LIST","detected_intent":"list_documents_by_counterparty","extracted_filters":{"sort":"period_desc","limit":20,"counterparty":"Чепурнов","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_documents_by_counterparty_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"counterparty","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":1000,"raw_rows_received":1000,"rows_after_account_scope":124,"rows_after_recipe_filter":1,"rows_materialized":124,"rows_matched":1,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["counterparty_from_llm_semantics","organization_from_followup_context","counterparty_anchor_resolved_via_catalog_lookup"],"assistant_reply":"Найдено документов по контрагенту: 1.\n1. 2022-01-20T12:00:03Z | Поступление на расчетный счет 00000000001 от 20.01.2022 12:00:03 | 0 / 0 | 890660 | аналитика: Чепурнов П.Д.; Договор № 11/1 от 25.11.2020 г.","reply_type":"factual","trace_id":"address-pRwoUjAJQh"}} +{"timestamp":"2026-04-16T20:28:26.556Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-rgHzmqLwN1","user_message":"а по свк","effective_address_user_message":"а по свк","address_followup_context_applied":true,"address_followup_context_previous_intent":"list_documents_by_counterparty","address_followup_context_previous_anchor":"Чепурнов П.Д.","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"hng8y251MRmxBK","address_llm_predecompose_reason":"normalized_fragment_rejected_semantic_guard","address_fallback_rule_hit":null,"address_sanitized_user_message":"а по свк","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"followup_context_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"list_documents_by_counterparty","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"list_documents_by_counterparty","extracted_filters":{"sort":"period_desc","limit":20,"counterparty":"свк","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_documents_by_counterparty_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"preferred","account_scope_fallback_applied":false,"anchor_type":"counterparty","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":1000,"raw_rows_received":1000,"rows_after_account_scope":124,"rows_after_recipe_filter":26,"rows_materialized":124,"rows_matched":26,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["counterparty_anchor_derived_from_loose_by_phrase","organization_from_followup_context","counterparty_anchor_resolved_via_catalog_lookup"],"assistant_reply":"Найдено документов по контрагенту: 26.\n1. 2021-11-10T12:00:07Z | Поступление на расчетный счет 00000000013 от 10.11.2021 12:00:07 | 0 / 0 | 20000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n2. 2021-09-29T12:00:03Z | Поступление на расчетный счет 00000000012 от 29.09.2021 12:00:03 | 0 / 0 | 50000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n3. 2021-08-31T12:00:04Z | Поступление на расчетный счет 00000000011 от 31.08.2021 12:00:04 | 0 / 0 | 120500 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n4. 2021-06-22T12:00:00Z | Поступление на расчетный счет 00000000010 от 22.06.2021 12:00:00 | 0 / 0 | 498630 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n5. 2021-06-09T12:00:05Z | Поступление на расчетный счет 00000000009 от 09.06.2021 12:00:05 | 0 / 0 | 418960 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n6. 2021-04-28T12:00:08Z | Поступление на расчетный счет 00000000008 от 28.04.2021 12:00:08 | 0 / 0 | 564300 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n7. 2021-04-22T12:00:00Z | Поступление на расчетный счет 00000000007 от 22.04.2021 12:00:00 | 0 / 0 | 982420 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n8. 2021-04-13T12:00:11Z | Поступление на расчетный счет 00000000006 от 13.04.2021 12:00:11 | 0 / 0 | 1882400 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n9. 2021-03-25T12:00:02Z | Поступление на расчетный счет 00000000005 от 25.03.2021 12:00:02 | 0 / 0 | 644315 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n10. 2021-03-24T12:00:03Z | Поступление на расчетный счет 00000000004 от 24.03.2021 12:00:03 | 0 / 0 | 1219990 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n11. 2021-03-18T12:00:00Z | Поступление на расчетный счет 00000000003 от 18.03.2021 12:00:00 | 0 / 0 | 1425310 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n12. 2021-03-12T12:00:03Z | Поступление на расчетный счет 00000000002 от 12.03.2021 12:00:03 | 0 / 0 | 214600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n13. 2021-02-19T12:00:01Z | Поступление на расчетный счет 00000000001 от 19.02.2021 12:00:01 | 0 / 0 | 518600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n14. 2020-12-30T12:00:00Z | Поступление на расчетный счет 00000000044 от 30.12.2020 12:00:00 | 0 / 0 | 3248300 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n15. 2020-12-16T16:20:53Z | Поступление на расчетный счет 00000000043 от 16.12.2020 16:20:53 | 0 / 0 | 216600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n16. 2020-12-14T12:00:00Z | Поступление на расчетный счет 00000000042 от 14.12.2020 12:00:00 | 0 / 0 | 200000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n17. 2020-11-30T12:00:07Z | Поступление на расчетный счет 00000000041 от 30.11.2020 12:00:07 | 0 / 0 | 38900 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n18. 2020-11-19T12:00:04Z | Поступление на расчетный счет 00000000039 от 19.11.2020 12:00:04 | 0 / 0 | 3320600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n19. 2020-11-18T12:00:05Z | Поступление на расчетный счет 00000000038 от 18.11.2020 12:00:05 | 0 / 0 | 745300 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n20. 2020-11-18T12:00:04Z | Поступление на расчетный счет 00000000037 от 18.11.2020 12:00:04 | 0 / 0 | 320000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n21. 2020-11-13T12:00:03Z | Поступление на расчетный счет 00000000036 от 13.11.2020 12:00:03 | 0 / 0 | 313600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n22. 2020-11-10T15:39:13Z | Поступление на расчетный счет 00000000035 от 10.11.2020 15:39:13 | 0 / 0 | 328300 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n23. 2020-10-26T12:00:00Z | Поступление на расчетный счет 00000000034 от 26.10.2020 12:00:00 | 0 / 0 | 175000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n24. 2020-08-20T12:00:06Z | Поступление на расчетный счет 00000000032 от 20.08.2020 12:00:06 | 0 / 0 | 3126005 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n25. 2020-07-30T12:00:00Z | Поступление на расчетный счет 00000000029 от 30.07.2020 12:00:00 | 0 / 0 | 20000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n26. 2020-07-27T12:00:00Z | Поступление на расчетный счет 00000000028 от 27.07.2020 12:00:00 | 0 / 0 | 40860 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020","reply_type":"factual","trace_id":"address-zRVTz2ImGw"}} +{"timestamp":"2026-04-16T20:28:37.472Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-yAstvnOUKv","user_message":"а сейчас у нас есть что на складе?","effective_address_user_message":"а сейчас у нас есть что на складе?","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"1S5Z99JnUV4DTF","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"а сейчас у нас есть что на складе?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_intent_resolver_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"inventory_on_hand_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"inventory_on_hand_as_of_date","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"inventory_on_hand_as_of_date","extracted_filters":{"sort":"period_desc","as_of_date":"2026-04-16","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_on_hand_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":11,"raw_rows_received":11,"rows_after_account_scope":11,"rows_after_recipe_filter":11,"rows_materialized":11,"rows_matched":11,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["warehouse_self_scope_detected","as_of_date_defaulted_today","organization_from_followup_context"],"assistant_reply":"На 16.04.2026 на складе подтверждено 11 позиций с остатком на 716.418,33 ₽.\n\nПозиции:\n1. Модуль прямоугольый 1400*110*750 | склад: Основной склад | количество: 22,000 | стоимость: 148.261,67 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n2. Конструкция трансформер рабочей станции 1300*900*2000 | склад: Основной склад | количество: 3,000 | стоимость: 498.472,50 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n3. Диван трехместный | склад: Основной склад | количество: 1,000 | стоимость: 34.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n4. Кресло орион | склад: Основной склад | количество: 1,000 | стоимость: 13.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n5. Зеркало для инвалидов поворотное травмобезопасное | склад: Основной склад | количество: 1,000 | стоимость: 7.250,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n6. Пуф арий | склад: Основной склад | количество: 1,000 | стоимость: 6.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n7. Столешница 600*3050*26 дуб ниагара | склад: Основной склад | количество: 1,000 | стоимость: 3.724,17 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n8. Столешница 600*3050*26 альмандин | склад: Основной склад | количество: 1,000 | стоимость: 3.075,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n9. Четки Пост (84*117) | склад: Основной склад | количество: 1,000 | стоимость: 833,33 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n10. Кромка с клеем 33 альмандин 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n11. Кромка с клеем 33 дуб ниагара 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n\nПодтверждение:\n- Дата среза: 16.04.2026.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 11.\n- Уникальных складов: 1.\n- Суммарное количество: 34,000.","reply_type":"factual","trace_id":"address-jNhkcU9JCD"}} +{"timestamp":"2026-04-16T20:28:58.631Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-ccIfwg2UK0","user_message":"что нам отгружать чепурнов? какой товар или услугу?","effective_address_user_message":"Определить, что необходимо отгрузить контрагенту Чепурнов","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"v2esy-x5kEDtqg","address_llm_predecompose_reason":"normalized_fragment_semantic_guard_raw_fragment_preferred","address_fallback_rule_hit":null,"address_sanitized_user_message":"что нам отгружать чепурнов? какой товар или услугу?","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_signal_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":null,"address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"list_lookup","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"OBJECT_LOOKUP","detected_intent":"unknown","extracted_filters":{"sort":"period_desc","limit":20,"counterparty":"Чепурнов","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":null,"mcp_call_status_legacy":"skipped","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"counterparty","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"skipped","rows_fetched":0,"raw_rows_received":0,"rows_after_account_scope":0,"rows_after_recipe_filter":0,"rows_materialized":0,"rows_matched":0,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"DEEP_ONLY","limited_reason_category":"unsupported","response_type":"LIMITED_WITH_REASON","limitations":["intent_not_supported_in_v1"],"assistant_reply":"В текущем адресном контуре этот запрос лучше не закрывать «в лоб» — риск неверной трактовки высок.\n\nНадежный ответ здесь требует более широкого анализа, чем текущий адресный контур.\n\nСигнал запроса: поиск конкретных объектов.\n\nКонтекст запроса: организация ООО \\Альтернатива Плюс\\.\n\nЧто могу сделать сейчас: показать документы и платежи по контрагенту Чепурнов; показать незакрытые договоры или хвосты на дату; могу проверить близкие сценарии: документы/платежи по контрагенту, договоры или остаток по счету.","reply_type":"partial_coverage","trace_id":"address-D5WXj8rAx6"}} +{"timestamp":"2026-04-16T20:29:09.962Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-JDLFcADDA5","user_message":"какие остатки на складе на сегодня","effective_address_user_message":"Какие остатки по складу на текущую дату?","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"xRg1uEtIIAF20n","address_llm_predecompose_reason":"normalized_fragment_applied","address_fallback_rule_hit":null,"address_sanitized_user_message":"какие остатки на складе на сегодня","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"inventory_on_hand_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"inventory_on_hand_as_of_date","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"inventory_on_hand_as_of_date","extracted_filters":{"sort":"period_desc","as_of_date":"2026-04-16","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_on_hand_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":11,"raw_rows_received":11,"rows_after_account_scope":11,"rows_after_recipe_filter":11,"rows_materialized":11,"rows_matched":11,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["as_of_date_defaulted_today","organization_from_followup_context"],"assistant_reply":"На 16.04.2026 на складе подтверждено 11 позиций с остатком на 716.418,33 ₽.\n\nПозиции:\n1. Модуль прямоугольый 1400*110*750 | склад: Основной склад | количество: 22,000 | стоимость: 148.261,67 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n2. Конструкция трансформер рабочей станции 1300*900*2000 | склад: Основной склад | количество: 3,000 | стоимость: 498.472,50 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n3. Диван трехместный | склад: Основной склад | количество: 1,000 | стоимость: 34.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n4. Кресло орион | склад: Основной склад | количество: 1,000 | стоимость: 13.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n5. Зеркало для инвалидов поворотное травмобезопасное | склад: Основной склад | количество: 1,000 | стоимость: 7.250,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n6. Пуф арий | склад: Основной склад | количество: 1,000 | стоимость: 6.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n7. Столешница 600*3050*26 дуб ниагара | склад: Основной склад | количество: 1,000 | стоимость: 3.724,17 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n8. Столешница 600*3050*26 альмандин | склад: Основной склад | количество: 1,000 | стоимость: 3.075,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n9. Четки Пост (84*117) | склад: Основной склад | количество: 1,000 | стоимость: 833,33 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n10. Кромка с клеем 33 альмандин 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n11. Кромка с клеем 33 дуб ниагара 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n\nПодтверждение:\n- Дата среза: 16.04.2026.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 11.\n- Уникальных складов: 1.\n- Суммарное количество: 34,000.","reply_type":"factual","trace_id":"address-51Keev8aCG"}} +{"timestamp":"2026-04-16T20:29:22.156Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-1dCS9YJbTA","user_message":"остатки на март 2016","effective_address_user_message":"остатки на март 2016","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"5AU2vrKy52DzLu","address_llm_predecompose_reason":"followup_raw_message_preferred_over_llm_rewrite","address_fallback_rule_hit":null,"address_sanitized_user_message":"остатки на март 2016","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_signal_detected","address_dialog_continuation_decision":"continue_previous","address_dialog_continuation_target_intent":"inventory_on_hand_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"range","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"UNKNOWN","detected_intent":"inventory_on_hand_as_of_date","extracted_filters":{"sort":"period_desc","period_from":"2016-03-01","period_to":"2016-03-31","as_of_date":"2016-03-31","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_on_hand_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":2,"raw_rows_received":2,"rows_after_account_scope":2,"rows_after_recipe_filter":2,"rows_materialized":2,"rows_matched":2,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["period_derived_from_month_phrase","as_of_date_derived_from_period_to","organization_from_followup_context"],"assistant_reply":"На 31.03.2016 на складе подтверждено 2 позиций с остатком на 812.786,49 ₽.\n\nПозиции:\n1. Шкаф для одежды 824*437*2010 | склад: Основной склад | количество: 11,000 | стоимость: 117.426,49 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2016-03-31T23:59:59Z\n2. Рабочая станция универсального специалиста (индивидуальное изготовление) | склад: Основной склад | количество: 3,000 | стоимость: 695.360,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2016-03-31T23:59:59Z\n\nПодтверждение:\n- Дата среза: 31.03.2016.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 2.\n- Уникальных складов: 1.\n- Суммарное количество: 14,000.","reply_type":"factual","trace_id":"address-N-sWXuMgIM"}} +{"timestamp":"2026-04-16T20:29:59.067Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-FPeTVM-bMg","user_message":"это по общей базе уже нужен вывод не по чепурнову","normalizer_output":null,"execution_plan":[],"resolved_execution_state":[],"routes":[],"retrieval_calls":[],"retrieval_results_raw":[],"retrieval_results_normalized":[],"requirements_extracted":[{"requirement_id":"R1","source_fragment_id":null,"requirement_text":"это по общей базе уже нужен вывод не по чепурнову","subject_tokens":[],"status":"clarification_needed","route":null}],"requirements_total":1,"requirements_covered":0,"requirements_uncovered":[],"coverage_status":"partial_or_limited","answer_grounding_status":"no_grounded_answer","reply_semantic_type":"clarification_required","why_included_summary":[],"selection_reason_summary":[],"route_subject_match":true,"clarification_target":["R1"],"dropped_intent_segments":[],"question_type_class":"unknown","company_anchors":{"contract_numbers":[],"document_numbers":[],"dates":[],"amounts":[],"accounts":[],"periods":[],"document_types":[],"all":[]},"analysis_context_applied":false,"analysis_context":null,"business_scope_raw":[],"business_scope_resolved":["company_specific_accounting"],"company_grounding_applied":true,"scope_resolution_reason":["settlement_claim_company_scope_recovery"],"company_scope_resolution_reason":["settlement_claim_company_scope_recovery"],"raw_time_anchor":null,"raw_time_scope":null,"resolved_time_anchor":null,"resolved_primary_period":null,"effective_primary_period":null,"temporal_guard_input":null,"temporal_alignment_status":"conflicting","temporal_resolution_source":"normalized_time_scope:missing","temporal_guard_basis":"none","temporal_guard_applied":false,"temporal_guard_outcome":"passed","temporal_guard":{"raw_time_anchor":null,"raw_time_scope":null,"resolved_time_anchor":null,"resolved_primary_period":null,"effective_primary_period":null,"temporal_guard_input":null,"temporal_alignment_status":"conflicting","temporal_resolution_source":"normalized_time_scope:missing","temporal_guard_basis":"none","temporal_guard_applied":false,"temporal_guard_outcome":"passed","primary_period_window":null,"allowed_context_window":null,"controlled_temporal_expansion_enabled":false,"context_expansion_reasons_allowed":["prehistory","carryover","post_period_closure","long_running_contract_context"],"normalized_anchor_drift_detected":false,"reason_codes":["missing_resolved_primary_period"]},"raw_numeric_tokens":[],"classified_numeric_tokens":[],"rejected_as_non_accounts":[],"resolved_account_anchors":[],"domain_polarity_guard":{"applied":false,"polarity":"not_applicable","outcome":"not_applicable","supplier_score":0,"customer_score":0,"account_scope":[],"raw_numeric_tokens":[],"classified_numeric_tokens":[],"rejected_as_non_accounts":[],"resolved_account_anchors":[],"rejected_problem_units":0,"rejected_evidence":0,"critical_contradiction":false,"reason_codes":[]},"claim_anchor_audit":{"claim_type":"prove_settlement_closure_state","settlement_role":"unknown","settlement_role_resolution_reason":["settlement_role_resolved_unknown"],"polarity_resolution_status":"unknown","required_anchors":["period","account_scope","counterparty_scope_or_contract","closure_signal"],"resolved_anchors":{"period":[],"account_scope":[],"amounts":[],"contract":[],"document_numbers":[],"document_types":[],"counterparty_scope":[],"advance_signal":[],"closure_signal":[],"vat_signal":[],"chain_signal":[],"close_signal":[],"cost_scope":[],"rbp_signal":[],"writeoff_signal":[],"fixed_asset_signal":[],"amortization_signal":[],"expected_fa_set":[],"actual_fa_set":[]},"missing_anchors":["period","account_scope","counterparty_scope_or_contract","closure_signal"],"claim_anchor_resolution_rate":0,"primary_period":null,"allowed_context_window":null,"context_expansion_reasons_allowed":["prehistory","carryover","post_period_closure","long_running_contract_context"],"reason_codes":["claim_missing_required_anchors","claim_anchor_resolution_low","unresolved_supplier_customer_polarity"]},"settlement_role":"unknown","settlement_role_resolution_reason":["settlement_role_resolved_unknown"],"polarity_resolution_status":"unknown","targeted_evidence_acquisition":{"claim_type":"prove_settlement_closure_state","required_checks":["payment_document_found","contract_matched","settlement_object_matched","closing_document_found","register_closure_entry_found","posting_link_found"],"check_status":{"payment_document_found":"not_found","contract_matched":"not_found","settlement_object_matched":"not_found","closing_document_found":"not_found","register_closure_entry_found":"not_found","posting_link_found":"not_found"},"targeted_item_hits":0,"targeted_evidence_hits":0,"targeted_evidence_hit_rate":0,"targeted_evidence_source_refs":[],"reason_codes":["targeted_evidence_not_found","targeted_evidence_hit_rate_low"]},"evidence_admissibility_gate":{"candidate_evidence_total":0,"admissible_evidence_count":0,"rejected_evidence_count":0,"rejected_item_count":0,"reject_breakdown":{"wrong_period":0,"wrong_domain":0,"wrong_account_scope":0,"weak_source_mapping":0,"zero_live_match":0,"future_dated_or_out_of_window":0},"category_breakdown":{"hard_evidence":0,"supporting_signal":0,"inadmissible_noise":0},"reason_codes":["no_admissible_evidence_for_grounded_answer"]},"eligibility_time_basis":"none","grounded_answer_eligibility_guard":{"eligible":false,"temporal_passed":true,"eligibility_time_basis":"none","business_scope_passed":true,"polarity_passed":true,"claim_anchors_passed":false,"claim_anchor_resolution_rate":0,"missing_required_anchors":4,"admissible_evidence_count":0,"critical_contradiction":false,"outcome":"limited_or_insufficient_evidence","grounding_mode":"limited_or_insufficient_evidence","reason_codes":["claim_anchor_coverage_insufficient","admissible_evidence_count_zero","targeted_evidence_hit_rate_zero"]},"problem_centric_answer_applied":false,"problem_units_used_count":0,"problem_answer_mode":"stage1_policy_v11","assistant_outcome_class_v1":"BLOCKED_BY_AMBIGUITY","assistant_orchestration_contracts_v1":{"query_frame":{"schema_version":"assistant_query_frame_v1","original_user_question":"это по общей базе уже нужен вывод не по чепурнову","normalized_question":"это по общей базе уже нужен вывод не по чепурнову","route_summary_mode":"none","fragments_total":0,"dropped_intent_segments":[],"analysis_context":null},"execution_plan":{"schema_version":"assistant_execution_plan_v1","steps":[],"requirements_total":1},"evidence_bundle":{"schema_version":"assistant_evidence_bundle_v1","retrieval_calls_total":0,"retrieval_results_total":0,"retrieval_status_breakdown":{"ok":0,"partial":0,"empty":0,"error":0},"evidence_total":0,"source_refs_total":0,"limitation_total":0,"error_total":0},"coverage":{"schema_version":"assistant_coverage_contract_v1","coverage_report":{"requirements_total":1,"requirements_covered":0,"requirements_uncovered":[],"requirements_partially_covered":[],"clarification_needed_for":["R1"],"out_of_scope_requirements":[]},"grounding":{"status":"no_grounded_answer","route_subject_match":true,"missing_requirements":["R1"],"reasons":["Ни одно требование не получило подтвержденного покрытия.","В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.","Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).","Недостаточно подтвержденных данных для уверенного ответа.","Не хватило целевых подтверждений по выбранному сценарию."],"why_included_summary":[],"selection_reason_summary":[]},"outcome_class":"BLOCKED_BY_AMBIGUITY"}},"answer_contract_stage4_v1":{"schema_version":"stage4_answer_contract_audit_v1","stage4_blocks_expected":["Коротко","Что именно проверено","Что найдено","Что пока не доказано","Что проверить первым/Что могу сделать сейчас"],"stage4_blocks_present":["Коротко","Что именно проверено","Что найдено","Что пока не доказано","Что проверить первым/Что могу сделать сейчас"],"stage4_blocks_missing":[],"legacy_blocks_present":[],"is_stage4_shape":true},"answer_structure_v11":{"schema_version":"answer_structure_v1_1","answer_summary":"Нужны уточнения: без сужения фокуса надежный вывод невозможен.","direct_answer":"Есть признаки проблемы, но без уточнений по периоду и объекту вывод ненадежен.","mechanism_block":{"status":"unresolved","mechanism_notes":[],"limitation_reason_codes":[]},"evidence_block":{"evidence_ids":[],"source_refs":[],"mechanism_notes":[],"coverage_note":"coverage_partial_or_limited"},"uncertainty_block":{"open_uncertainties":["R1","missing_anchor:period","missing_anchor:account","missing_anchor:document_or_object","missing_anchor:counterparty"],"limitations":["Ни одно требование не получило подтвержденного покрытия.","В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.","Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).","Недостаточно подтвержденных данных для уверенного ответа.","Не хватило целевых подтверждений по выбранному сценарию."]},"next_step_block":{"recommended_actions":["Дайте недостающие якоря (период/счет/объект), иначе сильный factual вывод невозможен."],"clarification_questions":["Уточните период проверки (например, июль 2020).","Уточните счет или группу счетов (например, 19, 60, 62).","Укажите документ/GUID/конкретный объект для трассировки.","Укажите контрагента или группу контрагентов.","Закройте уточнения для требований: R1."]}},"investigation_state_snapshot":{"schema_version":"investigation_state_v1","session_id":"asst-tlR2M3uhVX","status":"active","turn_index":1,"updated_at":"2026-04-16T20:29:59.054Z","question_id":"msg-cx0ohQIbMK","question_scope_id":"s:это по общей базе уже нужен вывод не по чепурнову","scope_origin":"underspecified","focus":{"domain":null,"period":null,"primary_accounts":[],"active_query_subject":"это по общей базе уже нужен вывод не по чепурнову"},"narrowing_status":"unknown","evidence_refs":[],"open_uncertainties":["clarify:R1"],"last_answer_mode":"clarification_required","followup_context":{"previous_question_id":null,"last_user_message":"это по общей базе уже нужен вывод не по чепурнову","referenced_requirement_ids":["R1"],"active_domain":null,"active_requirement_ids":["R1"],"uncovered_requirement_ids":["R1"],"last_problem_unit_id":null,"settlement_next_actions":[],"evidence_summary":[],"question_scope_id":"s:это по общей базе уже нужен вывод не по чепурнову","scope_origin":"underspecified"},"query_mode_hint":"investigation_candidate"},"fallback_type":"clarification","assistant_reply":"Коротко: Сейчас у меня нет надежного доменного маршрута по этому запросу, поэтому даю мягкий отказ вместо шаблонной технички.\n\nЧто именно проверено:\n- Проверен доступный контур 1С и возможность маршрутизации запроса.\n- Надежный доменный путь для текущей формулировки не подтвержден.\n\nЧто найдено:\n- Взаиморасчеты 60/62: найти хвосты, незакрытые оплаты и рисковые связки по контрагентам.\n- НДС 19/68: проверить цепочку документ -> счет-фактура -> регистр -> книга.\n- Закрытие месяца 20/44: проверить распределение затрат и остатки после регламентных операций.\n\nЧто пока не доказано:\n- Запрос не подтвержден в поддерживаемом контуре как надежный бухгалтерский сценарий.\n\nЧто могу сделать сейчас:\n- Взаиморасчеты 60/62 — найти хвосты, незакрытые оплаты и рисковые связки по контрагентам.\n- НДС 19/68 — проверить цепочку документ -> счет-фактура -> регистр -> книга.\n- Закрытие месяца 20/44 — проверить распределение затрат и остатки после регламентных операций.","reply_type":"clarification_required","trace_id":"s94Q97I27ZGMIP"}} +{"timestamp":"2026-04-16T20:30:12.267Z","level":"info","service":"assistant_loop","message":"assistant_address_tool_gate_skip","sessionId":"asst-tlR2M3uhVX","details":{"session_id":"asst-tlR2M3uhVX","user_message":"хвосты покажи по счету 60 на август 2022","effective_address_user_message":"покажи хвосты по счету 60 за август 2022 года","address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_reason":"normalized_fragment_applied","address_fallback_rule_hit":null,"address_sanitized_user_message":"хвосты покажи по счету 60 на август 2022","assistant_orchestration_contract_v1":{"schema_version":"assistant_orchestration_contract_v1","hard_meta_mode":null,"address_mode":"address_query","address_mode_confidence":"high","address_intent":"account_balance_snapshot","address_intent_confidence":"high","strong_data_signal_detected":true,"data_retrieval_signal_detected":true,"semantic_contract_valid":true,"semantic_apply_canonical_recommended":true,"semantic_reason_codes":["deep_investigation_signal_detected"],"semantic_route_arbitration":{"supported_address_intent_detected":false,"strict_deep_investigation_bypass_allowed":false,"semantic_deep_investigation_hint_detected":true,"semantic_aggregate_shape_detected":false,"followup_semantic_override_to_deep_allowed":false},"followup_context_detected":false,"unsupported_address_intent_fallback_to_deep":false,"deep_analysis_signal_fallback_to_deep":true,"aggregate_analytics_signal_fallback_to_deep":false,"deep_session_continuation_fallback_to_deep":false,"final_decision":{"run_address_lane":false,"tool_gate_decision":"skip_address_lane","tool_gate_reason":"deep_analysis_signal_fallback_to_deep","living_mode":"deep_analysis","living_reason":"deep_analysis_signal_fallback_to_deep"}},"address_tool_gate_decision":"skip_address_lane","address_tool_gate_reason":"deep_analysis_signal_fallback_to_deep","address_llm_predecompose_contract_intent":"account_balance_snapshot","address_llm_predecompose_contract_aggregation_profile":"balance_snapshot","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":["deep_investigation_signal_detected"]}} +{"timestamp":"2026-04-16T20:30:39.376Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-7JplPZakSk","user_message":"хвосты покажи по счету 60 на август 2022","normalizer_output":null,"execution_plan":[],"resolved_execution_state":[],"routes":[],"retrieval_calls":[],"retrieval_results_raw":[],"retrieval_results_normalized":[],"requirements_extracted":[{"requirement_id":"R1","source_fragment_id":null,"requirement_text":"хвосты покажи по счету 60 на август 2022","subject_tokens":["anomaly"],"status":"clarification_needed","route":null}],"requirements_total":1,"requirements_covered":0,"requirements_uncovered":[],"coverage_status":"partial_or_limited","answer_grounding_status":"no_grounded_answer","reply_semantic_type":"clarification_required","why_included_summary":[],"selection_reason_summary":[],"route_subject_match":true,"clarification_target":["R1"],"dropped_intent_segments":[],"question_type_class":"unknown","company_anchors":{"contract_numbers":[],"document_numbers":[],"dates":[],"amounts":[],"accounts":[],"periods":["2022"],"document_types":[],"all":["period:2022"]},"analysis_context_applied":false,"analysis_context":null,"business_scope_raw":[],"business_scope_resolved":["company_specific_accounting"],"company_grounding_applied":true,"scope_resolution_reason":["settlement_claim_company_scope_recovery"],"company_scope_resolution_reason":["settlement_claim_company_scope_recovery"],"raw_time_anchor":null,"raw_time_scope":null,"resolved_time_anchor":null,"resolved_primary_period":null,"effective_primary_period":null,"temporal_guard_input":null,"temporal_alignment_status":"conflicting","temporal_resolution_source":"normalized_time_scope:missing","temporal_guard_basis":"none","temporal_guard_applied":false,"temporal_guard_outcome":"passed","temporal_guard":{"raw_time_anchor":null,"raw_time_scope":null,"resolved_time_anchor":null,"resolved_primary_period":null,"effective_primary_period":null,"temporal_guard_input":null,"temporal_alignment_status":"conflicting","temporal_resolution_source":"normalized_time_scope:missing","temporal_guard_basis":"none","temporal_guard_applied":false,"temporal_guard_outcome":"passed","primary_period_window":null,"allowed_context_window":null,"controlled_temporal_expansion_enabled":false,"context_expansion_reasons_allowed":["prehistory","carryover","post_period_closure","long_running_contract_context"],"normalized_anchor_drift_detected":false,"reason_codes":["missing_resolved_primary_period"]},"raw_numeric_tokens":["60","2022"],"classified_numeric_tokens":[{"token":"60","classification":"other_numeric"}],"rejected_as_non_accounts":["60"],"resolved_account_anchors":[],"domain_polarity_guard":{"applied":true,"polarity":"mixed_or_unresolved","outcome":"limited_unresolved_polarity","supplier_score":0,"customer_score":0,"account_scope":[],"raw_numeric_tokens":["60","2022"],"classified_numeric_tokens":[{"token":"60","classification":"other_numeric"}],"rejected_as_non_accounts":["60"],"resolved_account_anchors":[],"rejected_problem_units":0,"rejected_evidence":0,"critical_contradiction":true,"reason_codes":["unresolved_supplier_customer_polarity","supplier_customer_signals_absent"]},"claim_anchor_audit":{"claim_type":"prove_settlement_closure_state","settlement_role":"unknown","settlement_role_resolution_reason":["settlement_role_resolved_unknown"],"polarity_resolution_status":"unknown","required_anchors":["period","account_scope","counterparty_scope_or_contract","closure_signal"],"resolved_anchors":{"period":["2022"],"account_scope":[],"amounts":[],"contract":[],"document_numbers":[],"document_types":[],"counterparty_scope":[],"advance_signal":[],"closure_signal":["closure"],"vat_signal":[],"chain_signal":[],"close_signal":[],"cost_scope":[],"rbp_signal":[],"writeoff_signal":[],"fixed_asset_signal":[],"amortization_signal":[],"expected_fa_set":[],"actual_fa_set":[]},"missing_anchors":["account_scope","counterparty_scope_or_contract"],"claim_anchor_resolution_rate":0.5,"primary_period":null,"allowed_context_window":null,"context_expansion_reasons_allowed":["prehistory","carryover","post_period_closure","long_running_contract_context"],"reason_codes":["claim_missing_required_anchors","claim_anchor_resolution_low","unresolved_supplier_customer_polarity"]},"settlement_role":"unknown","settlement_role_resolution_reason":["settlement_role_resolved_unknown"],"polarity_resolution_status":"unknown","targeted_evidence_acquisition":{"claim_type":"prove_settlement_closure_state","required_checks":["payment_document_found","contract_matched","settlement_object_matched","closing_document_found","register_closure_entry_found","posting_link_found"],"check_status":{"payment_document_found":"not_found","contract_matched":"not_found","settlement_object_matched":"not_found","closing_document_found":"not_found","register_closure_entry_found":"not_found","posting_link_found":"not_found"},"targeted_item_hits":0,"targeted_evidence_hits":0,"targeted_evidence_hit_rate":0,"targeted_evidence_source_refs":[],"reason_codes":["targeted_evidence_not_found","targeted_evidence_hit_rate_low"]},"evidence_admissibility_gate":{"candidate_evidence_total":0,"admissible_evidence_count":0,"rejected_evidence_count":0,"rejected_item_count":0,"reject_breakdown":{"wrong_period":0,"wrong_domain":0,"wrong_account_scope":0,"weak_source_mapping":0,"zero_live_match":0,"future_dated_or_out_of_window":0},"category_breakdown":{"hard_evidence":0,"supporting_signal":0,"inadmissible_noise":0},"reason_codes":["no_admissible_evidence_for_grounded_answer"]},"eligibility_time_basis":"none","grounded_answer_eligibility_guard":{"eligible":false,"temporal_passed":true,"eligibility_time_basis":"none","business_scope_passed":true,"polarity_passed":false,"claim_anchors_passed":true,"claim_anchor_resolution_rate":0.5,"missing_required_anchors":2,"admissible_evidence_count":0,"critical_contradiction":true,"outcome":"limited_or_insufficient_evidence","grounding_mode":"limited_or_insufficient_evidence","reason_codes":["polarity_guard_limited_unresolved_polarity","admissible_evidence_count_zero","targeted_evidence_hit_rate_zero","critical_domain_or_account_contradiction"]},"problem_centric_answer_applied":false,"problem_units_used_count":0,"problem_answer_mode":"stage1_policy_v11","assistant_outcome_class_v1":"BLOCKED_BY_AMBIGUITY","assistant_orchestration_contracts_v1":{"query_frame":{"schema_version":"assistant_query_frame_v1","original_user_question":"хвосты покажи по счету 60 на август 2022","normalized_question":"хвосты покажи по счету 60 на август 2022","route_summary_mode":"none","fragments_total":0,"dropped_intent_segments":[],"analysis_context":null},"execution_plan":{"schema_version":"assistant_execution_plan_v1","steps":[],"requirements_total":1},"evidence_bundle":{"schema_version":"assistant_evidence_bundle_v1","retrieval_calls_total":0,"retrieval_results_total":0,"retrieval_status_breakdown":{"ok":0,"partial":0,"empty":0,"error":0},"evidence_total":0,"source_refs_total":0,"limitation_total":0,"error_total":0},"coverage":{"schema_version":"assistant_coverage_contract_v1","coverage_report":{"requirements_total":1,"requirements_covered":0,"requirements_uncovered":[],"requirements_partially_covered":[],"clarification_needed_for":["R1"],"out_of_scope_requirements":[]},"grounding":{"status":"no_grounded_answer","route_subject_match":true,"missing_requirements":["R1"],"reasons":["Ни одно требование не получило подтвержденного покрытия.","В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.","Часть контекста вопроса не подтверждена напрямую в найденных данных: anomaly","Не удалось однозначно определить сторону расчета (нам должны или мы должны).","Недостаточно подтвержденных данных для уверенного ответа.","Не хватило целевых подтверждений по выбранному сценарию.","Есть противоречие по выбранному домену или контуру счета."],"why_included_summary":[],"selection_reason_summary":[]},"outcome_class":"BLOCKED_BY_AMBIGUITY"}},"answer_contract_stage4_v1":{"schema_version":"stage4_answer_contract_audit_v1","stage4_blocks_expected":["Коротко","Что именно проверено","Что найдено","Что пока не доказано","Что проверить первым/Что могу сделать сейчас"],"stage4_blocks_present":["Коротко","Что именно проверено","Что найдено","Что пока не доказано","Что проверить первым/Что могу сделать сейчас"],"stage4_blocks_missing":[],"legacy_blocks_present":[],"is_stage4_shape":true},"answer_structure_v11":{"schema_version":"answer_structure_v1_1","answer_summary":"Нужны уточнения: без сужения фокуса надежный вывод невозможен.","direct_answer":"Есть признаки проблемы, но без уточнений по периоду и объекту вывод ненадежен.","mechanism_block":{"status":"unresolved","mechanism_notes":[],"limitation_reason_codes":[]},"evidence_block":{"evidence_ids":[],"source_refs":[],"mechanism_notes":[],"coverage_note":"coverage_partial_or_limited"},"uncertainty_block":{"open_uncertainties":["R1","missing_anchor:document_or_object","missing_anchor:counterparty"],"limitations":["Ни одно требование не получило подтвержденного покрытия.","В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.","Часть контекста вопроса не подтверждена напрямую в найденных данных: anomaly","Не удалось однозначно определить сторону расчета (нам должны или мы должны).","Недостаточно подтвержденных данных для уверенного ответа.","Не хватило целевых подтверждений по выбранному сценарию.","Есть противоречие по выбранному домену или контуру счета.","Часть якорей запроса пока не подтверждена в опоре: 2022, period:2022."]},"next_step_block":{"recommended_actions":["Дайте недостающие якоря (период/счет/объект), иначе сильный factual вывод невозможен."],"clarification_questions":["Укажите документ/GUID/конкретный объект для трассировки.","Укажите контрагента или группу контрагентов.","Закройте уточнения для требований: R1."]}},"investigation_state_snapshot":{"schema_version":"investigation_state_v1","session_id":"asst-tlR2M3uhVX","status":"active","turn_index":2,"updated_at":"2026-04-16T20:30:39.363Z","question_id":"msg-MH-8zRXxn_","question_scope_id":"d:settlements_60_62|p:2022|a:60|s:хвосты покажи по счету 60 на август 2022","scope_origin":"explicit_from_message","focus":{"domain":"settlements_60_62","period":"2022","primary_accounts":["60"],"active_query_subject":"хвосты покажи по счету 60 на август 2022"},"narrowing_status":"unknown","evidence_refs":[],"open_uncertainties":["clarify:R1"],"last_answer_mode":"clarification_required","followup_context":{"previous_question_id":"msg-cx0ohQIbMK","last_user_message":"хвосты покажи по счету 60 на август 2022","referenced_requirement_ids":["R1"],"active_domain":"settlements_60_62","active_requirement_ids":["R1"],"uncovered_requirement_ids":["R1"],"last_problem_unit_id":null,"settlement_next_actions":["Проверьте договор и объект расчетов по платежу.","Сверьте регистр расчетов и привязку платежа к закрывающему документу.","Проверьте зачет аванса или взаимозачет по связке 60/62."],"evidence_summary":[],"question_scope_id":"d:settlements_60_62|p:2022|a:60|s:хвосты покажи по счету 60 на август 2022","scope_origin":"explicit_from_message"},"query_mode_hint":"investigation_candidate"},"fallback_type":"clarification","assistant_reply":"Коротко: По сценарию взаиморасчетов 60/62 пока не хватает подтвержденной опоры для надежного вывода.\n\nЧто именно проверено:\n- Проверен сценарий взаиморасчетов 60/62 в текущем контуре 1С.\n- Оценена достаточность подтвержденной опоры для прямого вывода.\n\nЧто найдено:\n- Взаиморасчеты 60/62: найти хвосты, незакрытые оплаты и рисковые связки по контрагентам.\n- НДС 19/68: проверить цепочку документ -> счет-фактура -> регистр -> книга.\n\nЧто пока не доказано:\n- Добавь контрагента или договор, чтобы зафиксировать контур проверки.\n- Укажи документ или объект, от которого строить проверку цепочки.\n- Уточни тип отклонения: разрыв цепочки, неверное закрытие или аномальный хвост.\n- Закрой уточнения для требований: R1.\n\nЧто могу сделать сейчас:\n- Взаиморасчеты 60/62 — найти хвосты, незакрытые оплаты и рисковые связки по контрагентам.\n- НДС 19/68 — проверить цепочку документ -> счет-фактура -> регистр -> книга.\n- Закрытие месяца 20/44 — проверить распределение затрат и остатки после регламентных операций.","reply_type":"clarification_required","trace_id":"cbWexcMb4f6HXF"}} +{"timestamp":"2026-04-16T20:30:53.592Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-miFAKw8rpM","user_message":"Есть ли остатки товара, которые закупались очень давно","effective_address_user_message":"Есть ли остатки товара, которые закупались очень давно","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":false,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"bUfkvoXT-f591J","address_llm_predecompose_reason":"normalized_fragment_rejected_intent_drop","address_fallback_rule_hit":null,"address_sanitized_user_message":"есть ли остатки товара, которые закупались очень давно","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_intent_resolver_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"inventory_aging_by_purchase_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"inventory_aging_by_purchase_date","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":true,"address_semantic_contract_quality":"medium","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":["unsupported_low_confidence_contract"],"detected_mode":"address_query","query_shape":"VERIFY_FACTUAL","detected_intent":"inventory_aging_by_purchase_date","extracted_filters":{"sort":"period_asc","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_aging_by_purchase_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":500,"raw_rows_received":500,"rows_after_account_scope":500,"rows_after_recipe_filter":500,"rows_materialized":500,"rows_matched":500,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_SUMMARY","limitations":["organization_from_followup_context"],"assistant_reply":"К старым закупкам на 16.04.2026 в первую очередь относятся позиции с самой ранней первой закупкой: Стенд информационный на 8 карманов (05.11.2014); Вывеска настенная (05.11.2014); Дверные указатели (05.11.2014).\nСобран exact-срез старых закупок для складского остатка на 16.04.2026.\n\nБлок 1. Статус результата\n- Контур: показан item-level список товарных позиций с самым ранним документально наблюдаемым закупочным следом на 41.01.\n- Порядок: позиции отсортированы от самой старой первой закупки к более новым.\n- Важно: без партионности этот контур не доказывает возраст конкретного лота, а показывает документально наблюдаемый возраст закупочного следа по товарной позиции.\n\nБлок 2. Сводка\n- Дата среза: 16.04.2026.\n- Самая ранняя первая закупка среди позиций: 05.11.2014.\n- Самая поздняя найденная закупка в наблюдаемом следе: 27.05.2019.\n- Позиции в aging-срезе: 390.\n- Закупочных документов в наблюдаемом следе: 110.\n- Закупочных операций в наблюдаемом следе: 500.\n- Между самой ранней первой закупкой и датой среза прошло 4.180 дн.\n- Поставщики, встречающиеся в наблюдаемом закупочном следе: Голдлайт, ООО; ГТК-Интер, ООО; Авант мебель, ООО; ПромЭлитКонсалт, ООО.\n\nБлок 3. Позиции от самых старых закупок\n1. Стенд информационный на 8 карманов | первая закупка: 05.11.2014 | последняя закупка: 17.11.2015 | документов: 2 | операций: 2 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n2. Вывеска настенная | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n3. Дверные указатели | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n4. Интерьерная аппликация на стену | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n5. Нумерация | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n6. Стенд настенный, информационный | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n7. Стойка информационная | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n8. Указатели 1500 | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n9. Указатели 200 | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n10. Указатели 500 | первая закупка: 05.11.2014 | последняя закупка: 05.11.2014 | документов: 1 | операций: 1 | возраст следа на 16.04.2026: 4.180 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Голдлайт, ООО\n11. Рабочая станция универсального специалиста (индивидуальное изготовление) | первая закупка: 05.02.2015 | последняя закупка: 22.07.2015 | документов: 7 | операций: 7 | возраст следа на 16.04.2026: 4.088 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Авант мебель, ООО; ГТК-Интер, ООО; ПромЭлитКонсалт, ООО\n12. Стойка для заполнения бумаг круглая | первая закупка: 05.02.2015 | последняя закупка: 06.02.2015 | документов: 3 | операций: 3 | возраст следа на 16.04.2026: 4.088 дн. | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | поставщики: Авант мебель, ООО; Артформ, ООО; ПромЭлитКонсалт, ООО","reply_type":"factual","trace_id":"address-fphB0HNkUP"}} +{"timestamp":"2026-04-16T20:31:06.901Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"asst-tlR2M3uhVX","eventType":"assistant_message_address","details":{"session_id":"asst-tlR2M3uhVX","message_id":"msg-AYPqgjF8-l","user_message":"Какие конкретно номенклатуры формируют остаток по складу на май 2020","effective_address_user_message":"Определить номенклатуру, которая формирует остаток на складе на май 2020 года","address_followup_context_applied":false,"address_followup_context_previous_intent":null,"address_followup_context_previous_anchor":null,"address_llm_predecompose_attempted":true,"address_llm_predecompose_applied":true,"address_llm_predecompose_provider":"local","address_llm_predecompose_trace_id":"AAppulS04AfiWc","address_llm_predecompose_reason":"normalized_fragment_applied","address_fallback_rule_hit":null,"address_sanitized_user_message":"какие конкретно номенклатуры формируют остаток по складу на май 2020","address_tool_gate_decision":"run_address_lane","address_tool_gate_reason":"address_mode_classifier_detected","address_dialog_continuation_decision":"new_topic","address_dialog_continuation_target_intent":"inventory_on_hand_as_of_date","address_retry_attempted":false,"address_retry_reason":null,"address_retry_initial_limited_category":null,"address_retry_result_category":null,"address_llm_predecompose_contract_intent":"inventory_on_hand_as_of_date","address_llm_predecompose_contract_aggregation_profile":"management_profile","address_llm_predecompose_contract_period_scope":"as_of","address_semantic_contract_valid":true,"address_semantic_contract_quality":"high","address_semantic_apply_canonical_recommended":true,"address_semantic_reason_codes":[],"detected_mode":"address_query","query_shape":"AGGREGATE_LOOKUP","detected_intent":"inventory_on_hand_as_of_date","extracted_filters":{"sort":"period_desc","period_from":"2020-05-01","period_to":"2020-05-31","as_of_date":"2020-05-31","organization":"ООО \\Альтернатива Плюс\\"},"selected_recipe":"address_inventory_on_hand_as_of_date_v1","mcp_call_status_legacy":"matched_non_empty","account_scope_mode":"strict","account_scope_fallback_applied":false,"anchor_type":"organization","resolver_confidence":"medium","match_failure_stage":"none","match_failure_reason":null,"mcp_call_status":"matched_non_empty","rows_fetched":10,"raw_rows_received":10,"rows_after_account_scope":10,"rows_after_recipe_filter":10,"rows_materialized":10,"rows_matched":10,"materialization_drop_reason":"none","account_token_raw":null,"account_token_normalized":null,"account_scope_fields_checked":["account_dt","account_kt","registrator","analytics"],"account_scope_match_strategy":"account_code_regex_plus_alias_map_v1","account_scope_drop_reason":"not_applicable","runtime_readiness":"LIVE_QUERYABLE_WITH_LIMITS","limited_reason_category":null,"response_type":"FACTUAL_LIST","limitations":["period_derived_from_month_phrase","as_of_date_derived_from_period_to","organization_from_followup_context"],"assistant_reply":"На 31.05.2020 на складе подтверждено 10 позиций с остатком на 709.168,33 ₽.\n\nПозиции:\n1. Модуль прямоугольый 1400*110*750 | склад: Основной склад | количество: 22,000 | стоимость: 148.261,67 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n2. Конструкция трансформер рабочей станции 1300*900*2000 | склад: Основной склад | количество: 3,000 | стоимость: 498.472,50 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n3. Диван трехместный | склад: Основной склад | количество: 1,000 | стоимость: 34.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n4. Кресло орион | склад: Основной склад | количество: 1,000 | стоимость: 13.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n5. Пуф арий | склад: Основной склад | количество: 1,000 | стоимость: 6.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n6. Столешница 600*3050*26 дуб ниагара | склад: Основной склад | количество: 1,000 | стоимость: 3.724,17 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n7. Столешница 600*3050*26 альмандин | склад: Основной склад | количество: 1,000 | стоимость: 3.075,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n8. Четки Пост (84*117) | склад: Основной склад | количество: 1,000 | стоимость: 833,33 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n9. Кромка с клеем 33 альмандин 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n10. Кромка с клеем 33 дуб ниагара 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2020-05-31T23:59:59Z\n\nПодтверждение:\n- Дата среза: 31.05.2020.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 10.\n- Уникальных складов: 1.\n- Суммарное количество: 33,000.","reply_type":"factual","trace_id":"address-ZuVKDiae0s"}} +{"timestamp":"2026-04-16T20:31:45.072Z","level":"info","service":"assistant_loop","message":"assistant_address_tool_gate_skip","sessionId":"probe-isolated-10236159","details":{"session_id":"probe-isolated-10236159","user_message":"??? ??? ???????? ????????? ????? ????? ??? ???????","effective_address_user_message":"??? ??? ???????? ????????? ????? ????? ??? ???????","address_llm_predecompose_attempted":false,"address_llm_predecompose_applied":false,"address_llm_predecompose_reason":"skipped_in_mock","address_fallback_rule_hit":null,"address_sanitized_user_message":"??? ??? ???????? ????????? ????? ????? ??? ???????","assistant_orchestration_contract_v1":{"schema_version":"assistant_orchestration_contract_v1","hard_meta_mode":"non_domain","address_mode":"unsupported","address_mode_confidence":"low","address_intent":"unknown","address_intent_confidence":"low","strong_data_signal_detected":false,"data_retrieval_signal_detected":false,"followup_context_detected":false,"unsupported_address_intent_fallback_to_deep":false,"final_decision":{"run_address_lane":false,"tool_gate_decision":"skip_address_lane","tool_gate_reason":"non_domain_query_indexed","living_mode":"chat","living_reason":"non_domain_query_indexed"}},"address_tool_gate_decision":"skip_address_lane","address_tool_gate_reason":"non_domain_query_indexed","address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"unspecified","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"]}} +{"timestamp":"2026-04-16T20:31:45.074Z","level":"warn","service":"assistant_loop","message":"assistant_living_chat_failed_fallback_to_deep","sessionId":"probe-isolated-10236159","details":{"session_id":"probe-isolated-10236159","user_message":"??? ??? ???????? ????????? ????? ????? ??? ???????","reason":"OpenAI API key is missing."}} +{"timestamp":"2026-04-16T20:31:45.132Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"probe-isolated-10236159","eventType":"assistant_message","details":{"session_id":"probe-isolated-10236159","message_id":"msg-2Z71y4m5D6","user_message":"??? ??? ???????? ????????? ????? ????? ??? ???????","normalizer_output":{"schema_version":"normalized_query_v1","user_question_raw":"??? ??? ???????? ????????? ????? ????? ??? ???????","normalized_question":"??? ??? ???????? ????????? ????? ????? ??? ???????","intent_class":"simple_factual","business_problem_type":"normalization_playground","domain_entities":["счет"],"accounts_mentioned":[],"documents_mentioned":[],"registers_mentioned":[],"period_scope":{"type":"missing","value":null,"confidence":"low"},"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":[{"field":"period_scope","reason":"period is not explicitly provided","severity":"medium"}],"confidence":{"overall":"low","intent_class":"medium","route_hint":"low"}},"execution_plan":[{"fragment_id":"F1","requirement_ids":["R1"],"route":"store_canonical","should_execute":true,"no_route_reason":null,"clarification_reason":null}],"resolved_execution_state":[],"routes":[{"fragment_id":"F1","route":"store_canonical","reason":"Canonical accounting data path selected.","confidence":"low","intent_class":"simple_factual"}],"retrieval_calls":[{"fragment_id":"F1","requirement_ids":["R1"],"route":"store_canonical","status":"executed","query_text":"??? ??? ???????? ????????? ????? ????? ??? ???????","reason":null}],"retrieval_results_raw":[{"fragment_id":"F1","route":"store_canonical","raw_result":{"status":"ok","result_type":"list","items":[{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","display_name":"00000000180","period":"2020-06-30T12:00:07","counterparty_id":"9a4c4530-b5ae-11e8-93de-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","display_name":"00000000178","period":"2020-06-30T12:00:05","counterparty_id":"4a6289f6-6808-11e8-8e6c-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","display_name":"00000000177","period":"2020-06-30T12:00:04","counterparty_id":"84a55286-970d-11e8-94ba-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","display_name":"00000000176","period":"2020-06-30T12:00:03","counterparty_id":"6be7395c-0231-11e6-8b48-5404a6c12c2c","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","display_name":"00000000175","period":"2020-06-30T12:00:02","counterparty_id":"69879ad0-76de-11e4-9a6c-5404a6c12c2c","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"d57e16a8-b090-11ea-a2db-00155d012600","display_name":"00000000015","period":"2020-06-30T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null},{"source_entity":"Document_РеализацияТоваровУслуг","source_id":"e17f08ca-c51a-11ea-a2e2-00155d012600","display_name":"00000000007","period":"2020-06-23T13:54:25","counterparty_id":"5c528e36-c519-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"0b4f2456-c5b6-11ea-a2e2-00155d012600","display_name":"00000000020","period":"2020-06-22T00:00:00","counterparty_id":"426ce148-ca81-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"04f191a0-b46b-11ea-a2db-00155d012600","display_name":"00000000174","period":"2020-06-19T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null},{"source_entity":"Document_РеализацияТоваровУслуг","source_id":"3f3fca52-a644-11ea-a2d7-00155d012600","display_name":"00000000006","period":"2020-06-19T00:00:00","counterparty_id":"cb5193b1-9a7e-11ea-a2d5-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"f751dbe5-ca80-11ea-a2e2-00155d012600","display_name":"00000000022","period":"2020-06-19T00:00:00","counterparty_id":"a3fe2e97-ca7d-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"9d202b38-b090-11ea-a2db-00155d012600","display_name":"00000000013","period":"2020-06-17T14:49:44","counterparty_id":"b07bb8ce-a010-11e6-91da-50465da00436","recorder":null}],"summary":{"checked_records":42,"returned_records":12,"query_subject":"cross_entity_breakage","semantic_profile":{"query_subject":"cross_entity_breakage","account_scope":[],"subaccount_scope":[],"domain_scope":["settlements"],"document_types":["settlement_document"],"entity_types":["counterparty","document","posting"],"period_scope":{"from":null,"to":null,"granularity":"unknown"},"relation_patterns":["document_to_posting","contract_to_documents"],"lifecycle_stage_filters":["created","posted","closed","reconciled"],"anomaly_patterns":["missing_link","broken_lifecycle"],"ranking_basis":["closure_risk","repeatability","financial_impact"],"excluded_interpretations":[],"explanation_focus":["why_selected","where_chain_breaks","what_business_risk"],"graph_traversal":{"runtime_enabled":true,"eligible":true,"planner_mode":"typed_domain_path","target_domains":["bank_settlement"],"target_relations":["document_to_posting","contract_to_documents","payment_to_settlement","statement_to_document"],"target_signals":["missing_link","broken_lifecycle","posting_mismatch","wrong_document_type","closure_risk"],"target_lifecycle_markers":["closed","reconciled","partially_linked","period_boundary","no_continuation"]}},"ranking_basis":["closure_risk","repeatability","financial_impact"],"domain_purity_guard":{"enabled":false,"domain_card_id":null,"domain_card_title":null,"source_scope":["docs"],"source_pool_records":42,"source_selection_allowed":42,"source_selection_rejected":0,"source_selection_rejected_forbidden":0,"ranking_checked":42,"ranking_allowed":42,"ranking_rejected":0,"promotion_checked":12,"promotion_allowed":12,"promotion_rejected":0,"top1_pure":true,"top3_pure":true,"strict_forbidden_mode":false,"strict_forbidden_fallback_source":false,"strict_forbidden_fallback_ranking":false,"strict_forbidden_fallback_promotion":false},"broad_query_detected":false,"broadness_level":"low","scope_confidence_hint":"high","narrowing_strength":"weak","broad_guard_applied":false,"minimum_evidence_failed":false,"anti_generic_guard_applied":false,"broad_result_flag":false},"evidence":[{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:07"},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:05"},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:04"},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:03"},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","period":"2020-06-30T12:00:02"},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"d57e16a8-b090-11ea-a2db-00155d012600","period":"2020-06-30T12:00:00"}],"why_included":["Показаны последние по дате записи канонического документного слоя.","P0 domain purity was not enforced."],"selection_reason":["Отбор по максимальной дате документа в пределах snapshot.","Semantic profile subject: cross_entity_breakage.","Domain gate source scope not applied."],"risk_factors":["missing_link","broken_lifecycle"],"business_interpretation":["Слой отражает базовый factual-срез документов для оперативной сверки."],"confidence":"high","limitations":["Это read-only snapshot, а не онлайн-состояние 1С.","Domain purity guardrail не применялся."],"errors":[]}}],"retrieval_results_normalized":[{"fragment_id":"F1","requirement_ids":["R1"],"route":"store_canonical","status":"ok","result_type":"list","items":[{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","display_name":"00000000180","period":"2020-06-30T12:00:07","counterparty_id":"9a4c4530-b5ae-11e8-93de-50465da00436","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","display_name":"00000000178","period":"2020-06-30T12:00:05","counterparty_id":"4a6289f6-6808-11e8-8e6c-50465da00436","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","display_name":"00000000177","period":"2020-06-30T12:00:04","counterparty_id":"84a55286-970d-11e8-94ba-50465da00436","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","display_name":"00000000176","period":"2020-06-30T12:00:03","counterparty_id":"6be7395c-0231-11e6-8b48-5404a6c12c2c","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","display_name":"00000000175","period":"2020-06-30T12:00:02","counterparty_id":"69879ad0-76de-11e4-9a6c-5404a6c12c2c","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"04f191a0-b46b-11ea-a2db-00155d012600","display_name":"00000000174","period":"2020-06-19T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null}],"summary":{"checked_records":42,"returned_records":12,"query_subject":"cross_entity_breakage","semantic_profile":{"query_subject":"cross_entity_breakage","account_scope":[],"subaccount_scope":[],"domain_scope":["settlements"],"document_types":["settlement_document"],"entity_types":["counterparty","document","posting"],"period_scope":{"from":null,"to":null,"granularity":"unknown"},"relation_patterns":["document_to_posting","contract_to_documents"],"lifecycle_stage_filters":["created","posted","closed","reconciled"],"anomaly_patterns":["missing_link","broken_lifecycle"],"ranking_basis":["closure_risk","repeatability","financial_impact"],"excluded_interpretations":[],"explanation_focus":["why_selected","where_chain_breaks","what_business_risk"],"graph_traversal":{"runtime_enabled":true,"eligible":true,"planner_mode":"typed_domain_path","target_domains":["bank_settlement"],"target_relations":["document_to_posting","contract_to_documents","payment_to_settlement","statement_to_document"],"target_signals":["missing_link","broken_lifecycle","posting_mismatch","wrong_document_type","closure_risk"],"target_lifecycle_markers":["closed","reconciled","partially_linked","period_boundary","no_continuation"]}},"ranking_basis":["closure_risk","repeatability","financial_impact"],"domain_purity_guard":{"enabled":false,"domain_card_id":null,"domain_card_title":null,"source_scope":["docs"],"source_pool_records":42,"source_selection_allowed":42,"source_selection_rejected":0,"source_selection_rejected_forbidden":0,"ranking_checked":42,"ranking_allowed":42,"ranking_rejected":0,"promotion_checked":12,"promotion_allowed":12,"promotion_rejected":0,"top1_pure":true,"top3_pure":true,"strict_forbidden_mode":false,"strict_forbidden_fallback_source":false,"strict_forbidden_fallback_ranking":false,"strict_forbidden_fallback_promotion":false},"broad_query_detected":false,"broadness_level":"low","scope_confidence_hint":"high","narrowing_strength":"weak","broad_guard_applied":false,"minimum_evidence_failed":false,"anti_generic_guard_applied":false,"broad_result_flag":false,"problem_units_enabled":true,"candidate_evidence_count":6,"problem_units_count":6,"problem_unit_types":["unresolved_settlement_cluster"],"problem_unit_duplicate_collapses":0,"problem_unit_severity_distribution":{"low":0,"medium":6,"high":0},"problem_unit_confidence_distribution":{"low":6,"medium":0,"high":0},"lifecycle_enriched_units":6,"problem_unit_lifecycle_domain_distribution":{"bank_settlement":6},"problem_unit_lifecycle_defect_distribution":{"stale_active_state":6},"graph_runtime_enabled":true,"graph_total_units":6,"graph_bound_units":6,"graph_nodes_count":30,"graph_edges_count":18,"graph_missing_links_count":6,"graph_conflicting_links_count":0,"graph_coverage_grade":"high","graph_domain_distribution":{"bank_settlement":6},"graph_relation_distribution":{"affects_account":5,"affects_document":5,"belongs_to_domain":1,"current_state":1,"expected_state":1,"has_defect":1,"missing_transition":1,"supported_by_evidence":1,"supports_path":2},"claim_bound_targeting":{"claim_type":"prove_settlement_closure_state","required_checks":["payment_document_found","contract_matched","settlement_object_matched","closing_document_found","register_closure_entry_found","posting_link_found"],"targeted_items":6,"targeted_evidence":11,"derived_evidence_added":6},"evidence_admissibility_gate":{"candidate_evidence":11,"admissible_evidence":6,"rejected_evidence":5,"rejected_items":0}},"evidence":[{"evidence_id":"claim-ev-Vc6D4uJmQB","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:07","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:07"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:07"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:07","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-CcdcjKGs7G","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:05","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:05"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:05"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:05","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-RsMQPjU8cS","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:04","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:04"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:04"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:04","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-3_aEkQDIOt","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:03","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:03"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:03"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:03","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-QVWikLmFUA","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600","period":"2020-06-30T12:00:02","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12:00:02"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600","period":"2020-06-30T12:00:02"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:02","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-yscJbTT6nk","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"04f191a0-b46b-11ea-a2db-00155d012600","period":"2020-06-19T12:00:00","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|04f191a0-b46b-11ea-a2db-00155d012600|2020-06-19t12:00:00"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"04f191a0-b46b-11ea-a2db-00155d012600","period":"2020-06-19T12:00:00"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-19T12:00:00","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"04f191a0-b46b-11ea-a2db-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}}],"why_included":["Показаны последние по дате записи канонического документного слоя.","P0 domain purity was not enforced."],"selection_reason":["Отбор по максимальной дате документа в пределах snapshot.","Semantic profile subject: cross_entity_breakage.","Domain gate source scope not applied."],"risk_factors":["missing_link","broken_lifecycle"],"business_interpretation":["Слой отражает базовый factual-срез документов для оперативной сверки."],"confidence":"high","limitations":["Это read-only snapshot, а не онлайн-состояние 1С.","Domain purity guardrail не применялся."],"errors":[],"raw_entities":[{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","display_name":"00000000180","period":"2020-06-30T12:00:07","counterparty_id":"9a4c4530-b5ae-11e8-93de-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","display_name":"00000000178","period":"2020-06-30T12:00:05","counterparty_id":"4a6289f6-6808-11e8-8e6c-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","display_name":"00000000177","period":"2020-06-30T12:00:04","counterparty_id":"84a55286-970d-11e8-94ba-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","display_name":"00000000176","period":"2020-06-30T12:00:03","counterparty_id":"6be7395c-0231-11e6-8b48-5404a6c12c2c","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","display_name":"00000000175","period":"2020-06-30T12:00:02","counterparty_id":"69879ad0-76de-11e4-9a6c-5404a6c12c2c","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"d57e16a8-b090-11ea-a2db-00155d012600","display_name":"00000000015","period":"2020-06-30T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null},{"source_entity":"Document_РеализацияТоваровУслуг","source_id":"e17f08ca-c51a-11ea-a2e2-00155d012600","display_name":"00000000007","period":"2020-06-23T13:54:25","counterparty_id":"5c528e36-c519-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"0b4f2456-c5b6-11ea-a2e2-00155d012600","display_name":"00000000020","period":"2020-06-22T00:00:00","counterparty_id":"426ce148-ca81-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"04f191a0-b46b-11ea-a2db-00155d012600","display_name":"00000000174","period":"2020-06-19T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null},{"source_entity":"Document_РеализацияТоваровУслуг","source_id":"3f3fca52-a644-11ea-a2d7-00155d012600","display_name":"00000000006","period":"2020-06-19T00:00:00","counterparty_id":"cb5193b1-9a7e-11ea-a2d5-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"f751dbe5-ca80-11ea-a2e2-00155d012600","display_name":"00000000022","period":"2020-06-19T00:00:00","counterparty_id":"a3fe2e97-ca7d-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"9d202b38-b090-11ea-a2db-00155d012600","display_name":"00000000013","period":"2020-06-17T14:49:44","counterparty_id":"b07bb8ce-a010-11e6-91da-50465da00436","recorder":null}],"candidate_evidence":[{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-1","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:07","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A07"},"relation_pattern_hits":["document_to_posting","contract_to_documents","domain_hint:bank_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","domain_hint:bank_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-2","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:05","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A05"},"relation_pattern_hits":["document_to_posting","contract_to_documents","domain_hint:bank_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","domain_hint:bank_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-3","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:04","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A04"},"relation_pattern_hits":["document_to_posting","contract_to_documents","domain_hint:bank_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","domain_hint:bank_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-4","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:03","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A03"},"relation_pattern_hits":["document_to_posting","contract_to_documents","domain_hint:bank_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","domain_hint:bank_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-5","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600","period":"2020-06-30T12:00:02","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12%3A00%3A02"},"relation_pattern_hits":["document_to_posting","contract_to_documents","domain_hint:bank_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","domain_hint:bank_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-6","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_ПоступлениеТоваровУслуг","id":"d57e16a8-b090-11ea-a2db-00155d012600","period":"2020-06-30T12:00:00","canonical_ref":"evidence_source_ref_v1|unknown|document_%D0%BF%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%D1%82%D0%BE%D0%B2%D0%B0%D1%80%D0%BE%D0%B2%D1%83%D1%81%D0%BB%D1%83%D0%B3|d57e16a8-b090-11ea-a2db-00155d012600|2020-06-30t12%3A00%3A00"},"relation_pattern_hits":["document_to_posting","contract_to_documents","domain_hint:bank_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","domain_hint:bank_settlement"],"entity_backlinks":[{"entity":"Document_ПоступлениеТоваровУслуг","id":"d57e16a8-b090-11ea-a2db-00155d012600"}],"confidence_hint":"low"}],"problem_units":[{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-1","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: document_to_posting.","business_defect_class":"document_to_posting","severity":{"score":0.48,"grade":"medium"},"confidence":{"score":0.3,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-1"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"bank_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-1","current_lifecycle_state":"stale_unlinked_payment","expected_lifecycle_state":"settlement_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.26,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_unlinked_payment; ожидаемая стадия: settlement_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-1","lifecycle_domain":"bank_settlement","resolved_current_state":"stale_unlinked_payment","resolved_expected_state":"settlement_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.26,"grade":"low"},"resolution_evidence":["cand-ev-F1-1"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":0.98,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-1","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-1"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-2","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: document_to_posting.","business_defect_class":"document_to_posting","severity":{"score":0.48,"grade":"medium"},"confidence":{"score":0.3,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-2"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"bank_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-2","current_lifecycle_state":"stale_unlinked_payment","expected_lifecycle_state":"settlement_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.26,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_unlinked_payment; ожидаемая стадия: settlement_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-2","lifecycle_domain":"bank_settlement","resolved_current_state":"stale_unlinked_payment","resolved_expected_state":"settlement_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.26,"grade":"low"},"resolution_evidence":["cand-ev-F1-2"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":0.98,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-2","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-2","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-2"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-3","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: document_to_posting.","business_defect_class":"document_to_posting","severity":{"score":0.48,"grade":"medium"},"confidence":{"score":0.3,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-3"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"bank_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-3","current_lifecycle_state":"stale_unlinked_payment","expected_lifecycle_state":"settlement_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.26,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_unlinked_payment; ожидаемая стадия: settlement_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-3","lifecycle_domain":"bank_settlement","resolved_current_state":"stale_unlinked_payment","resolved_expected_state":"settlement_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.26,"grade":"low"},"resolution_evidence":["cand-ev-F1-3"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":0.98,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-3","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-3","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-3"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-4","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: document_to_posting.","business_defect_class":"document_to_posting","severity":{"score":0.48,"grade":"medium"},"confidence":{"score":0.3,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-4"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"bank_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-4","current_lifecycle_state":"stale_unlinked_payment","expected_lifecycle_state":"settlement_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.26,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_unlinked_payment; ожидаемая стадия: settlement_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-4","lifecycle_domain":"bank_settlement","resolved_current_state":"stale_unlinked_payment","resolved_expected_state":"settlement_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.26,"grade":"low"},"resolution_evidence":["cand-ev-F1-4"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":0.98,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-4","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-4","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-4"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-5","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: document_to_posting.","business_defect_class":"document_to_posting","severity":{"score":0.48,"grade":"medium"},"confidence":{"score":0.3,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-5"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"bank_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-5","current_lifecycle_state":"stale_unlinked_payment","expected_lifecycle_state":"settlement_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.26,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_unlinked_payment; ожидаемая стадия: settlement_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-5","lifecycle_domain":"bank_settlement","resolved_current_state":"stale_unlinked_payment","resolved_expected_state":"settlement_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.26,"grade":"low"},"resolution_evidence":["cand-ev-F1-5"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":0.98,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-5","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-5","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-5"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-6","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: document_to_posting.","business_defect_class":"document_to_posting","severity":{"score":0.48,"grade":"medium"},"confidence":{"score":0.3,"grade":"low"},"affected_entities":["Document_ПоступлениеТоваровУслуг:d57e16a8-b090-11ea-a2db-00155d012600"],"affected_documents":["Document_ПоступлениеТоваровУслуг:d57e16a8-b090-11ea-a2db-00155d012600"],"affected_postings":[],"affected_accounts":[],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-6"],"entity_backlinks":[{"entity":"Document_ПоступлениеТоваровУслуг","id":"d57e16a8-b090-11ea-a2db-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"bank_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-6","current_lifecycle_state":"stale_unlinked_payment","expected_lifecycle_state":"settlement_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.26,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_unlinked_payment; ожидаемая стадия: settlement_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-6","lifecycle_domain":"bank_settlement","resolved_current_state":"stale_unlinked_payment","resolved_expected_state":"settlement_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.26,"grade":"low"},"resolution_evidence":["cand-ev-F1-6"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":0.98,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-6","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-6","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-6"],"graph_confidence":"low"}}],"problem_unit_summary":{"schema_version":"problem_unit_summary_v0_1","units_total":6,"duplicate_collapses":0,"unit_types":["unresolved_settlement_cluster"],"type_distribution":{"unresolved_settlement_cluster":6},"severity_distribution":{"low":0,"medium":6,"high":0},"confidence_distribution":{"low":6,"medium":0,"high":0},"primary_unit_type":"unresolved_settlement_cluster","lifecycle_enriched_units":6,"lifecycle_domain_distribution":{"bank_settlement":6},"lifecycle_defect_distribution":{"stale_active_state":6},"graph_summary":{"total_units":6,"bound_units":6,"node_count":30,"edge_count":18,"missing_links_count":6,"conflicting_links_count":0,"graph_coverage_grade":"high","domain_distribution":{"bank_settlement":6},"relation_distribution":{"affects_account":5,"affects_document":5,"belongs_to_domain":1,"current_state":1,"expected_state":1,"has_defect":1,"missing_transition":1,"supported_by_evidence":1,"supports_path":2}}},"accounting_graph":{"schema_version":"accounting_graph_v0_1","nodes":[{"node_id":"gnd-account-bank-settlement-account-document-24f17575-c117-11ea-a2e2-00155d0","node_type":"account","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-4"]}},{"node_id":"gnd-account-bank-settlement-account-document-2fdf7d2b-c117-11ea-a2e2-00155d0","node_type":"account","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-3"]}},{"node_id":"gnd-account-bank-settlement-account-document-5dfabe1f-c117-11ea-a2e2-00155d0","node_type":"account","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-2"]}},{"node_id":"gnd-account-bank-settlement-account-document-6f0947d8-bf77-11ea-a2e1-00155d0","node_type":"account","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-5"]}},{"node_id":"gnd-account-bank-settlement-account-document-c921c08a-c117-11ea-a2e2-00155d0","node_type":"account","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1"]}},{"node_id":"gnd-defect-bank-settlement-defect-stale-active-state","node_type":"defect","domain":"bank_settlement","label":"stale_active_state","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-document-bank-settlement-document-document-24f17575-c117-11ea-a2e2-00155d","node_type":"document","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-4"]}},{"node_id":"gnd-document-bank-settlement-document-document-2fdf7d2b-c117-11ea-a2e2-00155d","node_type":"document","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-3"]}},{"node_id":"gnd-document-bank-settlement-document-document-5dfabe1f-c117-11ea-a2e2-00155d","node_type":"document","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-2"]}},{"node_id":"gnd-document-bank-settlement-document-document-6f0947d8-bf77-11ea-a2e1-00155d","node_type":"document","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-5"]}},{"node_id":"gnd-document-bank-settlement-document-document-c921c08a-c117-11ea-a2e2-00155d","node_type":"document","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1"]}},{"node_id":"gnd-document-bank-settlement-document-document-d57e16a8-b090-11ea-a2db-00155d","node_type":"document","domain":"bank_settlement","label":"Document_ПоступлениеТоваровУслуг:d57e16a8-b090-11ea-a2db-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-6"]}},{"node_id":"gnd-domain-bank-settlement-domain-bank-settlement","node_type":"domain","domain":"bank_settlement","label":"bank_settlement","confidence":"low","attributes":{"domain":"bank_settlement"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-1","node_type":"evidence","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-1"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1"],"evidence_ids":["cand-ev-F1-1"]}},{"node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-2","node_type":"evidence","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-2"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-2"],"evidence_ids":["cand-ev-F1-2"]}},{"node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-3","node_type":"evidence","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-3"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-3"],"evidence_ids":["cand-ev-F1-3"]}},{"node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-4","node_type":"evidence","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-4"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-4"],"evidence_ids":["cand-ev-F1-4"]}},{"node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-5","node_type":"evidence","domain":"bank_settlement","label":"Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-5"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-5"],"evidence_ids":["cand-ev-F1-5"]}},{"node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-6","node_type":"evidence","domain":"bank_settlement","label":"Document_ПоступлениеТоваровУслуг:d57e16a8-b090-11ea-a2db-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-6"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-6"]}},{"node_id":"gnd-lifecycle-state-bank-settlement-current-state-stale-unlinked-payment","node_type":"lifecycle_state","domain":"bank_settlement","label":"stale_unlinked_payment","confidence":"low","attributes":{"state_role":"current"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-lifecycle-state-bank-settlement-expected-state-settlement-closed","node_type":"lifecycle_state","domain":"bank_settlement","label":"settlement_closed","confidence":"low","attributes":{"state_role":"expected"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","node_type":"problem_unit","domain":"bank_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-1","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"document_to_posting","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1"],"evidence_ids":["cand-ev-F1-1"]}},{"node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-2","node_type":"problem_unit","domain":"bank_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-2","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"document_to_posting","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-2"],"evidence_ids":["cand-ev-F1-2"]}},{"node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-3","node_type":"problem_unit","domain":"bank_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-3","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"document_to_posting","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-3"],"evidence_ids":["cand-ev-F1-3"]}},{"node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-4","node_type":"problem_unit","domain":"bank_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-4","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"document_to_posting","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-4"],"evidence_ids":["cand-ev-F1-4"]}},{"node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-5","node_type":"problem_unit","domain":"bank_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-5","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"document_to_posting","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-5"],"evidence_ids":["cand-ev-F1-5"]}},{"node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-6","node_type":"problem_unit","domain":"bank_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-6","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"document_to_posting","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-6"]}},{"node_id":"gnd-transition-bank-settlement-hint-contract-to-documents","node_type":"transition","domain":"bank_settlement","label":"contract_to_documents","confidence":"low","attributes":{"transition_role":"hint"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-transition-bank-settlement-hint-document-to-posting","node_type":"transition","domain":"bank_settlement","label":"document_to_posting","confidence":"low","attributes":{"transition_role":"hint"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-transition-bank-settlement-missing-transition-expected-transition-not-obser","node_type":"transition","domain":"bank_settlement","label":"expected_transition_not_observed","confidence":"low","attributes":{"transition_role":"missing"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}}],"edges":[{"edge_id":"ged-affects-account-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-account-bank-settlement-account-document-24f","relation_type":"affects_account","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-4","to_node_id":"gnd-account-bank-settlement-account-document-24f17575-c117-11ea-a2e2-00155d0","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-4"]}},{"edge_id":"ged-affects-account-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-account-bank-settlement-account-document-2fd","relation_type":"affects_account","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-3","to_node_id":"gnd-account-bank-settlement-account-document-2fdf7d2b-c117-11ea-a2e2-00155d0","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-3"]}},{"edge_id":"ged-affects-account-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-account-bank-settlement-account-document-5df","relation_type":"affects_account","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-2","to_node_id":"gnd-account-bank-settlement-account-document-5dfabe1f-c117-11ea-a2e2-00155d0","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-2"]}},{"edge_id":"ged-affects-account-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-account-bank-settlement-account-document-6f0","relation_type":"affects_account","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-5","to_node_id":"gnd-account-bank-settlement-account-document-6f0947d8-bf77-11ea-a2e1-00155d0","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-5"]}},{"edge_id":"ged-affects-account-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-account-bank-settlement-account-document-c92","relation_type":"affects_account","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-account-bank-settlement-account-document-c921c08a-c117-11ea-a2e2-00155d0","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1"]}},{"edge_id":"ged-affects-document-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-document-bank-settlement-document-document-2","relation_type":"affects_document","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-3","to_node_id":"gnd-document-bank-settlement-document-document-2fdf7d2b-c117-11ea-a2e2-00155d","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-3","cand-ev-F1-4"]}},{"edge_id":"ged-affects-document-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-document-bank-settlement-document-document-5","relation_type":"affects_document","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-2","to_node_id":"gnd-document-bank-settlement-document-document-5dfabe1f-c117-11ea-a2e2-00155d","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-2"]}},{"edge_id":"ged-affects-document-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-document-bank-settlement-document-document-6","relation_type":"affects_document","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-5","to_node_id":"gnd-document-bank-settlement-document-document-6f0947d8-bf77-11ea-a2e1-00155d","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-5"]}},{"edge_id":"ged-affects-document-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-document-bank-settlement-document-document-c","relation_type":"affects_document","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-document-bank-settlement-document-document-c921c08a-c117-11ea-a2e2-00155d","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1"]}},{"edge_id":"ged-affects-document-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-document-bank-settlement-document-document-d","relation_type":"affects_document","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-6","to_node_id":"gnd-document-bank-settlement-document-document-d57e16a8-b090-11ea-a2db-00155d","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-6"]}},{"edge_id":"ged-belongs-to-domain-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-domain-bank-settlement-domain-bank-settlemen","relation_type":"belongs_to_domain","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-domain-bank-settlement-domain-bank-settlement","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-current-state-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-lifecycle-state-bank-settlement-current-stat","relation_type":"current_state","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-lifecycle-state-bank-settlement-current-state-stale-unlinked-payment","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-expected-state-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-lifecycle-state-bank-settlement-expected-sta","relation_type":"expected_state","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-lifecycle-state-bank-settlement-expected-state-settlement-closed","domain":"bank_settlement","confidence":"low","flags":["expected_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-has-defect-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-defect-bank-settlement-defect-stale-active-s","relation_type":"has_defect","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-defect-bank-settlement-defect-stale-active-state","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-missing-transition-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-transition-bank-settlement-missing-transitio","relation_type":"missing_transition","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-transition-bank-settlement-missing-transition-expected-transition-not-obser","domain":"bank_settlement","confidence":"low","flags":["missing_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-supported-by-evidence-gnd-problem-unit-bank-settlement-problem-pu-unre-gnd-evidence-bank-settlement-evidence-cand-ev-f1","relation_type":"supported_by_evidence","from_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-1","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-supports-path-gnd-evidence-bank-settlement-evidence-cand-ev-f1-gnd-transition-bank-settlement-hint-contract-to-","relation_type":"supports_path","from_node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-1","to_node_id":"gnd-transition-bank-settlement-hint-contract-to-documents","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-supports-path-gnd-evidence-bank-settlement-evidence-cand-ev-f1-gnd-transition-bank-settlement-hint-document-to-","relation_type":"supports_path","from_node_id":"gnd-evidence-bank-settlement-evidence-cand-ev-f1-1","to_node_id":"gnd-transition-bank-settlement-hint-document-to-posting","domain":"bank_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}}],"unit_bindings":[{"problem_unit_id":"pu-unresolved_settlement_cluster-1","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-1","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-1"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-2","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-2","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-2"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-3","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-3","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-3"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-4","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-4","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-4"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-5","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-5","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-5"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-6","graph_node_id":"gnd-problem-unit-bank-settlement-problem-pu-unresolved-settlement-cluster-6","relation_path":["domain:bank_settlement","state:stale_unlinked_payment->settlement_closed","payment_to_settlement","wrong_closing_document_type","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-6"],"graph_confidence":"low"}],"summary":{"total_units":6,"bound_units":6,"node_count":30,"edge_count":18,"missing_links_count":6,"conflicting_links_count":0,"graph_coverage_grade":"high","domain_distribution":{"bank_settlement":6},"relation_distribution":{"affects_account":5,"affects_document":5,"belongs_to_domain":1,"current_state":1,"expected_state":1,"has_defect":1,"missing_transition":1,"supported_by_evidence":1,"supports_path":2}},"issues":[]}}],"requirements_extracted":[{"requirement_id":"R1","source_fragment_id":"F1","requirement_text":"??? ??? ???????? ????????? ????? ????? ??? ???????","subject_tokens":[],"status":"covered","route":"store_canonical"}],"requirements_total":1,"requirements_covered":1,"requirements_uncovered":[],"coverage_status":"full","answer_grounding_status":"no_grounded_answer","reply_semantic_type":"partial_coverage","why_included_summary":["Показаны последние по дате записи канонического документного слоя.","P0 domain purity was not enforced."],"selection_reason_summary":["Отбор по максимальной дате документа в пределах snapshot.","Semantic profile subject: cross_entity_breakage.","Domain gate source scope not applied."],"route_subject_match":true,"clarification_target":[],"dropped_intent_segments":[],"question_type_class":"unknown","company_anchors":{"contract_numbers":[],"document_numbers":[],"dates":[],"amounts":[],"accounts":[],"periods":[],"document_types":[],"all":[]},"analysis_context_applied":false,"analysis_context":null,"business_scope_raw":[],"business_scope_resolved":["company_specific_accounting"],"company_grounding_applied":true,"scope_resolution_reason":["settlement_claim_company_scope_recovery"],"company_scope_resolution_reason":["settlement_claim_company_scope_recovery"],"raw_time_anchor":null,"raw_time_scope":null,"resolved_time_anchor":null,"resolved_primary_period":null,"effective_primary_period":null,"temporal_guard_input":null,"temporal_alignment_status":"conflicting","temporal_resolution_source":"normalized_time_scope:missing","temporal_guard_basis":"none","temporal_guard_applied":false,"temporal_guard_outcome":"passed","temporal_guard":{"raw_time_anchor":null,"raw_time_scope":null,"resolved_time_anchor":null,"resolved_primary_period":null,"effective_primary_period":null,"temporal_guard_input":null,"temporal_alignment_status":"conflicting","temporal_resolution_source":"normalized_time_scope:missing","temporal_guard_basis":"none","temporal_guard_applied":false,"temporal_guard_outcome":"passed","primary_period_window":null,"allowed_context_window":null,"controlled_temporal_expansion_enabled":false,"context_expansion_reasons_allowed":["prehistory","carryover","post_period_closure","long_running_contract_context"],"normalized_anchor_drift_detected":false,"reason_codes":["missing_resolved_primary_period"]},"raw_numeric_tokens":[],"classified_numeric_tokens":[],"rejected_as_non_accounts":[],"resolved_account_anchors":[],"domain_polarity_guard":{"applied":false,"polarity":"not_applicable","outcome":"not_applicable","supplier_score":0,"customer_score":0,"account_scope":[],"raw_numeric_tokens":[],"classified_numeric_tokens":[],"rejected_as_non_accounts":[],"resolved_account_anchors":[],"rejected_problem_units":0,"rejected_evidence":0,"critical_contradiction":false,"reason_codes":[]},"claim_anchor_audit":{"claim_type":"prove_settlement_closure_state","settlement_role":"unknown","settlement_role_resolution_reason":["settlement_role_resolved_unknown"],"polarity_resolution_status":"unknown","required_anchors":["period","account_scope","counterparty_scope_or_contract","closure_signal"],"resolved_anchors":{"period":[],"account_scope":[],"amounts":[],"contract":[],"document_numbers":[],"document_types":[],"counterparty_scope":[],"advance_signal":[],"closure_signal":[],"vat_signal":[],"chain_signal":[],"close_signal":[],"cost_scope":[],"rbp_signal":[],"writeoff_signal":[],"fixed_asset_signal":[],"amortization_signal":[],"expected_fa_set":[],"actual_fa_set":[]},"missing_anchors":["period","account_scope","counterparty_scope_or_contract","closure_signal"],"claim_anchor_resolution_rate":0,"primary_period":null,"allowed_context_window":null,"context_expansion_reasons_allowed":["prehistory","carryover","post_period_closure","long_running_contract_context"],"reason_codes":["claim_missing_required_anchors","claim_anchor_resolution_low","unresolved_supplier_customer_polarity"]},"settlement_role":"unknown","settlement_role_resolution_reason":["settlement_role_resolved_unknown"],"polarity_resolution_status":"unknown","targeted_evidence_acquisition":{"claim_type":"prove_settlement_closure_state","required_checks":["payment_document_found","contract_matched","settlement_object_matched","closing_document_found","register_closure_entry_found","posting_link_found"],"check_status":{"payment_document_found":"found","contract_matched":"not_found","settlement_object_matched":"not_found","closing_document_found":"not_found","register_closure_entry_found":"not_found","posting_link_found":"not_found"},"targeted_item_hits":6,"targeted_evidence_hits":11,"targeted_evidence_hit_rate":0.1667,"targeted_evidence_source_refs":["evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:07","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:05","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:04","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:03","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12:00:02","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|04f191a0-b46b-11ea-a2db-00155d012600|2020-06-19t12:00:00","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A07","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A05","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A04","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A03","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12%3A00%3A02"],"reason_codes":["targeted_evidence_hit_rate_low"]},"evidence_admissibility_gate":{"candidate_evidence_total":11,"admissible_evidence_count":6,"rejected_evidence_count":5,"rejected_item_count":0,"reject_breakdown":{"wrong_period":0,"wrong_domain":0,"wrong_account_scope":0,"weak_source_mapping":5,"zero_live_match":0,"future_dated_or_out_of_window":0},"category_breakdown":{"hard_evidence":6,"supporting_signal":0,"inadmissible_noise":5},"reason_codes":["inadmissible_evidence_filtered"]},"eligibility_time_basis":"none","grounded_answer_eligibility_guard":{"eligible":false,"temporal_passed":true,"eligibility_time_basis":"none","business_scope_passed":true,"polarity_passed":true,"claim_anchors_passed":false,"claim_anchor_resolution_rate":0,"missing_required_anchors":4,"admissible_evidence_count":6,"critical_contradiction":false,"outcome":"limited_or_insufficient_evidence","grounding_mode":"limited_or_insufficient_evidence","reason_codes":["claim_anchor_coverage_insufficient"]},"problem_centric_answer_applied":true,"problem_units_used_count":4,"problem_answer_mode":"stage3_lifecycle_aware_v1","problem_unit_ids_used":["pu-unresolved_settlement_cluster-1","pu-unresolved_settlement_cluster-2","pu-unresolved_settlement_cluster-3","pu-unresolved_settlement_cluster-4"],"assistant_outcome_class_v1":"PARTIALLY_ANSWERED","assistant_orchestration_contracts_v1":{"query_frame":{"schema_version":"assistant_query_frame_v1","original_user_question":"??? ??? ???????? ????????? ????? ????? ??? ???????","normalized_question":"??? ??? ???????? ????????? ????? ????? ??? ???????","route_summary_mode":"legacy_v1","fragments_total":0,"dropped_intent_segments":[],"analysis_context":null},"execution_plan":{"schema_version":"assistant_execution_plan_v1","steps":[{"fragment_id":"F1","route":"store_canonical","should_execute":true,"requirement_ids":["R1"],"no_route_reason":null,"clarification_reason":null}],"requirements_total":1},"evidence_bundle":{"schema_version":"assistant_evidence_bundle_v1","retrieval_calls_total":1,"retrieval_results_total":1,"retrieval_status_breakdown":{"ok":1,"partial":0,"empty":0,"error":0},"evidence_total":6,"source_refs_total":6,"limitation_total":2,"error_total":0},"coverage":{"schema_version":"assistant_coverage_contract_v1","coverage_report":{"requirements_total":1,"requirements_covered":1,"requirements_uncovered":[],"requirements_partially_covered":[],"clarification_needed_for":[],"out_of_scope_requirements":[]},"grounding":{"status":"no_grounded_answer","route_subject_match":true,"missing_requirements":[],"reasons":["Не хватает ключевых ориентиров в вопросе (период, объект или контрагент)."],"why_included_summary":["Показаны последние по дате записи канонического документного слоя.","P0 domain purity was not enforced."],"selection_reason_summary":["Отбор по максимальной дате документа в пределах snapshot.","Semantic profile subject: cross_entity_breakage.","Domain gate source scope not applied."]},"outcome_class":"PARTIALLY_ANSWERED"}},"answer_contract_stage4_v1":{"schema_version":"stage4_answer_contract_audit_v1","stage4_blocks_expected":["Коротко","Что именно проверено","Что найдено","Что пока не доказано","Что проверить первым/Что могу сделать сейчас"],"stage4_blocks_present":["Коротко","Что именно проверено","Что найдено","Что пока не доказано","Что проверить первым/Что могу сделать сейчас"],"stage4_blocks_missing":[],"legacy_blocks_present":[],"is_stage4_shape":true},"answer_structure_v11":{"schema_version":"answer_structure_v1_1","answer_summary":"Выявлены связанные проблемные контуры: подтверждены разрывы и конфликты между участками цепочки (6 из 6 узлов).","direct_answer":"Текущая стадия: stale_unlinked_payment; ожидаемая стадия: settlement_closed. Объект завис во времени и не дошел до ожидаемого перехода; подтверждение пока частичное, вывод ограничен.","mechanism_block":{"status":"limited","mechanism_notes":["Mechanism candidate: document_to_posting."],"limitation_reason_codes":[]},"evidence_block":{"evidence_ids":["claim-ev-Vc6D4uJmQB","claim-ev-CcdcjKGs7G","claim-ev-RsMQPjU8cS","claim-ev-3_aEkQDIOt","claim-ev-QVWikLmFUA","claim-ev-yscJbTT6nk"],"source_refs":["evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:07","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:05","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:04","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:03","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12:00:02","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|04f191a0-b46b-11ea-a2db-00155d012600|2020-06-19t12:00:00"],"mechanism_notes":["Mechanism candidate: document_to_posting."],"coverage_note":"coverage_full_or_near_full","claim_evidence_links":[{"claim_ref":"claim:prove_settlement_closure_state","evidence_ids":["claim-ev-Vc6D4uJmQB","claim-ev-CcdcjKGs7G","claim-ev-RsMQPjU8cS","claim-ev-3_aEkQDIOt","claim-ev-QVWikLmFUA","claim-ev-yscJbTT6nk"]}]},"uncertainty_block":{"open_uncertainties":["missing_anchor:period"],"limitations":["Problem units remain weak-confidence; conclusions are intentionally limited.","Период в запросе не указан; вывод ограничен и требует проверки в конкретном периоде.","Это read-only snapshot, а не онлайн-состояние 1С.","Не хватает ключевых ориентиров в вопросе (период, объект или контрагент)."]},"next_step_block":{"recommended_actions":["Сверьте хвосты по расчетам: закрылся ли документ оплаты корректным закрывающим документом.","Проверьте, почему объект завис: ожидаемый переход не должен оставаться в активной стадии.","Уточните период проверки (например, июль 2020), чтобы подтвердить незавершенное списание без лишнего шума."],"clarification_questions":[]}},"investigation_state_snapshot":{"schema_version":"investigation_state_v1","session_id":"probe-isolated-10236159","status":"active","turn_index":1,"updated_at":"2026-04-16T20:31:45.128Z","question_id":"msg-ST20JDd-yW","question_scope_id":"d:store_canonical|s:??? ??? ???????? ????????? ????? ????? ??? ???????","scope_origin":"route_derived","focus":{"domain":"store_canonical","period":null,"primary_accounts":[],"active_query_subject":"??? ??? ???????? ????????? ????? ????? ??? ???????"},"narrowing_status":"not_needed","evidence_refs":["claim-ev-Vc6D4uJmQB","claim-ev-CcdcjKGs7G","claim-ev-RsMQPjU8cS","claim-ev-3_aEkQDIOt","claim-ev-QVWikLmFUA","claim-ev-yscJbTT6nk"],"open_uncertainties":["Это read-only snapshot, а не онлайн-состояние 1С.","Domain purity guardrail не применялся."],"last_answer_mode":"partial_coverage","followup_context":{"previous_question_id":null,"last_user_message":"??? ??? ???????? ????????? ????? ????? ??? ???????","referenced_requirement_ids":["R1"],"active_domain":"store_canonical","active_requirement_ids":["R1"],"uncovered_requirement_ids":[],"last_problem_unit_id":"pu-unresolved_settlement_cluster-1","settlement_next_actions":[],"evidence_summary":["R1:ok:store_canonical"],"question_scope_id":"d:store_canonical|s:??? ??? ???????? ????????? ????? ????? ??? ???????","scope_origin":"route_derived"},"query_mode_hint":"direct_answer","problem_unit_state":{"active_problem_units":["pu-unresolved_settlement_cluster-1","pu-unresolved_settlement_cluster-2","pu-unresolved_settlement_cluster-3","pu-unresolved_settlement_cluster-4","pu-unresolved_settlement_cluster-5","pu-unresolved_settlement_cluster-6"],"resolved_problem_units":[],"problem_unit_backlinks":[{"problem_unit_id":"pu-unresolved_settlement_cluster-1","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-2","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-3","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-4","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-5","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-6","entity_backlinks":[{"entity":"Document_ПоступлениеТоваровУслуг","id":"d57e16a8-b090-11ea-a2db-00155d012600"}]}],"focus_problem_types":["unresolved_settlement_cluster"]}},"fallback_type":"partial","assistant_reply":"Коротко: Часть признаков подтверждена, для полного вывода нужна допроверка.\n\nЧто именно проверено:\n- Вывод опирается на 6 подтвержденных наблюдений в текущем срезе.\n- Проверены связанные документы и проводки по 6 источникам.\n- Есть связка между основным выводом и подтверждающими записями.\n- Опора частичная: не по всем объектам ОС подтверждено попадание в начисление амортизации.\n\nЧто найдено:\n- Оплата зависла без подтвержденного закрытия расчета. расчет закрыт. Текущая стадия ожидаемая стадия. Объект завис во времени и не дошел до ожидаемого перехода подтверждение пока частичное, вывод ограничен.\n- По ОС часть переходов к начислению амортизации подтверждена не полностью, поэтому есть риск пропуска отдельных объектов.\n\nЧто пока не доказано:\n- Надежность problem-сигнала низкая, поэтому вывод ограничен.\n- Период в запросе не указан; вывод ограничен и требует проверки в конкретном периоде.\n- Оценка сделана на snapshot-срезе и может не включать часть цепочки.\n- Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).\n- Период проверки не указан.\n\nЧто проверить первым:\n- Уточните период проверки, чтобы подтвердить проблему без лишнего шума.\n- Проверьте по каждому объекту ОС карточку и параметр амортизации (способ, срок, дата начала начисления).\n- Сверьте хвосты по расчетам: закрылся ли документ оплаты корректным закрывающим документом.\n- Проверьте, почему объект завис: ожидаемый переход не должен оставаться в активной стадии.","reply_type":"partial_coverage","trace_id":"CfX9ddtHgDvCjh"}} +{"timestamp":"2026-04-16T20:31:45.171Z","level":"info","service":"assistant_loop","message":"assistant_address_tool_gate_skip","sessionId":"probe-isolated-54062565","details":{"session_id":"probe-isolated-54062565","user_message":"?????? ?????? ?? ????? 60 ?? ?????? 2022","effective_address_user_message":"?????? ?????? ?? ????? 60 ?? ?????? 2022","address_llm_predecompose_attempted":false,"address_llm_predecompose_applied":false,"address_llm_predecompose_reason":"skipped_in_mock","address_fallback_rule_hit":null,"address_sanitized_user_message":"?????? ?????? ?? ????? 60 ?? ?????? 2022","assistant_orchestration_contract_v1":{"schema_version":"assistant_orchestration_contract_v1","hard_meta_mode":null,"address_mode":"unsupported","address_mode_confidence":"low","address_intent":"unknown","address_intent_confidence":"low","strong_data_signal_detected":false,"data_retrieval_signal_detected":false,"semantic_contract_valid":false,"semantic_apply_canonical_recommended":false,"semantic_reason_codes":["unsupported_low_confidence_contract"],"semantic_route_arbitration":{"supported_address_intent_detected":false,"strict_deep_investigation_bypass_allowed":false,"semantic_deep_investigation_hint_detected":false,"semantic_aggregate_shape_detected":false,"followup_semantic_override_to_deep_allowed":false},"followup_context_detected":false,"unsupported_address_intent_fallback_to_deep":false,"deep_analysis_signal_fallback_to_deep":false,"aggregate_analytics_signal_fallback_to_deep":false,"deep_session_continuation_fallback_to_deep":false,"final_decision":{"run_address_lane":false,"tool_gate_decision":"skip_address_lane","tool_gate_reason":"llm_predecompose_semantic_guard_rejected","living_mode":"deep_analysis","living_reason":"mock_mode_keeps_deep_pipeline"}},"address_tool_gate_decision":"skip_address_lane","address_tool_gate_reason":"llm_predecompose_semantic_guard_rejected","address_llm_predecompose_contract_intent":"unknown","address_llm_predecompose_contract_aggregation_profile":"unknown","address_llm_predecompose_contract_period_scope":"year","address_semantic_contract_valid":false,"address_semantic_contract_quality":"low","address_semantic_apply_canonical_recommended":false,"address_semantic_reason_codes":["unsupported_low_confidence_contract"]}} +{"timestamp":"2026-04-16T20:31:45.226Z","level":"info","service":"assistant_loop","message":"assistant_message_processed","sessionId":"probe-isolated-54062565","eventType":"assistant_message","details":{"session_id":"probe-isolated-54062565","message_id":"msg-mfD9wmEnDr","user_message":"?????? ?????? ?? ????? 60 ?? ?????? 2022","normalizer_output":{"schema_version":"normalized_query_v1","user_question_raw":"?????? ?????? ?? ????? 60 ?? ?????? 2022","normalized_question":"?????? ?????? ?? ????? 60 ?? ?????? 2022","intent_class":"simple_factual","business_problem_type":"normalization_playground","domain_entities":["счет"],"accounts_mentioned":[],"documents_mentioned":[],"registers_mentioned":[],"period_scope":{"type":"inferred","value":"2020-06","confidence":"medium"},"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":true,"needs_evidence":false},"expected_output_shape":"point_answer","route_hint":"store_canonical","ambiguities":[],"confidence":{"overall":"medium","intent_class":"medium","route_hint":"medium"}},"execution_plan":[{"fragment_id":"F1","requirement_ids":["R1"],"route":"store_canonical","should_execute":true,"no_route_reason":null,"clarification_reason":null}],"resolved_execution_state":[],"routes":[{"fragment_id":"F1","route":"store_canonical","reason":"Canonical accounting data path selected.","confidence":"medium","intent_class":"simple_factual"}],"retrieval_calls":[{"fragment_id":"F1","requirement_ids":["R1"],"route":"store_canonical","status":"executed","query_text":"?????? ?????? ?? ????? 60 ?? ?????? 2022","reason":null}],"retrieval_results_raw":[{"fragment_id":"F1","route":"store_canonical","raw_result":{"status":"ok","result_type":"list","items":[{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","display_name":"00000000180","period":"2020-06-30T12:00:07","counterparty_id":"9a4c4530-b5ae-11e8-93de-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","display_name":"00000000178","period":"2020-06-30T12:00:05","counterparty_id":"4a6289f6-6808-11e8-8e6c-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","display_name":"00000000177","period":"2020-06-30T12:00:04","counterparty_id":"84a55286-970d-11e8-94ba-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","display_name":"00000000176","period":"2020-06-30T12:00:03","counterparty_id":"6be7395c-0231-11e6-8b48-5404a6c12c2c","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","display_name":"00000000175","period":"2020-06-30T12:00:02","counterparty_id":"69879ad0-76de-11e4-9a6c-5404a6c12c2c","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"d57e16a8-b090-11ea-a2db-00155d012600","display_name":"00000000015","period":"2020-06-30T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null},{"source_entity":"Document_РеализацияТоваровУслуг","source_id":"e17f08ca-c51a-11ea-a2e2-00155d012600","display_name":"00000000007","period":"2020-06-23T13:54:25","counterparty_id":"5c528e36-c519-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"0b4f2456-c5b6-11ea-a2e2-00155d012600","display_name":"00000000020","period":"2020-06-22T00:00:00","counterparty_id":"426ce148-ca81-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"04f191a0-b46b-11ea-a2db-00155d012600","display_name":"00000000174","period":"2020-06-19T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null},{"source_entity":"Document_РеализацияТоваровУслуг","source_id":"3f3fca52-a644-11ea-a2d7-00155d012600","display_name":"00000000006","period":"2020-06-19T00:00:00","counterparty_id":"cb5193b1-9a7e-11ea-a2d5-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"f751dbe5-ca80-11ea-a2e2-00155d012600","display_name":"00000000022","period":"2020-06-19T00:00:00","counterparty_id":"a3fe2e97-ca7d-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"9d202b38-b090-11ea-a2db-00155d012600","display_name":"00000000013","period":"2020-06-17T14:49:44","counterparty_id":"b07bb8ce-a010-11e6-91da-50465da00436","recorder":null}],"summary":{"checked_records":182,"returned_records":12,"query_subject":"supplier_tail_analysis","semantic_profile":{"query_subject":"supplier_tail_analysis","account_scope":["60"],"subaccount_scope":[],"domain_scope":["suppliers","settlements","customers","supplier_payments"],"document_types":["supplier_receipt","settlement_document","sales_document","payment_order"],"entity_types":["counterparty","contract","document","posting"],"period_scope":{"from":"2022-01-01","to":"2022-12-31","granularity":"year"},"relation_patterns":["payment_to_settlement","contract_to_documents","document_to_posting"],"lifecycle_stage_filters":["created","posted","closed","reconciled"],"anomaly_patterns":["missing_link","broken_lifecycle","closure_risk"],"ranking_basis":["closure_risk","repeatability","financial_impact"],"excluded_interpretations":[],"explanation_focus":["why_selected","where_chain_breaks","what_business_risk"],"graph_traversal":{"runtime_enabled":true,"eligible":true,"planner_mode":"typed_domain_path","target_domains":["bank_settlement","customer_settlement"],"target_relations":["payment_to_settlement","contract_to_documents","document_to_posting","statement_to_document"],"target_signals":["missing_link","broken_lifecycle","closure_risk","posting_mismatch","wrong_document_type"],"target_lifecycle_markers":["closed","reconciled","partially_linked","period_boundary","no_continuation"]}},"ranking_basis":["closure_risk","repeatability","financial_impact"],"domain_purity_guard":{"enabled":true,"domain_card_id":"settlements_60_62","domain_card_title":"Settlements and bank flow (60-62)","source_scope":["docs","keyFields"],"source_pool_records":182,"source_selection_allowed":42,"source_selection_rejected":140,"source_selection_rejected_forbidden":0,"ranking_checked":42,"ranking_allowed":42,"ranking_rejected":0,"promotion_checked":12,"promotion_allowed":12,"promotion_rejected":0,"top1_pure":true,"top3_pure":true,"strict_forbidden_mode":true,"strict_forbidden_fallback_source":true,"strict_forbidden_fallback_ranking":true,"strict_forbidden_fallback_promotion":true},"broad_query_detected":false,"broadness_level":"low","scope_confidence_hint":"high","narrowing_strength":"weak","broad_guard_applied":false,"minimum_evidence_failed":false,"anti_generic_guard_applied":false,"broad_result_flag":false},"evidence":[{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:07"},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:05"},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:04"},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:03"},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","period":"2020-06-30T12:00:02"},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"d57e16a8-b090-11ea-a2db-00155d012600","period":"2020-06-30T12:00:00"}],"why_included":["Показаны последние по дате записи канонического документного слоя.","P0 domain purity enforced for settlements_60_62."],"selection_reason":["Отбор по максимальной дате документа в пределах snapshot.","Semantic profile subject: supplier_tail_analysis.","Domain gate source scope: docs, keyFields."],"risk_factors":["missing_link","broken_lifecycle","closure_risk"],"business_interpretation":["Слой отражает базовый factual-срез документов для оперативной сверки."],"confidence":"high","limitations":["Это read-only snapshot, а не онлайн-состояние 1С.","Canonical output ограничен доменным runtime-контрактом."],"errors":[]}}],"retrieval_results_normalized":[{"fragment_id":"F1","requirement_ids":["R1"],"route":"store_canonical","status":"ok","result_type":"list","items":[{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","display_name":"00000000180","period":"2020-06-30T12:00:07","counterparty_id":"9a4c4530-b5ae-11e8-93de-50465da00436","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","display_name":"00000000178","period":"2020-06-30T12:00:05","counterparty_id":"4a6289f6-6808-11e8-8e6c-50465da00436","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","display_name":"00000000177","period":"2020-06-30T12:00:04","counterparty_id":"84a55286-970d-11e8-94ba-50465da00436","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","display_name":"00000000176","period":"2020-06-30T12:00:03","counterparty_id":"6be7395c-0231-11e6-8b48-5404a6c12c2c","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","display_name":"00000000175","period":"2020-06-30T12:00:02","counterparty_id":"69879ad0-76de-11e4-9a6c-5404a6c12c2c","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"04f191a0-b46b-11ea-a2db-00155d012600","display_name":"00000000174","period":"2020-06-19T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null,"claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null}],"summary":{"checked_records":182,"returned_records":12,"query_subject":"supplier_tail_analysis","semantic_profile":{"query_subject":"supplier_tail_analysis","account_scope":["60"],"subaccount_scope":[],"domain_scope":["suppliers","settlements","customers","supplier_payments"],"document_types":["supplier_receipt","settlement_document","sales_document","payment_order"],"entity_types":["counterparty","contract","document","posting"],"period_scope":{"from":"2022-01-01","to":"2022-12-31","granularity":"year"},"relation_patterns":["payment_to_settlement","contract_to_documents","document_to_posting"],"lifecycle_stage_filters":["created","posted","closed","reconciled"],"anomaly_patterns":["missing_link","broken_lifecycle","closure_risk"],"ranking_basis":["closure_risk","repeatability","financial_impact"],"excluded_interpretations":[],"explanation_focus":["why_selected","where_chain_breaks","what_business_risk"],"graph_traversal":{"runtime_enabled":true,"eligible":true,"planner_mode":"typed_domain_path","target_domains":["bank_settlement","customer_settlement"],"target_relations":["payment_to_settlement","contract_to_documents","document_to_posting","statement_to_document"],"target_signals":["missing_link","broken_lifecycle","closure_risk","posting_mismatch","wrong_document_type"],"target_lifecycle_markers":["closed","reconciled","partially_linked","period_boundary","no_continuation"]}},"ranking_basis":["closure_risk","repeatability","financial_impact"],"domain_purity_guard":{"enabled":true,"domain_card_id":"settlements_60_62","domain_card_title":"Settlements and bank flow (60-62)","source_scope":["docs","keyFields"],"source_pool_records":182,"source_selection_allowed":42,"source_selection_rejected":140,"source_selection_rejected_forbidden":0,"ranking_checked":42,"ranking_allowed":42,"ranking_rejected":0,"promotion_checked":12,"promotion_allowed":12,"promotion_rejected":0,"top1_pure":true,"top3_pure":true,"strict_forbidden_mode":true,"strict_forbidden_fallback_source":true,"strict_forbidden_fallback_ranking":true,"strict_forbidden_fallback_promotion":true},"broad_query_detected":false,"broadness_level":"low","scope_confidence_hint":"high","narrowing_strength":"weak","broad_guard_applied":false,"minimum_evidence_failed":false,"anti_generic_guard_applied":false,"broad_result_flag":false,"problem_units_enabled":true,"candidate_evidence_count":6,"problem_units_count":6,"problem_unit_types":["unresolved_settlement_cluster"],"problem_unit_duplicate_collapses":0,"problem_unit_severity_distribution":{"low":0,"medium":6,"high":0},"problem_unit_confidence_distribution":{"low":6,"medium":0,"high":0},"lifecycle_enriched_units":6,"problem_unit_lifecycle_domain_distribution":{"customer_settlement":6},"problem_unit_lifecycle_defect_distribution":{"stale_active_state":6},"graph_runtime_enabled":true,"graph_total_units":6,"graph_bound_units":6,"graph_nodes_count":30,"graph_edges_count":10,"graph_missing_links_count":6,"graph_conflicting_links_count":0,"graph_coverage_grade":"high","graph_domain_distribution":{"customer_settlement":6},"graph_relation_distribution":{"affects_account":1,"affects_document":1,"belongs_to_domain":1,"current_state":1,"expected_state":1,"has_defect":1,"missing_transition":1,"supported_by_evidence":1,"supports_path":2},"claim_bound_targeting":{"claim_type":"prove_settlement_closure_state","required_checks":["payment_document_found","contract_matched","settlement_object_matched","closing_document_found","register_closure_entry_found","posting_link_found"],"targeted_items":6,"targeted_evidence":11,"derived_evidence_added":6},"evidence_admissibility_gate":{"candidate_evidence":11,"admissible_evidence":6,"rejected_evidence":5,"rejected_items":0}},"evidence":[{"evidence_id":"claim-ev-4vQiizVfTp","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:07","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:07"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:07"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:07","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-4HokXEvAeT","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:05","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:05"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:05"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:05","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-FiZrJf2aFp","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:04","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:04"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:04"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:04","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-yRc1ascq56","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:03","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:03"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:03"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:03","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-KXSl6cZbzd","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600","period":"2020-06-30T12:00:02","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12:00:02"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600","period":"2020-06-30T12:00:02"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-30T12:00:02","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}},{"evidence_id":"claim-ev-8dIsf5A5R8","claim_ref":"claim:prove_settlement_closure_state","source_type":"derived","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"04f191a0-b46b-11ea-a2db-00155d012600","period":"2020-06-19T12:00:00","canonical_ref":"evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|04f191a0-b46b-11ea-a2db-00155d012600|2020-06-19t12:00:00"},"pointer":{"fragment_id":"F1","route":"store_canonical","source":{"namespace":"assistant_derived","entity":"Document_СписаниеСРасчетногоСчета","id":"04f191a0-b46b-11ea-a2db-00155d012600","period":"2020-06-19T12:00:00"},"locator":{"field_path":null,"item_index":null}},"evidence_kind":"mechanism_link","mechanism_note":"payment_document_found","confidence":"medium","limitation":null,"payload":{"from_targeted_item":true,"claim_type":"prove_settlement_closure_state","claim_target_checks":["payment_document_found"],"context_expansion_allowed":true,"context_expansion_reason":null,"period":"2020-06-19T12:00:00","source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"04f191a0-b46b-11ea-a2db-00155d012600","account_context":[],"account_debit":null,"account_credit":null,"relation_pattern_hits":[],"fa_object_hint":null,"fa_expected_set_candidate":false,"fa_actual_set_candidate":false,"fa_coverage_status":null}}],"why_included":["Показаны последние по дате записи канонического документного слоя.","P0 domain purity enforced for settlements_60_62."],"selection_reason":["Отбор по максимальной дате документа в пределах snapshot.","Semantic profile subject: supplier_tail_analysis.","Domain gate source scope: docs, keyFields."],"risk_factors":["missing_link","broken_lifecycle","closure_risk"],"business_interpretation":["Слой отражает базовый factual-срез документов для оперативной сверки."],"confidence":"high","limitations":["Это read-only snapshot, а не онлайн-состояние 1С.","Canonical output ограничен доменным runtime-контрактом."],"errors":[],"raw_entities":[{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"c921c08a-c117-11ea-a2e2-00155d012600","display_name":"00000000180","period":"2020-06-30T12:00:07","counterparty_id":"9a4c4530-b5ae-11e8-93de-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"5dfabe1f-c117-11ea-a2e2-00155d012600","display_name":"00000000178","period":"2020-06-30T12:00:05","counterparty_id":"4a6289f6-6808-11e8-8e6c-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","display_name":"00000000177","period":"2020-06-30T12:00:04","counterparty_id":"84a55286-970d-11e8-94ba-50465da00436","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"24f17575-c117-11ea-a2e2-00155d012600","display_name":"00000000176","period":"2020-06-30T12:00:03","counterparty_id":"6be7395c-0231-11e6-8b48-5404a6c12c2c","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"6f0947d8-bf77-11ea-a2e1-00155d012600","display_name":"00000000175","period":"2020-06-30T12:00:02","counterparty_id":"69879ad0-76de-11e4-9a6c-5404a6c12c2c","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"d57e16a8-b090-11ea-a2db-00155d012600","display_name":"00000000015","period":"2020-06-30T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null},{"source_entity":"Document_РеализацияТоваровУслуг","source_id":"e17f08ca-c51a-11ea-a2e2-00155d012600","display_name":"00000000007","period":"2020-06-23T13:54:25","counterparty_id":"5c528e36-c519-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"0b4f2456-c5b6-11ea-a2e2-00155d012600","display_name":"00000000020","period":"2020-06-22T00:00:00","counterparty_id":"426ce148-ca81-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_СписаниеСРасчетногоСчета","source_id":"04f191a0-b46b-11ea-a2db-00155d012600","display_name":"00000000174","period":"2020-06-19T12:00:00","counterparty_id":"c1e65898-7bd0-11e9-a2bc-00155d012600","recorder":null},{"source_entity":"Document_РеализацияТоваровУслуг","source_id":"3f3fca52-a644-11ea-a2d7-00155d012600","display_name":"00000000006","period":"2020-06-19T00:00:00","counterparty_id":"cb5193b1-9a7e-11ea-a2d5-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"f751dbe5-ca80-11ea-a2e2-00155d012600","display_name":"00000000022","period":"2020-06-19T00:00:00","counterparty_id":"a3fe2e97-ca7d-11ea-a2e2-00155d012600","recorder":null},{"source_entity":"Document_ПоступлениеТоваровУслуг","source_id":"9d202b38-b090-11ea-a2db-00155d012600","display_name":"00000000013","period":"2020-06-17T14:49:44","counterparty_id":"b07bb8ce-a010-11e6-91da-50465da00436","recorder":null}],"candidate_evidence":[{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-1","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:07","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A07"},"relation_pattern_hits":["payment_to_settlement","contract_to_documents","document_to_posting","domain_hint:bank_settlement","domain_hint:customer_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","closure_risk","domain_hint:bank_settlement","domain_hint:customer_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-2","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:05","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A05"},"relation_pattern_hits":["payment_to_settlement","contract_to_documents","document_to_posting","domain_hint:bank_settlement","domain_hint:customer_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","closure_risk","domain_hint:bank_settlement","domain_hint:customer_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-3","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:04","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A04"},"relation_pattern_hits":["payment_to_settlement","contract_to_documents","document_to_posting","domain_hint:bank_settlement","domain_hint:customer_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","closure_risk","domain_hint:bank_settlement","domain_hint:customer_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-4","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600","period":"2020-06-30T12:00:03","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A03"},"relation_pattern_hits":["payment_to_settlement","contract_to_documents","document_to_posting","domain_hint:bank_settlement","domain_hint:customer_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","closure_risk","domain_hint:bank_settlement","domain_hint:customer_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-5","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600","period":"2020-06-30T12:00:02","canonical_ref":"evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12%3A00%3A02"},"relation_pattern_hits":["payment_to_settlement","contract_to_documents","document_to_posting","domain_hint:bank_settlement","domain_hint:customer_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","closure_risk","domain_hint:bank_settlement","domain_hint:customer_settlement"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600"}],"confidence_hint":"low"},{"schema_version":"candidate_evidence_v0_1","candidate_id":"cand-ev-F1-6","route":"store_canonical","source_ref":{"schema_version":"evidence_source_ref_v1","namespace":"unknown","entity":"Document_ПоступлениеТоваровУслуг","id":"d57e16a8-b090-11ea-a2db-00155d012600","period":"2020-06-30T12:00:00","canonical_ref":"evidence_source_ref_v1|unknown|document_%D0%BF%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%D1%82%D0%BE%D0%B2%D0%B0%D1%80%D0%BE%D0%B2%D1%83%D1%81%D0%BB%D1%83%D0%B3|d57e16a8-b090-11ea-a2db-00155d012600|2020-06-30t12%3A00%3A00"},"relation_pattern_hits":["payment_to_settlement","contract_to_documents","document_to_posting","domain_hint:bank_settlement","domain_hint:customer_settlement"],"anomaly_patterns":["missing_link","broken_lifecycle","closure_risk","domain_hint:bank_settlement","domain_hint:customer_settlement"],"entity_backlinks":[{"entity":"Document_ПоступлениеТоваровУслуг","id":"d57e16a8-b090-11ea-a2db-00155d012600"}],"confidence_hint":"low"}],"problem_units":[{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-1","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: payment_to_settlement.","business_defect_class":"payment_to_settlement","severity":{"score":0.68,"grade":"medium"},"confidence":{"score":0.35,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-1"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"customer_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-1","current_lifecycle_state":"stale_receivable","expected_lifecycle_state":"receivable_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.31,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_receivable; ожидаемая стадия: receivable_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-1","lifecycle_domain":"customer_settlement","resolved_current_state":"stale_receivable","resolved_expected_state":"receivable_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.31,"grade":"low"},"resolution_evidence":["cand-ev-F1-1"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":1.18,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-1","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-1"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-2","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: payment_to_settlement.","business_defect_class":"payment_to_settlement","severity":{"score":0.68,"grade":"medium"},"confidence":{"score":0.35,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-2"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"customer_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-2","current_lifecycle_state":"stale_receivable","expected_lifecycle_state":"receivable_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.31,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_receivable; ожидаемая стадия: receivable_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-2","lifecycle_domain":"customer_settlement","resolved_current_state":"stale_receivable","resolved_expected_state":"receivable_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.31,"grade":"low"},"resolution_evidence":["cand-ev-F1-2"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":1.18,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-2","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-2","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-2"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-3","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: payment_to_settlement.","business_defect_class":"payment_to_settlement","severity":{"score":0.68,"grade":"medium"},"confidence":{"score":0.35,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-3"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"customer_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-3","current_lifecycle_state":"stale_receivable","expected_lifecycle_state":"receivable_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.31,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_receivable; ожидаемая стадия: receivable_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-3","lifecycle_domain":"customer_settlement","resolved_current_state":"stale_receivable","resolved_expected_state":"receivable_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.31,"grade":"low"},"resolution_evidence":["cand-ev-F1-3"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":1.18,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-3","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-3","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-3"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-4","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: payment_to_settlement.","business_defect_class":"payment_to_settlement","severity":{"score":0.68,"grade":"medium"},"confidence":{"score":0.35,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-4"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"customer_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-4","current_lifecycle_state":"stale_receivable","expected_lifecycle_state":"receivable_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.31,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_receivable; ожидаемая стадия: receivable_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-4","lifecycle_domain":"customer_settlement","resolved_current_state":"stale_receivable","resolved_expected_state":"receivable_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.31,"grade":"low"},"resolution_evidence":["cand-ev-F1-4"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":1.18,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-4","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-4","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-4"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-5","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: payment_to_settlement.","business_defect_class":"payment_to_settlement","severity":{"score":0.68,"grade":"medium"},"confidence":{"score":0.35,"grade":"low"},"affected_entities":["Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600"],"affected_documents":["Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600"],"affected_postings":[],"affected_accounts":["Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600"],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-5"],"entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"customer_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-5","current_lifecycle_state":"stale_receivable","expected_lifecycle_state":"receivable_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.31,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_receivable; ожидаемая стадия: receivable_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-5","lifecycle_domain":"customer_settlement","resolved_current_state":"stale_receivable","resolved_expected_state":"receivable_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.31,"grade":"low"},"resolution_evidence":["cand-ev-F1-5"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":1.18,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-5","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-5","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-5"],"graph_confidence":"low"}},{"schema_version":"problem_unit_v0_1","problem_unit_id":"pu-unresolved_settlement_cluster-6","problem_unit_type":"unresolved_settlement_cluster","title":"Unresolved settlement cluster detected","mechanism_summary":"Mechanism candidate: payment_to_settlement.","business_defect_class":"payment_to_settlement","severity":{"score":0.68,"grade":"medium"},"confidence":{"score":0.35,"grade":"low"},"affected_entities":["Document_ПоступлениеТоваровУслуг:d57e16a8-b090-11ea-a2db-00155d012600"],"affected_documents":["Document_ПоступлениеТоваровУслуг:d57e16a8-b090-11ea-a2db-00155d012600"],"affected_postings":[],"affected_accounts":[],"affected_counterparties":[],"affected_contracts":[],"evidence_pack":["cand-ev-F1-6"],"entity_backlinks":[{"entity":"Document_ПоступлениеТоваровУслуг","id":"d57e16a8-b090-11ea-a2db-00155d012600"}],"snapshot_limitations":["low_confidence_candidates_present"],"lifecycle_domain":"customer_settlement","lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-6","current_lifecycle_state":"stale_receivable","expected_lifecycle_state":"receivable_closed","missing_transition":"expected_transition_not_observed","lifecycle_defect_type":"stale_active_state","stale_duration":"unknown_snapshot_window","lifecycle_confidence":{"score":0.31,"grade":"low"},"business_lifecycle_interpretation":"Текущая стадия: stale_receivable; ожидаемая стадия: receivable_closed. Объект завис во времени и не дошел до ожидаемого перехода.","lifecycle_resolution":{"lifecycle_object_id":"lcobj-pu-unresolved_settlement_cluster-6","lifecycle_domain":"customer_settlement","resolved_current_state":"stale_receivable","resolved_expected_state":"receivable_closed","resolved_previous_states":[],"missing_transitions":["expected_transition_not_observed"],"invalid_transitions":[],"detected_defects":["stale_active_state"],"state_confidence":{"score":0.31,"grade":"low"},"resolution_evidence":["cand-ev-F1-6"],"snapshot_limitations":["low_confidence_candidates_present","actual_state_inferred","expected_state_inferred"]},"lifecycle_ranking_score":1.18,"lifecycle_ranking_basis":["base_problem_severity","stale_duration_weight","stale_duration_present"],"graph_binding":{"problem_unit_id":"pu-unresolved_settlement_cluster-6","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-6","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-6"],"graph_confidence":"low"}}],"problem_unit_summary":{"schema_version":"problem_unit_summary_v0_1","units_total":6,"duplicate_collapses":0,"unit_types":["unresolved_settlement_cluster"],"type_distribution":{"unresolved_settlement_cluster":6},"severity_distribution":{"low":0,"medium":6,"high":0},"confidence_distribution":{"low":6,"medium":0,"high":0},"primary_unit_type":"unresolved_settlement_cluster","lifecycle_enriched_units":6,"lifecycle_domain_distribution":{"customer_settlement":6},"lifecycle_defect_distribution":{"stale_active_state":6},"graph_summary":{"total_units":6,"bound_units":6,"node_count":30,"edge_count":10,"missing_links_count":6,"conflicting_links_count":0,"graph_coverage_grade":"high","domain_distribution":{"customer_settlement":6},"relation_distribution":{"affects_account":1,"affects_document":1,"belongs_to_domain":1,"current_state":1,"expected_state":1,"has_defect":1,"missing_transition":1,"supported_by_evidence":1,"supports_path":2}}},"accounting_graph":{"schema_version":"accounting_graph_v0_1","nodes":[{"node_id":"gnd-account-customer-settlement-account-document-24f17575-c117-11ea-a2e2-00155d0","node_type":"account","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-4"]}},{"node_id":"gnd-account-customer-settlement-account-document-2fdf7d2b-c117-11ea-a2e2-00155d0","node_type":"account","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-3"]}},{"node_id":"gnd-account-customer-settlement-account-document-5dfabe1f-c117-11ea-a2e2-00155d0","node_type":"account","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-2"]}},{"node_id":"gnd-account-customer-settlement-account-document-6f0947d8-bf77-11ea-a2e1-00155d0","node_type":"account","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-5"]}},{"node_id":"gnd-account-customer-settlement-account-document-c921c08a-c117-11ea-a2e2-00155d0","node_type":"account","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"account":"Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1"]}},{"node_id":"gnd-defect-customer-settlement-defect-stale-active-state","node_type":"defect","domain":"customer_settlement","label":"stale_active_state","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-document-customer-settlement-document-document-24f17575-c117-11ea-a2e2-00155d","node_type":"document","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-4"]}},{"node_id":"gnd-document-customer-settlement-document-document-2fdf7d2b-c117-11ea-a2e2-00155d","node_type":"document","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-3"]}},{"node_id":"gnd-document-customer-settlement-document-document-5dfabe1f-c117-11ea-a2e2-00155d","node_type":"document","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-2"]}},{"node_id":"gnd-document-customer-settlement-document-document-6f0947d8-bf77-11ea-a2e1-00155d","node_type":"document","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-5"]}},{"node_id":"gnd-document-customer-settlement-document-document-c921c08a-c117-11ea-a2e2-00155d","node_type":"document","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1"]}},{"node_id":"gnd-document-customer-settlement-document-document-d57e16a8-b090-11ea-a2db-00155d","node_type":"document","domain":"customer_settlement","label":"Document_ПоступлениеТоваровУслуг:d57e16a8-b090-11ea-a2db-00155d012600","confidence":"low","attributes":{},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-6"]}},{"node_id":"gnd-domain-customer-settlement-domain-customer-settlement","node_type":"domain","domain":"customer_settlement","label":"customer_settlement","confidence":"low","attributes":{"domain":"customer_settlement"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-1","node_type":"evidence","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:c921c08a-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-1"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1"],"evidence_ids":["cand-ev-F1-1"]}},{"node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-2","node_type":"evidence","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:5dfabe1f-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-2"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-2"],"evidence_ids":["cand-ev-F1-2"]}},{"node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-3","node_type":"evidence","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:2fdf7d2b-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-3"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-3"],"evidence_ids":["cand-ev-F1-3"]}},{"node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-4","node_type":"evidence","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:24f17575-c117-11ea-a2e2-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-4"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-4"],"evidence_ids":["cand-ev-F1-4"]}},{"node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-5","node_type":"evidence","domain":"customer_settlement","label":"Document_СписаниеСРасчетногоСчета:6f0947d8-bf77-11ea-a2e1-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-5"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-5"],"evidence_ids":["cand-ev-F1-5"]}},{"node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-6","node_type":"evidence","domain":"customer_settlement","label":"Document_ПоступлениеТоваровУслуг:d57e16a8-b090-11ea-a2db-00155d012600","confidence":"low","attributes":{"candidate_id":"cand-ev-F1-6"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-6"]}},{"node_id":"gnd-lifecycle-state-customer-settlement-current-state-stale-receivable","node_type":"lifecycle_state","domain":"customer_settlement","label":"stale_receivable","confidence":"low","attributes":{"state_role":"current"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-lifecycle-state-customer-settlement-expected-state-receivable-closed","node_type":"lifecycle_state","domain":"customer_settlement","label":"receivable_closed","confidence":"low","attributes":{"state_role":"expected"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","node_type":"problem_unit","domain":"customer_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-1","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"payment_to_settlement","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1"],"evidence_ids":["cand-ev-F1-1"]}},{"node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-2","node_type":"problem_unit","domain":"customer_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-2","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"payment_to_settlement","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-2"],"evidence_ids":["cand-ev-F1-2"]}},{"node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-3","node_type":"problem_unit","domain":"customer_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-3","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"payment_to_settlement","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-3"],"evidence_ids":["cand-ev-F1-3"]}},{"node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-4","node_type":"problem_unit","domain":"customer_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-4","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"payment_to_settlement","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-4"],"evidence_ids":["cand-ev-F1-4"]}},{"node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-5","node_type":"problem_unit","domain":"customer_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-5","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"payment_to_settlement","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-5"],"evidence_ids":["cand-ev-F1-5"]}},{"node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-6","node_type":"problem_unit","domain":"customer_settlement","label":"Unresolved settlement cluster detected","confidence":"low","attributes":{"problem_unit_id":"pu-unresolved_settlement_cluster-6","problem_unit_type":"unresolved_settlement_cluster","business_defect_class":"payment_to_settlement","lifecycle_defect_type":"stale_active_state"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-6"]}},{"node_id":"gnd-transition-customer-settlement-hint-contract-to-documents","node_type":"transition","domain":"customer_settlement","label":"contract_to_documents","confidence":"low","attributes":{"transition_role":"hint"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-transition-customer-settlement-hint-payment-to-settlement","node_type":"transition","domain":"customer_settlement","label":"payment_to_settlement","confidence":"low","attributes":{"transition_role":"hint"},"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"node_id":"gnd-transition-customer-settlement-missing-transition-expected-transition-not-obser","node_type":"transition","domain":"customer_settlement","label":"expected_transition_not_observed","confidence":"low","attributes":{"transition_role":"missing"},"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}}],"edges":[{"edge_id":"ged-affects-account-gnd-problem-unit-customer-settlement-problem-pu--gnd-account-customer-settlement-account-document","relation_type":"affects_account","from_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-account-customer-settlement-account-document-c921c08a-c117-11ea-a2e2-00155d0","domain":"customer_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5"]}},{"edge_id":"ged-affects-document-gnd-problem-unit-customer-settlement-problem-pu--gnd-document-customer-settlement-document-docume","relation_type":"affects_document","from_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-document-customer-settlement-document-document-c921c08a-c117-11ea-a2e2-00155d","domain":"customer_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-belongs-to-domain-gnd-problem-unit-customer-settlement-problem-pu--gnd-domain-customer-settlement-domain-customer-s","relation_type":"belongs_to_domain","from_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-domain-customer-settlement-domain-customer-settlement","domain":"customer_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-current-state-gnd-problem-unit-customer-settlement-problem-pu--gnd-lifecycle-state-customer-settlement-current-","relation_type":"current_state","from_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-lifecycle-state-customer-settlement-current-state-stale-receivable","domain":"customer_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-expected-state-gnd-problem-unit-customer-settlement-problem-pu--gnd-lifecycle-state-customer-settlement-expected","relation_type":"expected_state","from_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-lifecycle-state-customer-settlement-expected-state-receivable-closed","domain":"customer_settlement","confidence":"low","flags":["expected_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-has-defect-gnd-problem-unit-customer-settlement-problem-pu--gnd-defect-customer-settlement-defect-stale-acti","relation_type":"has_defect","from_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-defect-customer-settlement-defect-stale-active-state","domain":"customer_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-missing-transition-gnd-problem-unit-customer-settlement-problem-pu--gnd-transition-customer-settlement-missing-trans","relation_type":"missing_transition","from_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-transition-customer-settlement-missing-transition-expected-transition-not-obser","domain":"customer_settlement","confidence":"low","flags":["missing_link"],"provenance":{"route":"store_canonical","candidate_ids":[],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-supported-by-evidence-gnd-problem-unit-customer-settlement-problem-pu--gnd-evidence-customer-settlement-evidence-cand-e","relation_type":"supported_by_evidence","from_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","to_node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-1","domain":"customer_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-supports-path-gnd-evidence-customer-settlement-evidence-cand-e-gnd-transition-customer-settlement-hint-contract","relation_type":"supports_path","from_node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-1","to_node_id":"gnd-transition-customer-settlement-hint-contract-to-documents","domain":"customer_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}},{"edge_id":"ged-supports-path-gnd-evidence-customer-settlement-evidence-cand-e-gnd-transition-customer-settlement-hint-payment-","relation_type":"supports_path","from_node_id":"gnd-evidence-customer-settlement-evidence-cand-ev-f1-1","to_node_id":"gnd-transition-customer-settlement-hint-payment-to-settlement","domain":"customer_settlement","confidence":"low","flags":["actual_link"],"provenance":{"route":"store_canonical","candidate_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"],"evidence_ids":["cand-ev-F1-1","cand-ev-F1-2","cand-ev-F1-3","cand-ev-F1-4","cand-ev-F1-5","cand-ev-F1-6"]}}],"unit_bindings":[{"problem_unit_id":"pu-unresolved_settlement_cluster-1","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-1","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-1"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-2","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-2","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-2"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-3","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-3","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-3"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-4","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-4","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-4"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-5","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-5","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-5"],"graph_confidence":"low"},{"problem_unit_id":"pu-unresolved_settlement_cluster-6","graph_node_id":"gnd-problem-unit-customer-settlement-problem-pu-unresolved-settlement-cluster-6","relation_path":["domain:customer_settlement","state:stale_receivable->receivable_closed","invoice_to_payment","payment_to_closure","missing:expected_transition_not_observed"],"missing_links":["expected_transition_not_observed"],"conflicting_links":[],"provenance_evidence_ids":["cand-ev-F1-6"],"graph_confidence":"low"}],"summary":{"total_units":6,"bound_units":6,"node_count":30,"edge_count":10,"missing_links_count":6,"conflicting_links_count":0,"graph_coverage_grade":"high","domain_distribution":{"customer_settlement":6},"relation_distribution":{"affects_account":1,"affects_document":1,"belongs_to_domain":1,"current_state":1,"expected_state":1,"has_defect":1,"missing_transition":1,"supported_by_evidence":1,"supports_path":2}},"issues":[]}}],"requirements_extracted":[{"requirement_id":"R1","source_fragment_id":"F1","requirement_text":"?????? ?????? ?? ????? 60 ?? ?????? 2022","subject_tokens":[],"status":"covered","route":"store_canonical"}],"requirements_total":1,"requirements_covered":1,"requirements_uncovered":[],"coverage_status":"full","answer_grounding_status":"no_grounded_answer","reply_semantic_type":"partial_coverage","why_included_summary":["Показаны последние по дате записи канонического документного слоя.","P0 domain purity enforced for settlements_60_62."],"selection_reason_summary":["Отбор по максимальной дате документа в пределах snapshot.","Semantic profile subject: supplier_tail_analysis.","Domain gate source scope: docs, keyFields."],"route_subject_match":true,"clarification_target":[],"dropped_intent_segments":[],"question_type_class":"unknown","company_anchors":{"contract_numbers":[],"document_numbers":[],"dates":[],"amounts":[],"accounts":[],"periods":["2022"],"document_types":[],"all":["period:2022"]},"analysis_context_applied":false,"analysis_context":null,"business_scope_raw":[],"business_scope_resolved":["company_specific_accounting"],"company_grounding_applied":true,"scope_resolution_reason":["settlement_claim_company_scope_recovery"],"company_scope_resolution_reason":["settlement_claim_company_scope_recovery"],"raw_time_anchor":null,"raw_time_scope":null,"resolved_time_anchor":null,"resolved_primary_period":null,"effective_primary_period":null,"temporal_guard_input":null,"temporal_alignment_status":"conflicting","temporal_resolution_source":"normalized_time_scope:missing","temporal_guard_basis":"none","temporal_guard_applied":false,"temporal_guard_outcome":"passed","temporal_guard":{"raw_time_anchor":null,"raw_time_scope":null,"resolved_time_anchor":null,"resolved_primary_period":null,"effective_primary_period":null,"temporal_guard_input":null,"temporal_alignment_status":"conflicting","temporal_resolution_source":"normalized_time_scope:missing","temporal_guard_basis":"none","temporal_guard_applied":false,"temporal_guard_outcome":"passed","primary_period_window":null,"allowed_context_window":null,"controlled_temporal_expansion_enabled":false,"context_expansion_reasons_allowed":["prehistory","carryover","post_period_closure","long_running_contract_context"],"normalized_anchor_drift_detected":false,"reason_codes":["missing_resolved_primary_period"]},"raw_numeric_tokens":["60","2022"],"classified_numeric_tokens":[{"token":"60","classification":"other_numeric"}],"rejected_as_non_accounts":["60"],"resolved_account_anchors":[],"domain_polarity_guard":{"applied":true,"polarity":"mixed_or_unresolved","outcome":"limited_unresolved_polarity","supplier_score":0,"customer_score":0,"account_scope":[],"raw_numeric_tokens":["60","2022"],"classified_numeric_tokens":[{"token":"60","classification":"other_numeric"}],"rejected_as_non_accounts":["60"],"resolved_account_anchors":[],"rejected_problem_units":0,"rejected_evidence":0,"critical_contradiction":true,"reason_codes":["unresolved_supplier_customer_polarity","supplier_customer_signals_absent"]},"claim_anchor_audit":{"claim_type":"prove_settlement_closure_state","settlement_role":"unknown","settlement_role_resolution_reason":["settlement_role_resolved_unknown"],"polarity_resolution_status":"unknown","required_anchors":["period","account_scope","counterparty_scope_or_contract","closure_signal"],"resolved_anchors":{"period":["2022"],"account_scope":[],"amounts":[],"contract":[],"document_numbers":[],"document_types":[],"counterparty_scope":[],"advance_signal":[],"closure_signal":[],"vat_signal":[],"chain_signal":[],"close_signal":[],"cost_scope":[],"rbp_signal":[],"writeoff_signal":[],"fixed_asset_signal":[],"amortization_signal":[],"expected_fa_set":[],"actual_fa_set":[]},"missing_anchors":["account_scope","counterparty_scope_or_contract","closure_signal"],"claim_anchor_resolution_rate":0.25,"primary_period":null,"allowed_context_window":null,"context_expansion_reasons_allowed":["prehistory","carryover","post_period_closure","long_running_contract_context"],"reason_codes":["claim_missing_required_anchors","claim_anchor_resolution_low","unresolved_supplier_customer_polarity"]},"settlement_role":"unknown","settlement_role_resolution_reason":["settlement_role_resolved_unknown"],"polarity_resolution_status":"unknown","targeted_evidence_acquisition":{"claim_type":"prove_settlement_closure_state","required_checks":["payment_document_found","contract_matched","settlement_object_matched","closing_document_found","register_closure_entry_found","posting_link_found"],"check_status":{"payment_document_found":"found","contract_matched":"not_found","settlement_object_matched":"not_found","closing_document_found":"not_found","register_closure_entry_found":"not_found","posting_link_found":"not_found"},"targeted_item_hits":6,"targeted_evidence_hits":11,"targeted_evidence_hit_rate":0.1667,"targeted_evidence_source_refs":["evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:07","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:05","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:04","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:03","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12:00:02","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|04f191a0-b46b-11ea-a2db-00155d012600|2020-06-19t12:00:00","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A07","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A05","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A04","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12%3A00%3A03","evidence_source_ref_v1|unknown|document_%D1%81%D0%BF%D0%B8%D1%81%D0%B0%D0%BD%D0%B8%D0%B5%D1%81%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%D0%BD%D0%BE%D0%B3%D0%BE%D1%81%D1%87%D0%B5%D1%82%D0%B0|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12%3A00%3A02"],"reason_codes":["targeted_evidence_hit_rate_low"]},"evidence_admissibility_gate":{"candidate_evidence_total":11,"admissible_evidence_count":6,"rejected_evidence_count":5,"rejected_item_count":0,"reject_breakdown":{"wrong_period":0,"wrong_domain":0,"wrong_account_scope":0,"weak_source_mapping":5,"zero_live_match":0,"future_dated_or_out_of_window":0},"category_breakdown":{"hard_evidence":6,"supporting_signal":0,"inadmissible_noise":5},"reason_codes":["inadmissible_evidence_filtered"]},"eligibility_time_basis":"none","grounded_answer_eligibility_guard":{"eligible":false,"temporal_passed":true,"eligibility_time_basis":"none","business_scope_passed":true,"polarity_passed":false,"claim_anchors_passed":false,"claim_anchor_resolution_rate":0.25,"missing_required_anchors":3,"admissible_evidence_count":6,"critical_contradiction":true,"outcome":"limited_or_insufficient_evidence","grounding_mode":"limited_or_insufficient_evidence","reason_codes":["polarity_guard_limited_unresolved_polarity","claim_anchor_coverage_insufficient","critical_domain_or_account_contradiction"]},"problem_centric_answer_applied":true,"problem_units_used_count":4,"problem_answer_mode":"stage3_lifecycle_aware_v1","problem_unit_ids_used":["pu-unresolved_settlement_cluster-1","pu-unresolved_settlement_cluster-2","pu-unresolved_settlement_cluster-3","pu-unresolved_settlement_cluster-4"],"assistant_outcome_class_v1":"PARTIALLY_ANSWERED","assistant_orchestration_contracts_v1":{"query_frame":{"schema_version":"assistant_query_frame_v1","original_user_question":"?????? ?????? ?? ????? 60 ?? ?????? 2022","normalized_question":"?????? ?????? ?? ????? 60 ?? ?????? 2022","route_summary_mode":"legacy_v1","fragments_total":0,"dropped_intent_segments":[],"analysis_context":null},"execution_plan":{"schema_version":"assistant_execution_plan_v1","steps":[{"fragment_id":"F1","route":"store_canonical","should_execute":true,"requirement_ids":["R1"],"no_route_reason":null,"clarification_reason":null}],"requirements_total":1},"evidence_bundle":{"schema_version":"assistant_evidence_bundle_v1","retrieval_calls_total":1,"retrieval_results_total":1,"retrieval_status_breakdown":{"ok":1,"partial":0,"empty":0,"error":0},"evidence_total":6,"source_refs_total":6,"limitation_total":2,"error_total":0},"coverage":{"schema_version":"assistant_coverage_contract_v1","coverage_report":{"requirements_total":1,"requirements_covered":1,"requirements_uncovered":[],"requirements_partially_covered":[],"clarification_needed_for":[],"out_of_scope_requirements":[]},"grounding":{"status":"no_grounded_answer","route_subject_match":true,"missing_requirements":[],"reasons":["Не удалось однозначно определить сторону расчета (нам должны или мы должны).","Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).","Есть противоречие по выбранному домену или контуру счета."],"why_included_summary":["Показаны последние по дате записи канонического документного слоя.","P0 domain purity enforced for settlements_60_62."],"selection_reason_summary":["Отбор по максимальной дате документа в пределах snapshot.","Semantic profile subject: supplier_tail_analysis.","Domain gate source scope: docs, keyFields."]},"outcome_class":"PARTIALLY_ANSWERED"}},"answer_contract_stage4_v1":{"schema_version":"stage4_answer_contract_audit_v1","stage4_blocks_expected":["Коротко","Что именно проверено","Что найдено","Что пока не доказано","Что проверить первым/Что могу сделать сейчас"],"stage4_blocks_present":["Коротко","Что именно проверено","Что найдено","Что пока не доказано","Что проверить первым/Что могу сделать сейчас"],"stage4_blocks_missing":[],"legacy_blocks_present":[],"is_stage4_shape":true},"answer_structure_v11":{"schema_version":"answer_structure_v1_1","answer_summary":"Выявлены связанные проблемные контуры: подтверждены разрывы и конфликты между участками цепочки (6 из 6 узлов).","direct_answer":"Оплата отражена, но ожидаемое закрытие расчета не подтверждено; подтверждение пока частичное, вывод ограничен.","mechanism_block":{"status":"limited","mechanism_notes":["Mechanism candidate: payment_to_settlement."],"limitation_reason_codes":[]},"evidence_block":{"evidence_ids":["claim-ev-4vQiizVfTp","claim-ev-4HokXEvAeT","claim-ev-FiZrJf2aFp","claim-ev-yRc1ascq56","claim-ev-KXSl6cZbzd","claim-ev-8dIsf5A5R8"],"source_refs":["evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|c921c08a-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:07","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|5dfabe1f-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:05","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|2fdf7d2b-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:04","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|24f17575-c117-11ea-a2e2-00155d012600|2020-06-30t12:00:03","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|6f0947d8-bf77-11ea-a2e1-00155d012600|2020-06-30t12:00:02","evidence_source_ref_v1|assistant_derived|document_списаниесрасчетногосчета|04f191a0-b46b-11ea-a2db-00155d012600|2020-06-19t12:00:00"],"mechanism_notes":["Mechanism candidate: payment_to_settlement."],"coverage_note":"coverage_full_or_near_full","claim_evidence_links":[{"claim_ref":"claim:prove_settlement_closure_state","evidence_ids":["claim-ev-4vQiizVfTp","claim-ev-4HokXEvAeT","claim-ev-FiZrJf2aFp","claim-ev-yRc1ascq56","claim-ev-KXSl6cZbzd","claim-ev-8dIsf5A5R8"]}]},"uncertainty_block":{"open_uncertainties":[],"limitations":["Problem units remain weak-confidence; conclusions are intentionally limited.","Это read-only snapshot, а не онлайн-состояние 1С.","Canonical output ограничен доменным runtime-контрактом.","Не удалось однозначно определить сторону расчета (нам должны или мы должны).","Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).","Есть противоречие по выбранному домену или контуру счета."]},"next_step_block":{"recommended_actions":["Проверьте договор и объект расчетов по платежу/зачету.","Сверьте регистр расчетов и привязку платежа к закрывающему документу по 60/62.","Проверьте зачет аванса или взаимозачет и связку платежа с закрытием расчета.","Сверьте хвосты по расчетам: закрылся ли документ оплаты корректным закрывающим документом.","Проверьте, почему объект завис: ожидаемый переход не должен оставаться в активной стадии."],"clarification_questions":[]}},"investigation_state_snapshot":{"schema_version":"investigation_state_v1","session_id":"probe-isolated-54062565","status":"active","turn_index":1,"updated_at":"2026-04-16T20:31:45.224Z","question_id":"msg-HcW4bEmyEP","question_scope_id":"d:settlements_60_62|p:2022|s:?????? ?????? ?? ????? 60 ?? ?????? 2022","scope_origin":"explicit_from_message","focus":{"domain":"settlements_60_62","period":"2022","primary_accounts":[],"active_query_subject":"?????? ?????? ?? ????? 60 ?? ?????? 2022"},"narrowing_status":"not_needed","evidence_refs":["claim-ev-4vQiizVfTp","claim-ev-4HokXEvAeT","claim-ev-FiZrJf2aFp","claim-ev-yRc1ascq56","claim-ev-KXSl6cZbzd","claim-ev-8dIsf5A5R8"],"open_uncertainties":["Это read-only snapshot, а не онлайн-состояние 1С.","Canonical output ограничен доменным runtime-контрактом."],"last_answer_mode":"partial_coverage","followup_context":{"previous_question_id":null,"last_user_message":"?????? ?????? ?? ????? 60 ?? ?????? 2022","referenced_requirement_ids":["R1"],"active_domain":"settlements_60_62","active_requirement_ids":["R1"],"uncovered_requirement_ids":[],"last_problem_unit_id":"pu-unresolved_settlement_cluster-1","settlement_next_actions":["Проверьте договор и объект расчетов по платежу.","Сверьте регистр расчетов и привязку платежа к закрывающему документу.","Проверьте зачет аванса или взаимозачет по связке 60/62."],"evidence_summary":["R1:ok:store_canonical"],"question_scope_id":"d:settlements_60_62|p:2022|s:?????? ?????? ?? ????? 60 ?? ?????? 2022","scope_origin":"explicit_from_message"},"query_mode_hint":"direct_answer","problem_unit_state":{"active_problem_units":["pu-unresolved_settlement_cluster-1","pu-unresolved_settlement_cluster-2","pu-unresolved_settlement_cluster-3","pu-unresolved_settlement_cluster-4","pu-unresolved_settlement_cluster-5","pu-unresolved_settlement_cluster-6"],"resolved_problem_units":[],"problem_unit_backlinks":[{"problem_unit_id":"pu-unresolved_settlement_cluster-1","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"c921c08a-c117-11ea-a2e2-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-2","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"5dfabe1f-c117-11ea-a2e2-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-3","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"2fdf7d2b-c117-11ea-a2e2-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-4","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"24f17575-c117-11ea-a2e2-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-5","entity_backlinks":[{"entity":"Document_СписаниеСРасчетногоСчета","id":"6f0947d8-bf77-11ea-a2e1-00155d012600"}]},{"problem_unit_id":"pu-unresolved_settlement_cluster-6","entity_backlinks":[{"entity":"Document_ПоступлениеТоваровУслуг","id":"d57e16a8-b090-11ea-a2db-00155d012600"}]}],"focus_problem_types":["unresolved_settlement_cluster"]}},"fallback_type":"partial","assistant_reply":"Коротко: Есть подтвержденные сигналы разрыва закрытия расчетов, часть вывода остается ограниченной.\n\nЧто именно проверено:\n- Вывод опирается на 6 подтвержденных наблюдений в текущем срезе.\n- Проверены связанные документы и проводки по 6 источникам.\n- Есть связка между основным выводом и подтверждающими записями.\n- Опора есть, но достаточна только для предварительного вывода.\n- В опоре использованы якоря вопроса: 2022, period:2022.\n\nЧто найдено:\n- Оплата отражена, но ожидаемое закрытие расчета не подтверждено; подтверждение пока частичное, вывод ограничен.\n- Переход от оплаты к закрытию расчета не подтвержден.\n- Часть ожидаемой цепочки подтверждена, но ключевой переход не подтвержден.\n\nЧто пока не доказано:\n- Надежность problem-сигнала низкая, поэтому вывод ограничен.\n- Оценка сделана на snapshot-срезе и может не включать часть цепочки.\n- Canonical output ограничен доменным runtime-контрактом.\n- Не удалось однозначно определить сторону расчета (нам должны или мы должны).\n- Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).\n\nЧто проверить первым:\n- Сверьте договор и объект расчетов, затем подтвердите запись в регистре расчетов и документ зачета.\n- Проверьте связку платеж -> расчетный документ -> проводки по 60/62/76 и факт закрытия хвоста.\n- Проверьте договор и объект расчетов по платежу/зачету.\n- Сверьте регистр расчетов и привязку платежа к закрывающему документу по 60/62.","reply_type":"partial_coverage","trace_id":"U49TU2_7tHfBBg"}} diff --git a/docs/orchestration/address_truth_harness_targeted_counterparty_tails.json b/docs/orchestration/address_truth_harness_targeted_counterparty_tails.json new file mode 100644 index 0000000..43178c1 --- /dev/null +++ b/docs/orchestration/address_truth_harness_targeted_counterparty_tails.json @@ -0,0 +1,87 @@ +{ + "schema_version": "domain_truth_harness_spec_v1", + "scenario_id": "address_truth_harness_targeted_counterparty_tails", + "domain": "address_targeted_counterparty_tails", + "title": "Targeted live replay for counterparty documents, shipment items, inventory reset, and account-60 tails", + "description": "Strict short replay for the current targeted regressions without a full long-session autorun.", + "bindings": {}, + "steps": [ + { + "step_id": "step_01_documents_by_counterparty", + "title": "Counterparty documents with normalized name", + "question": "покажи все документы по чапурнову", + "allowed_reply_types": [ + "factual", + "factual_with_explanation" + ], + "expected_intents": [ + "list_documents_by_counterparty" + ], + "required_direct_answer_patterns_any": [ + "(?i)контрагент:", + "(?i)чапурнов" + ] + }, + { + "step_id": "step_02_counterparty_item_flow", + "title": "Counterparty shipment items", + "question": "что нам отгружал чапурнов? какой товар или услугу?", + "allowed_reply_types": [ + "factual" + ], + "expected_intents": [ + "list_documents_by_counterparty" + ], + "required_direct_answer_patterns_any": [ + "(?i)контрагент:", + "(?i)позиции:", + "(?i)чапурнов" + ], + "forbidden_direct_answer_patterns": [ + "(?i)^по текущим условиям в доступном срезе данных совпадений не нашлось", + "(?i)^сейчас не дам прямой адресный ответ" + ] + }, + { + "step_id": "step_03_inventory_reset", + "title": "Inventory root after counterparty thread", + "question": "какие остатки на складе на сегодня?", + "allowed_reply_types": [ + "factual" + ], + "expected_intents": [ + "inventory_on_hand_as_of_date" + ], + "required_direct_answer_patterns_any": [ + "(?i)на складе", + "(?i)остат" + ], + "forbidden_direct_answer_patterns": [ + "(?i)чапурнов", + "(?i)контрагент:" + ] + }, + { + "step_id": "step_04_open_items_account_60", + "title": "Account 60 tails for August 2022", + "question": "хвосты покажи по счету 60 на август 2022", + "allowed_reply_types": [ + "factual", + "factual_with_explanation" + ], + "expected_intents": [ + "open_items_by_counterparty_or_contract" + ], + "required_filters": { + "account": "60", + "period_from": "2022-08-01", + "period_to": "2022-08-31", + "as_of_date": "2022-08-31" + }, + "required_direct_answer_patterns_any": [ + "(?i)счету 60", + "(?i)хвост" + ] + } + ] +} diff --git a/llm_normalizer/backend/dist/services/addressFilterExtractor.js b/llm_normalizer/backend/dist/services/addressFilterExtractor.js index d41b8e8..2c7827e 100644 --- a/llm_normalizer/backend/dist/services/addressFilterExtractor.js +++ b/llm_normalizer/backend/dist/services/addressFilterExtractor.js @@ -432,6 +432,9 @@ function extractYearRangePeriod(text) { }; } function cleanupAnchorValue(value) { + const stripLeadingEntityRole = (text) => String(text ?? "") + .replace(/^(?:(?:по\s+)?(?:контрагент(?:ом|у|а|ы|ов)?|поставщик(?:ом|у|а|и|ов)?|клиент(?:ом|у|а|ы|ов)?|покупател(?:ем|ю|я|и|ей)|продав(?:цом|цу|ца|цы|цов)|заказчик(?:ом|у|а|и|ов)?|исполнител(?:ем|ю|я|и|ей)|подрядчик(?:ом|у|а|и|ов)?))\s+/iu, "") + .trim(); const stripOuterQuotes = (text) => String(text ?? "") .replace(/^['"«»“”„`’‘]+|['"«»“”„`’‘]+$/gu, "") .trim(); @@ -439,6 +442,10 @@ function cleanupAnchorValue(value) { if (!cleaned) { return ""; } + cleaned = stripOuterQuotes(stripLeadingEntityRole(cleaned.replace(/[?!]+$/u, "").trim())); + if (!cleaned) { + return ""; + } // Remove trailing as-of qualifiers often captured by broad contract/counterparty regexes: // " на 2020-07-31", " на дату 31.07.2020", " as of 2020-07-31". const asOfTailPattern = /\s+(?:на\s+(?:дат[ауеы]\s+)?\d{1,4}[./-]\d{1,2}(?:[./-]\d{1,4})?|as\s+of\s+\d{1,4}[./-]\d{1,2}(?:[./-]\d{1,4})?)(?:\s+|$)[\s\S]*$/iu; @@ -471,7 +478,7 @@ function cleanupAnchorValue(value) { .replace(/\s+(?:from|to|between|and)(?:\s+|$)[\s\S]*$/iu, "") .replace(/\s+(?:с|по|за)(?:\s+|$)[\s\S]*$/iu, "") .trim(); - return stripOuterQuotes(cleaned); + return stripOuterQuotes(stripLeadingEntityRole(cleaned)); } function cleanupContractAnchorValue(value) { let normalized = cleanupAnchorValue(value); @@ -568,6 +575,9 @@ function isLowQualityCounterpartyAnchorValue(rawValue) { if (!value) { return true; } + if (/(?:за\s+вс[её]\s+время|за\s+всю\s+истори(?:ю|и)|all\s+time|entire\s+period|full\s+history)/iu.test(value)) { + return true; + } const tokens = value .split(/[^a-zа-я0-9]+/iu) .map((token) => token.trim()) @@ -601,6 +611,16 @@ function isLowQualityCounterpartyAnchorValue(rawValue) { "дата", "конец", "период", + "весь", + "все", + "всё", + "всю", + "всех", + "всего", + "время", + "история", + "истории", + "срок", "месяц", "году", "год", @@ -800,6 +820,30 @@ function extractLeadingCounterpartyTokenHeuristic(text) { } return undefined; } +function extractShipmentCounterpartyValue(text) { + const hasShipmentCounterpartyTokenShape = (token) => { + const source = String(token ?? "").trim(); + if (!source) { + return false; + } + if (hasStrongCounterpartyTokenShape(source)) { + return true; + } + return /^[\p{L}]{5,}$/u.test(source); + }; + const match = String(text ?? "").match(/(?:что\s+нам\s+)?(?:отгруж(?:ал|али|ено)|постав(?:лял|ляли|ил|или)|привоз(?:ил|или)|продал)\s+([\p{L}][\p{L}\p{N}._-]{1,})(?=[\s,.;:!?)]|$)/iu); + if (!match) { + return undefined; + } + const candidate = String(match[1] ?? "").trim(); + if (!candidate || !hasShipmentCounterpartyTokenShape(candidate)) { + return undefined; + } + if (!isLikelyCounterpartyToken(candidate)) { + return undefined; + } + return candidate; +} function hasExplicitAccountCue(text) { return /(?:сч[её]т|счет|account|acct)/iu.test(String(text ?? "")); } @@ -1447,6 +1491,17 @@ function extractAddressFilters(userMessage, intent) { warnings.push("counterparty_anchor_derived_from_implicit_phrase"); } } + if (!filters.counterparty && + allowGenericCounterpartyAnchor && + (intent === "list_documents_by_counterparty" || + intent === "bank_operations_by_counterparty" || + intent === "list_contracts_by_counterparty")) { + const shipmentCounterparty = extractShipmentCounterpartyValue(text); + if (shipmentCounterparty) { + filters.counterparty = cleanupAnchorValue(shipmentCounterparty); + warnings.push("counterparty_anchor_derived_from_shipment_phrase"); + } + } if (!filters.counterparty && allowGenericCounterpartyAnchor && (intent === "list_documents_by_counterparty" || diff --git a/llm_normalizer/backend/dist/services/addressIntentResolver.js b/llm_normalizer/backend/dist/services/addressIntentResolver.js index 011fbeb..015bcc6 100644 --- a/llm_normalizer/backend/dist/services/addressIntentResolver.js +++ b/llm_normalizer/backend/dist/services/addressIntentResolver.js @@ -562,7 +562,7 @@ function hasVatLiabilityConfirmedTaxPeriodSignal(text) { if (!hasVatLexeme) { return false; } - const hasPaymentCue = /(?:к\s+уплате|надо|нужно|заплатить|уплатить|плат[её]ж|платежку|в\s+налогов|в\s+бюджет|должн[аы]?\s+заплатить|мы\s+должн[аы]?|должн[аы]?\s+мы)/iu.test(text); + const hasPaymentCue = /(?:к\s+уплате|надо|нужно|заплатить|уплатить|плат[её]ж|платежку|в\s+налогов|в\s+бюджет|должн[аы]?\s+заплатить|мы\s+должн[аы]?|должн[аы]?\s+мы|сгруз(?:ить|им|ишь|ите|ил|ила|или|ка))/iu.test(text); if (!hasPaymentCue) { return false; } @@ -587,11 +587,11 @@ function hasVatPayableConfirmedSignal(text) { if (!hasVatLexeme) { return false; } - const hasPaymentCue = /(?:к\s+уплате|надо|нужно|заплатить|уплатить|плат[её]ж|платежку|в\s+налогов|в\s+бюджет|должн[аы]?\s+заплатить|мы\s+должн[аы]?|должн[аы]?\s+мы)/iu.test(text); + const hasPaymentCue = /(?:к\s+уплате|надо|нужно|заплатить|уплатить|плат[её]ж|платежку|в\s+налогов|в\s+бюджет|должн[аы]?\s+заплатить|мы\s+должн[аы]?|должн[аы]?\s+мы|сгруз(?:ить|им|ишь|ите|ил|ила|или|ка))/iu.test(text); if (!hasPaymentCue) { return false; } - const hasDateOrPeriodCue = /(?:на\s+дат|по\s+состоянию|на\s+конец|за\s+(?:\d{4}|январ|феврал|март|апрел|май|июн|июл|август|сентябр|октябр|ноябр|декабр)|квартал|месяц|год|период|\b\d{4}[./-]\d{2}[./-]\d{2}\b)/iu.test(text); + const hasDateOrPeriodCue = /(?:на\s+дат|по\s+состоянию|на\s+конец|за\s+(?:\d{4}|январ|феврал|март|апрел|май|июн|июл|август|сентябр|октябр|ноябр|декабр)|на\s+(?:январ|феврал|март|апрел|май|июн|июл|август|сентябр|октябр|ноябр|декабр)\S*(?:\s+(?:19|20)\d{2})?|квартал|месяц|год|период|\b\d{4}[./-]\d{2}[./-]\d{2}\b)/iu.test(text); return hasDateOrPeriodCue || /(?:сколько|скока|скок)/iu.test(text); } function hasPeriodCoverageProfileSignal(text) { @@ -684,6 +684,9 @@ function hasCounterpartyDebtLongevitySignal(text) { return hasCounterpartyLexeme && hasDebtLexeme && hasLongevityCue; } function hasCounterpartyActivityLifecycleSignal(text) { + if (hasCustomerRevenueAndPaymentsSignal(text) || hasSupplierPayoutsProfileSignal(text)) { + return false; + } const hasPaymentRiskLexeme = /(?:не\s+плат(?:ит|ят|ил|или)|без\s+оплат|оплат(?:ы|а)?\s+нет|нет\s+оплат|задерж(?:ива|к)|просроч|задолж|\bдолг(?:и|ов|а|у)?\b)/iu.test(text); if (hasPaymentRiskLexeme) { return false; @@ -721,6 +724,19 @@ function hasCounterpartyActivityLifecycleSignal(text) { } return hasCounterpartyLexeme && hasActivityLexeme && (hasTimeWindowLexeme || hasListVerb); } +function hasCounterpartyShipmentItemFlowSignal(text) { + const hasNamedTailAfterShipmentCue = /(?:отгруж(?:ал|али|ено)|постав(?:лял|ляли|ил|или)|привоз(?:ил|или)|продал)\s+[a-zа-яё][a-zа-яё0-9._-]{2,}/iu.test(text); + const hasPartySignal = hasPartyAnchorMention(text) || + hasLooseByAnchorMention(text) || + hasImplicitCounterpartyAnchorAroundDocs(text) || + hasHeuristicCounterpartyAnchor(text); + if (!hasPartySignal && !hasNamedTailAfterShipmentCue) { + return false; + } + const hasInboundShipmentCue = /(?:что\s+нам\s+(?:отгруж(?:ал|али|ено)|постав(?:лял|ляли|ил|или)|привоз(?:ил|или)|продал)|кто\s+нам\s+постав(?:лял|ил)|что\s+постав(?:лял|или)\s+нам|что\s+нам\s+поставили)/iu.test(text); + const hasItemOrServiceCue = /(?:како(?:й|е|го|му)\s+товар|каки(?:е|х)\s+товар|какую\s+услуг|какие\s+услуг|товар\s+или\s+услуг|позици(?:ю|и|ях)?)/iu.test(text); + return hasInboundShipmentCue || hasItemOrServiceCue; +} function hasContractUsageOverviewSignal(text) { if (hasAny(text, CONTRACT_USAGE_OVERVIEW_HINTS)) { return true; @@ -1652,7 +1668,9 @@ function resolveAddressIntent(userMessage) { !hasInventoryProvenanceSignalV2(text) && !hasInventoryPurchaseDocumentsSignalV2(text) && !hasInventorySaleTraceSignalV2(text) && - /(?:контраг|договор|контракт|counterparty|contract|покупател|клиент|заказчик|customer|client|buyer|supplier|поставщик)/iu.test(text)) { + (/(?:контраг|договор|контракт|counterparty|contract|покупател|клиент|заказчик|customer|client|buyer|supplier|поставщик)/iu.test(text) || + hasAccountNumberAnchor(text) || + hasCompactAccountCodeToken(text))) { return { intent: "open_items_by_counterparty_or_contract", confidence: "medium", @@ -1760,15 +1778,20 @@ function resolveAddressIntent(userMessage) { reasons: ["bank_ops_by_counterparty_signal_detected"] }; } - if (hasAny(text, DOCUMENTS_BY_COUNTERPARTY_HINTS) && + if ((hasAny(text, DOCUMENTS_BY_COUNTERPARTY_HINTS) || hasCounterpartyShipmentItemFlowSignal(text)) && (hasPartyAnchorMention(text) || hasLooseByAnchorMention(text) || hasImplicitCounterpartyAnchorAroundDocs(text) || - hasHeuristicCounterpartyAnchor(text))) { + hasHeuristicCounterpartyAnchor(text) || + hasCounterpartyShipmentItemFlowSignal(text))) { return { intent: "list_documents_by_counterparty", confidence: "medium", - reasons: ["documents_by_counterparty_signal_detected"] + reasons: [ + hasCounterpartyShipmentItemFlowSignal(text) + ? "counterparty_item_flow_signal_detected" + : "documents_by_counterparty_signal_detected" + ] }; } if (hasAccountBalanceSignal(text)) { diff --git a/llm_normalizer/backend/dist/services/addressNavigationState.js b/llm_normalizer/backend/dist/services/addressNavigationState.js index 962ba38..6e4eb27 100644 --- a/llm_normalizer/backend/dist/services/addressNavigationState.js +++ b/llm_normalizer/backend/dist/services/addressNavigationState.js @@ -439,10 +439,19 @@ function evolveAddressNavigationStateWithAssistantItem(state, item, turnIndex) { const organizationScope = toNonEmptyString(filtersWithDerivedScope.organization); const nextResultSets = capResultSets([...state.result_sets.filter((itemSet) => itemSet.result_set_id !== resultSetId), resultSet].sort((left, right) => left.created_from_turn - right.created_from_turn)); const nextEvents = capNavigationEvents([...state.navigation_history, navigationEvent]); - return { - ...state, - updated_at: createdAt, - session_context: { + const nextSessionContext = action === "open" + ? { + active_result_set_id: resultSetId, + active_focus_object: focusObject ?? null, + last_confirmed_route: routeId ?? null, + date_scope: { + as_of_date: normalizedDateScope.as_of_date, + period_from: normalizedDateScope.period_from, + period_to: normalizedDateScope.period_to + }, + organization_scope: organizationScope ?? state.session_context.organization_scope + } + : { active_result_set_id: resultSetId, active_focus_object: focusObject ?? state.session_context.active_focus_object, last_confirmed_route: routeId ?? state.session_context.last_confirmed_route, @@ -452,7 +461,11 @@ function evolveAddressNavigationStateWithAssistantItem(state, item, turnIndex) { period_to: normalizedDateScope.period_to ?? state.session_context.date_scope.period_to }, organization_scope: organizationScope ?? state.session_context.organization_scope - }, + }; + return { + ...state, + updated_at: createdAt, + session_context: nextSessionContext, result_sets: nextResultSets, navigation_history: nextEvents }; diff --git a/llm_normalizer/backend/dist/services/addressQueryService.js b/llm_normalizer/backend/dist/services/addressQueryService.js index c7b1988..baaaeaf 100644 --- a/llm_normalizer/backend/dist/services/addressQueryService.js +++ b/llm_normalizer/backend/dist/services/addressQueryService.js @@ -10,6 +10,8 @@ const composeStage_1 = require("./address_runtime/composeStage"); const addressCapabilityPolicy_1 = require("./addressCapabilityPolicy"); const addressRouteExpectations_1 = require("./addressRouteExpectations"); const assistantOrganizationMatcher_1 = require("./assistantOrganizationMatcher"); +const openaiResponsesClient_1 = require("./openaiResponsesClient"); +const files_1 = require("../utils/files"); const ACCOUNT_SCOPE_FIELDS_CHECKED = ["account_dt", "account_kt", "registrator", "analytics"]; const ACCOUNT_SCOPE_MATCH_STRATEGY = "account_code_regex_plus_alias_map_v1"; const ADDRESS_ANCHOR_RECOVERY_LIMIT = 1000; @@ -115,6 +117,7 @@ const COUNTERPARTY_CATALOG_LOOKUP_QUERY_TEMPLATE = ` Справочник.Контрагенты КАК Контрагенты `; let counterpartyCatalogCache = null; +const limitedReplyLlmClient = new openaiResponsesClient_1.OpenAIResponsesClient(); function parseFiniteNumber(value) { if (typeof value === "number" && Number.isFinite(value)) { return value; @@ -654,9 +657,37 @@ function anchorTokenVariants(token) { } return Array.from(variants); } +function normalizePartyTokenSkeleton(value) { + return normalizeSearchText(value).replace(/\s+/g, "").replace(/[аеёиоуыэюяaeiouy]+/giu, ""); +} +function fuzzyPartyTokenMatches(candidate, token) { + const normalizedCandidate = normalizeSearchText(candidate); + const normalizedToken = normalizeSearchText(token); + if (!normalizedCandidate || !normalizedToken) { + return false; + } + if (normalizedCandidate === normalizedToken) { + return true; + } + if (normalizedCandidate.length < 4 || + normalizedToken.length < 4 || + /\d/u.test(normalizedCandidate) || + /\d/u.test(normalizedToken)) { + return false; + } + const candidateSkeleton = normalizePartyTokenSkeleton(normalizedCandidate); + const tokenSkeleton = normalizePartyTokenSkeleton(normalizedToken); + if (candidateSkeleton.length < 3 || tokenSkeleton.length < 3) { + return false; + } + return (candidateSkeleton === tokenSkeleton || + candidateSkeleton.startsWith(tokenSkeleton) || + tokenSkeleton.startsWith(candidateSkeleton)); +} function matchesAnchorText(searchable, anchor) { const searchableNormalized = normalizeSearchText(searchable); const searchableLatin = transliterateCyrillicToLatin(searchableNormalized); + const searchableTokens = tokenizeSearchableText(searchable); const tokens = tokenizeAnchor(anchor); if (tokens.length === 0) { const direct = normalizeSearchText(anchor); @@ -669,7 +700,9 @@ function matchesAnchorText(searchable, anchor) { const variants = anchorTokenVariants(token); return variants.some((variant) => { const tokenLatin = transliterateCyrillicToLatin(variant); - return searchableNormalized.includes(variant) || searchableLatin.includes(tokenLatin); + return (searchableNormalized.includes(variant) || + searchableLatin.includes(tokenLatin) || + searchableTokens.some((candidate) => fuzzyPartyTokenMatches(candidate, variant))); }); }); } @@ -791,6 +824,13 @@ function normalizeCounterpartyName(value) { .replace(/\s+/g, " ") .trim(); } +function hasCounterpartyShipmentItemFlowSignal(userMessage) { + const text = normalizeSearchText(String(userMessage ?? "")); + if (!text) { + return false; + } + return /(?:что\s+нам\s+(?:отгруж|постав|привоз|прод)|кто\s+нам\s+постав|како(?:й|е|го|му)\s+товар|какую\s+услуг|какие\s+товар|какие\s+услуг|товар\s+или\s+услуг|позици(?:ю|и|ях)?)/iu.test(text); +} function extractCounterpartyCatalogNames(rows) { return uniqueStrings(rows .map((row) => { @@ -807,6 +847,7 @@ function scoreCounterpartyCandidate(name, anchor) { } const normalizedName = normalizeCounterpartyName(name); const normalizedAnchor = normalizeCounterpartyName(anchor); + const nameTokens = tokenizeSearchableText(name); if (!normalizedName || !normalizedAnchor) { return null; } @@ -817,6 +858,9 @@ function scoreCounterpartyCandidate(name, anchor) { else if (normalizedName.includes(normalizedAnchor)) { score += 5_000; } + else if (fuzzyPartyTokenMatches(normalizedName, normalizedAnchor)) { + score += 3_500; + } else if (normalizedAnchor.includes(normalizedName) && normalizedName.length >= 4) { score += 2_000; } @@ -828,6 +872,9 @@ function scoreCounterpartyCandidate(name, anchor) { if (normalizedName.includes(variant)) { tokenScore = Math.max(tokenScore, Math.max(2, variant.length) * 20); } + else if (nameTokens.some((candidate) => fuzzyPartyTokenMatches(candidate, variant))) { + tokenScore = Math.max(tokenScore, Math.max(2, variant.length) * 12); + } } if (tokenScore === 0) { return null; @@ -1019,7 +1066,7 @@ function toNormalizedRows(rows) { const accountKt = valueAsString(row.СчетКт ?? row.account_kt ?? row.AccountKt).trim() || null; const amount = parseFiniteNumber(row.Сумма ?? row.amount ?? row.Amount); const quantity = firstFiniteNumber(row.Количество, row.quantity, row.Quantity); - const item = firstNonEmptyString(row.Номенклатура, row.Item, row.item, row.НоменклатураПредставление, row.SubcontoDt1, row.SubcontoDt2, row.SubcontoDt3, row.SubcontoKt1, row.SubcontoKt2, row.SubcontoKt3, row.СубконтоДт1, row.СубконтоДт2, row.СубконтоДт3, row.СубконтоКт1, row.СубконтоКт2, row.СубконтоКт3); + const item = resolveInventoryItemFromRawRow(row, accountDt, accountKt); const warehouse = firstNonEmptyString(row.Склад, row.Warehouse, row.warehouse, row.СкладПредставление); const organization = firstNonEmptyString(row.Организация, row.Organization, row.organization, row.organization_name, row.ОрганизацияПредставление); const analytics = collectAnalyticsStrings(row); @@ -1038,6 +1085,150 @@ function toNormalizedRows(rows) { }) .filter((item) => Boolean(item.period || item.registrator)); } +function hasInventoryAccountPrefix(account) { + const normalized = String(account ?? "").trim(); + return /^41(?:\.01)?(?:$|[^\d])/u.test(normalized); +} +function resolveInventoryItemFromRawRow(row, accountDt, accountKt) { + const debitCandidates = [ + row.SubcontoDt1, + row.SubcontoDt2, + row.SubcontoDt3, + row.СубконтоДт1, + row.СубконтоДт2, + row.СубконтоДт3 + ]; + const creditCandidates = [ + row.SubcontoKt1, + row.SubcontoKt2, + row.SubcontoKt3, + row.СубконтоКт1, + row.СубконтоКт2, + row.СубконтоКт3 + ]; + if (hasInventoryAccountPrefix(accountDt) && !hasInventoryAccountPrefix(accountKt)) { + const debitSideItem = firstNonEmptyString(...debitCandidates, ...creditCandidates); + if (debitSideItem) { + return debitSideItem; + } + } + if (hasInventoryAccountPrefix(accountKt) && !hasInventoryAccountPrefix(accountDt)) { + const creditSideItem = firstNonEmptyString(...creditCandidates, ...debitCandidates); + if (creditSideItem) { + return creditSideItem; + } + } + const explicitItem = firstNonEmptyString(row.Номенклатура, row.Nomenclature, row.nomenclature, row.Item, row.item, row.НоменклатураПредставление); + if (explicitItem) { + return explicitItem; + } + return firstNonEmptyString(...debitCandidates, ...creditCandidates); +} +function formatMoneyRubForReply(value) { + return `${new Intl.NumberFormat("ru-RU", { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + }).format(value)} ₽`; +} +function extractContractNameFromNormalizedRow(row) { + for (const token of row.analytics) { + const normalized = String(token ?? "").trim(); + if (!normalized) { + continue; + } + if (/^(?:0|<пусто>|пустая ссылка)$/iu.test(normalized)) { + continue; + } + if (/(?:договор|contract|дог\.)/iu.test(normalized)) { + return normalized; + } + } + return null; +} +function hasBankAccountPrefix(account) { + const normalized = String(account ?? "").trim(); + return /^5[12](?:$|[^\d])/u.test(normalized); +} +function hasPayablesAccountPrefix(account) { + const normalized = String(account ?? "").trim(); + return /^60(?:$|[^\d])/u.test(normalized); +} +function isOutgoingSupplierPaymentRow(row) { + const registrator = normalizeSearchText(row.registrator); + return ((hasPayablesAccountPrefix(row.account_dt) && hasBankAccountPrefix(row.account_kt)) || + registrator.includes("списание с расчетного счета")); +} +function isIncomingSupplierReturnRow(row) { + const registrator = normalizeSearchText(row.registrator); + return ((hasBankAccountPrefix(row.account_dt) && hasPayablesAccountPrefix(row.account_kt)) || + registrator.includes("поступление на расчетный счет")); +} +function formatCounterpartyBankActivityRows(rows, limit = 5) { + return rows.slice(0, limit).map((row, index) => { + const parts = [`${index + 1}. ${row.registrator}`, `дата: ${row.period ?? "не указана"}`]; + if (typeof row.amount === "number" && Number.isFinite(row.amount)) { + parts.push(`сумма: ${formatMoneyRubForReply(row.amount)}`); + } + const contract = extractContractNameFromNormalizedRow(row); + if (contract) { + parts.push(`договор: ${contract}`); + } + return parts.join(" | "); + }); +} +function buildCounterpartyItemFlowBankFallbackReply(counterpartyLabel, bankRows) { + if (bankRows.length === 0) { + return null; + } + const outgoingPayments = bankRows.filter((row) => isOutgoingSupplierPaymentRow(row)); + const incomingReturns = bankRows.filter((row) => isIncomingSupplierReturnRow(row)); + const classifiedKeys = new Set([...outgoingPayments, ...incomingReturns].map((row) => `${row.period ?? ""}|${row.registrator}|${row.amount ?? ""}`)); + const otherBankRows = bankRows.filter((row) => !classifiedKeys.has(`${row.period ?? ""}|${row.registrator}|${row.amount ?? ""}`)); + const outgoingTotal = outgoingPayments.reduce((sum, row) => sum + (row.amount ?? 0), 0); + const incomingTotal = incomingReturns.reduce((sum, row) => sum + (row.amount ?? 0), 0); + const otherTotal = otherBankRows.reduce((sum, row) => sum + (row.amount ?? 0), 0); + const contracts = uniqueStrings(bankRows + .map((row) => extractContractNameFromNormalizedRow(row)) + .filter((item) => Boolean(item))); + const summaryParts = []; + if (outgoingPayments.length > 0) { + summaryParts.push(`исходящих оплат поставщику: ${outgoingPayments.length} на ${formatMoneyRubForReply(outgoingTotal)}`); + } + if (incomingReturns.length > 0) { + summaryParts.push(`возвратов от поставщика: ${incomingReturns.length} на ${formatMoneyRubForReply(incomingTotal)}`); + } + if (otherBankRows.length > 0) { + summaryParts.push(`прочих банковских документов: ${otherBankRows.length} на ${formatMoneyRubForReply(otherTotal)}`); + } + if (summaryParts.length === 0) { + return null; + } + const lines = [`Контрагент: ${counterpartyLabel}. Подтвержденных поставок товаров или услуг не найдено.`]; + lines.push("Позиции: подтвержденных поставок товаров или услуг не найдено."); + lines.push(`По связанным расчетам с контрагентом найдено ${summaryParts.join("; ")}.`); + if (outgoingPayments.length > 0 && incomingReturns.length > 0 && Math.abs(outgoingTotal - incomingTotal) < 0.005) { + lines.push("Сумма возврата совпадает с суммой исходящих оплат."); + } + if (contracts.length === 1) { + lines.push(`Договор: ${contracts[0]}.`); + } + else if (contracts.length > 1) { + lines.push(`Договоры: ${contracts.slice(0, 3).join("; ")}.`); + } + if (outgoingPayments.length > 0) { + lines.push("Оплаты поставщику:"); + lines.push(...formatCounterpartyBankActivityRows(outgoingPayments)); + } + if (incomingReturns.length > 0) { + lines.push("Возвраты от поставщика:"); + lines.push(...formatCounterpartyBankActivityRows(incomingReturns)); + } + if (otherBankRows.length > 0) { + lines.push("Прочие банковские документы:"); + lines.push(...formatCounterpartyBankActivityRows(otherBankRows)); + } + return lines.join("\n"); +} function rowSearchableText(row) { return [ row.registrator, @@ -2113,6 +2304,88 @@ function hasAggregateLimitedSignal(input) { } return /(?:оборот|выруч|доход|прибыл|марж|рентабел|тренд|динам|самый|топ|ranking|revenue|profit|margin|year)/iu.test(String(input.reason ?? "")); } +function shouldUseLlmLimitedReply(category) { + return (category === "unsupported" || + category === "recipe_visibility_gap" || + category === "execution_error" || + category === "missing_anchor" || + category === "empty_match"); +} +function loadSharedLlmRequestConfig() { + const record = (0, files_1.readJsonFile)(config_1.SHARED_LLM_CONNECTION_FILE, null); + const connection = record?.connection; + if (!connection || typeof connection !== "object") { + return null; + } + const llmProvider = connection.llmProvider === "local" ? "local" : "openai"; + const model = String(connection.model ?? "").trim() || config_1.DEFAULT_MODEL; + const baseUrl = String(connection.baseUrl ?? "").trim() || config_1.DEFAULT_OPENAI_BASE_URL; + const temperature = typeof connection.temperature === "number" && Number.isFinite(connection.temperature) + ? connection.temperature + : 0.2; + const maxOutputTokens = typeof connection.maxOutputTokens === "number" && Number.isFinite(connection.maxOutputTokens) + ? Math.max(64, Math.trunc(connection.maxOutputTokens)) + : config_1.DEFAULT_MAX_OUTPUT_TOKENS; + const apiKey = String(process.env.OPENAI_API_KEY ?? "").trim(); + if (llmProvider === "openai" && apiKey.length === 0) { + return null; + } + return { + llmProvider, + apiKey, + model, + baseUrl, + temperature, + maxOutputTokens + }; +} +async function tryComposeLlmLimitedReply(input) { + if (process.env.VITEST === "true" || process.env.NODE_ENV === "test") { + return null; + } + if (!shouldUseLlmLimitedReply(input.category)) { + return null; + } + const question = String(input.userMessage ?? "").trim(); + if (!question) { + return null; + } + const config = loadSharedLlmRequestConfig(); + if (!config) { + return null; + } + const contextPayload = { + question, + intent: input.intent, + category: input.category, + reason: normalizeLimitedReason(input.reasonText), + next_step: normalizeLimitedNextStep(input.nextStep ?? ""), + filters: input.filters, + anchor: input.anchor + ? { + type: input.anchor.anchor_type, + raw: input.anchor.anchor_value_raw, + resolved: input.anchor.anchor_value_resolved + } + : null + }; + try { + const response = await limitedReplyLlmClient.chat(config, { + systemPrompt: "Ты формулируешь мягкий, но предметный отказ для бухгалтерского ассистента 1С. Нельзя выдумывать факты и нельзя утверждать, что данные найдены, если это не подтверждено.", + developerPrompt: "Ответь по-русски, коротко и по делу. Дай 2-4 коротких абзаца. Первая фраза должна прямо сказать, что именно сейчас не удается надежно подтвердить по вопросу пользователя. Если есть контрагент, счет, договор, организация или период, упомяни их естественно. Коротко скажи, что уже проверено, и предложи 1-2 ближайших шага. Не используй техжаргон вроде address lane, partial_coverage, recipe, capability, unsupported.", + userMessage: `Контекст отказа:\n${JSON.stringify(contextPayload, null, 2)}`, + maxOutputTokens: Math.min(280, Math.max(160, config.maxOutputTokens ?? config_1.DEFAULT_MAX_OUTPUT_TOKENS)), + temperature: 0.2 + }); + const text = String(response.outputText ?? "") + .replace(/\r\n/g, "\n") + .trim(); + return text.length > 0 ? text : null; + } + catch { + return null; + } +} function composeLimitedReply(input) { const reason = normalizeLimitedReason(input.reason); const filterSeed = buildLimitedVariantSeedFingerprint(input.filters); @@ -2511,6 +2784,7 @@ class AddressQueryService { requestedResultMode, filters: executionFilters }); + let anchor = (0, resolveStage_1.resolvePrimaryAnchor)(intent.intent, filters.extracted_filters); if ((0, addressCapabilityPolicy_1.isCapabilityRouteBlocked)(capabilityDecision)) { return buildLimitedExecutionResult({ mode, @@ -2537,6 +2811,17 @@ class AddressQueryService { } const composeOptionsFromFilters = (filterSet, options = {}) => ({ userMessage, + itemHint: typeof filterSet.item === "string" ? filterSet.item : undefined, + counterpartyHint: typeof options.counterpartyHint === "string" + ? options.counterpartyHint + : typeof filterSet.counterparty === "string" + ? filterSet.counterparty + : undefined, + accountHint: typeof options.accountHint === "string" + ? options.accountHint + : typeof filterSet.account === "string" + ? filterSet.account + : undefined, periodFrom: typeof filterSet.period_from === "string" ? filterSet.period_from : undefined, periodTo: typeof filterSet.period_to === "string" ? filterSet.period_to : undefined, asOfDate: typeof filterSet.as_of_date === "string" ? filterSet.as_of_date : undefined, @@ -2545,8 +2830,39 @@ class AddressQueryService { emphasizeNumbers: options.emphasizeNumbers ?? undefined, useRubCurrency: options.useRubCurrency ?? undefined }); + const finalizeLimitedResult = async (input) => { + const result = buildLimitedExecutionResult(input); + const llmReply = await tryComposeLlmLimitedReply({ + userMessage, + category: input.category, + intent: input.intent.intent, + reasonText: input.reasonText, + nextStep: input.nextStep, + filters: input.filters, + anchor: input.anchor + }); + if (!llmReply) { + return result; + } + return { + ...result, + reply_text: llmReply + }; + }; + const composeRuntimeOptions = (filterSet, options = {}) => composeOptionsFromFilters(filterSet, { + ...options, + counterpartyHint: typeof options.counterpartyHint === "string" + ? options.counterpartyHint + : anchor?.anchor_type === "counterparty" + ? anchor.anchor_value_resolved ?? anchor.anchor_value_raw ?? undefined + : undefined, + accountHint: typeof options.accountHint === "string" + ? options.accountHint + : typeof filterSet.account === "string" + ? filterSet.account + : undefined + }); const futureGuardReferenceDate = resolveFutureGuardReferenceDate(analysisDate, executionFilters); - let anchor = (0, resolveStage_1.resolvePrimaryAnchor)(intent.intent, filters.extracted_filters); const debtLifecycleReceivablesScenario = intent.intent === "list_receivables_counterparties" && Array.isArray(intent.reasons) && intent.reasons.includes("receivables_debt_lifecycle_signal_detected"); @@ -2596,7 +2912,7 @@ class AddressQueryService { baseReasons.push("confirmed_balance_unavailable_fallback_to_heuristic_candidates"); } if (intent.intent === "unknown") { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -2618,7 +2934,7 @@ class AddressQueryService { }); } if (recipeSelection.selected_recipe === null) { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -2640,7 +2956,7 @@ class AddressQueryService { }); } if (recipeSelection.missing_required_filters.length > 0) { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -2662,7 +2978,7 @@ class AddressQueryService { }); } if (!config_1.FEATURE_ASSISTANT_ADDRESS_QUERY_LIVE_V1) { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -2687,6 +3003,14 @@ class AddressQueryService { if (shouldAttemptCounterpartyCatalogResolution(intent.intent, filters.extracted_filters)) { const catalogResolution = await resolveCounterpartyViaCatalog(rawCounterpartyAnchor); if (catalogResolution.resolvedValue) { + filters.extracted_filters = { + ...filters.extracted_filters, + counterparty: catalogResolution.resolvedValue + }; + executionFilters = { + ...executionFilters, + counterparty: catalogResolution.resolvedValue + }; if (normalizeCounterpartyName(rawCounterpartyAnchor) !== normalizeCounterpartyName(catalogResolution.resolvedValue)) { filters.warnings.push("counterparty_anchor_resolved_via_catalog_lookup"); } @@ -2723,6 +3047,42 @@ class AddressQueryService { let composeIntent = intent.intent; let routeExpectationIntent = intent.intent; let plan = enforceStrictAccountScopeForIntent((0, addressRecipeCatalog_1.buildAddressRecipePlan)(recipeSelection.selected_recipe, executionFilters), intent.intent); + const counterpartyItemFlowQuery = intent.intent === "list_documents_by_counterparty" && + hasCounterpartyShipmentItemFlowSignal(userMessage) && + typeof executionFilters.counterparty === "string" && + executionFilters.counterparty.trim().length > 0; + const counterpartyItemFlowFilters = counterpartyItemFlowQuery && anchor.anchor_type === "counterparty" && anchor.anchor_value_resolved + ? { + ...executionFilters, + counterparty: anchor.anchor_value_resolved + } + : executionFilters; + if (counterpartyItemFlowQuery) { + plan = { + ...plan, + query: (0, addressRecipeCatalog_1.buildCounterpartyPurchaseDocumentQuery)(counterpartyItemFlowFilters, plan.limit), + account_scope: [], + account_scope_mode: "preferred" + }; + if (!baseReasons.includes("counterparty_item_flow_query_override_to_purchase_documents")) { + baseReasons.push("counterparty_item_flow_query_override_to_purchase_documents"); + } + } + const accountOnlyOpenItemsQuery = intent.intent === "open_items_by_counterparty_or_contract" && + typeof executionFilters.account === "string" && + executionFilters.account.trim().length > 0 && + !(typeof executionFilters.counterparty === "string" && executionFilters.counterparty.trim().length > 0) && + !(typeof executionFilters.contract === "string" && executionFilters.contract.trim().length > 0); + if (accountOnlyOpenItemsQuery) { + plan = { + ...plan, + query: (0, addressRecipeCatalog_1.buildOpenItemsMovementQuery)(executionFilters, plan.limit), + account_scope_mode: "strict" + }; + if (!baseReasons.includes("open_items_account_query_override_to_movements")) { + baseReasons.push("open_items_account_query_override_to_movements"); + } + } let mcp = await (0, addressMcpClient_1.executeAddressMcpQuery)({ query: plan.query, limit: plan.limit @@ -2823,7 +3183,7 @@ class AddressQueryService { } if (mcp.error) { const errorScopeAudit = buildDefaultAccountScopeAudit(filters.extracted_filters); - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -2952,6 +3312,78 @@ class AddressQueryService { : matchFailureStage === "materialized_but_filtered_out_by_recipe" ? "rows_filtered_out_by_intent_recipe_after_anchor_match" : null; + const buildFactualNoRowsResult = (replyText, noRowsReason, extraLimitations = []) => { + const responseType = "FACTUAL_SUMMARY"; + const semantics = mergeAddressResultSemantics(deriveAddressResultSemantics({ + intent: intent.intent, + selectedRecipe: effectiveRecipeId, + filters: filters.extracted_filters, + semanticFrame, + responseType, + rowsMatched: 0 + }), undefined); + return { + handled: true, + reply_text: replyText, + reply_type: (0, composeStage_1.inferReplyType)(responseType), + response_type: responseType, + debug: { + detected_mode: mode.mode, + detected_mode_confidence: mode.confidence, + query_shape: shape.shape, + query_shape_confidence: shape.confidence, + detected_intent: intent.intent, + detected_intent_confidence: intent.confidence, + extracted_filters: filters.extracted_filters, + missing_required_filters: [], + selected_recipe: effectiveRecipeId, + mcp_call_status_legacy: toLegacyMcpStatus(stageStatus), + account_scope_mode: plan.account_scope_mode, + account_scope_fallback_applied: accountScopeFallbackApplied, + anchor_type: anchor.anchor_type, + anchor_value_raw: anchor.anchor_value_raw, + anchor_value_resolved: anchor.anchor_value_resolved, + resolver_confidence: anchor.resolver_confidence, + ambiguity_count: anchor.ambiguity_count, + match_failure_stage: matchFailureStage, + match_failure_reason: matchFailureReason, + mcp_call_status: stageStatus, + rows_fetched: mcp.fetched_rows, + raw_rows_received: mcp.raw_rows.length, + rows_after_account_scope: normalizedRows.length, + rows_after_recipe_filter: filterByAnchors.length, + rows_materialized: normalizedRows.length, + rows_matched: 0, + raw_row_keys_sample: rowDiagnostics.rawRowKeysSample, + materialization_drop_reason: rowDiagnostics.materializationDropReason, + account_token_raw: accountScopeAudit.accountTokenRaw, + account_token_normalized: accountScopeAudit.accountTokenNormalized, + account_scope_fields_checked: accountScopeAudit.accountScopeFieldsChecked, + account_scope_match_strategy: accountScopeAudit.accountScopeMatchStrategy, + account_scope_drop_reason: accountScopeAudit.accountScopeDropReason, + runtime_readiness: "LIVE_QUERYABLE_WITH_LIMITS", + limited_reason_category: null, + response_type: responseType, + ...semantics, + limitations: [...filters.warnings, ...extraLimitations], + reasons: withConfirmedBalanceFallbackReason([...baseReasons, noRowsReason], requestedResultMode, undefined, semantics.result_mode), + ...(capabilityAudit + ? { + capability_id: capabilityAudit.capabilityId, + capability_layer: capabilityAudit.layer, + capability_route_mode: capabilityAudit.routeMode, + capability_route_enabled: capabilityAudit.enabled, + capability_route_reason: capabilityAudit.reason + } + : {}), + ...(shadowRouteAudit + ? { + shadow_route_status: shadowRouteAudit.status + } + : {}) + } + }; + }; if (organizationWarehouseRecoveryApplied) { if (!baseReasons.includes("organization_scope_live_grounding_recovered_rows")) { baseReasons.push("organization_scope_live_grounding_recovered_rows"); @@ -2996,7 +3428,7 @@ class AddressQueryService { const recoveredBankRows = applyIntentSpecificFilter("bank_operations_by_contract", filterByAnchors); const recoveredRows = recoveredBankRows.length > 0 ? recoveredBankRows : filterByAnchors; if (recoveredRows.length > 0) { - const factual = (0, composeStage_1.composeFactualReply)(intent.intent, recoveredRows, composeOptionsFromFilters(executionFilters)); + const factual = (0, composeStage_1.composeFactualReply)(intent.intent, recoveredRows, composeRuntimeOptions(executionFilters)); const recoveryReason = recoveredBankRows.length > 0 ? "contract_docs_recovered_via_bank_fallback" : "contract_docs_recovered_via_anchor_rows"; @@ -3123,7 +3555,7 @@ class AddressQueryService { rowsAnchorMatched: expandedRowsByAnchor.length, rowsMatched: expandedFilteredRows.length }); - const expandedFactual = (0, composeStage_1.composeFactualReply)(intent.intent, expandedFilteredRows, composeOptionsFromFilters(expandedLimitFilters)); + const expandedFactual = (0, composeStage_1.composeFactualReply)(intent.intent, expandedFilteredRows, composeRuntimeOptions(expandedLimitFilters)); const expandedPrefix = `Период сохранен. Глубина live-выборки автоматически расширена до ${expandedPlan.limit} строк.`; const expandedLimitations = [...filters.warnings, "query_limit_auto_expanded_for_anchor_recovery"]; const expandedReasons = [...baseReasons, "query_limit_auto_expanded_for_anchor_recovery"]; @@ -3253,7 +3685,7 @@ class AddressQueryService { }); const observedWindow = deriveObservedPeriodWindow(broadenedFilteredRows); const broadenedPrefix = composeAutoBroadenedPeriodPrefix(filters.extracted_filters, observedWindow); - const broadenedFactual = (0, composeStage_1.composeFactualReply)(intent.intent, broadenedFilteredRows, composeOptionsFromFilters(autoBroadenedFilters)); + const broadenedFactual = (0, composeStage_1.composeFactualReply)(intent.intent, broadenedFilteredRows, composeRuntimeOptions(autoBroadenedFilters)); const broadenedLimitations = [ ...filters.warnings, ...broadenedAdjustments, @@ -3340,6 +3772,7 @@ class AddressQueryService { } } if (filteredRows.length === 0 && + !counterpartyItemFlowQuery && isDocumentOrBankAnchorIntent(intent.intent) && !hasExplicitPeriodWindow(filters.extracted_filters) && (anchor.anchor_type === "counterparty" || anchor.anchor_type === "contract")) { @@ -3401,7 +3834,7 @@ class AddressQueryService { rowsAnchorMatched: historicalRowsByAnchor.length, rowsMatched: historicalFilteredRows.length }); - const historicalFactual = (0, composeStage_1.composeFactualReply)(intent.intent, historicalFilteredRows, composeOptionsFromFilters(historicalFilters)); + const historicalFactual = (0, composeStage_1.composeFactualReply)(intent.intent, historicalFilteredRows, composeRuntimeOptions(historicalFilters)); const historicalPrefix = "Найдены данные в историческом срезе базы по вашему запросу."; const historicalSuggestion = intent.intent === "list_documents_by_counterparty" ? "\nЕсли нужно, могу дополнительно показать платежи и договоры по этому контрагенту." @@ -3473,7 +3906,7 @@ class AddressQueryService { (stageStatus === "materialized_but_not_anchor_matched" || stageStatus === "materialized_but_filtered_out_by_recipe")) { const documentBankFallbackRows = applyIntentSpecificFilter(intent.intent, normalizedRows); if (documentBankFallbackRows.length > 0) { - const fallbackFactual = (0, composeStage_1.composeFactualReply)(intent.intent, documentBankFallbackRows, composeOptionsFromFilters(executionFilters)); + const fallbackFactual = (0, composeStage_1.composeFactualReply)(intent.intent, documentBankFallbackRows, composeRuntimeOptions(executionFilters)); const fallbackPrefix = "По вашему запросу показываю найденные документы и операции в доступном срезе базы."; const fallbackSuggestion = intent.intent === "list_documents_by_counterparty" ? "\nЕсли нужно, могу дополнительно сузить период или показать только платежи." @@ -3546,6 +3979,43 @@ class AddressQueryService { !toNonEmptyFilterValue(filters.extracted_filters.contract) && !toNonEmptyFilterValue(filters.extracted_filters.document_ref); if (filteredRows.length === 0 && !allowConfirmedAsOfZeroSnapshot) { + if (stageStatus === "no_raw_rows" && counterpartyItemFlowQuery && anchor.anchor_type === "counterparty") { + const counterpartyLabel = String(anchor.anchor_value_resolved ?? anchor.anchor_value_raw ?? "указанный контрагент") + .trim() + .replace(/[.]+$/u, ""); + const bankFallbackSelection = (0, addressRecipeCatalog_1.selectAddressRecipe)("bank_operations_by_counterparty", counterpartyItemFlowFilters); + if (bankFallbackSelection.selected_recipe) { + const bankFallbackPlan = enforceStrictAccountScopeForIntent((0, addressRecipeCatalog_1.buildAddressRecipePlan)(bankFallbackSelection.selected_recipe, counterpartyItemFlowFilters), "bank_operations_by_counterparty"); + const bankFallbackMcp = await (0, addressMcpClient_1.executeAddressMcpQuery)({ + query: bankFallbackPlan.query, + limit: bankFallbackPlan.limit + }); + if (!bankFallbackMcp.error) { + const bankFallbackNormalizedRows = applyAccountScopeFilter(toNormalizedRows(bankFallbackMcp.raw_rows), bankFallbackPlan.account_scope); + const bankFallbackRows = applyIntentSpecificFilter("bank_operations_by_counterparty", applyAddressFilters(bankFallbackNormalizedRows, counterpartyItemFlowFilters).rows); + const bankFallbackReply = buildCounterpartyItemFlowBankFallbackReply(counterpartyLabel, bankFallbackRows); + if (bankFallbackReply) { + return buildFactualNoRowsResult(bankFallbackReply, "counterparty_item_flow_no_supply_but_bank_activity_explained", ["counterparty_item_flow_bank_activity_fallback_applied"]); + } + } + } + return buildFactualNoRowsResult(`Контрагент: ${counterpartyLabel}. Позиции: подтвержденных поступлений товаров или услуг не найдено.\nПроверил документы поступления и связанные движения по этому контрагенту: в доступном срезе базы строк с товарами или услугами не нашлось.`, "counterparty_item_flow_exact_negative_response"); + } + if (stageStatus === "no_raw_rows" && accountOnlyOpenItemsQuery) { + const accountLabel = typeof executionFilters.account === "string" && executionFilters.account.trim().length > 0 + ? executionFilters.account.trim() + : "указанному счету"; + const periodLabel = typeof executionFilters.period_from === "string" && typeof executionFilters.period_to === "string" + ? `за период ${executionFilters.period_from}..${executionFilters.period_to}` + : typeof executionFilters.as_of_date === "string" + ? `на дату ${executionFilters.as_of_date}` + : ""; + const organizationLabel = typeof executionFilters.organization === "string" && executionFilters.organization.trim().length > 0 + ? executionFilters.organization.trim() + : ""; + return buildFactualNoRowsResult(`По счету ${accountLabel}${periodLabel ? ` ${periodLabel}` : ""} открытых остатков не найдено.` + + (organizationLabel ? `\nОрганизация: ${organizationLabel}.` : ""), "open_items_account_exact_negative_response"); + } const hadBaseRows = normalizedRows.length > 0 || mcp.fetched_rows > 0; const hadAnchorMatchedRows = filterByAnchors.length > 0; const isVisibilityGapCandidate = hadBaseRows && @@ -3623,7 +4093,7 @@ class AddressQueryService { ? "document_or_bank_visibility_gap_after_base_filter" : "no_rows_after_recipe_and_scope_filter" ]; - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -3665,7 +4135,7 @@ class AddressQueryService { composeIntent === "payables_confirmed_as_of_date" || composeIntent === "receivables_confirmed_as_of_date"; const shouldUseRubCurrency = composeIntent === "vat_payable_forecast" || composeIntent === "vat_liability_confirmed_for_tax_period"; - const factual = (0, composeStage_1.composeFactualReply)(composeIntent, filteredRows, composeOptionsFromFilters(executionFilters, { + const factual = (0, composeStage_1.composeFactualReply)(composeIntent, filteredRows, composeRuntimeOptions(executionFilters, { vatDirectSourceProbe, emphasizeNumbers: shouldEmphasizeNumbers, useRubCurrency: shouldUseRubCurrency @@ -3695,7 +4165,7 @@ class AddressQueryService { resultMode: factualResultSemantics.result_mode }); if (finalRouteExpectationAudit.status === "mismatch" && config_1.FEATURE_ASSISTANT_ROUTE_EXPECTATION_HARD_GUARD_V1) { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -3741,7 +4211,7 @@ class AddressQueryService { : intent.intent === "vat_liability_confirmed_for_tax_period" ? "vat_tax_period" : "vat_payable"; - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, diff --git a/llm_normalizer/backend/dist/services/addressRecipeCatalog.js b/llm_normalizer/backend/dist/services/addressRecipeCatalog.js index 13e1920..8751617 100644 --- a/llm_normalizer/backend/dist/services/addressRecipeCatalog.js +++ b/llm_normalizer/backend/dist/services/addressRecipeCatalog.js @@ -1,5 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildCounterpartyPurchaseDocumentQuery = buildCounterpartyPurchaseDocumentQuery; +exports.buildOpenItemsMovementQuery = buildOpenItemsMovementQuery; exports.selectAddressRecipe = selectAddressRecipe; exports.buildAddressRecipePlan = buildAddressRecipePlan; const config_1 = require("../config"); @@ -78,6 +80,38 @@ __WHERE_CLAUSE__ УПОРЯДОЧИТЬ ПО Товары.Ссылка.Дата __ORDER_DIRECTION__ `; +const COUNTERPARTY_PURCHASE_GOODS_QUERY_TEMPLATE = ` +ВЫБРАТЬ ПЕРВЫЕ __LIMIT__ + Товары.Ссылка.Дата КАК Период, + ПРЕДСТАВЛЕНИЕ(Товары.Ссылка) КАК Регистратор, + "41.01" КАК СчетДт, + "" КАК СчетКт, + Товары.Сумма КАК Сумма, + ПРЕДСТАВЛЕНИЕ(Товары.Номенклатура) КАК Номенклатура, + ПРЕДСТАВЛЕНИЕ(Товары.Ссылка.Контрагент) КАК Контрагент, + ПРЕДСТАВЛЕНИЕ(Товары.Ссылка.ДоговорКонтрагента) КАК Договор, + ПРЕДСТАВЛЕНИЕ(Товары.Ссылка.Организация) КАК Организация, + Товары.Количество КАК Количество +ИЗ + Документ.ПоступлениеТоваровУслуг.Товары КАК Товары +__WHERE_CLAUSE__ +`; +const COUNTERPARTY_PURCHASE_SERVICES_QUERY_TEMPLATE = ` +ВЫБРАТЬ ПЕРВЫЕ __LIMIT__ + Услуги.Ссылка.Дата КАК Период, + ПРЕДСТАВЛЕНИЕ(Услуги.Ссылка) КАК Регистратор, + "" КАК СчетДт, + "" КАК СчетКт, + Услуги.Сумма КАК Сумма, + ПРЕДСТАВЛЕНИЕ(Услуги.Номенклатура) КАК Номенклатура, + ПРЕДСТАВЛЕНИЕ(Услуги.Ссылка.Контрагент) КАК Контрагент, + ПРЕДСТАВЛЕНИЕ(Услуги.Ссылка.ДоговорКонтрагента) КАК Договор, + ПРЕДСТАВЛЕНИЕ(Услуги.Ссылка.Организация) КАК Организация, + 0 КАК Количество +ИЗ + Документ.ПоступлениеТоваровУслуг.Услуги КАК Услуги +__WHERE_CLAUSE__ +`; const PAYABLES_CONFIRMED_AS_OF_QUERY_TEMPLATE = ` ВЫБРАТЬ ПЕРВЫЕ __LIMIT__ __AS_OF_EXPR__ КАК Период, @@ -1149,6 +1183,31 @@ function buildInventoryItemReferenceCondition(filters, fieldPaths) { } return clauses.length === 1 ? clauses[0] : `(${clauses.join(" ИЛИ ")})`; } +function buildCounterpartyReferenceCondition(filters, fieldPaths) { + const counterparty = typeof filters.counterparty === "string" ? filters.counterparty.trim() : ""; + if (!counterparty) { + return null; + } + const counterpartyTokens = Array.from(new Set(counterparty + .split(/[^A-Za-zА-Яа-яЁё0-9]+/u) + .map((token) => token.trim()) + .filter((token) => token.length >= 3))); + const tokens = counterpartyTokens.length > 0 ? counterpartyTokens : [counterparty]; + const clauses = fieldPaths + .map((fieldPath) => String(fieldPath ?? "").trim()) + .filter((fieldPath) => fieldPath.length > 0) + .map((fieldPath) => { + const tokenConditions = tokens.map((token) => { + const escapedToken = toQueryStringLiteral(token); + return `${fieldPath}.Наименование ПОДОБНО "%${escapedToken}%"`; + }); + return tokenConditions.length === 1 ? tokenConditions[0] : `(${tokenConditions.join(" И ")})`; + }); + if (clauses.length === 0) { + return null; + } + return clauses.length === 1 ? clauses[0] : `(${clauses.join(" ИЛИ ")})`; +} function buildInventorySaleDocumentQuery(filters, resolvedLimit) { const itemCondition = buildInventoryItemReferenceCondition(filters, ["Товары.Номенклатура"]); return INVENTORY_SALE_DOCUMENTS_QUERY_TEMPLATE @@ -1163,6 +1222,28 @@ function buildInventoryPurchaseDocumentQuery(filters, resolvedLimit) { .replace("__WHERE_CLAUSE__", buildWhereClause(filters, "Товары.Ссылка.Дата", ['Товары.Ссылка.Проведен = ИСТИНА', itemCondition].filter((item) => Boolean(item)))) .replaceAll("__ORDER_DIRECTION__", resolveOrderDirection(filters.sort)); } +function buildCounterpartyPurchaseDocumentQuery(filters, resolvedLimit) { + const goodsCounterpartyCondition = buildCounterpartyReferenceCondition(filters, ["Товары.Ссылка.Контрагент"]); + const servicesCounterpartyCondition = buildCounterpartyReferenceCondition(filters, ["Услуги.Ссылка.Контрагент"]); + const goodsQuery = COUNTERPARTY_PURCHASE_GOODS_QUERY_TEMPLATE.replace("__LIMIT__", String(resolvedLimit)).replace("__WHERE_CLAUSE__", buildWhereClause(filters, "Товары.Ссылка.Дата", ['Товары.Ссылка.Проведен = ИСТИНА', goodsCounterpartyCondition].filter((item) => Boolean(item)))); + const servicesQuery = COUNTERPARTY_PURCHASE_SERVICES_QUERY_TEMPLATE.replace("__LIMIT__", String(resolvedLimit)).replace("__WHERE_CLAUSE__", buildWhereClause(filters, "Услуги.Ссылка.Дата", ['Услуги.Ссылка.Проведен = ИСТИНА', servicesCounterpartyCondition].filter((item) => Boolean(item)))); + return `${goodsQuery} +ОБЪЕДИНИТЬ ВСЕ +${servicesQuery} +УПОРЯДОЧИТЬ ПО + Период ${resolveOrderDirection(filters.sort)}`; +} +function buildOpenItemsMovementQuery(filters, resolvedLimit) { + const extraConditions = []; + const accountCondition = buildMovementAccountCondition(filters); + if (accountCondition) { + extraConditions.push(accountCondition); + } + return MOVEMENTS_QUERY_TEMPLATE + .replace("__LIMIT__", String(resolvedLimit)) + .replace("__WHERE_CLAUSE__", buildWhereClause(filters, "Движения.Период", extraConditions)) + .replaceAll("__ORDER_DIRECTION__", resolveOrderDirection(filters.sort)); +} function shouldBoostLimitForAllTimeCounterparty(filters) { const hasAnchor = (typeof filters.counterparty === "string" && filters.counterparty.trim().length > 0) || (typeof filters.contract === "string" && filters.contract.trim().length > 0); diff --git a/llm_normalizer/backend/dist/services/address_runtime/composeStage.js b/llm_normalizer/backend/dist/services/address_runtime/composeStage.js index 76abf35..932d748 100644 --- a/llm_normalizer/backend/dist/services/address_runtime/composeStage.js +++ b/llm_normalizer/backend/dist/services/address_runtime/composeStage.js @@ -479,6 +479,12 @@ function detectValueRankingFocus(userMessage) { if (!text) { return "top_by_total"; } + const asksTotalMoneyEarned = /(?:сколько|скока|скок).*(?:денег|выручк|доход|заработ|оборот)/iu.test(text) && + !/(?:клиент|заказчик|покупател|контрагент|customer|client|counterpart)/iu.test(text) && + !/(?:топ|top|сам(?:ый|ая|ое|ые)|наибольш|больше\s+всего|максимальн)/iu.test(text); + if (asksTotalMoneyEarned) { + return "total_flow"; + } const asksYearlyRevenueRanking = /(?:доходн|выручк|оборот|прибыл|деньг|денег|revenue|turnover|income)/iu.test(text) && /(?:год|года|годы|year|years|по\s+годам)/iu.test(text) && /(?:сам(?:ый|ая|ое|ые)|топ|луч|best|max|наибольш|больше)/iu.test(text); @@ -575,6 +581,13 @@ function extractCounterpartyName(row) { } return null; } +function hasCounterpartyItemFlowQuestion(userMessage) { + const text = String(userMessage ?? "").trim().toLowerCase(); + if (!text) { + return false; + } + return /(?:что\s+нам\s+(?:отгруж|постав|привоз|прод)|како(?:й|е|го|му)\s+товар|какую\s+услуг|какие\s+товар|какие\s+услуг|товар\s+или\s+услуг|позици(?:ю|и|ях)?)/iu.test(text); +} function extractInventoryItemName(row) { const direct = String(row.item ?? "").trim(); if (direct) { @@ -752,10 +765,13 @@ function looksLikeInventoryPartyToken(value) { } return normalized === normalized.toUpperCase() && normalized.length >= 4; } -function extractInventoryCounterpartyCandidates(row) { +function extractInventoryCounterpartyCandidates(row, excludedTokens = []) { const itemToken = normalizeEntityToken(extractInventoryItemName(row)); const warehouseToken = normalizeEntityToken(extractInventoryWarehouseName(row)); const organizationToken = normalizeEntityToken(extractInventoryOrganizationName(row)); + const excludedComparableTokens = excludedTokens + .map((token) => normalizeEntityToken(token)) + .filter((token) => Boolean(token)); const candidates = []; for (const token of row.analytics) { const normalized = String(token ?? "").trim(); @@ -763,14 +779,18 @@ function extractInventoryCounterpartyCandidates(row) { continue; } const comparable = normalizeEntityToken(normalized); - if (!comparable || comparable === itemToken || comparable === warehouseToken || comparable === organizationToken) { + if (!comparable || + comparable === itemToken || + comparable === warehouseToken || + comparable === organizationToken || + excludedComparableTokens.includes(comparable)) { continue; } candidates.push(normalized); } return uniqueStrings(candidates); } -function summarizeInventoryTraceRows(rows) { +function summarizeInventoryTraceRows(rows, excludedCounterpartyTokens = []) { const items = uniqueStrings(rows .map((row) => extractInventoryItemName(row)) .filter((item) => Boolean(item))); @@ -780,7 +800,7 @@ function summarizeInventoryTraceRows(rows) { const organizations = uniqueStrings(rows .map((row) => extractInventoryOrganizationName(row)) .filter((item) => Boolean(item))); - const counterparties = uniqueStrings(rows.flatMap((row) => extractInventoryCounterpartyCandidates(row))); + const counterparties = uniqueStrings(rows.flatMap((row) => extractInventoryCounterpartyCandidates(row, excludedCounterpartyTokens))); const documents = uniqueStrings(rows .map((row) => String(row.registrator ?? "").trim()) .filter((item) => item.length > 0 && item !== "(без названия)")); @@ -800,9 +820,9 @@ function summarizeInventoryTraceRows(rows) { totalAmount }; } -function formatInventoryTraceRows(rows, limit = 10) { +function formatInventoryTraceRows(rows, limit = 10, excludedCounterpartyTokens = []) { return rows.slice(0, limit).map((row, index) => { - const parties = extractInventoryCounterpartyCandidates(row); + const parties = extractInventoryCounterpartyCandidates(row, excludedCounterpartyTokens); const warehouse = extractInventoryWarehouseName(row); const organization = extractInventoryOrganizationName(row); const amount = typeof row.amount === "number" && Number.isFinite(row.amount) ? formatMoneyRub(row.amount) : "сумма не указана"; @@ -823,6 +843,33 @@ function formatInventoryTraceRows(rows, limit = 10) { return parts.join(" | "); }); } +function formatCounterpartyItemFlowRows(rows, limit = 12) { + return rows.slice(0, limit).map((row, index) => { + const item = extractInventoryItemName(row) ?? "позиция не указана"; + const contract = extractContractName(row); + const warehouse = extractInventoryWarehouseName(row); + const organization = extractInventoryOrganizationName(row); + const quantity = extractInventoryQuantity(row); + const amount = typeof row.amount === "number" && Number.isFinite(row.amount) ? formatMoneyRub(row.amount) : "сумма не указана"; + const parts = [ + `${index + 1}. ${item}`, + `договор: ${contract ?? "не указан"}`, + `документ: ${row.registrator}`, + `дата: ${inventoryTraceDateLabel(row.period)}`, + `сумма: ${amount}` + ]; + if (quantity !== null && quantity > 0) { + parts.push(`количество: ${formatNumberWithDots(quantity, 3)}`); + } + if (warehouse) { + parts.push(`склад: ${warehouse}`); + } + if (organization) { + parts.push(`организация: ${organization}`); + } + return parts.join(" | "); + }); +} function buildInventoryAgingByItemAggregate(rows, asOfDate) { const byItem = new Map(); const asOfTimestamp = toUtcDayTimestamp(asOfDate); @@ -2575,6 +2622,8 @@ function composeFactualReply(intent, rows, options = {}) { } const profileRows = Array.from(byCounterparty.values()); const yearRows = Array.from(byYear.values()); + const totalFlow = profileRows.reduce((sum, item) => sum + item.total, 0); + const totalOperations = profileRows.reduce((sum, item) => sum + item.ops, 0); const rankedByTotal = [...profileRows].sort((a, b) => b.total - a.total || b.ops - a.ops || a.name.localeCompare(b.name)); const rankedByYearTotal = [...yearRows].sort((a, b) => b.total - a.total || b.ops - a.ops || a.year - b.year); const rankedByOps = [...profileRows].sort((a, b) => b.ops - a.ops || b.total - a.total || a.name.localeCompare(b.name)); @@ -2606,6 +2655,31 @@ function composeFactualReply(intent, rows, options = {}) { text: lines.join("\n") }; } + if (focus === "total_flow") { + const periodLine = options.periodFrom && options.periodTo + ? `За период ${formatDateRu(options.periodFrom)}..${formatDateRu(options.periodTo)} подтверждено ${formatMoneyRub(totalFlow)} ${isSupplier ? "исходящих выплат" : "входящих поступлений"}.` + : `За все доступное время подтверждено ${formatMoneyRub(totalFlow)} ${isSupplier ? "исходящих выплат" : "входящих поступлений"}.`; + const directAnswerLine = isSupplier + ? periodLine + : `${periodLine} Это сумма денег, полученных от клиентов, а не чистая прибыль.`; + const summaryLines = [ + directAnswerLine, + "", + "Подтверждение:", + `- Операций в выборке: ${totalOperations}.`, + `- Контрагентов в выборке: ${profileRows.length}.` + ]; + if (rankedByYearTotal.length > 0) { + summaryLines.push(`- Самый сильный год по поступлениям: ${rankedByYearTotal[0].year} (${formatMoneyRub(rankedByYearTotal[0].total)}).`); + } + if (rankedByTotal.length > 0) { + summaryLines.push(`- Крупнейший контрагент по потоку: ${rankedByTotal[0].name} (${formatMoneyRub(rankedByTotal[0].total)}).`); + } + return { + responseType: "FACTUAL_SUMMARY", + text: summaryLines.join("\n") + }; + } if (focus === "top_years_by_total") { const visible = rankedByYearTotal.slice(0, limit); const heading = isSupplier @@ -3344,8 +3418,11 @@ function composeFactualReply(intent, rows, options = {}) { if (intent === "inventory_sale_trace_for_item") { const asOfDate = resolvePayablesAsOfDate(options); const saleRows = rows.filter((row) => isInventorySaleMovement(row)); - const summary = summarizeInventoryTraceRows(saleRows); - const itemLabel = summary.item ?? "товар не определен"; + const requestedItemHint = String(options.itemHint ?? "").trim(); + const provisionalExcludedTokens = requestedItemHint ? [requestedItemHint] : []; + const summary = summarizeInventoryTraceRows(saleRows, provisionalExcludedTokens); + const itemLabel = requestedItemHint || (summary.item ?? "товар не определен"); + const excludedCounterpartyTokens = [itemLabel]; const directAnswerLine = summary.counterparties.length === 1 ? `По товару ${itemLabel} покупатель определен: ${summary.counterparties[0]}.` : summary.counterparties.length > 1 @@ -3367,7 +3444,7 @@ function composeFactualReply(intent, rows, options = {}) { } lines.push("", "Документы выбытия:"); if (saleRows.length > 0) { - lines.push(...formatInventoryTraceRows(saleRows, 12)); + lines.push(...formatInventoryTraceRows(saleRows, 12, excludedCounterpartyTokens)); } else { lines.push("- По выбранному товару не найдено проводок выбытия со счета 41.01 в доступном контуре."); @@ -3964,8 +4041,11 @@ function composeFactualReply(intent, rows, options = {}) { } if (intent === "open_items_by_counterparty_or_contract") { const counterparties = buildCounterpartyRiskAggregate(rows); + const accountLead = typeof options.accountHint === "string" && options.accountHint.trim().length > 0 + ? `Проверил хвосты по счету ${options.accountHint.trim()}.` + : "Собраны открытые позиции по взаиморасчетам."; const lines = [ - "Собраны открытые позиции по взаиморасчетам.", + accountLead, `Строк отобрано: ${rows.length}.`, `Контрагентов с сигналом: ${counterparties.length}.` ]; @@ -4019,10 +4099,63 @@ function composeFactualReply(intent, rows, options = {}) { }; } if (intent === "list_documents_by_counterparty") { - const lines = [ - `Найдено документов по контрагенту: ${rows.length}.`, - ...formatTopRows(rows, rows.length) - ]; + const resolvedCounterparty = (typeof options.counterpartyHint === "string" && options.counterpartyHint.trim().length > 0 + ? options.counterpartyHint.trim() + : null) ?? + (() => { + const counterparties = uniqueStrings(rows + .map((row) => extractCounterpartyName(row)) + .filter((item) => Boolean(item))); + return counterparties.length === 1 ? counterparties[0] : null; + })(); + const counterpartyLabel = typeof resolvedCounterparty === "string" && resolvedCounterparty.endsWith(".") + ? resolvedCounterparty + : resolvedCounterparty + ? `${resolvedCounterparty}.` + : null; + const counterpartyInline = typeof counterpartyLabel === "string" ? counterpartyLabel.replace(/[.]+$/u, "") : resolvedCounterparty; + const itemFlowQuestion = hasCounterpartyItemFlowQuestion(options.userMessage); + const items = uniqueStrings(rows + .map((row) => extractInventoryItemName(row)) + .filter((item) => Boolean(item))); + const contracts = uniqueStrings(rows + .map((row) => extractContractName(row)) + .filter((item) => Boolean(item))); + const lines = []; + if (itemFlowQuestion) { + lines.push(counterpartyInline + ? `Контрагент: ${counterpartyInline}. Подтвержденных поставок товаров или услуг: ${rows.length}.` + : `Подтвержденных поставок товаров или услуг по запрошенному контрагенту: ${rows.length}.`); + } + else { + lines.push(counterpartyInline + ? `Контрагент: ${counterpartyInline}. Найдено документов: ${rows.length}.` + : `Найдено документов по контрагенту: ${rows.length}.`); + } + if (counterpartyLabel) { + lines.push(`Контрагент: ${counterpartyLabel}`); + } + if (itemFlowQuestion) { + if (items.length > 0) { + lines.push(`Позиции: ${items.slice(0, 8).join("; ")}.`); + if (items.length > 8) { + lines.push(`Показаны первые 8 из ${items.length} позиций.`); + } + } + if (contracts.length === 1) { + lines.push(`Договор: ${contracts[0]}.`); + } + else if (contracts.length > 1) { + lines.push(`Договоры в выборке: ${contracts.slice(0, 3).join("; ")}.`); + } + lines.push(...formatCounterpartyItemFlowRows(rows)); + if (rows.length > 12) { + lines.push(`Показаны первые 12 из ${rows.length} поставок.`); + } + } + else { + lines.push(...formatTopRows(rows, rows.length)); + } return { responseType: "FACTUAL_LIST", text: lines.join("\n") diff --git a/llm_normalizer/backend/dist/services/address_runtime/decomposeStage.js b/llm_normalizer/backend/dist/services/address_runtime/decomposeStage.js index 1c7fe1a..c2ab7f3 100644 --- a/llm_normalizer/backend/dist/services/address_runtime/decomposeStage.js +++ b/llm_normalizer/backend/dist/services/address_runtime/decomposeStage.js @@ -34,7 +34,7 @@ function hasSameDateHint(text) { return /(?:на\s+ту\s+же\s+дат[ауеы]|на\s+эту\s+же\s+дат[ауеы]|на\s+эту\s+дат[ауеы]|эту\s+дат[ауеы]|та\s+же\s+дата|дат[ауеы],?\s+котор(?:ую|ая)\s+(?:до\s+этого|раньше|ранее)\s+(?:рассматривали|смотрели)|дат[ауеы],?\s+которая\s+был[ао]?\s+ранее\s+рассмотрен[ао]?|same\s+date|as\s+of\s+same\s+date|the\s+same\s+date|date\s+we\s+looked\s+at\s+before|previously\s+considered\s+date)/iu.test(String(text ?? "")); } function hasSamePeriodHint(text) { - return /(?:на\s+тот\s+же\s+период|за\s+тот\s+же\s+период|тот\s+же\s+период(?:\s+рассмотрения)?|на\s+этот\s+же\s+период|за\s+этот\s+же\s+период|аналогичн\w+\s+текущ\w+\s+период\w+|same\s+period|same\s+range|same\s+window)/iu.test(String(text ?? "")); + return /(?:на\s+тот\s+же\s+период|за\s+тот\s+же\s+период|тот\s+же\s+период(?:\s+рассмотрения)?|на\s+этот\s+же\s+период|за\s+этот\s+же\s+период|за\s+этот\s+период|на\s+этот\s+период|за\s+тот\s+период|на\s+тот\s+период|этот\s+период|тот\s+период|аналогичн\w+\s+текущ\w+\s+период\w+|same\s+period|same\s+range|same\s+window)/iu.test(String(text ?? "")); } function hasExplicitPeriodLiteral(text) { return /(?:^|[^\d*×xх])((?:19|20)\d{2}(?:[./-](?:0?[1-9]|1[0-2]))?)(?=$|[^\d*×xх])/iu.test(String(text ?? "")); @@ -521,6 +521,9 @@ function hasAddressFollowupContextSignal(text) { if (hasSameDateHint(normalized)) { return true; } + if (hasSamePeriodHint(normalized)) { + return true; + } const tokenCount = normalized.split(/\s+/).filter(Boolean).length; if (tokenCount <= 12 && /(?:почему|why|из[-\s]?за\s+чего|как\s+так|reason)/iu.test(normalized) && @@ -668,7 +671,9 @@ function mergeFollowupFilters(current, intent, userMessage, followupContext) { intent === "inventory_aging_by_purchase_date" || intent === "payables_confirmed_as_of_date" || intent === "receivables_confirmed_as_of_date" || - intent === "vat_payable_confirmed_as_of_date") { + intent === "vat_payable_confirmed_as_of_date" || + intent === "vat_payable_forecast" || + intent === "vat_liability_confirmed_for_tax_period") { const hasFollowupSignalForConfirmed = hasAddressFollowupContextSignal(userMessage); const inheritedContract = previousContract ?? (followupContext.previous_anchor_type === "contract" ? previousAnchorValue : null); const currentContract = toNonEmptyString(merged.contract); @@ -739,6 +744,30 @@ function mergeFollowupFilters(current, intent, userMessage, followupContext) { reasons.push("as_of_date_from_followup_context"); } } + if (samePeriodRequested && + (intent === "vat_payable_confirmed_as_of_date" || + intent === "vat_payable_forecast" || + intent === "vat_liability_confirmed_for_tax_period" || + intent === "payables_confirmed_as_of_date" || + intent === "receivables_confirmed_as_of_date")) { + if (previousPeriodFrom && merged.period_from !== previousPeriodFrom) { + merged.period_from = previousPeriodFrom; + reasons.push("period_from_from_followup_context"); + } + if (previousPeriodTo && merged.period_to !== previousPeriodTo) { + merged.period_to = previousPeriodTo; + reasons.push("period_to_from_followup_context"); + } + if (intent === "vat_payable_confirmed_as_of_date" || + intent === "payables_confirmed_as_of_date" || + intent === "receivables_confirmed_as_of_date") { + const inheritedAsOfDate = previousAsOfDate ?? previousPeriodTo ?? previousPeriodFrom; + if (inheritedAsOfDate && merged.as_of_date !== inheritedAsOfDate) { + merged.as_of_date = inheritedAsOfDate; + reasons.push("as_of_date_from_followup_context"); + } + } + } if (samePeriodRequested && (intent === "inventory_on_hand_as_of_date" || intent === "inventory_supplier_stock_overlap_as_of_date")) { if (previousPeriodFrom && merged.period_from !== previousPeriodFrom) { @@ -921,6 +950,15 @@ function mergeFollowupFilters(current, intent, userMessage, followupContext) { merged.period_to = previousPeriodTo; } reasons.push("period_from_followup_context"); + if (intent === "vat_payable_confirmed_as_of_date" || + intent === "payables_confirmed_as_of_date" || + intent === "receivables_confirmed_as_of_date") { + const inheritedAsOfDate = previousAsOfDate ?? previousPeriodTo ?? previousPeriodFrom; + if (inheritedAsOfDate) { + merged.as_of_date = inheritedAsOfDate; + reasons.push("as_of_date_from_followup_context"); + } + } } if ((intent === "list_open_contracts" || intent === "open_contracts_confirmed_as_of_date" || @@ -962,7 +1000,7 @@ function resolveMissingRequiredFilters(intent, filters) { }); } function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupContext) { - if (!followupContext || !followupContext.previous_intent) { + if (!followupContext || (!followupContext.previous_intent && !followupContext.target_intent)) { return detectedIntent; } const normalizedMessage = String(userMessage ?? ""); @@ -970,7 +1008,11 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo if (!hasFollowupSignal) { return detectedIntent; } - const previousIntent = followupContext.previous_intent; + const sourceIntent = followupContext.previous_intent ?? null; + const fallbackIntent = followupContext.target_intent ?? sourceIntent; + if (!sourceIntent && !fallbackIntent) { + return detectedIntent; + } const previousFilters = followupContext.previous_filters ?? {}; const previousContract = toNonEmptyString(previousFilters.contract); const previousCounterparty = toNonEmptyString(previousFilters.counterparty); @@ -1000,7 +1042,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo reasons: [...detectedIntent.reasons, "open_items_from_followup_context"] }; } - const previousIsBalanceFamily = previousIntent === "account_balance_snapshot" || previousIntent === "documents_forming_balance"; + const previousIsBalanceFamily = sourceIntent === "account_balance_snapshot" || sourceIntent === "documents_forming_balance"; if (previousIsBalanceFamily && hasAccountSignal(normalizedMessage) && (detectedIntent.intent === "unknown" || @@ -1015,7 +1057,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo reasons: [...detectedIntent.reasons, "intent_adjusted_to_balance_followup_context"] }; } - const previousIsInventoryFamily = isInventoryIntent(previousIntent); + const previousIsInventoryFamily = isInventoryIntent(sourceIntent ?? undefined); const inventorySelectedObjectFollowup = hasSelectedObjectInventorySignal(normalizedMessage) || (previousIsInventoryFamily && hasFollowupSignal); if (inventorySelectedObjectFollowup && hasInventorySupplierFollowupCue(normalizedMessage)) { if (detectedIntent.intent === "unknown" || @@ -1024,7 +1066,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo detectedIntent.intent === "bank_operations_by_counterparty" || detectedIntent.intent === "bank_operations_by_contract" || detectedIntent.intent === "inventory_on_hand_as_of_date" || - detectedIntent.intent === previousIntent) { + detectedIntent.intent === sourceIntent) { return { intent: "inventory_purchase_provenance_for_item", confidence: "low", @@ -1037,7 +1079,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo detectedIntent.intent === "list_documents_by_counterparty" || detectedIntent.intent === "list_documents_by_contract" || detectedIntent.intent === "inventory_on_hand_as_of_date" || - detectedIntent.intent === previousIntent) { + detectedIntent.intent === sourceIntent) { return { intent: "inventory_purchase_documents_for_item", confidence: "low", @@ -1054,7 +1096,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo detectedIntent.intent === "bank_operations_by_contract" || detectedIntent.intent === "inventory_on_hand_as_of_date" || detectedIntent.intent === "inventory_sale_trace_for_item" || - detectedIntent.intent === previousIntent) { + detectedIntent.intent === sourceIntent) { return { intent: "inventory_profitability_for_item", confidence: "low", @@ -1065,7 +1107,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo if (inventorySelectedObjectFollowup && hasInventoryPurchaseDateFollowupCue(normalizedMessage)) { if (detectedIntent.intent === "unknown" || detectedIntent.intent === "inventory_purchase_provenance_for_item" || - detectedIntent.intent === previousIntent || + detectedIntent.intent === sourceIntent || detectedIntent.intent === "inventory_on_hand_as_of_date") { return { intent: "inventory_purchase_provenance_for_item", @@ -1078,7 +1120,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo if (detectedIntent.intent === "unknown" || detectedIntent.intent === "inventory_purchase_provenance_for_item" || detectedIntent.intent === "inventory_on_hand_as_of_date" || - detectedIntent.intent === previousIntent) { + detectedIntent.intent === sourceIntent) { return { intent: "inventory_sale_trace_for_item", confidence: "low", @@ -1090,7 +1132,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo if (detectedIntent.intent === "unknown" || detectedIntent.intent === "inventory_sale_trace_for_item" || detectedIntent.intent === "inventory_on_hand_as_of_date" || - detectedIntent.intent === previousIntent) { + detectedIntent.intent === sourceIntent) { return { intent: "inventory_purchase_to_sale_chain", confidence: "low", @@ -1101,7 +1143,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo if (previousIsInventoryFamily && hasFollowupSignal && hasBareInventoryPurchaseDateFollowupCue(normalizedMessage) && - (detectedIntent.intent === "unknown" || detectedIntent.intent === previousIntent)) { + (detectedIntent.intent === "unknown" || detectedIntent.intent === sourceIntent)) { return { intent: "inventory_purchase_provenance_for_item", confidence: "low", @@ -1158,7 +1200,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo return detectedIntent; } return { - intent: previousIntent, + intent: fallbackIntent ?? "unknown", confidence: "low", reasons: [...detectedIntent.reasons, "intent_from_followup_context"] }; diff --git a/llm_normalizer/backend/dist/services/address_runtime/resolveStage.js b/llm_normalizer/backend/dist/services/address_runtime/resolveStage.js index eecc71c..9c7146b 100644 --- a/llm_normalizer/backend/dist/services/address_runtime/resolveStage.js +++ b/llm_normalizer/backend/dist/services/address_runtime/resolveStage.js @@ -72,6 +72,12 @@ function tokenizeAnchor(value) { .map((token) => token.trim()) .filter((token) => token.length >= 2 && !PARTY_ANCHOR_STOPWORDS.has(token)); } +function tokenizeSearchableText(value) { + return normalizeSearchText(value) + .split(" ") + .map((token) => token.trim()) + .filter(Boolean); +} function anchorTokenVariants(token) { const source = String(token ?? "").trim().toLowerCase(); if (!source) { @@ -90,9 +96,37 @@ function anchorTokenVariants(token) { } return Array.from(variants); } +function normalizePartyTokenSkeleton(value) { + return normalizeSearchText(value).replace(/\s+/g, "").replace(/[аеёиоуыэюяaeiouy]+/giu, ""); +} +function fuzzyPartyTokenMatches(candidate, token) { + const normalizedCandidate = normalizeSearchText(candidate); + const normalizedToken = normalizeSearchText(token); + if (!normalizedCandidate || !normalizedToken) { + return false; + } + if (normalizedCandidate === normalizedToken) { + return true; + } + if (normalizedCandidate.length < 4 || + normalizedToken.length < 4 || + /\d/u.test(normalizedCandidate) || + /\d/u.test(normalizedToken)) { + return false; + } + const candidateSkeleton = normalizePartyTokenSkeleton(normalizedCandidate); + const tokenSkeleton = normalizePartyTokenSkeleton(normalizedToken); + if (candidateSkeleton.length < 3 || tokenSkeleton.length < 3) { + return false; + } + return (candidateSkeleton === tokenSkeleton || + candidateSkeleton.startsWith(tokenSkeleton) || + tokenSkeleton.startsWith(candidateSkeleton)); +} function matchesAnchorText(searchable, anchor) { const searchableNormalized = normalizeSearchText(searchable); const searchableLatin = transliterateCyrillicToLatin(searchableNormalized); + const searchableTokens = tokenizeSearchableText(searchable); const tokens = tokenizeAnchor(anchor); if (tokens.length === 0) { const direct = normalizeSearchText(anchor); @@ -105,7 +139,9 @@ function matchesAnchorText(searchable, anchor) { const variants = anchorTokenVariants(token); return variants.some((variant) => { const tokenLatin = transliterateCyrillicToLatin(variant); - return searchableNormalized.includes(variant) || searchableLatin.includes(tokenLatin); + return (searchableNormalized.includes(variant) || + searchableLatin.includes(tokenLatin) || + searchableTokens.some((candidate) => fuzzyPartyTokenMatches(candidate, variant))); }); }); if (fullMatch) { diff --git a/llm_normalizer/backend/dist/services/assistantService.js b/llm_normalizer/backend/dist/services/assistantService.js index 329aecf..cc6de63 100644 --- a/llm_normalizer/backend/dist/services/assistantService.js +++ b/llm_normalizer/backend/dist/services/assistantService.js @@ -2482,6 +2482,12 @@ function findRecentAddressFilterValue(items, key) { if (!isAddressLaneDebugPayload(debug)) { continue; } + const replyType = toNonEmptyString(item.reply_type); + const limitedReasonCategory = toNonEmptyString(debug.limited_reason_category); + if ((replyType && replyType !== "factual" && replyType !== "factual_with_explanation") || + limitedReasonCategory) { + continue; + } const directFilterValue = readAddressFilterString(debug, key); if (directFilterValue) { return directFilterValue; @@ -2777,8 +2783,10 @@ function hasShortDebtMirrorFollowupSignal(userMessage) { return false; } return samples.some((sample) => /^(?:а|a|и|i)\s+(?:нам\s+)?кто(?=$|[\s,.;:!?])/iu.test(sample) || + /^(?:а|a|и|i)\s+нам(?=$|[\s,.;:!?])/iu.test(sample) || /^(?:а|a|и|i)\s+(?:мы\s+)?кому(?=$|[\s,.;:!?])/iu.test(sample) || /^(?:р°|a|рё|i)\s+(?:рЅр°рј\s+)?рєс‚рѕ(?=$|[\s,.;:!?])/iu.test(sample) || + /^(?:р°|a|рё|i)\s+рЅр°рј(?=$|[\s,.;:!?])/iu.test(sample) || /^(?:р°|a|рё|i)\s+(?:рјс‹\s+)?рєрѕрјсѓ(?=$|[\s,.;:!?])/iu.test(sample)); } function isInventorySelectedObjectIntent(intent) { @@ -2896,6 +2904,7 @@ function resolveDebtRoleSwapFollowupIntent(userMessage, previousIntent) { } const hasReceivablesCue = /(?:нам\s+кто\s+долж|кто\s+нам\s+долж|кто\s+долж[а-яё]*\s+нам|дебитор|к\s+получению|к\s+взысканию|receivable)/iu.test(normalized) || /^(?:а|a|и|i)\s+(?:нам\s+)?кто(?=$|[\s,.;:!?])/iu.test(normalized) || + /^(?:а|a|и|i)\s+нам(?=$|[\s,.;:!?])/iu.test(normalized) || /^(?:р°|a|рё|i)\s+(?:рЅр°рј\s+)?рєс‚рѕ(?=$|[\s,.;:!?])/iu.test(normalized); const hasPayablesCue = /(?:мы\s+кому\s+долж|кому\s+мы\s+долж|кому\s+долж[а-яё]*\s+мы|кредитор|к\s+уплате|payable)/iu.test(normalized) || /^(?:а|a|и|i)\s+(?:мы\s+)?кому(?=$|[\s,.;:!?])/iu.test(normalized) || @@ -2910,6 +2919,49 @@ function resolveDebtRoleSwapFollowupIntent(userMessage, previousIntent) { } return null; } +function hasExplicitOrganizationScopeCue(text) { + return /(?:(?:^|[\s"'«»„“()\\\/])(?:ооо|ао|пао|зао|оао|ип|гку|муп|гуп|llc|ltd|inc|corp)(?=$|[\s"'«»„“()\\\/.,;:]))|организац|компан|контор|фирм/u.test(String(text ?? "").toLowerCase()); +} +function looksLikeBareCounterpartyScopeTarget(text) { + const normalized = compactWhitespace(String(text ?? "").toLowerCase()); + if (!normalized) { + return false; + } + if (hasExplicitOrganizationScopeCue(normalized)) { + return false; + } + if (/[0-9]/u.test(normalized)) { + return false; + } + const tokens = normalized.split(/\s+/u).filter(Boolean); + if (tokens.length === 0 || tokens.length > 4) { + return false; + } + return tokens.every((token) => /^[a-zа-яё._-]{2,}$/iu.test(token)); +} +function shouldDowngradeOrganizationSemanticHint(scopeTargetText, fragmentText) { + const target = toNonEmptyString(scopeTargetText); + if (!target) { + return false; + } + if (hasExplicitOrganizationScopeCue(target) || hasExplicitOrganizationScopeCue(fragmentText)) { + return false; + } + return looksLikeBareCounterpartyScopeTarget(target); +} +function shouldKeepPreviousIntentForShortCounterpartyRetarget(userMessage, sourceIntent) { + const normalized = compactWhitespace(repairAddressMojibake(String(userMessage ?? "")).toLowerCase()); + if (!normalized || countTokens(normalized) > 4) { + return false; + } + if (sourceIntent !== "list_documents_by_counterparty" && sourceIntent !== "list_documents_by_contract") { + return false; + } + if (/(?:банк|выписк|плат[её]ж|оплат|списан|поступлен|bank|payment|wire|statement)/iu.test(normalized)) { + return false; + } + return /^(?:а|и|ну)?\s*по\s+[a-zа-яё0-9._-]{2,}(?:\s+[a-zа-яё0-9._-]{2,})?$/iu.test(normalized); +} function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMessage = null, llmPreDecomposeMeta = null, addressNavigationState = null) { const previousAddressItem = findLastAddressAssistantItem(items); const previousAddressDebug = previousAddressItem?.debug ?? null; @@ -3030,7 +3082,8 @@ function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMes const suggestedIntent = Array.isArray(followupOffer?.suggested_intents) ? toNonEmptyString(followupOffer.suggested_intents[0]) : null; - if (suggestedIntent) { + const keepPreviousIntent = shouldKeepPreviousIntentForShortCounterpartyRetarget(userMessage, sourceIntent); + if (suggestedIntent && !keepPreviousIntent) { previousIntent = suggestedIntent; followupSelectionMode = "switch_to_suggested_intent"; } @@ -3128,13 +3181,19 @@ function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMes let previousFilters = previousFiltersRaw && typeof previousFiltersRaw === "object" ? { ...previousFiltersRaw } : {}; - if (!toNonEmptyString(previousFilters.contract)) { + const shouldBackfillHistoricalPartyAnchors = sourceIntentHint === "list_contracts_by_counterparty" || + sourceIntentHint === "list_documents_by_counterparty" || + sourceIntentHint === "bank_operations_by_counterparty" || + sourceIntentHint === "list_documents_by_contract" || + sourceIntentHint === "bank_operations_by_contract" || + sourceIntentHint === "open_items_by_counterparty_or_contract"; + if (shouldBackfillHistoricalPartyAnchors && !toNonEmptyString(previousFilters.contract)) { const historicalContract = findRecentAddressFilterValue(items, "contract"); if (historicalContract) { previousFilters.contract = historicalContract; } } - if (!toNonEmptyString(previousFilters.counterparty)) { + if (shouldBackfillHistoricalPartyAnchors && !toNonEmptyString(previousFilters.counterparty)) { const historicalCounterparty = findRecentAddressFilterValue(items, "counterparty"); if (historicalCounterparty) { previousFilters.counterparty = historicalCounterparty; @@ -3180,7 +3239,10 @@ function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMes const rootContextOnlyPivot = Boolean((isInventorySelectedObjectIntent(sourceIntentHint) || currentFrameKind === "inventory_drilldown") && hasForeignAccountingPivotOverInventoryMessage(userMessage, alternateMessage)); const inventoryRootTemporalPivot = Boolean(inventoryRootFrame && - (isInventorySelectedObjectIntent(sourceIntentHint) || currentFrameKind === "inventory_drilldown") && + (isInventorySelectedObjectIntent(sourceIntentHint) || + isInventoryRootFrameIntent(sourceIntentHint) || + currentFrameKind === "inventory_drilldown" || + currentFrameKind === "inventory_root") && (hasInventoryRootTemporalFollowupPrimary || hasInventoryRootTemporalFollowupAlternate) && !hasForeignAccountingPivotOverInventoryMessage(userMessage, alternateMessage)); const rootScopedPivot = rootContextOnlyPivot || inventoryRootTemporalPivot; @@ -3254,19 +3316,34 @@ function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMes if (!previousIntent && !previousAnchor && Object.keys(previousFilters).length === 0) { return null; } + const shouldAttachInventoryRootFrame = Boolean(inventoryRootFrame && + (rootScopedPivot || + isInventoryRootFrameIntent(sourceIntentHint) || + isInventorySelectedObjectIntent(sourceIntentHint) || + hasNavigationInventoryItemFocusHint || + inventoryShortFollowupPrimary || + inventoryShortFollowupAlternate || + hasInventoryRootTemporalFollowupPrimary || + hasInventoryRootTemporalFollowupAlternate || + hasSelectedObjectInventorySignalPrimary || + hasSelectedObjectInventorySignalAlternate)); + const carryoverTargetIntent = followupSelectionMode === "carry_root_context" + ? inventoryRootFrame?.intent ?? explicitIntent ?? previousIntent ?? undefined + : explicitIntent ?? previousIntent ?? undefined; return { followupContext: { previous_intent: previousIntent ?? undefined, + target_intent: carryoverTargetIntent, previous_filters: previousFilters, previous_anchor_type: previousAnchorType ?? undefined, previous_anchor_value: previousAnchor, resolved_counterparty_from_display: resolvedCounterpartyFromDisplay || undefined, root_context_only: rootScopedPivot || undefined, - root_intent: inventoryRootFrame?.intent ?? undefined, - root_filters: inventoryRootFrame?.filters ?? undefined, - root_anchor_type: inventoryRootFrame?.anchorType ?? undefined, - root_anchor_value: inventoryRootFrame?.anchorValue ?? undefined, - current_frame_kind: currentFrameKind ?? undefined + root_intent: shouldAttachInventoryRootFrame ? inventoryRootFrame?.intent ?? undefined : undefined, + root_filters: shouldAttachInventoryRootFrame ? inventoryRootFrame?.filters ?? undefined : undefined, + root_anchor_type: shouldAttachInventoryRootFrame ? inventoryRootFrame?.anchorType ?? undefined : undefined, + root_anchor_value: shouldAttachInventoryRootFrame ? inventoryRootFrame?.anchorValue ?? undefined : undefined, + current_frame_kind: shouldAttachInventoryRootFrame ? currentFrameKind ?? undefined : undefined }, previousAddressIntent: previousIntent, previousAddressAnchor: previousAnchor, @@ -3340,7 +3417,7 @@ function isRetryableAddressLimitedResult(addressLane) { return false; } const category = String(addressLane?.debug?.limited_reason_category ?? "").trim().toLowerCase(); - return category === "missing_anchor" || category === "empty_match"; + return category === "missing_anchor" || category === "empty_match" || category === "unsupported"; } function isAddressLlmPreDecomposeCandidate(userMessage) { const repaired = repairAddressMojibake(String(userMessage ?? "")); @@ -3359,13 +3436,19 @@ function normalizeAddressSemanticHintsFromFragment(fragment) { return null; } const scopeTargetKind = toNonEmptyString(hints.scope_target_kind); + const scopeTargetText = toNonEmptyString(hints.scope_target_text); + const fragmentText = toNonEmptyString(fragment.raw_fragment_text) ?? toNonEmptyString(fragment.normalized_fragment_text) ?? ""; + const normalizedScopeTargetKind = scopeTargetKind === "organization" && + shouldDowngradeOrganizationSemanticHint(scopeTargetText, fragmentText) + ? "counterparty" + : scopeTargetKind; const dateScopeKind = toNonEmptyString(hints.date_scope_kind); return { - scope_target_kind: scopeTargetKind ?? "none", - scope_target_text: toNonEmptyString(hints.scope_target_text), + scope_target_kind: normalizedScopeTargetKind ?? "none", + scope_target_text: scopeTargetText, date_scope_kind: dateScopeKind ?? "missing", - self_scope_detected: hints.self_scope_detected === true || scopeTargetKind === "self_scope", - selected_object_scope_detected: hints.selected_object_scope_detected === true || scopeTargetKind === "selected_object" + self_scope_detected: hints.self_scope_detected === true || normalizedScopeTargetKind === "self_scope", + selected_object_scope_detected: hints.selected_object_scope_detected === true || normalizedScopeTargetKind === "selected_object" }; } function extractAddressPredecomposeCandidateFromFragments(fragments) { diff --git a/llm_normalizer/backend/src/services/addressFilterExtractor.ts b/llm_normalizer/backend/src/services/addressFilterExtractor.ts index 0b8465d..226b7ff 100644 --- a/llm_normalizer/backend/src/services/addressFilterExtractor.ts +++ b/llm_normalizer/backend/src/services/addressFilterExtractor.ts @@ -471,6 +471,13 @@ function extractYearRangePeriod(text: string): { period_from?: string; period_to } function cleanupAnchorValue(value: string): string { + const stripLeadingEntityRole = (text: string): string => + String(text ?? "") + .replace( + /^(?:(?:по\s+)?(?:контрагент(?:ом|у|а|ы|ов)?|поставщик(?:ом|у|а|и|ов)?|клиент(?:ом|у|а|ы|ов)?|покупател(?:ем|ю|я|и|ей)|продав(?:цом|цу|ца|цы|цов)|заказчик(?:ом|у|а|и|ов)?|исполнител(?:ем|ю|я|и|ей)|подрядчик(?:ом|у|а|и|ов)?))\s+/iu, + "" + ) + .trim(); const stripOuterQuotes = (text: string): string => String(text ?? "") .replace(/^['"«»“”„`’‘]+|['"«»“”„`’‘]+$/gu, "") @@ -480,6 +487,10 @@ function cleanupAnchorValue(value: string): string { if (!cleaned) { return ""; } + cleaned = stripOuterQuotes(stripLeadingEntityRole(cleaned.replace(/[?!]+$/u, "").trim())); + if (!cleaned) { + return ""; + } // Remove trailing as-of qualifiers often captured by broad contract/counterparty regexes: // " на 2020-07-31", " на дату 31.07.2020", " as of 2020-07-31". @@ -525,7 +536,7 @@ function cleanupAnchorValue(value: string): string { .replace(/\s+(?:с|по|за)(?:\s+|$)[\s\S]*$/iu, "") .trim(); - return stripOuterQuotes(cleaned); + return stripOuterQuotes(stripLeadingEntityRole(cleaned)); } function cleanupContractAnchorValue(value: string): string { @@ -638,6 +649,9 @@ function isLowQualityCounterpartyAnchorValue(rawValue: string): boolean { if (!value) { return true; } + if (/(?:за\s+вс[её]\s+время|за\s+всю\s+истори(?:ю|и)|all\s+time|entire\s+period|full\s+history)/iu.test(value)) { + return true; + } const tokens = value .split(/[^a-zа-я0-9]+/iu) .map((token) => token.trim()) @@ -681,6 +695,16 @@ function isLowQualityCounterpartyAnchorValue(rawValue: string): boolean { "дата", "конец", "период", + "весь", + "все", + "всё", + "всю", + "всех", + "всего", + "время", + "история", + "истории", + "срок", "месяц", "году", "год", @@ -906,6 +930,33 @@ function extractLeadingCounterpartyTokenHeuristic(text: string): string | undefi return undefined; } +function extractShipmentCounterpartyValue(text: string): string | undefined { + const hasShipmentCounterpartyTokenShape = (token: string): boolean => { + const source = String(token ?? "").trim(); + if (!source) { + return false; + } + if (hasStrongCounterpartyTokenShape(source)) { + return true; + } + return /^[\p{L}]{5,}$/u.test(source); + }; + const match = String(text ?? "").match( + /(?:что\s+нам\s+)?(?:отгруж(?:ал|али|ено)|постав(?:лял|ляли|ил|или)|привоз(?:ил|или)|продал)\s+([\p{L}][\p{L}\p{N}._-]{1,})(?=[\s,.;:!?)]|$)/iu + ); + if (!match) { + return undefined; + } + const candidate = String(match[1] ?? "").trim(); + if (!candidate || !hasShipmentCounterpartyTokenShape(candidate)) { + return undefined; + } + if (!isLikelyCounterpartyToken(candidate)) { + return undefined; + } + return candidate; +} + function hasExplicitAccountCue(text: string): boolean { return /(?:сч[её]т|счет|account|acct)/iu.test(String(text ?? "")); } @@ -1666,6 +1717,19 @@ export function extractAddressFilters(userMessage: string, intent: AddressIntent warnings.push("counterparty_anchor_derived_from_implicit_phrase"); } } + if ( + !filters.counterparty && + allowGenericCounterpartyAnchor && + (intent === "list_documents_by_counterparty" || + intent === "bank_operations_by_counterparty" || + intent === "list_contracts_by_counterparty") + ) { + const shipmentCounterparty = extractShipmentCounterpartyValue(text); + if (shipmentCounterparty) { + filters.counterparty = cleanupAnchorValue(shipmentCounterparty); + warnings.push("counterparty_anchor_derived_from_shipment_phrase"); + } + } if ( !filters.counterparty && allowGenericCounterpartyAnchor && diff --git a/llm_normalizer/backend/src/services/addressIntentResolver.ts b/llm_normalizer/backend/src/services/addressIntentResolver.ts index cd6a5be..6862a01 100644 --- a/llm_normalizer/backend/src/services/addressIntentResolver.ts +++ b/llm_normalizer/backend/src/services/addressIntentResolver.ts @@ -618,7 +618,7 @@ function hasVatLiabilityConfirmedTaxPeriodSignal(text: string): boolean { return false; } const hasPaymentCue = - /(?:к\s+уплате|надо|нужно|заплатить|уплатить|плат[её]ж|платежку|в\s+налогов|в\s+бюджет|должн[аы]?\s+заплатить|мы\s+должн[аы]?|должн[аы]?\s+мы)/iu.test( + /(?:к\s+уплате|надо|нужно|заплатить|уплатить|плат[её]ж|платежку|в\s+налогов|в\s+бюджет|должн[аы]?\s+заплатить|мы\s+должн[аы]?|должн[аы]?\s+мы|сгруз(?:ить|им|ишь|ите|ил|ила|или|ка))/iu.test( text ); if (!hasPaymentCue) { @@ -656,14 +656,14 @@ function hasVatPayableConfirmedSignal(text: string): boolean { return false; } const hasPaymentCue = - /(?:к\s+уплате|надо|нужно|заплатить|уплатить|плат[её]ж|платежку|в\s+налогов|в\s+бюджет|должн[аы]?\s+заплатить|мы\s+должн[аы]?|должн[аы]?\s+мы)/iu.test( + /(?:к\s+уплате|надо|нужно|заплатить|уплатить|плат[её]ж|платежку|в\s+налогов|в\s+бюджет|должн[аы]?\s+заплатить|мы\s+должн[аы]?|должн[аы]?\s+мы|сгруз(?:ить|им|ишь|ите|ил|ила|или|ка))/iu.test( text ); if (!hasPaymentCue) { return false; } const hasDateOrPeriodCue = - /(?:на\s+дат|по\s+состоянию|на\s+конец|за\s+(?:\d{4}|январ|феврал|март|апрел|май|июн|июл|август|сентябр|октябр|ноябр|декабр)|квартал|месяц|год|период|\b\d{4}[./-]\d{2}[./-]\d{2}\b)/iu.test( + /(?:на\s+дат|по\s+состоянию|на\s+конец|за\s+(?:\d{4}|январ|феврал|март|апрел|май|июн|июл|август|сентябр|октябр|ноябр|декабр)|на\s+(?:январ|феврал|март|апрел|май|июн|июл|август|сентябр|октябр|ноябр|декабр)\S*(?:\s+(?:19|20)\d{2})?|квартал|месяц|год|период|\b\d{4}[./-]\d{2}[./-]\d{2}\b)/iu.test( text ); return hasDateOrPeriodCue || /(?:сколько|скока|скок)/iu.test(text); @@ -784,6 +784,9 @@ function hasCounterpartyDebtLongevitySignal(text: string): boolean { } function hasCounterpartyActivityLifecycleSignal(text: string): boolean { + if (hasCustomerRevenueAndPaymentsSignal(text) || hasSupplierPayoutsProfileSignal(text)) { + return false; + } const hasPaymentRiskLexeme = /(?:не\s+плат(?:ит|ят|ил|или)|без\s+оплат|оплат(?:ы|а)?\s+нет|нет\s+оплат|задерж(?:ива|к)|просроч|задолж|\bдолг(?:и|ов|а|у)?\b)/iu.test( text @@ -837,6 +840,30 @@ function hasCounterpartyActivityLifecycleSignal(text: string): boolean { return hasCounterpartyLexeme && hasActivityLexeme && (hasTimeWindowLexeme || hasListVerb); } +function hasCounterpartyShipmentItemFlowSignal(text: string): boolean { + const hasNamedTailAfterShipmentCue = + /(?:отгруж(?:ал|али|ено)|постав(?:лял|ляли|ил|или)|привоз(?:ил|или)|продал)\s+[a-zа-яё][a-zа-яё0-9._-]{2,}/iu.test( + text + ); + const hasPartySignal = + hasPartyAnchorMention(text) || + hasLooseByAnchorMention(text) || + hasImplicitCounterpartyAnchorAroundDocs(text) || + hasHeuristicCounterpartyAnchor(text); + if (!hasPartySignal && !hasNamedTailAfterShipmentCue) { + return false; + } + const hasInboundShipmentCue = + /(?:что\s+нам\s+(?:отгруж(?:ал|али|ено)|постав(?:лял|ляли|ил|или)|привоз(?:ил|или)|продал)|кто\s+нам\s+постав(?:лял|ил)|что\s+постав(?:лял|или)\s+нам|что\s+нам\s+поставили)/iu.test( + text + ); + const hasItemOrServiceCue = + /(?:како(?:й|е|го|му)\s+товар|каки(?:е|х)\s+товар|какую\s+услуг|какие\s+услуг|товар\s+или\s+услуг|позици(?:ю|и|ях)?)/iu.test( + text + ); + return hasInboundShipmentCue || hasItemOrServiceCue; +} + function hasContractUsageOverviewSignal(text: string): boolean { if (hasAny(text, CONTRACT_USAGE_OVERVIEW_HINTS)) { return true; @@ -2021,8 +2048,12 @@ export function resolveAddressIntent(userMessage: string): AddressIntentResoluti !hasInventoryProvenanceSignalV2(text) && !hasInventoryPurchaseDocumentsSignalV2(text) && !hasInventorySaleTraceSignalV2(text) && - /(?:контраг|договор|контракт|counterparty|contract|покупател|клиент|заказчик|customer|client|buyer|supplier|поставщик)/iu.test( - text + ( + /(?:контраг|договор|контракт|counterparty|contract|покупател|клиент|заказчик|customer|client|buyer|supplier|поставщик)/iu.test( + text + ) || + hasAccountNumberAnchor(text) || + hasCompactAccountCodeToken(text) ) ) { return { @@ -2164,16 +2195,21 @@ export function resolveAddressIntent(userMessage: string): AddressIntentResoluti } if ( - hasAny(text, DOCUMENTS_BY_COUNTERPARTY_HINTS) && + (hasAny(text, DOCUMENTS_BY_COUNTERPARTY_HINTS) || hasCounterpartyShipmentItemFlowSignal(text)) && (hasPartyAnchorMention(text) || hasLooseByAnchorMention(text) || hasImplicitCounterpartyAnchorAroundDocs(text) || - hasHeuristicCounterpartyAnchor(text)) + hasHeuristicCounterpartyAnchor(text) || + hasCounterpartyShipmentItemFlowSignal(text)) ) { return { intent: "list_documents_by_counterparty", confidence: "medium", - reasons: ["documents_by_counterparty_signal_detected"] + reasons: [ + hasCounterpartyShipmentItemFlowSignal(text) + ? "counterparty_item_flow_signal_detected" + : "documents_by_counterparty_signal_detected" + ] }; } diff --git a/llm_normalizer/backend/src/services/addressNavigationState.ts b/llm_normalizer/backend/src/services/addressNavigationState.ts index 798063d..f3611bc 100644 --- a/llm_normalizer/backend/src/services/addressNavigationState.ts +++ b/llm_normalizer/backend/src/services/addressNavigationState.ts @@ -499,20 +499,34 @@ export function evolveAddressNavigationStateWithAssistantItem( ) ); const nextEvents = capNavigationEvents([...state.navigation_history, navigationEvent]); + const nextSessionContext = + action === "open" + ? { + active_result_set_id: resultSetId, + active_focus_object: focusObject ?? null, + last_confirmed_route: routeId ?? null, + date_scope: { + as_of_date: normalizedDateScope.as_of_date, + period_from: normalizedDateScope.period_from, + period_to: normalizedDateScope.period_to + }, + organization_scope: organizationScope ?? state.session_context.organization_scope + } + : { + active_result_set_id: resultSetId, + active_focus_object: focusObject ?? state.session_context.active_focus_object, + last_confirmed_route: routeId ?? state.session_context.last_confirmed_route, + date_scope: { + as_of_date: normalizedDateScope.as_of_date ?? state.session_context.date_scope.as_of_date, + period_from: normalizedDateScope.period_from ?? state.session_context.date_scope.period_from, + period_to: normalizedDateScope.period_to ?? state.session_context.date_scope.period_to + }, + organization_scope: organizationScope ?? state.session_context.organization_scope + }; return { ...state, updated_at: createdAt, - session_context: { - active_result_set_id: resultSetId, - active_focus_object: focusObject ?? state.session_context.active_focus_object, - last_confirmed_route: routeId ?? state.session_context.last_confirmed_route, - date_scope: { - as_of_date: normalizedDateScope.as_of_date ?? state.session_context.date_scope.as_of_date, - period_from: normalizedDateScope.period_from ?? state.session_context.date_scope.period_from, - period_to: normalizedDateScope.period_to ?? state.session_context.date_scope.period_to - }, - organization_scope: organizationScope ?? state.session_context.organization_scope - }, + session_context: nextSessionContext, result_sets: nextResultSets, navigation_history: nextEvents }; diff --git a/llm_normalizer/backend/src/services/addressQueryService.ts b/llm_normalizer/backend/src/services/addressQueryService.ts index 4de361e..ff2a770 100644 --- a/llm_normalizer/backend/src/services/addressQueryService.ts +++ b/llm_normalizer/backend/src/services/addressQueryService.ts @@ -1,9 +1,13 @@ import { + DEFAULT_MAX_OUTPUT_TOKENS, + DEFAULT_MODEL, + DEFAULT_OPENAI_BASE_URL, FEATURE_ASSISTANT_CAPABILITY_ROUTE_GUARD_V1, FEATURE_ASSISTANT_ROUTE_EXPECTATION_AUDIT_V1, FEATURE_ASSISTANT_ROUTE_EXPECTATION_HARD_GUARD_V1, FEATURE_ASSISTANT_ADDRESS_QUERY_V1, - FEATURE_ASSISTANT_ADDRESS_QUERY_LIVE_V1 + FEATURE_ASSISTANT_ADDRESS_QUERY_LIVE_V1, + SHARED_LLM_CONNECTION_FILE } from "../config"; import type { AddressCapabilityLayer, @@ -28,6 +32,8 @@ import type { } from "../types/addressQuery"; import { buildAddressRecipePlan, + buildCounterpartyPurchaseDocumentQuery, + buildOpenItemsMovementQuery, selectAddressRecipe, type AddressRecipeExecutionPlan } from "./addressRecipeCatalog"; @@ -57,6 +63,8 @@ import { normalizeOrganizationScopeValue, resolveOrganizationSelectionFromMessage } from "./assistantOrganizationMatcher"; +import { OpenAIResponsesClient, type OpenAIRequestConfig } from "./openaiResponsesClient"; +import { readJsonFile } from "../utils/files"; interface NormalizedAddressRow { period: string | null; @@ -219,7 +227,20 @@ interface CounterpartyCatalogResolution { ambiguityCount: number; } +interface SharedLlmConnectionRecord { + schema_version: "shared_llm_connection_v1"; + updated_at: string; + connection: { + llmProvider: "openai" | "local"; + model: string; + baseUrl: string; + temperature: number; + maxOutputTokens: number; + }; +} + let counterpartyCatalogCache: { names: string[]; loadedAt: number } | null = null; +const limitedReplyLlmClient = new OpenAIResponsesClient(); function parseFiniteNumber(value: unknown): number | null { if (typeof value === "number" && Number.isFinite(value)) { @@ -836,9 +857,43 @@ function anchorTokenVariants(token: string): string[] { return Array.from(variants); } +function normalizePartyTokenSkeleton(value: string): string { + return normalizeSearchText(value).replace(/\s+/g, "").replace(/[аеёиоуыэюяaeiouy]+/giu, ""); +} + +function fuzzyPartyTokenMatches(candidate: string, token: string): boolean { + const normalizedCandidate = normalizeSearchText(candidate); + const normalizedToken = normalizeSearchText(token); + if (!normalizedCandidate || !normalizedToken) { + return false; + } + if (normalizedCandidate === normalizedToken) { + return true; + } + if ( + normalizedCandidate.length < 4 || + normalizedToken.length < 4 || + /\d/u.test(normalizedCandidate) || + /\d/u.test(normalizedToken) + ) { + return false; + } + const candidateSkeleton = normalizePartyTokenSkeleton(normalizedCandidate); + const tokenSkeleton = normalizePartyTokenSkeleton(normalizedToken); + if (candidateSkeleton.length < 3 || tokenSkeleton.length < 3) { + return false; + } + return ( + candidateSkeleton === tokenSkeleton || + candidateSkeleton.startsWith(tokenSkeleton) || + tokenSkeleton.startsWith(candidateSkeleton) + ); +} + function matchesAnchorText(searchable: string, anchor: string): boolean { const searchableNormalized = normalizeSearchText(searchable); const searchableLatin = transliterateCyrillicToLatin(searchableNormalized); + const searchableTokens = tokenizeSearchableText(searchable); const tokens = tokenizeAnchor(anchor); if (tokens.length === 0) { const direct = normalizeSearchText(anchor); @@ -851,7 +906,11 @@ function matchesAnchorText(searchable: string, anchor: string): boolean { const variants = anchorTokenVariants(token); return variants.some((variant) => { const tokenLatin = transliterateCyrillicToLatin(variant); - return searchableNormalized.includes(variant) || searchableLatin.includes(tokenLatin); + return ( + searchableNormalized.includes(variant) || + searchableLatin.includes(tokenLatin) || + searchableTokens.some((candidate) => fuzzyPartyTokenMatches(candidate, variant)) + ); }); }); } @@ -989,6 +1048,16 @@ function normalizeCounterpartyName(value: string): string { .trim(); } +function hasCounterpartyShipmentItemFlowSignal(userMessage: string): boolean { + const text = normalizeSearchText(String(userMessage ?? "")); + if (!text) { + return false; + } + return /(?:что\s+нам\s+(?:отгруж|постав|привоз|прод)|кто\s+нам\s+постав|како(?:й|е|го|му)\s+товар|какую\s+услуг|какие\s+товар|какие\s+услуг|товар\s+или\s+услуг|позици(?:ю|и|ях)?)/iu.test( + text + ); +} + function extractCounterpartyCatalogNames(rows: Array>): string[] { return uniqueStrings( rows @@ -1009,6 +1078,7 @@ function scoreCounterpartyCandidate(name: string, anchor: string): number | null } const normalizedName = normalizeCounterpartyName(name); const normalizedAnchor = normalizeCounterpartyName(anchor); + const nameTokens = tokenizeSearchableText(name); if (!normalizedName || !normalizedAnchor) { return null; } @@ -1018,6 +1088,8 @@ function scoreCounterpartyCandidate(name: string, anchor: string): number | null score += 10_000; } else if (normalizedName.includes(normalizedAnchor)) { score += 5_000; + } else if (fuzzyPartyTokenMatches(normalizedName, normalizedAnchor)) { + score += 3_500; } else if (normalizedAnchor.includes(normalizedName) && normalizedName.length >= 4) { score += 2_000; } @@ -1029,6 +1101,8 @@ function scoreCounterpartyCandidate(name: string, anchor: string): number | null for (const variant of variants) { if (normalizedName.includes(variant)) { tokenScore = Math.max(tokenScore, Math.max(2, variant.length) * 20); + } else if (nameTokens.some((candidate) => fuzzyPartyTokenMatches(candidate, variant))) { + tokenScore = Math.max(tokenScore, Math.max(2, variant.length) * 12); } } if (tokenScore === 0) { @@ -1241,24 +1315,7 @@ function toNormalizedRows(rows: Array>): NormalizedAddre const accountKt = valueAsString(row.СчетКт ?? row.account_kt ?? row.AccountKt).trim() || null; const amount = parseFiniteNumber(row.Сумма ?? row.amount ?? row.Amount); const quantity = firstFiniteNumber(row.Количество, row.quantity, row.Quantity); - const item = firstNonEmptyString( - row.Номенклатура, - row.Item, - row.item, - row.НоменклатураПредставление, - row.SubcontoDt1, - row.SubcontoDt2, - row.SubcontoDt3, - row.SubcontoKt1, - row.SubcontoKt2, - row.SubcontoKt3, - row.СубконтоДт1, - row.СубконтоДт2, - row.СубконтоДт3, - row.СубконтоКт1, - row.СубконтоКт2, - row.СубконтоКт3 - ); + const item = resolveInventoryItemFromRawRow(row, accountDt, accountKt); const warehouse = firstNonEmptyString(row.Склад, row.Warehouse, row.warehouse, row.СкладПредставление); const organization = firstNonEmptyString( row.Организация, @@ -1285,6 +1342,191 @@ function toNormalizedRows(rows: Array>): NormalizedAddre .filter((item) => Boolean(item.period || item.registrator)); } +function hasInventoryAccountPrefix(account: string | null | undefined): boolean { + const normalized = String(account ?? "").trim(); + return /^41(?:\.01)?(?:$|[^\d])/u.test(normalized); +} + +function resolveInventoryItemFromRawRow( + row: Record, + accountDt: string | null, + accountKt: string | null +): string | null { + const debitCandidates = [ + row.SubcontoDt1, + row.SubcontoDt2, + row.SubcontoDt3, + row.СубконтоДт1, + row.СубконтоДт2, + row.СубконтоДт3 + ]; + const creditCandidates = [ + row.SubcontoKt1, + row.SubcontoKt2, + row.SubcontoKt3, + row.СубконтоКт1, + row.СубконтоКт2, + row.СубконтоКт3 + ]; + + if (hasInventoryAccountPrefix(accountDt) && !hasInventoryAccountPrefix(accountKt)) { + const debitSideItem = firstNonEmptyString(...debitCandidates, ...creditCandidates); + if (debitSideItem) { + return debitSideItem; + } + } + if (hasInventoryAccountPrefix(accountKt) && !hasInventoryAccountPrefix(accountDt)) { + const creditSideItem = firstNonEmptyString(...creditCandidates, ...debitCandidates); + if (creditSideItem) { + return creditSideItem; + } + } + + const explicitItem = firstNonEmptyString( + row.Номенклатура, + row.Nomenclature, + row.nomenclature, + row.Item, + row.item, + row.НоменклатураПредставление + ); + if (explicitItem) { + return explicitItem; + } + return firstNonEmptyString(...debitCandidates, ...creditCandidates); +} + +function formatMoneyRubForReply(value: number): string { + return `${new Intl.NumberFormat("ru-RU", { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + }).format(value)} ₽`; +} + +function extractContractNameFromNormalizedRow(row: NormalizedAddressRow): string | null { + for (const token of row.analytics) { + const normalized = String(token ?? "").trim(); + if (!normalized) { + continue; + } + if (/^(?:0|<пусто>|пустая ссылка)$/iu.test(normalized)) { + continue; + } + if (/(?:договор|contract|дог\.)/iu.test(normalized)) { + return normalized; + } + } + return null; +} + +function hasBankAccountPrefix(account: string | null | undefined): boolean { + const normalized = String(account ?? "").trim(); + return /^5[12](?:$|[^\d])/u.test(normalized); +} + +function hasPayablesAccountPrefix(account: string | null | undefined): boolean { + const normalized = String(account ?? "").trim(); + return /^60(?:$|[^\d])/u.test(normalized); +} + +function isOutgoingSupplierPaymentRow(row: NormalizedAddressRow): boolean { + const registrator = normalizeSearchText(row.registrator); + return ( + (hasPayablesAccountPrefix(row.account_dt) && hasBankAccountPrefix(row.account_kt)) || + registrator.includes("списание с расчетного счета") + ); +} + +function isIncomingSupplierReturnRow(row: NormalizedAddressRow): boolean { + const registrator = normalizeSearchText(row.registrator); + return ( + (hasBankAccountPrefix(row.account_dt) && hasPayablesAccountPrefix(row.account_kt)) || + registrator.includes("поступление на расчетный счет") + ); +} + +function formatCounterpartyBankActivityRows(rows: NormalizedAddressRow[], limit = 5): string[] { + return rows.slice(0, limit).map((row, index) => { + const parts = [`${index + 1}. ${row.registrator}`, `дата: ${row.period ?? "не указана"}`]; + if (typeof row.amount === "number" && Number.isFinite(row.amount)) { + parts.push(`сумма: ${formatMoneyRubForReply(row.amount)}`); + } + const contract = extractContractNameFromNormalizedRow(row); + if (contract) { + parts.push(`договор: ${contract}`); + } + return parts.join(" | "); + }); +} + +function buildCounterpartyItemFlowBankFallbackReply( + counterpartyLabel: string, + bankRows: NormalizedAddressRow[] +): string | null { + if (bankRows.length === 0) { + return null; + } + + const outgoingPayments = bankRows.filter((row) => isOutgoingSupplierPaymentRow(row)); + const incomingReturns = bankRows.filter((row) => isIncomingSupplierReturnRow(row)); + const classifiedKeys = new Set( + [...outgoingPayments, ...incomingReturns].map((row) => `${row.period ?? ""}|${row.registrator}|${row.amount ?? ""}`) + ); + const otherBankRows = bankRows.filter( + (row) => !classifiedKeys.has(`${row.period ?? ""}|${row.registrator}|${row.amount ?? ""}`) + ); + const outgoingTotal = outgoingPayments.reduce((sum, row) => sum + (row.amount ?? 0), 0); + const incomingTotal = incomingReturns.reduce((sum, row) => sum + (row.amount ?? 0), 0); + const otherTotal = otherBankRows.reduce((sum, row) => sum + (row.amount ?? 0), 0); + const contracts = uniqueStrings( + bankRows + .map((row) => extractContractNameFromNormalizedRow(row)) + .filter((item): item is string => Boolean(item)) + ); + const summaryParts: string[] = []; + if (outgoingPayments.length > 0) { + summaryParts.push( + `исходящих оплат поставщику: ${outgoingPayments.length} на ${formatMoneyRubForReply(outgoingTotal)}` + ); + } + if (incomingReturns.length > 0) { + summaryParts.push( + `возвратов от поставщика: ${incomingReturns.length} на ${formatMoneyRubForReply(incomingTotal)}` + ); + } + if (otherBankRows.length > 0) { + summaryParts.push(`прочих банковских документов: ${otherBankRows.length} на ${formatMoneyRubForReply(otherTotal)}`); + } + if (summaryParts.length === 0) { + return null; + } + + const lines = [`Контрагент: ${counterpartyLabel}. Подтвержденных поставок товаров или услуг не найдено.`]; + lines.push("Позиции: подтвержденных поставок товаров или услуг не найдено."); + lines.push(`По связанным расчетам с контрагентом найдено ${summaryParts.join("; ")}.`); + if (outgoingPayments.length > 0 && incomingReturns.length > 0 && Math.abs(outgoingTotal - incomingTotal) < 0.005) { + lines.push("Сумма возврата совпадает с суммой исходящих оплат."); + } + if (contracts.length === 1) { + lines.push(`Договор: ${contracts[0]}.`); + } else if (contracts.length > 1) { + lines.push(`Договоры: ${contracts.slice(0, 3).join("; ")}.`); + } + if (outgoingPayments.length > 0) { + lines.push("Оплаты поставщику:"); + lines.push(...formatCounterpartyBankActivityRows(outgoingPayments)); + } + if (incomingReturns.length > 0) { + lines.push("Возвраты от поставщика:"); + lines.push(...formatCounterpartyBankActivityRows(incomingReturns)); + } + if (otherBankRows.length > 0) { + lines.push("Прочие банковские документы:"); + lines.push(...formatCounterpartyBankActivityRows(otherBankRows)); + } + return lines.join("\n"); +} + function rowSearchableText(row: NormalizedAddressRow): string { return [ row.registrator, @@ -2630,6 +2872,104 @@ function hasAggregateLimitedSignal(input: { ); } +function shouldUseLlmLimitedReply(category: AddressLimitedReasonCategory): boolean { + return ( + category === "unsupported" || + category === "recipe_visibility_gap" || + category === "execution_error" || + category === "missing_anchor" || + category === "empty_match" + ); +} + +function loadSharedLlmRequestConfig(): OpenAIRequestConfig | null { + const record = readJsonFile(SHARED_LLM_CONNECTION_FILE, null); + const connection = record?.connection; + if (!connection || typeof connection !== "object") { + return null; + } + const llmProvider = connection.llmProvider === "local" ? "local" : "openai"; + const model = String(connection.model ?? "").trim() || DEFAULT_MODEL; + const baseUrl = String(connection.baseUrl ?? "").trim() || DEFAULT_OPENAI_BASE_URL; + const temperature = + typeof connection.temperature === "number" && Number.isFinite(connection.temperature) + ? connection.temperature + : 0.2; + const maxOutputTokens = + typeof connection.maxOutputTokens === "number" && Number.isFinite(connection.maxOutputTokens) + ? Math.max(64, Math.trunc(connection.maxOutputTokens)) + : DEFAULT_MAX_OUTPUT_TOKENS; + const apiKey = String(process.env.OPENAI_API_KEY ?? "").trim(); + if (llmProvider === "openai" && apiKey.length === 0) { + return null; + } + return { + llmProvider, + apiKey, + model, + baseUrl, + temperature, + maxOutputTokens + }; +} + +async function tryComposeLlmLimitedReply(input: { + userMessage: string; + category: AddressLimitedReasonCategory; + intent: AddressIntent; + reasonText: string; + nextStep?: string; + filters: AddressFilterSet; + anchor?: AnchorResolutionDebug; +}): Promise { + if (process.env.VITEST === "true" || process.env.NODE_ENV === "test") { + return null; + } + if (!shouldUseLlmLimitedReply(input.category)) { + return null; + } + const question = String(input.userMessage ?? "").trim(); + if (!question) { + return null; + } + const config = loadSharedLlmRequestConfig(); + if (!config) { + return null; + } + const contextPayload = { + question, + intent: input.intent, + category: input.category, + reason: normalizeLimitedReason(input.reasonText), + next_step: normalizeLimitedNextStep(input.nextStep ?? ""), + filters: input.filters, + anchor: input.anchor + ? { + type: input.anchor.anchor_type, + raw: input.anchor.anchor_value_raw, + resolved: input.anchor.anchor_value_resolved + } + : null + }; + try { + const response = await limitedReplyLlmClient.chat(config, { + systemPrompt: + "Ты формулируешь мягкий, но предметный отказ для бухгалтерского ассистента 1С. Нельзя выдумывать факты и нельзя утверждать, что данные найдены, если это не подтверждено.", + developerPrompt: + "Ответь по-русски, коротко и по делу. Дай 2-4 коротких абзаца. Первая фраза должна прямо сказать, что именно сейчас не удается надежно подтвердить по вопросу пользователя. Если есть контрагент, счет, договор, организация или период, упомяни их естественно. Коротко скажи, что уже проверено, и предложи 1-2 ближайших шага. Не используй техжаргон вроде address lane, partial_coverage, recipe, capability, unsupported.", + userMessage: `Контекст отказа:\n${JSON.stringify(contextPayload, null, 2)}`, + maxOutputTokens: Math.min(280, Math.max(160, config.maxOutputTokens ?? DEFAULT_MAX_OUTPUT_TOKENS)), + temperature: 0.2 + }); + const text = String(response.outputText ?? "") + .replace(/\r\n/g, "\n") + .trim(); + return text.length > 0 ? text : null; + } catch { + return null; + } +} + function composeLimitedReply(input: { category: AddressLimitedReasonCategory; reason: string; @@ -3132,6 +3472,7 @@ export class AddressQueryService { requestedResultMode, filters: executionFilters }); + let anchor = resolvePrimaryAnchor(intent.intent, filters.extracted_filters); if (isCapabilityRouteBlocked(capabilityDecision)) { return buildLimitedExecutionResult({ mode, @@ -3162,9 +3503,24 @@ export class AddressQueryService { vatDirectSourceProbe?: VatDirectSourceProbeSummary | null; emphasizeNumbers?: boolean; useRubCurrency?: boolean; + counterpartyHint?: string; + accountHint?: string; } = {} ) => ({ userMessage, + itemHint: typeof filterSet.item === "string" ? filterSet.item : undefined, + counterpartyHint: + typeof options.counterpartyHint === "string" + ? options.counterpartyHint + : typeof filterSet.counterparty === "string" + ? filterSet.counterparty + : undefined, + accountHint: + typeof options.accountHint === "string" + ? options.accountHint + : typeof filterSet.account === "string" + ? filterSet.account + : undefined, periodFrom: typeof filterSet.period_from === "string" ? filterSet.period_from : undefined, periodTo: typeof filterSet.period_to === "string" ? filterSet.period_to : undefined, asOfDate: typeof filterSet.as_of_date === "string" ? filterSet.as_of_date : undefined, @@ -3173,8 +3529,53 @@ export class AddressQueryService { emphasizeNumbers: options.emphasizeNumbers ?? undefined, useRubCurrency: options.useRubCurrency ?? undefined }); + const finalizeLimitedResult = async ( + input: Parameters[0] + ): Promise => { + const result = buildLimitedExecutionResult(input); + const llmReply = await tryComposeLlmLimitedReply({ + userMessage, + category: input.category, + intent: input.intent.intent, + reasonText: input.reasonText, + nextStep: input.nextStep, + filters: input.filters, + anchor: input.anchor + }); + if (!llmReply) { + return result; + } + return { + ...result, + reply_text: llmReply + }; + }; + const composeRuntimeOptions = ( + filterSet: AddressFilterSet, + options: { + vatDirectSourceProbe?: VatDirectSourceProbeSummary | null; + emphasizeNumbers?: boolean; + useRubCurrency?: boolean; + counterpartyHint?: string; + accountHint?: string; + } = {} + ) => + composeOptionsFromFilters(filterSet, { + ...options, + counterpartyHint: + typeof options.counterpartyHint === "string" + ? options.counterpartyHint + : anchor?.anchor_type === "counterparty" + ? anchor.anchor_value_resolved ?? anchor.anchor_value_raw ?? undefined + : undefined, + accountHint: + typeof options.accountHint === "string" + ? options.accountHint + : typeof filterSet.account === "string" + ? filterSet.account + : undefined + }); const futureGuardReferenceDate = resolveFutureGuardReferenceDate(analysisDate, executionFilters); - let anchor = resolvePrimaryAnchor(intent.intent, filters.extracted_filters); const debtLifecycleReceivablesScenario = intent.intent === "list_receivables_counterparties" && Array.isArray(intent.reasons) && @@ -3238,7 +3639,7 @@ export class AddressQueryService { } if (intent.intent === "unknown") { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -3261,7 +3662,7 @@ export class AddressQueryService { } if (recipeSelection.selected_recipe === null) { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -3284,7 +3685,7 @@ export class AddressQueryService { } if (recipeSelection.missing_required_filters.length > 0) { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -3307,7 +3708,7 @@ export class AddressQueryService { } if (!FEATURE_ASSISTANT_ADDRESS_QUERY_LIVE_V1) { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -3334,6 +3735,14 @@ export class AddressQueryService { if (shouldAttemptCounterpartyCatalogResolution(intent.intent, filters.extracted_filters)) { const catalogResolution = await resolveCounterpartyViaCatalog(rawCounterpartyAnchor); if (catalogResolution.resolvedValue) { + filters.extracted_filters = { + ...filters.extracted_filters, + counterparty: catalogResolution.resolvedValue + }; + executionFilters = { + ...executionFilters, + counterparty: catalogResolution.resolvedValue + }; if (normalizeCounterpartyName(rawCounterpartyAnchor) !== normalizeCounterpartyName(catalogResolution.resolvedValue)) { filters.warnings.push("counterparty_anchor_resolved_via_catalog_lookup"); } @@ -3375,6 +3784,45 @@ export class AddressQueryService { buildAddressRecipePlan(recipeSelection.selected_recipe, executionFilters), intent.intent ); + const counterpartyItemFlowQuery = + intent.intent === "list_documents_by_counterparty" && + hasCounterpartyShipmentItemFlowSignal(userMessage) && + typeof executionFilters.counterparty === "string" && + executionFilters.counterparty.trim().length > 0; + const counterpartyItemFlowFilters = + counterpartyItemFlowQuery && anchor.anchor_type === "counterparty" && anchor.anchor_value_resolved + ? { + ...executionFilters, + counterparty: anchor.anchor_value_resolved + } + : executionFilters; + if (counterpartyItemFlowQuery) { + plan = { + ...plan, + query: buildCounterpartyPurchaseDocumentQuery(counterpartyItemFlowFilters, plan.limit), + account_scope: [], + account_scope_mode: "preferred" + }; + if (!baseReasons.includes("counterparty_item_flow_query_override_to_purchase_documents")) { + baseReasons.push("counterparty_item_flow_query_override_to_purchase_documents"); + } + } + const accountOnlyOpenItemsQuery = + intent.intent === "open_items_by_counterparty_or_contract" && + typeof executionFilters.account === "string" && + executionFilters.account.trim().length > 0 && + !(typeof executionFilters.counterparty === "string" && executionFilters.counterparty.trim().length > 0) && + !(typeof executionFilters.contract === "string" && executionFilters.contract.trim().length > 0); + if (accountOnlyOpenItemsQuery) { + plan = { + ...plan, + query: buildOpenItemsMovementQuery(executionFilters, plan.limit), + account_scope_mode: "strict" + }; + if (!baseReasons.includes("open_items_account_query_override_to_movements")) { + baseReasons.push("open_items_account_query_override_to_movements"); + } + } let mcp = await executeAddressMcpQuery({ query: plan.query, limit: plan.limit @@ -3479,7 +3927,7 @@ export class AddressQueryService { if (mcp.error) { const errorScopeAudit = buildDefaultAccountScopeAudit(filters.extracted_filters); - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -3623,6 +4071,90 @@ export class AddressQueryService { : matchFailureStage === "materialized_but_filtered_out_by_recipe" ? "rows_filtered_out_by_intent_recipe_after_anchor_match" : null; + const buildFactualNoRowsResult = ( + replyText: string, + noRowsReason: string, + extraLimitations: string[] = [] + ): AddressExecutionResult => { + const responseType: AddressResponseType = "FACTUAL_SUMMARY"; + const semantics = mergeAddressResultSemantics( + deriveAddressResultSemantics({ + intent: intent.intent, + selectedRecipe: effectiveRecipeId, + filters: filters.extracted_filters, + semanticFrame, + responseType, + rowsMatched: 0 + }), + undefined + ); + return { + handled: true, + reply_text: replyText, + reply_type: inferReplyType(responseType), + response_type: responseType, + debug: { + detected_mode: mode.mode, + detected_mode_confidence: mode.confidence, + query_shape: shape.shape, + query_shape_confidence: shape.confidence, + detected_intent: intent.intent, + detected_intent_confidence: intent.confidence, + extracted_filters: filters.extracted_filters, + missing_required_filters: [], + selected_recipe: effectiveRecipeId, + mcp_call_status_legacy: toLegacyMcpStatus(stageStatus), + account_scope_mode: plan.account_scope_mode, + account_scope_fallback_applied: accountScopeFallbackApplied, + anchor_type: anchor.anchor_type, + anchor_value_raw: anchor.anchor_value_raw, + anchor_value_resolved: anchor.anchor_value_resolved, + resolver_confidence: anchor.resolver_confidence, + ambiguity_count: anchor.ambiguity_count, + match_failure_stage: matchFailureStage, + match_failure_reason: matchFailureReason, + mcp_call_status: stageStatus, + rows_fetched: mcp.fetched_rows, + raw_rows_received: mcp.raw_rows.length, + rows_after_account_scope: normalizedRows.length, + rows_after_recipe_filter: filterByAnchors.length, + rows_materialized: normalizedRows.length, + rows_matched: 0, + raw_row_keys_sample: rowDiagnostics.rawRowKeysSample, + materialization_drop_reason: rowDiagnostics.materializationDropReason, + account_token_raw: accountScopeAudit.accountTokenRaw, + account_token_normalized: accountScopeAudit.accountTokenNormalized, + account_scope_fields_checked: accountScopeAudit.accountScopeFieldsChecked, + account_scope_match_strategy: accountScopeAudit.accountScopeMatchStrategy, + account_scope_drop_reason: accountScopeAudit.accountScopeDropReason, + runtime_readiness: "LIVE_QUERYABLE_WITH_LIMITS", + limited_reason_category: null, + response_type: responseType, + ...semantics, + limitations: [...filters.warnings, ...extraLimitations], + reasons: withConfirmedBalanceFallbackReason( + [...baseReasons, noRowsReason], + requestedResultMode, + undefined, + semantics.result_mode + ), + ...(capabilityAudit + ? { + capability_id: capabilityAudit.capabilityId, + capability_layer: capabilityAudit.layer, + capability_route_mode: capabilityAudit.routeMode, + capability_route_enabled: capabilityAudit.enabled, + capability_route_reason: capabilityAudit.reason + } + : {}), + ...(shadowRouteAudit + ? { + shadow_route_status: shadowRouteAudit.status + } + : {}) + } + }; + }; if (organizationWarehouseRecoveryApplied) { if (!baseReasons.includes("organization_scope_live_grounding_recovered_rows")) { baseReasons.push("organization_scope_live_grounding_recovered_rows"); @@ -3669,7 +4201,7 @@ export class AddressQueryService { const recoveredBankRows = applyIntentSpecificFilter("bank_operations_by_contract", filterByAnchors); const recoveredRows = recoveredBankRows.length > 0 ? recoveredBankRows : filterByAnchors; if (recoveredRows.length > 0) { - const factual = composeFactualReply(intent.intent, recoveredRows, composeOptionsFromFilters(executionFilters)); + const factual = composeFactualReply(intent.intent, recoveredRows, composeRuntimeOptions(executionFilters)); const recoveryReason = recoveredBankRows.length > 0 ? "contract_docs_recovered_via_bank_fallback" @@ -3822,7 +4354,7 @@ export class AddressQueryService { const expandedFactual = composeFactualReply( intent.intent, expandedFilteredRows, - composeOptionsFromFilters(expandedLimitFilters) + composeRuntimeOptions(expandedLimitFilters) ); const expandedPrefix = `Период сохранен. Глубина live-выборки автоматически расширена до ${expandedPlan.limit} строк.`; const expandedLimitations = [...filters.warnings, "query_limit_auto_expanded_for_anchor_recovery"]; @@ -3977,7 +4509,7 @@ export class AddressQueryService { const broadenedFactual = composeFactualReply( intent.intent, broadenedFilteredRows, - composeOptionsFromFilters(autoBroadenedFilters) + composeRuntimeOptions(autoBroadenedFilters) ); const broadenedLimitations = [ ...filters.warnings, @@ -4075,6 +4607,7 @@ export class AddressQueryService { if ( filteredRows.length === 0 && + !counterpartyItemFlowQuery && isDocumentOrBankAnchorIntent(intent.intent) && !hasExplicitPeriodWindow(filters.extracted_filters) && (anchor.anchor_type === "counterparty" || anchor.anchor_type === "contract") @@ -4151,7 +4684,7 @@ export class AddressQueryService { const historicalFactual = composeFactualReply( intent.intent, historicalFilteredRows, - composeOptionsFromFilters(historicalFilters) + composeRuntimeOptions(historicalFilters) ); const historicalPrefix = "Найдены данные в историческом срезе базы по вашему запросу."; const historicalSuggestion = @@ -4238,7 +4771,7 @@ export class AddressQueryService { const fallbackFactual = composeFactualReply( intent.intent, documentBankFallbackRows, - composeOptionsFromFilters(executionFilters) + composeRuntimeOptions(executionFilters) ); const fallbackPrefix = "По вашему запросу показываю найденные документы и операции в доступном срезе базы."; const fallbackSuggestion = @@ -4322,6 +4855,65 @@ export class AddressQueryService { !toNonEmptyFilterValue(filters.extracted_filters.contract) && !toNonEmptyFilterValue(filters.extracted_filters.document_ref); if (filteredRows.length === 0 && !allowConfirmedAsOfZeroSnapshot) { + if (stageStatus === "no_raw_rows" && counterpartyItemFlowQuery && anchor.anchor_type === "counterparty") { + const counterpartyLabel = String(anchor.anchor_value_resolved ?? anchor.anchor_value_raw ?? "указанный контрагент") + .trim() + .replace(/[.]+$/u, ""); + const bankFallbackSelection = selectAddressRecipe("bank_operations_by_counterparty", counterpartyItemFlowFilters); + if (bankFallbackSelection.selected_recipe) { + const bankFallbackPlan = enforceStrictAccountScopeForIntent( + buildAddressRecipePlan(bankFallbackSelection.selected_recipe, counterpartyItemFlowFilters), + "bank_operations_by_counterparty" + ); + const bankFallbackMcp = await executeAddressMcpQuery({ + query: bankFallbackPlan.query, + limit: bankFallbackPlan.limit + }); + if (!bankFallbackMcp.error) { + const bankFallbackNormalizedRows = applyAccountScopeFilter( + toNormalizedRows(bankFallbackMcp.raw_rows), + bankFallbackPlan.account_scope + ); + const bankFallbackRows = applyIntentSpecificFilter( + "bank_operations_by_counterparty", + applyAddressFilters(bankFallbackNormalizedRows, counterpartyItemFlowFilters).rows + ); + const bankFallbackReply = buildCounterpartyItemFlowBankFallbackReply(counterpartyLabel, bankFallbackRows); + if (bankFallbackReply) { + return buildFactualNoRowsResult( + bankFallbackReply, + "counterparty_item_flow_no_supply_but_bank_activity_explained", + ["counterparty_item_flow_bank_activity_fallback_applied"] + ); + } + } + } + return buildFactualNoRowsResult( + `Контрагент: ${counterpartyLabel}. Позиции: подтвержденных поступлений товаров или услуг не найдено.\nПроверил документы поступления и связанные движения по этому контрагенту: в доступном срезе базы строк с товарами или услугами не нашлось.`, + "counterparty_item_flow_exact_negative_response" + ); + } + if (stageStatus === "no_raw_rows" && accountOnlyOpenItemsQuery) { + const accountLabel = + typeof executionFilters.account === "string" && executionFilters.account.trim().length > 0 + ? executionFilters.account.trim() + : "указанному счету"; + const periodLabel = + typeof executionFilters.period_from === "string" && typeof executionFilters.period_to === "string" + ? `за период ${executionFilters.period_from}..${executionFilters.period_to}` + : typeof executionFilters.as_of_date === "string" + ? `на дату ${executionFilters.as_of_date}` + : ""; + const organizationLabel = + typeof executionFilters.organization === "string" && executionFilters.organization.trim().length > 0 + ? executionFilters.organization.trim() + : ""; + return buildFactualNoRowsResult( + `По счету ${accountLabel}${periodLabel ? ` ${periodLabel}` : ""} открытых остатков не найдено.` + + (organizationLabel ? `\nОрганизация: ${organizationLabel}.` : ""), + "open_items_account_exact_negative_response" + ); + } const hadBaseRows = normalizedRows.length > 0 || mcp.fetched_rows > 0; const hadAnchorMatchedRows = filterByAnchors.length > 0; const isVisibilityGapCandidate = @@ -4405,7 +4997,7 @@ export class AddressQueryService { ? "document_or_bank_visibility_gap_after_base_filter" : "no_rows_after_recipe_and_scope_filter" ]; - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -4454,7 +5046,7 @@ export class AddressQueryService { const factual = composeFactualReply( composeIntent, filteredRows, - composeOptionsFromFilters(executionFilters, { + composeRuntimeOptions(executionFilters, { vatDirectSourceProbe, emphasizeNumbers: shouldEmphasizeNumbers, useRubCurrency: shouldUseRubCurrency @@ -4489,7 +5081,7 @@ export class AddressQueryService { resultMode: factualResultSemantics.result_mode }); if (finalRouteExpectationAudit.status === "mismatch" && FEATURE_ASSISTANT_ROUTE_EXPECTATION_HARD_GUARD_V1) { - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, @@ -4537,7 +5129,7 @@ export class AddressQueryService { : intent.intent === "vat_liability_confirmed_for_tax_period" ? "vat_tax_period" : "vat_payable"; - return buildLimitedExecutionResult({ + return finalizeLimitedResult({ mode, shape, intent, diff --git a/llm_normalizer/backend/src/services/addressRecipeCatalog.ts b/llm_normalizer/backend/src/services/addressRecipeCatalog.ts index 5182be8..3d79831 100644 --- a/llm_normalizer/backend/src/services/addressRecipeCatalog.ts +++ b/llm_normalizer/backend/src/services/addressRecipeCatalog.ts @@ -85,6 +85,40 @@ __WHERE_CLAUSE__ Товары.Ссылка.Дата __ORDER_DIRECTION__ `; +const COUNTERPARTY_PURCHASE_GOODS_QUERY_TEMPLATE = ` +ВЫБРАТЬ ПЕРВЫЕ __LIMIT__ + Товары.Ссылка.Дата КАК Период, + ПРЕДСТАВЛЕНИЕ(Товары.Ссылка) КАК Регистратор, + "41.01" КАК СчетДт, + "" КАК СчетКт, + Товары.Сумма КАК Сумма, + ПРЕДСТАВЛЕНИЕ(Товары.Номенклатура) КАК Номенклатура, + ПРЕДСТАВЛЕНИЕ(Товары.Ссылка.Контрагент) КАК Контрагент, + ПРЕДСТАВЛЕНИЕ(Товары.Ссылка.ДоговорКонтрагента) КАК Договор, + ПРЕДСТАВЛЕНИЕ(Товары.Ссылка.Организация) КАК Организация, + Товары.Количество КАК Количество +ИЗ + Документ.ПоступлениеТоваровУслуг.Товары КАК Товары +__WHERE_CLAUSE__ +`; + +const COUNTERPARTY_PURCHASE_SERVICES_QUERY_TEMPLATE = ` +ВЫБРАТЬ ПЕРВЫЕ __LIMIT__ + Услуги.Ссылка.Дата КАК Период, + ПРЕДСТАВЛЕНИЕ(Услуги.Ссылка) КАК Регистратор, + "" КАК СчетДт, + "" КАК СчетКт, + Услуги.Сумма КАК Сумма, + ПРЕДСТАВЛЕНИЕ(Услуги.Номенклатура) КАК Номенклатура, + ПРЕДСТАВЛЕНИЕ(Услуги.Ссылка.Контрагент) КАК Контрагент, + ПРЕДСТАВЛЕНИЕ(Услуги.Ссылка.ДоговорКонтрагента) КАК Договор, + ПРЕДСТАВЛЕНИЕ(Услуги.Ссылка.Организация) КАК Организация, + 0 КАК Количество +ИЗ + Документ.ПоступлениеТоваровУслуг.Услуги КАК Услуги +__WHERE_CLAUSE__ +`; + const PAYABLES_CONFIRMED_AS_OF_QUERY_TEMPLATE = ` ВЫБРАТЬ ПЕРВЫЕ __LIMIT__ __AS_OF_EXPR__ КАК Период, @@ -1227,6 +1261,36 @@ function buildInventoryItemReferenceCondition(filters: AddressFilterSet, fieldPa return clauses.length === 1 ? clauses[0] : `(${clauses.join(" ИЛИ ")})`; } +function buildCounterpartyReferenceCondition(filters: AddressFilterSet, fieldPaths: string[]): string | null { + const counterparty = typeof filters.counterparty === "string" ? filters.counterparty.trim() : ""; + if (!counterparty) { + return null; + } + const counterpartyTokens = Array.from( + new Set( + counterparty + .split(/[^A-Za-zА-Яа-яЁё0-9]+/u) + .map((token) => token.trim()) + .filter((token) => token.length >= 3) + ) + ); + const tokens = counterpartyTokens.length > 0 ? counterpartyTokens : [counterparty]; + const clauses = fieldPaths + .map((fieldPath) => String(fieldPath ?? "").trim()) + .filter((fieldPath) => fieldPath.length > 0) + .map((fieldPath) => { + const tokenConditions = tokens.map((token) => { + const escapedToken = toQueryStringLiteral(token); + return `${fieldPath}.Наименование ПОДОБНО "%${escapedToken}%"`; + }); + return tokenConditions.length === 1 ? tokenConditions[0] : `(${tokenConditions.join(" И ")})`; + }); + if (clauses.length === 0) { + return null; + } + return clauses.length === 1 ? clauses[0] : `(${clauses.join(" ИЛИ ")})`; +} + function buildInventorySaleDocumentQuery(filters: AddressFilterSet, resolvedLimit: number): string { const itemCondition = buildInventoryItemReferenceCondition(filters, ["Товары.Номенклатура"]); return INVENTORY_SALE_DOCUMENTS_QUERY_TEMPLATE @@ -1257,6 +1321,44 @@ function buildInventoryPurchaseDocumentQuery(filters: AddressFilterSet, resolved .replaceAll("__ORDER_DIRECTION__", resolveOrderDirection(filters.sort)); } +export function buildCounterpartyPurchaseDocumentQuery(filters: AddressFilterSet, resolvedLimit: number): string { + const goodsCounterpartyCondition = buildCounterpartyReferenceCondition(filters, ["Товары.Ссылка.Контрагент"]); + const servicesCounterpartyCondition = buildCounterpartyReferenceCondition(filters, ["Услуги.Ссылка.Контрагент"]); + const goodsQuery = COUNTERPARTY_PURCHASE_GOODS_QUERY_TEMPLATE.replace("__LIMIT__", String(resolvedLimit)).replace( + "__WHERE_CLAUSE__", + buildWhereClause( + filters, + "Товары.Ссылка.Дата", + ['Товары.Ссылка.Проведен = ИСТИНА', goodsCounterpartyCondition].filter((item): item is string => Boolean(item)) + ) + ); + const servicesQuery = COUNTERPARTY_PURCHASE_SERVICES_QUERY_TEMPLATE.replace("__LIMIT__", String(resolvedLimit)).replace( + "__WHERE_CLAUSE__", + buildWhereClause( + filters, + "Услуги.Ссылка.Дата", + ['Услуги.Ссылка.Проведен = ИСТИНА', servicesCounterpartyCondition].filter((item): item is string => Boolean(item)) + ) + ); + return `${goodsQuery} +ОБЪЕДИНИТЬ ВСЕ +${servicesQuery} +УПОРЯДОЧИТЬ ПО + Период ${resolveOrderDirection(filters.sort)}`; +} + +export function buildOpenItemsMovementQuery(filters: AddressFilterSet, resolvedLimit: number): string { + const extraConditions: string[] = []; + const accountCondition = buildMovementAccountCondition(filters); + if (accountCondition) { + extraConditions.push(accountCondition); + } + return MOVEMENTS_QUERY_TEMPLATE + .replace("__LIMIT__", String(resolvedLimit)) + .replace("__WHERE_CLAUSE__", buildWhereClause(filters, "Движения.Период", extraConditions)) + .replaceAll("__ORDER_DIRECTION__", resolveOrderDirection(filters.sort)); +} + function shouldBoostLimitForAllTimeCounterparty(filters: AddressFilterSet): boolean { const hasAnchor = (typeof filters.counterparty === "string" && filters.counterparty.trim().length > 0) || diff --git a/llm_normalizer/backend/src/services/address_runtime/composeStage.ts b/llm_normalizer/backend/src/services/address_runtime/composeStage.ts index 166b45c..feeca1e 100644 --- a/llm_normalizer/backend/src/services/address_runtime/composeStage.ts +++ b/llm_normalizer/backend/src/services/address_runtime/composeStage.ts @@ -40,6 +40,9 @@ export interface VatDirectSourceProbeSummary { interface ComposeFactualReplyOptions { userMessage?: string; + itemHint?: string; + counterpartyHint?: string; + accountHint?: string; periodFrom?: string; periodTo?: string; asOfDate?: string; @@ -78,6 +81,7 @@ type CounterpartyProfileFocus = type CounterpartyLifecycleFocus = "active_customers_period" | "active_customers_all_time"; type ValueRankingFocus = | "top_by_total" + | "total_flow" | "top_years_by_total" | "top_by_ops" | "top_by_max_single" @@ -662,6 +666,13 @@ function detectValueRankingFocus(userMessage: string | null | undefined): ValueR if (!text) { return "top_by_total"; } + const asksTotalMoneyEarned = + /(?:сколько|скока|скок).*(?:денег|выручк|доход|заработ|оборот)/iu.test(text) && + !/(?:клиент|заказчик|покупател|контрагент|customer|client|counterpart)/iu.test(text) && + !/(?:топ|top|сам(?:ый|ая|ое|ые)|наибольш|больше\s+всего|максимальн)/iu.test(text); + if (asksTotalMoneyEarned) { + return "total_flow"; + } const asksYearlyRevenueRanking = /(?:доходн|выручк|оборот|прибыл|деньг|денег|revenue|turnover|income)/iu.test(text) && /(?:год|года|годы|year|years|по\s+годам)/iu.test(text) && @@ -767,6 +778,16 @@ function extractCounterpartyName(row: ComposeStageRow): string | null { return null; } +function hasCounterpartyItemFlowQuestion(userMessage: string | undefined): boolean { + const text = String(userMessage ?? "").trim().toLowerCase(); + if (!text) { + return false; + } + return /(?:что\s+нам\s+(?:отгруж|постав|привоз|прод)|како(?:й|е|го|му)\s+товар|какую\s+услуг|какие\s+товар|какие\s+услуг|товар\s+или\s+услуг|позици(?:ю|и|ях)?)/iu.test( + text + ); +} + function extractInventoryItemName(row: ComposeStageRow): string | null { const direct = String(row.item ?? "").trim(); if (direct) { @@ -988,10 +1009,13 @@ function looksLikeInventoryPartyToken(value: string): boolean { return normalized === normalized.toUpperCase() && normalized.length >= 4; } -function extractInventoryCounterpartyCandidates(row: ComposeStageRow): string[] { +function extractInventoryCounterpartyCandidates(row: ComposeStageRow, excludedTokens: string[] = []): string[] { const itemToken = normalizeEntityToken(extractInventoryItemName(row)); const warehouseToken = normalizeEntityToken(extractInventoryWarehouseName(row)); const organizationToken = normalizeEntityToken(extractInventoryOrganizationName(row)); + const excludedComparableTokens = excludedTokens + .map((token) => normalizeEntityToken(token)) + .filter((token): token is string => Boolean(token)); const candidates: string[] = []; for (const token of row.analytics) { const normalized = String(token ?? "").trim(); @@ -999,7 +1023,13 @@ function extractInventoryCounterpartyCandidates(row: ComposeStageRow): string[] continue; } const comparable = normalizeEntityToken(normalized); - if (!comparable || comparable === itemToken || comparable === warehouseToken || comparable === organizationToken) { + if ( + !comparable || + comparable === itemToken || + comparable === warehouseToken || + comparable === organizationToken || + excludedComparableTokens.includes(comparable) + ) { continue; } candidates.push(normalized); @@ -1018,7 +1048,7 @@ interface InventoryTraceSummary { totalAmount: number; } -function summarizeInventoryTraceRows(rows: ComposeStageRow[]): InventoryTraceSummary { +function summarizeInventoryTraceRows(rows: ComposeStageRow[], excludedCounterpartyTokens: string[] = []): InventoryTraceSummary { const items = uniqueStrings( rows .map((row) => extractInventoryItemName(row)) @@ -1034,7 +1064,9 @@ function summarizeInventoryTraceRows(rows: ComposeStageRow[]): InventoryTraceSum .map((row) => extractInventoryOrganizationName(row)) .filter((item): item is string => Boolean(item)) ); - const counterparties = uniqueStrings(rows.flatMap((row) => extractInventoryCounterpartyCandidates(row))); + const counterparties = uniqueStrings( + rows.flatMap((row) => extractInventoryCounterpartyCandidates(row, excludedCounterpartyTokens)) + ); const documents = uniqueStrings( rows .map((row) => String(row.registrator ?? "").trim()) @@ -1057,9 +1089,9 @@ function summarizeInventoryTraceRows(rows: ComposeStageRow[]): InventoryTraceSum }; } -function formatInventoryTraceRows(rows: ComposeStageRow[], limit = 10): string[] { +function formatInventoryTraceRows(rows: ComposeStageRow[], limit = 10, excludedCounterpartyTokens: string[] = []): string[] { return rows.slice(0, limit).map((row, index) => { - const parties = extractInventoryCounterpartyCandidates(row); + const parties = extractInventoryCounterpartyCandidates(row, excludedCounterpartyTokens); const warehouse = extractInventoryWarehouseName(row); const organization = extractInventoryOrganizationName(row); const amount = @@ -1082,6 +1114,35 @@ function formatInventoryTraceRows(rows: ComposeStageRow[], limit = 10): string[] }); } +function formatCounterpartyItemFlowRows(rows: ComposeStageRow[], limit = 12): string[] { + return rows.slice(0, limit).map((row, index) => { + const item = extractInventoryItemName(row) ?? "позиция не указана"; + const contract = extractContractName(row); + const warehouse = extractInventoryWarehouseName(row); + const organization = extractInventoryOrganizationName(row); + const quantity = extractInventoryQuantity(row); + const amount = + typeof row.amount === "number" && Number.isFinite(row.amount) ? formatMoneyRub(row.amount) : "сумма не указана"; + const parts = [ + `${index + 1}. ${item}`, + `договор: ${contract ?? "не указан"}`, + `документ: ${row.registrator}`, + `дата: ${inventoryTraceDateLabel(row.period)}`, + `сумма: ${amount}` + ]; + if (quantity !== null && quantity > 0) { + parts.push(`количество: ${formatNumberWithDots(quantity, 3)}`); + } + if (warehouse) { + parts.push(`склад: ${warehouse}`); + } + if (organization) { + parts.push(`организация: ${organization}`); + } + return parts.join(" | "); + }); +} + interface InventoryAgingByItemAggregate { item: string; warehouse: string | null; @@ -3296,6 +3357,8 @@ export function composeFactualReply( const profileRows = Array.from(byCounterparty.values()); const yearRows = Array.from(byYear.values()); + const totalFlow = profileRows.reduce((sum, item) => sum + item.total, 0); + const totalOperations = profileRows.reduce((sum, item) => sum + item.ops, 0); const rankedByTotal = [...profileRows].sort((a, b) => b.total - a.total || b.ops - a.ops || a.name.localeCompare(b.name)); const rankedByYearTotal = [...yearRows].sort((a, b) => b.total - a.total || b.ops - a.ops || a.year - b.year); const rankedByOps = [...profileRows].sort((a, b) => b.ops - a.ops || b.total - a.total || a.name.localeCompare(b.name)); @@ -3337,6 +3400,33 @@ export function composeFactualReply( }; } + if (focus === "total_flow") { + const periodLine = + options.periodFrom && options.periodTo + ? `За период ${formatDateRu(options.periodFrom)}..${formatDateRu(options.periodTo)} подтверждено ${formatMoneyRub(totalFlow)} ${isSupplier ? "исходящих выплат" : "входящих поступлений"}.` + : `За все доступное время подтверждено ${formatMoneyRub(totalFlow)} ${isSupplier ? "исходящих выплат" : "входящих поступлений"}.`; + const directAnswerLine = isSupplier + ? periodLine + : `${periodLine} Это сумма денег, полученных от клиентов, а не чистая прибыль.`; + const summaryLines = [ + directAnswerLine, + "", + "Подтверждение:", + `- Операций в выборке: ${totalOperations}.`, + `- Контрагентов в выборке: ${profileRows.length}.` + ]; + if (rankedByYearTotal.length > 0) { + summaryLines.push(`- Самый сильный год по поступлениям: ${rankedByYearTotal[0].year} (${formatMoneyRub(rankedByYearTotal[0].total)}).`); + } + if (rankedByTotal.length > 0) { + summaryLines.push(`- Крупнейший контрагент по потоку: ${rankedByTotal[0].name} (${formatMoneyRub(rankedByTotal[0].total)}).`); + } + return { + responseType: "FACTUAL_SUMMARY", + text: summaryLines.join("\n") + }; + } + if (focus === "top_years_by_total") { const visible = rankedByYearTotal.slice(0, limit); const heading = isSupplier @@ -4274,8 +4364,11 @@ export function composeFactualReply( if (intent === "inventory_sale_trace_for_item") { const asOfDate = resolvePayablesAsOfDate(options); const saleRows = rows.filter((row) => isInventorySaleMovement(row)); - const summary = summarizeInventoryTraceRows(saleRows); - const itemLabel = summary.item ?? "товар не определен"; + const requestedItemHint = String(options.itemHint ?? "").trim(); + const provisionalExcludedTokens = requestedItemHint ? [requestedItemHint] : []; + const summary = summarizeInventoryTraceRows(saleRows, provisionalExcludedTokens); + const itemLabel = requestedItemHint || (summary.item ?? "товар не определен"); + const excludedCounterpartyTokens = [itemLabel]; const directAnswerLine = summary.counterparties.length === 1 ? `По товару ${itemLabel} покупатель определен: ${summary.counterparties[0]}.` @@ -4296,7 +4389,7 @@ export function composeFactualReply( } lines.push("", "Документы выбытия:"); if (saleRows.length > 0) { - lines.push(...formatInventoryTraceRows(saleRows, 12)); + lines.push(...formatInventoryTraceRows(saleRows, 12, excludedCounterpartyTokens)); } else { lines.push("- По выбранному товару не найдено проводок выбытия со счета 41.01 в доступном контуре."); } @@ -5023,8 +5116,12 @@ export function composeFactualReply( if (intent === "open_items_by_counterparty_or_contract") { const counterparties = buildCounterpartyRiskAggregate(rows); + const accountLead = + typeof options.accountHint === "string" && options.accountHint.trim().length > 0 + ? `Проверил хвосты по счету ${options.accountHint.trim()}.` + : "Собраны открытые позиции по взаиморасчетам."; const lines = [ - "Собраны открытые позиции по взаиморасчетам.", + accountLead, `Строк отобрано: ${rows.length}.`, `Контрагентов с сигналом: ${counterparties.length}.` ]; @@ -5090,10 +5187,73 @@ export function composeFactualReply( } if (intent === "list_documents_by_counterparty") { - const lines = [ - `Найдено документов по контрагенту: ${rows.length}.`, - ...formatTopRows(rows, rows.length) - ]; + const resolvedCounterparty = + (typeof options.counterpartyHint === "string" && options.counterpartyHint.trim().length > 0 + ? options.counterpartyHint.trim() + : null) ?? + (() => { + const counterparties = uniqueStrings( + rows + .map((row) => extractCounterpartyName(row)) + .filter((item): item is string => Boolean(item)) + ); + return counterparties.length === 1 ? counterparties[0] : null; + })(); + const counterpartyLabel = + typeof resolvedCounterparty === "string" && resolvedCounterparty.endsWith(".") + ? resolvedCounterparty + : resolvedCounterparty + ? `${resolvedCounterparty}.` + : null; + const counterpartyInline = + typeof counterpartyLabel === "string" ? counterpartyLabel.replace(/[.]+$/u, "") : resolvedCounterparty; + const itemFlowQuestion = hasCounterpartyItemFlowQuestion(options.userMessage); + const items = uniqueStrings( + rows + .map((row) => extractInventoryItemName(row)) + .filter((item): item is string => Boolean(item)) + ); + const contracts = uniqueStrings( + rows + .map((row) => extractContractName(row)) + .filter((item): item is string => Boolean(item)) + ); + const lines: string[] = []; + if (itemFlowQuestion) { + lines.push( + counterpartyInline + ? `Контрагент: ${counterpartyInline}. Подтвержденных поставок товаров или услуг: ${rows.length}.` + : `Подтвержденных поставок товаров или услуг по запрошенному контрагенту: ${rows.length}.` + ); + } else { + lines.push( + counterpartyInline + ? `Контрагент: ${counterpartyInline}. Найдено документов: ${rows.length}.` + : `Найдено документов по контрагенту: ${rows.length}.` + ); + } + if (counterpartyLabel) { + lines.push(`Контрагент: ${counterpartyLabel}`); + } + if (itemFlowQuestion) { + if (items.length > 0) { + lines.push(`Позиции: ${items.slice(0, 8).join("; ")}.`); + if (items.length > 8) { + lines.push(`Показаны первые 8 из ${items.length} позиций.`); + } + } + if (contracts.length === 1) { + lines.push(`Договор: ${contracts[0]}.`); + } else if (contracts.length > 1) { + lines.push(`Договоры в выборке: ${contracts.slice(0, 3).join("; ")}.`); + } + lines.push(...formatCounterpartyItemFlowRows(rows)); + if (rows.length > 12) { + lines.push(`Показаны первые 12 из ${rows.length} поставок.`); + } + } else { + lines.push(...formatTopRows(rows, rows.length)); + } return { responseType: "FACTUAL_LIST", text: lines.join("\n") diff --git a/llm_normalizer/backend/src/services/address_runtime/decomposeStage.ts b/llm_normalizer/backend/src/services/address_runtime/decomposeStage.ts index 9fa4987..ff3ef3f 100644 --- a/llm_normalizer/backend/src/services/address_runtime/decomposeStage.ts +++ b/llm_normalizer/backend/src/services/address_runtime/decomposeStage.ts @@ -26,6 +26,7 @@ import type { AddressLlmSemanticHints } from "../../types/addressQuery"; export interface AddressFollowupContext { previous_intent?: AddressIntent; + target_intent?: AddressIntent; previous_filters?: AddressFilterSet; previous_anchor_type?: | "account" @@ -98,7 +99,7 @@ function hasSameDateHint(text: string): boolean { } function hasSamePeriodHint(text: string): boolean { - return /(?:на\s+тот\s+же\s+период|за\s+тот\s+же\s+период|тот\s+же\s+период(?:\s+рассмотрения)?|на\s+этот\s+же\s+период|за\s+этот\s+же\s+период|аналогичн\w+\s+текущ\w+\s+период\w+|same\s+period|same\s+range|same\s+window)/iu.test( + return /(?:на\s+тот\s+же\s+период|за\s+тот\s+же\s+период|тот\s+же\s+период(?:\s+рассмотрения)?|на\s+этот\s+же\s+период|за\s+этот\s+же\s+период|за\s+этот\s+период|на\s+этот\s+период|за\s+тот\s+период|на\s+тот\s+период|этот\s+период|тот\s+период|аналогичн\w+\s+текущ\w+\s+период\w+|same\s+period|same\s+range|same\s+window)/iu.test( String(text ?? "") ); } @@ -672,6 +673,9 @@ export function hasAddressFollowupContextSignal(text: string): boolean { if (hasSameDateHint(normalized)) { return true; } + if (hasSamePeriodHint(normalized)) { + return true; + } const tokenCount = normalized.split(/\s+/).filter(Boolean).length; if ( @@ -853,7 +857,9 @@ function mergeFollowupFilters( intent === "inventory_aging_by_purchase_date" || intent === "payables_confirmed_as_of_date" || intent === "receivables_confirmed_as_of_date" || - intent === "vat_payable_confirmed_as_of_date" + intent === "vat_payable_confirmed_as_of_date" || + intent === "vat_payable_forecast" || + intent === "vat_liability_confirmed_for_tax_period" ) { const hasFollowupSignalForConfirmed = hasAddressFollowupContextSignal(userMessage); const inheritedContract = previousContract ?? (followupContext.previous_anchor_type === "contract" ? previousAnchorValue : null); @@ -935,6 +941,34 @@ function mergeFollowupFilters( reasons.push("as_of_date_from_followup_context"); } } + if ( + samePeriodRequested && + (intent === "vat_payable_confirmed_as_of_date" || + intent === "vat_payable_forecast" || + intent === "vat_liability_confirmed_for_tax_period" || + intent === "payables_confirmed_as_of_date" || + intent === "receivables_confirmed_as_of_date") + ) { + if (previousPeriodFrom && merged.period_from !== previousPeriodFrom) { + merged.period_from = previousPeriodFrom; + reasons.push("period_from_from_followup_context"); + } + if (previousPeriodTo && merged.period_to !== previousPeriodTo) { + merged.period_to = previousPeriodTo; + reasons.push("period_to_from_followup_context"); + } + if ( + intent === "vat_payable_confirmed_as_of_date" || + intent === "payables_confirmed_as_of_date" || + intent === "receivables_confirmed_as_of_date" + ) { + const inheritedAsOfDate = previousAsOfDate ?? previousPeriodTo ?? previousPeriodFrom; + if (inheritedAsOfDate && merged.as_of_date !== inheritedAsOfDate) { + merged.as_of_date = inheritedAsOfDate; + reasons.push("as_of_date_from_followup_context"); + } + } + } if ( samePeriodRequested && (intent === "inventory_on_hand_as_of_date" || intent === "inventory_supplier_stock_overlap_as_of_date") @@ -1146,6 +1180,17 @@ function mergeFollowupFilters( merged.period_to = previousPeriodTo; } reasons.push("period_from_followup_context"); + if ( + intent === "vat_payable_confirmed_as_of_date" || + intent === "payables_confirmed_as_of_date" || + intent === "receivables_confirmed_as_of_date" + ) { + const inheritedAsOfDate = previousAsOfDate ?? previousPeriodTo ?? previousPeriodFrom; + if (inheritedAsOfDate) { + merged.as_of_date = inheritedAsOfDate; + reasons.push("as_of_date_from_followup_context"); + } + } } if ( @@ -1199,7 +1244,7 @@ function deriveIntentWithFollowupContext( userMessage: string, followupContext: AddressFollowupContext | null ): AddressIntentResolution { - if (!followupContext || !followupContext.previous_intent) { + if (!followupContext || (!followupContext.previous_intent && !followupContext.target_intent)) { return detectedIntent; } @@ -1208,7 +1253,11 @@ function deriveIntentWithFollowupContext( if (!hasFollowupSignal) { return detectedIntent; } - const previousIntent = followupContext.previous_intent; + const sourceIntent = followupContext.previous_intent ?? null; + const fallbackIntent = followupContext.target_intent ?? sourceIntent; + if (!sourceIntent && !fallbackIntent) { + return detectedIntent; + } const previousFilters = followupContext.previous_filters ?? {}; const previousContract = toNonEmptyString(previousFilters.contract); const previousCounterparty = toNonEmptyString(previousFilters.counterparty); @@ -1243,7 +1292,8 @@ function deriveIntentWithFollowupContext( }; } - const previousIsBalanceFamily = previousIntent === "account_balance_snapshot" || previousIntent === "documents_forming_balance"; + const previousIsBalanceFamily = + sourceIntent === "account_balance_snapshot" || sourceIntent === "documents_forming_balance"; if ( previousIsBalanceFamily && hasAccountSignal(normalizedMessage) && @@ -1262,7 +1312,7 @@ function deriveIntentWithFollowupContext( }; } - const previousIsInventoryFamily = isInventoryIntent(previousIntent); + const previousIsInventoryFamily = isInventoryIntent(sourceIntent ?? undefined); const inventorySelectedObjectFollowup = hasSelectedObjectInventorySignal(normalizedMessage) || (previousIsInventoryFamily && hasFollowupSignal); if (inventorySelectedObjectFollowup && hasInventorySupplierFollowupCue(normalizedMessage)) { @@ -1273,7 +1323,7 @@ function deriveIntentWithFollowupContext( detectedIntent.intent === "bank_operations_by_counterparty" || detectedIntent.intent === "bank_operations_by_contract" || detectedIntent.intent === "inventory_on_hand_as_of_date" || - detectedIntent.intent === previousIntent + detectedIntent.intent === sourceIntent ) { return { intent: "inventory_purchase_provenance_for_item", @@ -1289,7 +1339,7 @@ function deriveIntentWithFollowupContext( detectedIntent.intent === "list_documents_by_counterparty" || detectedIntent.intent === "list_documents_by_contract" || detectedIntent.intent === "inventory_on_hand_as_of_date" || - detectedIntent.intent === previousIntent + detectedIntent.intent === sourceIntent ) { return { intent: "inventory_purchase_documents_for_item", @@ -1309,7 +1359,7 @@ function deriveIntentWithFollowupContext( detectedIntent.intent === "bank_operations_by_contract" || detectedIntent.intent === "inventory_on_hand_as_of_date" || detectedIntent.intent === "inventory_sale_trace_for_item" || - detectedIntent.intent === previousIntent + detectedIntent.intent === sourceIntent ) { return { intent: "inventory_profitability_for_item", @@ -1323,7 +1373,7 @@ function deriveIntentWithFollowupContext( if ( detectedIntent.intent === "unknown" || detectedIntent.intent === "inventory_purchase_provenance_for_item" || - detectedIntent.intent === previousIntent || + detectedIntent.intent === sourceIntent || detectedIntent.intent === "inventory_on_hand_as_of_date" ) { return { @@ -1339,7 +1389,7 @@ function deriveIntentWithFollowupContext( detectedIntent.intent === "unknown" || detectedIntent.intent === "inventory_purchase_provenance_for_item" || detectedIntent.intent === "inventory_on_hand_as_of_date" || - detectedIntent.intent === previousIntent + detectedIntent.intent === sourceIntent ) { return { intent: "inventory_sale_trace_for_item", @@ -1354,7 +1404,7 @@ function deriveIntentWithFollowupContext( detectedIntent.intent === "unknown" || detectedIntent.intent === "inventory_sale_trace_for_item" || detectedIntent.intent === "inventory_on_hand_as_of_date" || - detectedIntent.intent === previousIntent + detectedIntent.intent === sourceIntent ) { return { intent: "inventory_purchase_to_sale_chain", @@ -1368,7 +1418,7 @@ function deriveIntentWithFollowupContext( previousIsInventoryFamily && hasFollowupSignal && hasBareInventoryPurchaseDateFollowupCue(normalizedMessage) && - (detectedIntent.intent === "unknown" || detectedIntent.intent === previousIntent) + (detectedIntent.intent === "unknown" || detectedIntent.intent === sourceIntent) ) { return { intent: "inventory_purchase_provenance_for_item", @@ -1431,7 +1481,7 @@ function deriveIntentWithFollowupContext( } return { - intent: previousIntent, + intent: fallbackIntent ?? "unknown", confidence: "low", reasons: [...detectedIntent.reasons, "intent_from_followup_context"] }; diff --git a/llm_normalizer/backend/src/services/address_runtime/resolveStage.ts b/llm_normalizer/backend/src/services/address_runtime/resolveStage.ts index d88ed25..f4cbba4 100644 --- a/llm_normalizer/backend/src/services/address_runtime/resolveStage.ts +++ b/llm_normalizer/backend/src/services/address_runtime/resolveStage.ts @@ -101,6 +101,13 @@ function tokenizeAnchor(value: string): string[] { .filter((token) => token.length >= 2 && !PARTY_ANCHOR_STOPWORDS.has(token)); } +function tokenizeSearchableText(value: string): string[] { + return normalizeSearchText(value) + .split(" ") + .map((token) => token.trim()) + .filter(Boolean); +} + function anchorTokenVariants(token: string): string[] { const source = String(token ?? "").trim().toLowerCase(); if (!source) { @@ -123,9 +130,43 @@ function anchorTokenVariants(token: string): string[] { return Array.from(variants); } +function normalizePartyTokenSkeleton(value: string): string { + return normalizeSearchText(value).replace(/\s+/g, "").replace(/[аеёиоуыэюяaeiouy]+/giu, ""); +} + +function fuzzyPartyTokenMatches(candidate: string, token: string): boolean { + const normalizedCandidate = normalizeSearchText(candidate); + const normalizedToken = normalizeSearchText(token); + if (!normalizedCandidate || !normalizedToken) { + return false; + } + if (normalizedCandidate === normalizedToken) { + return true; + } + if ( + normalizedCandidate.length < 4 || + normalizedToken.length < 4 || + /\d/u.test(normalizedCandidate) || + /\d/u.test(normalizedToken) + ) { + return false; + } + const candidateSkeleton = normalizePartyTokenSkeleton(normalizedCandidate); + const tokenSkeleton = normalizePartyTokenSkeleton(normalizedToken); + if (candidateSkeleton.length < 3 || tokenSkeleton.length < 3) { + return false; + } + return ( + candidateSkeleton === tokenSkeleton || + candidateSkeleton.startsWith(tokenSkeleton) || + tokenSkeleton.startsWith(candidateSkeleton) + ); +} + function matchesAnchorText(searchable: string, anchor: string): boolean { const searchableNormalized = normalizeSearchText(searchable); const searchableLatin = transliterateCyrillicToLatin(searchableNormalized); + const searchableTokens = tokenizeSearchableText(searchable); const tokens = tokenizeAnchor(anchor); if (tokens.length === 0) { const direct = normalizeSearchText(anchor); @@ -138,7 +179,11 @@ function matchesAnchorText(searchable: string, anchor: string): boolean { const variants = anchorTokenVariants(token); return variants.some((variant) => { const tokenLatin = transliterateCyrillicToLatin(variant); - return searchableNormalized.includes(variant) || searchableLatin.includes(tokenLatin); + return ( + searchableNormalized.includes(variant) || + searchableLatin.includes(tokenLatin) || + searchableTokens.some((candidate) => fuzzyPartyTokenMatches(candidate, variant)) + ); }); }); if (fullMatch) { diff --git a/llm_normalizer/backend/src/services/assistantService.ts b/llm_normalizer/backend/src/services/assistantService.ts index 1d749d7..c6c2f29 100644 --- a/llm_normalizer/backend/src/services/assistantService.ts +++ b/llm_normalizer/backend/src/services/assistantService.ts @@ -2440,6 +2440,12 @@ function findRecentAddressFilterValue(items, key) { if (!isAddressLaneDebugPayload(debug)) { continue; } + const replyType = toNonEmptyString(item.reply_type); + const limitedReasonCategory = toNonEmptyString(debug.limited_reason_category); + if ((replyType && replyType !== "factual" && replyType !== "factual_with_explanation") || + limitedReasonCategory) { + continue; + } const directFilterValue = readAddressFilterString(debug, key); if (directFilterValue) { return directFilterValue; @@ -2735,8 +2741,10 @@ function hasShortDebtMirrorFollowupSignal(userMessage) { return false; } return samples.some((sample) => /^(?:а|a|и|i)\s+(?:нам\s+)?кто(?=$|[\s,.;:!?])/iu.test(sample) || + /^(?:а|a|и|i)\s+нам(?=$|[\s,.;:!?])/iu.test(sample) || /^(?:а|a|и|i)\s+(?:мы\s+)?кому(?=$|[\s,.;:!?])/iu.test(sample) || /^(?:р°|a|рё|i)\s+(?:рЅр°рј\s+)?рєс‚рѕ(?=$|[\s,.;:!?])/iu.test(sample) || + /^(?:р°|a|рё|i)\s+рЅр°рј(?=$|[\s,.;:!?])/iu.test(sample) || /^(?:р°|a|рё|i)\s+(?:рјс‹\s+)?рєрѕрјсѓ(?=$|[\s,.;:!?])/iu.test(sample)); } function isInventorySelectedObjectIntent(intent) { @@ -2854,6 +2862,7 @@ function resolveDebtRoleSwapFollowupIntent(userMessage, previousIntent) { } const hasReceivablesCue = /(?:нам\s+кто\s+долж|кто\s+нам\s+долж|кто\s+долж[а-яё]*\s+нам|дебитор|к\s+получению|к\s+взысканию|receivable)/iu.test(normalized) || /^(?:а|a|и|i)\s+(?:нам\s+)?кто(?=$|[\s,.;:!?])/iu.test(normalized) || + /^(?:а|a|и|i)\s+нам(?=$|[\s,.;:!?])/iu.test(normalized) || /^(?:р°|a|рё|i)\s+(?:рЅр°рј\s+)?рєс‚рѕ(?=$|[\s,.;:!?])/iu.test(normalized); const hasPayablesCue = /(?:мы\s+кому\s+долж|кому\s+мы\s+долж|кому\s+долж[а-яё]*\s+мы|кредитор|к\s+уплате|payable)/iu.test(normalized) || /^(?:а|a|и|i)\s+(?:мы\s+)?кому(?=$|[\s,.;:!?])/iu.test(normalized) || @@ -2868,6 +2877,49 @@ function resolveDebtRoleSwapFollowupIntent(userMessage, previousIntent) { } return null; } +function hasExplicitOrganizationScopeCue(text) { + return /(?:(?:^|[\s"'«»„“()\\\/])(?:ооо|ао|пао|зао|оао|ип|гку|муп|гуп|llc|ltd|inc|corp)(?=$|[\s"'«»„“()\\\/.,;:]))|организац|компан|контор|фирм/u.test(String(text ?? "").toLowerCase()); +} +function looksLikeBareCounterpartyScopeTarget(text) { + const normalized = compactWhitespace(String(text ?? "").toLowerCase()); + if (!normalized) { + return false; + } + if (hasExplicitOrganizationScopeCue(normalized)) { + return false; + } + if (/[0-9]/u.test(normalized)) { + return false; + } + const tokens = normalized.split(/\s+/u).filter(Boolean); + if (tokens.length === 0 || tokens.length > 4) { + return false; + } + return tokens.every((token) => /^[a-zа-яё._-]{2,}$/iu.test(token)); +} +function shouldDowngradeOrganizationSemanticHint(scopeTargetText, fragmentText) { + const target = toNonEmptyString(scopeTargetText); + if (!target) { + return false; + } + if (hasExplicitOrganizationScopeCue(target) || hasExplicitOrganizationScopeCue(fragmentText)) { + return false; + } + return looksLikeBareCounterpartyScopeTarget(target); +} +function shouldKeepPreviousIntentForShortCounterpartyRetarget(userMessage, sourceIntent) { + const normalized = compactWhitespace(repairAddressMojibake(String(userMessage ?? "")).toLowerCase()); + if (!normalized || countTokens(normalized) > 4) { + return false; + } + if (sourceIntent !== "list_documents_by_counterparty" && sourceIntent !== "list_documents_by_contract") { + return false; + } + if (/(?:банк|выписк|плат[её]ж|оплат|списан|поступлен|bank|payment|wire|statement)/iu.test(normalized)) { + return false; + } + return /^(?:а|и|ну)?\s*по\s+[a-zа-яё0-9._-]{2,}(?:\s+[a-zа-яё0-9._-]{2,})?$/iu.test(normalized); +} function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMessage = null, llmPreDecomposeMeta = null, addressNavigationState = null) { const previousAddressItem = findLastAddressAssistantItem(items); const previousAddressDebug = previousAddressItem?.debug ?? null; @@ -2988,7 +3040,8 @@ function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMes const suggestedIntent = Array.isArray(followupOffer?.suggested_intents) ? toNonEmptyString(followupOffer.suggested_intents[0]) : null; - if (suggestedIntent) { + const keepPreviousIntent = shouldKeepPreviousIntentForShortCounterpartyRetarget(userMessage, sourceIntent); + if (suggestedIntent && !keepPreviousIntent) { previousIntent = suggestedIntent; followupSelectionMode = "switch_to_suggested_intent"; } @@ -3086,13 +3139,20 @@ function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMes let previousFilters = previousFiltersRaw && typeof previousFiltersRaw === "object" ? { ...previousFiltersRaw } : {}; - if (!toNonEmptyString(previousFilters.contract)) { + const shouldBackfillHistoricalPartyAnchors = + sourceIntentHint === "list_contracts_by_counterparty" || + sourceIntentHint === "list_documents_by_counterparty" || + sourceIntentHint === "bank_operations_by_counterparty" || + sourceIntentHint === "list_documents_by_contract" || + sourceIntentHint === "bank_operations_by_contract" || + sourceIntentHint === "open_items_by_counterparty_or_contract"; + if (shouldBackfillHistoricalPartyAnchors && !toNonEmptyString(previousFilters.contract)) { const historicalContract = findRecentAddressFilterValue(items, "contract"); if (historicalContract) { previousFilters.contract = historicalContract; } } - if (!toNonEmptyString(previousFilters.counterparty)) { + if (shouldBackfillHistoricalPartyAnchors && !toNonEmptyString(previousFilters.counterparty)) { const historicalCounterparty = findRecentAddressFilterValue(items, "counterparty"); if (historicalCounterparty) { previousFilters.counterparty = historicalCounterparty; @@ -3138,7 +3198,10 @@ function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMes const rootContextOnlyPivot = Boolean((isInventorySelectedObjectIntent(sourceIntentHint) || currentFrameKind === "inventory_drilldown") && hasForeignAccountingPivotOverInventoryMessage(userMessage, alternateMessage)); const inventoryRootTemporalPivot = Boolean(inventoryRootFrame && - (isInventorySelectedObjectIntent(sourceIntentHint) || currentFrameKind === "inventory_drilldown") && + (isInventorySelectedObjectIntent(sourceIntentHint) || + isInventoryRootFrameIntent(sourceIntentHint) || + currentFrameKind === "inventory_drilldown" || + currentFrameKind === "inventory_root") && (hasInventoryRootTemporalFollowupPrimary || hasInventoryRootTemporalFollowupAlternate) && !hasForeignAccountingPivotOverInventoryMessage(userMessage, alternateMessage)); const rootScopedPivot = rootContextOnlyPivot || inventoryRootTemporalPivot; @@ -3212,19 +3275,34 @@ function resolveAddressFollowupCarryoverContext(userMessage, items, alternateMes if (!previousIntent && !previousAnchor && Object.keys(previousFilters).length === 0) { return null; } + const shouldAttachInventoryRootFrame = Boolean(inventoryRootFrame && + (rootScopedPivot || + isInventoryRootFrameIntent(sourceIntentHint) || + isInventorySelectedObjectIntent(sourceIntentHint) || + hasNavigationInventoryItemFocusHint || + inventoryShortFollowupPrimary || + inventoryShortFollowupAlternate || + hasInventoryRootTemporalFollowupPrimary || + hasInventoryRootTemporalFollowupAlternate || + hasSelectedObjectInventorySignalPrimary || + hasSelectedObjectInventorySignalAlternate)); + const carryoverTargetIntent = followupSelectionMode === "carry_root_context" + ? inventoryRootFrame?.intent ?? explicitIntent ?? previousIntent ?? undefined + : explicitIntent ?? previousIntent ?? undefined; return { followupContext: { previous_intent: previousIntent ?? undefined, + target_intent: carryoverTargetIntent, previous_filters: previousFilters, previous_anchor_type: previousAnchorType ?? undefined, previous_anchor_value: previousAnchor, resolved_counterparty_from_display: resolvedCounterpartyFromDisplay || undefined, root_context_only: rootScopedPivot || undefined, - root_intent: inventoryRootFrame?.intent ?? undefined, - root_filters: inventoryRootFrame?.filters ?? undefined, - root_anchor_type: inventoryRootFrame?.anchorType ?? undefined, - root_anchor_value: inventoryRootFrame?.anchorValue ?? undefined, - current_frame_kind: currentFrameKind ?? undefined + root_intent: shouldAttachInventoryRootFrame ? inventoryRootFrame?.intent ?? undefined : undefined, + root_filters: shouldAttachInventoryRootFrame ? inventoryRootFrame?.filters ?? undefined : undefined, + root_anchor_type: shouldAttachInventoryRootFrame ? inventoryRootFrame?.anchorType ?? undefined : undefined, + root_anchor_value: shouldAttachInventoryRootFrame ? inventoryRootFrame?.anchorValue ?? undefined : undefined, + current_frame_kind: shouldAttachInventoryRootFrame ? currentFrameKind ?? undefined : undefined }, previousAddressIntent: previousIntent, previousAddressAnchor: previousAnchor, @@ -3298,7 +3376,7 @@ function isRetryableAddressLimitedResult(addressLane) { return false; } const category = String(addressLane?.debug?.limited_reason_category ?? "").trim().toLowerCase(); - return category === "missing_anchor" || category === "empty_match"; + return category === "missing_anchor" || category === "empty_match" || category === "unsupported"; } function isAddressLlmPreDecomposeCandidate(userMessage) { const repaired = repairAddressMojibake(String(userMessage ?? "")); @@ -3317,13 +3395,19 @@ function normalizeAddressSemanticHintsFromFragment(fragment) { return null; } const scopeTargetKind = toNonEmptyString(hints.scope_target_kind); + const scopeTargetText = toNonEmptyString(hints.scope_target_text); + const fragmentText = toNonEmptyString(fragment.raw_fragment_text) ?? toNonEmptyString(fragment.normalized_fragment_text) ?? ""; + const normalizedScopeTargetKind = scopeTargetKind === "organization" && + shouldDowngradeOrganizationSemanticHint(scopeTargetText, fragmentText) + ? "counterparty" + : scopeTargetKind; const dateScopeKind = toNonEmptyString(hints.date_scope_kind); return { - scope_target_kind: scopeTargetKind ?? "none", - scope_target_text: toNonEmptyString(hints.scope_target_text), + scope_target_kind: normalizedScopeTargetKind ?? "none", + scope_target_text: scopeTargetText, date_scope_kind: dateScopeKind ?? "missing", - self_scope_detected: hints.self_scope_detected === true || scopeTargetKind === "self_scope", - selected_object_scope_detected: hints.selected_object_scope_detected === true || scopeTargetKind === "selected_object" + self_scope_detected: hints.self_scope_detected === true || normalizedScopeTargetKind === "self_scope", + selected_object_scope_detected: hints.selected_object_scope_detected === true || normalizedScopeTargetKind === "selected_object" }; } function extractAddressPredecomposeCandidateFromFragments(fragments) { diff --git a/llm_normalizer/backend/tests/addressCounterpartyItemFlowAndOpenItemsRoute.test.ts b/llm_normalizer/backend/tests/addressCounterpartyItemFlowAndOpenItemsRoute.test.ts new file mode 100644 index 0000000..5467aeb --- /dev/null +++ b/llm_normalizer/backend/tests/addressCounterpartyItemFlowAndOpenItemsRoute.test.ts @@ -0,0 +1,243 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; + +const { executeAddressMcpQueryMock } = vi.hoisted(() => ({ + executeAddressMcpQueryMock: vi.fn() +})); + +vi.mock("../src/services/addressMcpClient", async () => { + const actual = await vi.importActual( + "../src/services/addressMcpClient" + ); + return { + ...actual, + executeAddressMcpQuery: executeAddressMcpQueryMock + }; +}); + +import { resolveAddressIntent } from "../src/services/addressIntentResolver"; +import { AddressQueryService } from "../src/services/addressQueryService"; +import { composeFactualReply } from "../src/services/address_runtime/composeStage"; + +afterEach(() => { + executeAddressMcpQueryMock.mockReset(); + vi.restoreAllMocks(); +}); + +describe("counterparty shipment item flow and open-items routing", () => { + it("routes counterparty shipment item-flow wording to documents by counterparty", () => { + const result = resolveAddressIntent("что нам отгружал чепурнов? какой товар или услугу?"); + expect(result.intent).toBe("list_documents_by_counterparty"); + expect(result.reasons).toContain("counterparty_item_flow_signal_detected"); + }); + + it("routes account 60 tails wording to open items intent", () => { + const result = resolveAddressIntent("хвосты покажи по счету 60 на август 2022"); + expect(result.intent).toBe("open_items_by_counterparty_or_contract"); + }); + + it("includes resolved full counterparty name in document reply", () => { + const reply = composeFactualReply( + "list_documents_by_counterparty", + [ + { + period: "2022-08-15T00:00:00Z", + registrator: "Поступление товаров и услуг 000000123 от 15.08.2022", + account_dt: "41.01", + account_kt: "60.01", + amount: 12500, + analytics: ["Чепурнов П.Д.", "Основной договор"], + item: "Кабель силовой", + organization: 'ООО "Альтернатива Плюс"' + } + ], + { + userMessage: "покажи все документы по чапурнову", + counterpartyHint: "Чепурнов П.Д." + } + ); + + expect(reply.text).toContain("Контрагент: Чепурнов П.Д."); + }); + + it("uses purchase document query for fuzzy counterparty item-flow wording", async () => { + executeAddressMcpQueryMock + .mockResolvedValueOnce({ + fetched_rows: 1, + matched_rows: 1, + raw_rows: [ + { + Counterparty: "Чепурнов П.Д.", + Registrator: "Чепурнов П.Д." + } + ], + rows: [], + error: null + }) + .mockResolvedValueOnce({ + fetched_rows: 2, + matched_rows: 2, + raw_rows: [ + { + Period: "2020-03-10T00:00:00Z", + Registrator: "Поступление товаров и услуг 000000001 от 10.03.2020", + AccountDt: "41.01", + AccountKt: "60.01", + Amount: 12000, + Nomenclature: "Кабель силовой", + Counterparty: "Чепурнов П.Д.", + Contract: "Основной договор", + Quantity: 2, + Organization: 'ООО "Альтернатива Плюс"' + }, + { + Period: "2020-03-14T00:00:00Z", + Registrator: "Поступление товаров и услуг 000000002 от 14.03.2020", + AccountDt: "41.01", + AccountKt: "60.01", + Amount: 5400, + Nomenclature: "Патч-корд", + Counterparty: "Чепурнов П.Д.", + Contract: "Основной договор", + Quantity: 10, + Organization: 'ООО "Альтернатива Плюс"' + } + ], + rows: [], + error: null + }); + + const service = new AddressQueryService(); + const result = await service.tryHandle( + "какие товары или услуги были отгружены нашей компании контрагентом чапурновым?" + ); + + expect(result?.handled).toBe(true); + expect(result?.response_type).toBe("FACTUAL_LIST"); + expect(result?.debug.detected_intent).toBe("list_documents_by_counterparty"); + expect(String(result?.reply_text ?? "")).toContain("Контрагент: Чепурнов П.Д."); + expect(String(result?.reply_text ?? "")).toContain("Позиции:"); + expect(String(result?.reply_text ?? "")).toContain("Кабель силовой"); + expect(String(result?.reply_text ?? "")).toContain("договор:"); + expect(String(result?.reply_text ?? "")).toContain("дата:"); + + const query = String(executeAddressMcpQueryMock.mock.calls.at(-1)?.[0]?.query ?? ""); + expect(query).toContain("Документ.ПоступлениеТоваровУслуг.Товары"); + expect(query).toContain("Документ.ПоступлениеТоваровУслуг.Услуги"); + expect(query).toContain("Товары.Ссылка.Контрагент.Наименование ПОДОБНО"); + expect(query).not.toContain("контрагентом"); + }); + + it("explains supplier payments and return when no supply rows are found", async () => { + executeAddressMcpQueryMock.mockImplementation(async (request?: { query?: string }) => { + const query = String(request?.query ?? ""); + if (query.includes("Справочник.Контрагенты")) { + return { + fetched_rows: 1, + matched_rows: 1, + raw_rows: [ + { + Counterparty: "Чепурнов П.Д.", + Registrator: "Чепурнов П.Д." + } + ], + rows: [], + error: null + }; + } + if (query.includes("Документ.ПоступлениеТоваровУслуг.Товары") || query.includes("Документ.ПоступлениеТоваровУслуг.Услуги")) { + return { + fetched_rows: 0, + matched_rows: 0, + raw_rows: [], + rows: [], + error: null + }; + } + return { + fetched_rows: 3, + matched_rows: 3, + raw_rows: [ + { + Period: "2021-06-11T12:00:01Z", + Registrator: "Списание с расчетного счета 00000000124 от 11.06.2021", + AccountDt: "60.02", + AccountKt: "51", + Amount: 119210, + SubcontoDt1: "Чепурнов П.Д.", + SubcontoDt2: "Договор № 11/1 от 25.11.2020", + SubcontoKt1: "ПАО СБЕРБАНК" + }, + { + Period: "2021-05-18T12:00:00Z", + Registrator: "Списание с расчетного счета 00000000112 от 18.05.2021", + AccountDt: "60.02", + AccountKt: "51", + Amount: 180230, + SubcontoDt1: "Чепурнов П.Д.", + SubcontoDt2: "Договор № 11/1 от 25.11.2020", + SubcontoKt1: "ПАО СБЕРБАНК" + }, + { + Period: "2022-01-20T12:00:03Z", + Registrator: "Поступление на расчетный счет 00000000001 от 20.01.2022", + AccountDt: "51", + AccountKt: "60.02", + Amount: 299440, + SubcontoKt1: "Чепурнов П.Д.", + SubcontoKt2: "Договор № 11/1 от 25.11.2020", + SubcontoDt1: "ПАО СБЕРБАНК" + } + ], + rows: [], + error: null + }; + }); + + const service = new AddressQueryService(); + const result = await service.tryHandle( + "какие товары или услуги были отгружены нашей компании контрагентом чапурновым?" + ); + + expect(result?.handled).toBe(true); + expect(String(result?.reply_text ?? "")).toContain("Подтвержденных поставок товаров или услуг не найдено"); + expect(String(result?.reply_text ?? "")).toContain("исходящих оплат поставщику"); + expect(String(result?.reply_text ?? "")).toContain("возвратов от поставщика"); + expect(String(result?.reply_text ?? "")).toContain("Договор:"); + expect(result?.debug.reasons).toContain("counterparty_item_flow_no_supply_but_bank_activity_explained"); + + expect(executeAddressMcpQueryMock.mock.calls.length).toBeGreaterThanOrEqual(2); + }); + + it("keeps account 60 tails in open-items route and mentions the account in reply", async () => { + executeAddressMcpQueryMock.mockResolvedValueOnce({ + fetched_rows: 1, + matched_rows: 1, + raw_rows: [ + { + Period: "2022-08-31T23:59:59Z", + Registrator: "Поступление на расчетный счет 000000001 от 31.08.2022", + AccountDt: "51", + AccountKt: "60.01", + Amount: 150000, + SubcontoKt1: "ООО Поставщик", + SubcontoKt2: "Договор поставки", + Organization: 'ООО "Альтернатива Плюс"' + } + ], + rows: [], + error: null + }); + + const service = new AddressQueryService(); + const result = await service.tryHandle("хвосты покажи по счету 60 на август 2022"); + + expect(result?.handled).toBe(true); + expect(result?.response_type).toBe("FACTUAL_LIST"); + expect(result?.debug.detected_intent).toBe("open_items_by_counterparty_or_contract"); + expect(String(result?.reply_text ?? "")).toContain("счету 60"); + + const query = String(executeAddressMcpQueryMock.mock.calls[0]?.[0]?.query ?? ""); + expect(query).toContain("РегистрБухгалтерии.Хозрасчетный.ДвиженияССубконто"); + expect(query).toContain("60%"); + }); +}); diff --git a/llm_normalizer/backend/tests/addressCounterpartyLifecycleOrganizationScopeRegression.test.ts b/llm_normalizer/backend/tests/addressCounterpartyLifecycleOrganizationScopeRegression.test.ts index 6d172cf..6f320c5 100644 --- a/llm_normalizer/backend/tests/addressCounterpartyLifecycleOrganizationScopeRegression.test.ts +++ b/llm_normalizer/backend/tests/addressCounterpartyLifecycleOrganizationScopeRegression.test.ts @@ -73,10 +73,48 @@ describe("counterparty lifecycle organization scope regressions", () => { expect(result?.handled).toBe(true); expect(result?.reply_type).toBe("factual"); expect(result?.response_type).toBe("FACTUAL_LIST"); - expect(result?.debug.detected_intent).toBe("counterparty_activity_lifecycle"); + expect(result?.debug.detected_intent).toBe("customer_revenue_and_payments"); + expect(result?.debug.selected_recipe).toBe("address_customer_revenue_and_payments_v1"); expect(result?.debug.extracted_filters?.organization).toBe('ООО "Альтернатива Плюс"'); + expect(result?.debug.extracted_filters?.counterparty).toBeUndefined(); expect(result?.debug.match_failure_reason).toBeNull(); expect(result?.debug.rows_matched).toBe(3); expect(String(result?.reply_text ?? "")).toContain('ООО "Ромашка"'); }); + + it("does not turn 'за все время' into a bogus counterparty anchor for highest-value customer wording", async () => { + executeAddressMcpQueryMock.mockResolvedValueOnce({ + fetched_rows: 2, + matched_rows: 2, + raw_rows: [ + { + Period: "2020-01-15T00:00:00Z", + Registrator: "CP_CUSTOMER_ACTIVITY", + AccountDt: "62.01", + AccountKt: "90.01", + Amount: 120, + Counterparty: 'ООО "Ромашка"' + }, + { + Period: "2020-02-20T00:00:00Z", + Registrator: "CP_CUSTOMER_ACTIVITY", + AccountDt: "62.01", + AccountKt: "90.01", + Amount: 80, + Counterparty: 'ООО "Ландыш"' + } + ], + rows: [], + error: null + }); + + const service = new AddressQueryService(); + const result = await service.tryHandle("какой у нас самый доходный клиент за все время"); + + expect(result?.handled).toBe(true); + expect(result?.debug.detected_intent).toBe("customer_revenue_and_payments"); + expect(result?.debug.selected_recipe).toBe("address_customer_revenue_and_payments_v1"); + expect(result?.debug.extracted_filters?.counterparty).toBeUndefined(); + expect(String(result?.reply_text ?? "")).toContain('ООО "Ромашка"'); + }); }); diff --git a/llm_normalizer/backend/tests/addressFollowupTemporalRegression.test.ts b/llm_normalizer/backend/tests/addressFollowupTemporalRegression.test.ts index 8df3f7d..290c220 100644 --- a/llm_normalizer/backend/tests/addressFollowupTemporalRegression.test.ts +++ b/llm_normalizer/backend/tests/addressFollowupTemporalRegression.test.ts @@ -42,6 +42,62 @@ describe("address follow-up temporal regressions", () => { expect(result?.baseReasons).toContain("period_derived_from_followup_context_year"); }); + it("inherits the previous VAT period for 'за этот период' follow-up", () => { + const result = runAddressDecomposeStage("какой НДС мы должны примерно заплатить за этот период", { + previous_intent: "vat_payable_confirmed_as_of_date", + previous_filters: { + period_from: "2017-05-01", + period_to: "2017-05-31", + as_of_date: "2017-05-31" + }, + previous_anchor_type: "unknown", + previous_anchor_value: null + }); + + expect(result).not.toBeNull(); + expect(result?.intent.intent).toBe("vat_payable_confirmed_as_of_date"); + expect(result?.filters.extracted_filters.period_from).toBe("2017-05-01"); + expect(result?.filters.extracted_filters.period_to).toBe("2017-05-31"); + expect(result?.filters.extracted_filters.as_of_date).toBe("2017-05-31"); + expect(result?.baseReasons).toContain("period_from_from_followup_context"); + }); + + it("keeps inherited period when a follow-up retargets from receivables into VAT for the same period", () => { + const result = runAddressDecomposeStage("а какой НДС мы должны примерно заплатить за этот период", { + previous_intent: "receivables_confirmed_as_of_date", + target_intent: "vat_payable_confirmed_as_of_date", + previous_filters: { + period_from: "2017-05-01", + period_to: "2017-05-31", + as_of_date: "2017-05-31" + }, + previous_anchor_type: "organization", + previous_anchor_value: 'ООО "Альтернатива Плюс"' + }); + + expect(result).not.toBeNull(); + expect(result?.intent.intent).toBe("vat_payable_confirmed_as_of_date"); + expect(result?.filters.extracted_filters.period_from).toBe("2017-05-01"); + expect(result?.filters.extracted_filters.period_to).toBe("2017-05-31"); + expect(result?.filters.extracted_filters.as_of_date).toBe("2017-05-31"); + }); + + it("uses follow-up target intent for short debt mirror like 'а нам?'", () => { + const result = runAddressDecomposeStage("а нам?", { + previous_intent: "payables_confirmed_as_of_date", + target_intent: "receivables_confirmed_as_of_date", + previous_filters: { + as_of_date: "2026-04-16" + }, + previous_anchor_type: "organization", + previous_anchor_value: 'ООО "Альтернатива Плюс"' + }); + + expect(result).not.toBeNull(); + expect(result?.intent.intent).toBe("receivables_confirmed_as_of_date"); + expect(result?.filters.extracted_filters.as_of_date).toBe("2026-04-16"); + }); + it("keeps same-date inventory pivot anchored to the previous VAT date", () => { const result = runAddressDecomposeStage("какие остатки по складу на эту же дату", { previous_intent: "vat_payable_confirmed_as_of_date", diff --git a/llm_normalizer/backend/tests/addressInventorySaleTraceDocumentRoute.test.ts b/llm_normalizer/backend/tests/addressInventorySaleTraceDocumentRoute.test.ts index 60a5a26..71ec11d 100644 --- a/llm_normalizer/backend/tests/addressInventorySaleTraceDocumentRoute.test.ts +++ b/llm_normalizer/backend/tests/addressInventorySaleTraceDocumentRoute.test.ts @@ -81,6 +81,9 @@ describe("inventory sale trace movement route", () => { expect(result?.debug.detected_intent).toBe("inventory_sale_trace_for_item"); expect(result?.debug.selected_recipe).toBe("address_inventory_sale_trace_for_item_v1"); expect(String(result?.reply_text ?? "")).toContain("Комитет государственных услуг г. Москвы"); + expect(String(result?.reply_text ?? "")).not.toMatch( + /Контрагент:\s*Рабочая станция универсального специалиста/i + ); expect(executeAddressMcpQueryMock).toHaveBeenCalledTimes(1); const query = String(executeAddressMcpQueryMock.mock.calls[0]?.[0]?.query ?? ""); diff --git a/llm_normalizer/backend/tests/addressNavigationState.test.ts b/llm_normalizer/backend/tests/addressNavigationState.test.ts index b65c19c..4d28ff1 100644 --- a/llm_normalizer/backend/tests/addressNavigationState.test.ts +++ b/llm_normalizer/backend/tests/addressNavigationState.test.ts @@ -181,4 +181,65 @@ describe("address navigation state", () => { expect(evolved.session_context.organization_scope).toBe("ООО Альтернатива Плюс"); expect(evolved.session_context.active_focus_object).toBeNull(); }); + it("resets stale focus and date scope on explicit new topic turn", () => { + const initial = normalizeAddressNavigationState( + { + schema_version: "address_navigation_state_v1", + session_id: "asst-6", + updated_at: "2026-04-12T10:00:00.000Z", + session_context: { + active_result_set_id: "rs-prev", + active_focus_object: { + object_type: "counterparty", + object_id: "counterparty:chapurnov", + label: "Чепурнов", + provenance_result_set_id: "rs-prev", + selected_at: "2026-04-12T09:59:00.000Z" + }, + last_confirmed_route: "address_documents_by_counterparty_v1", + date_scope: { + as_of_date: null, + period_from: "2017-01-01", + period_to: "2017-12-31" + }, + organization_scope: "РћРћРћ Альтернатива Плюс" + }, + result_sets: [], + navigation_history: [] + } as any, + "asst-6" + ); + const assistantItem = { + message_id: "msg-a5", + session_id: "asst-6", + role: "assistant", + text: "РќР° 16.04.2026 РЅР° складе подтверждено 11 позиций.", + reply_type: "factual", + created_at: "2026-04-12T10:05:00.000Z", + trace_id: "address-791", + debug: { + detected_mode: "address_query", + detected_intent: "inventory_on_hand_as_of_date", + selected_recipe: "address_inventory_on_hand_as_of_date_v1", + extracted_filters: { + as_of_date: "2026-04-16", + organization: "РћРћРћ Альтернатива Плюс" + }, + anchor_type: "organization", + anchor_value_resolved: "РћРћРћ Альтернатива Плюс", + dialog_continuation_contract_v2: { + decision: "new_topic" + } + } + } as any; + + const evolved = evolveAddressNavigationStateWithAssistantItem(initial, assistantItem, 5); + expect(evolved.session_context.active_result_set_id).toBe("rs-msg-a5"); + expect(evolved.session_context.active_focus_object?.label).toBe("РћРћРћ Альтернатива Плюс"); + expect(evolved.session_context.date_scope.as_of_date).toBe("2026-04-16"); + expect(evolved.session_context.date_scope.period_from).toBeNull(); + expect(evolved.session_context.date_scope.period_to).toBeNull(); + expect(evolved.session_context.last_confirmed_route).toBe("address_inventory_on_hand_as_of_date_v1"); + expect(evolved.navigation_history[0]?.action).toBe("open"); + }); }); diff --git a/llm_normalizer/backend/tests/addressVatConfirmedRoute.test.ts b/llm_normalizer/backend/tests/addressVatConfirmedRoute.test.ts index c4ebc25..3eb9161 100644 --- a/llm_normalizer/backend/tests/addressVatConfirmedRoute.test.ts +++ b/llm_normalizer/backend/tests/addressVatConfirmedRoute.test.ts @@ -13,6 +13,12 @@ describe("vat payable confirmed as-of route", () => { expect(result.reasons).toContain("vat_payable_confirmed_signal_detected"); }); + it("treats colloquial 'сгрузить' wording as confirmed VAT payable intent", () => { + const result = resolveAddressIntent("какой НДС мы должны сгрузить на март 2020"); + expect(result.intent).toBe("vat_payable_confirmed_as_of_date"); + expect(result.reasons).toContain("vat_payable_confirmed_signal_detected"); + }); + it("keeps VAT forecast intent when explicit forecast wording is used", () => { const result = resolveAddressIntent("какой прогноз оплаты ндс на март 2020"); expect(result.intent).toBe("vat_payable_forecast"); @@ -62,5 +68,5 @@ describe("vat payable confirmed as-of route", () => { expect(result?.debug.requested_result_mode).toBe("confirmed_balance"); expect(result?.debug.route_expectation_status).toBe("matched"); expect(result?.debug.limited_reason_category).not.toBe("unsupported"); - }); + }, 15000); }); diff --git a/llm_normalizer/backend/tests/assistantAddressFollowupContext.test.ts b/llm_normalizer/backend/tests/assistantAddressFollowupContext.test.ts index a3d73d0..dfa1a29 100644 --- a/llm_normalizer/backend/tests/assistantAddressFollowupContext.test.ts +++ b/llm_normalizer/backend/tests/assistantAddressFollowupContext.test.ts @@ -2599,5 +2599,321 @@ describe("assistant address follow-up carryover", () => { expect(calls[0].options?.followupContext?.previous_filters?.as_of_date).toBe("2020-05-31"); expect(normalizerService.normalize).not.toHaveBeenCalled(); }); + + it("treats short 'а нам?' as a receivables mirror follow-up after payables answer", async () => { + const calls: Array<{ message: string; options?: any }> = []; + const followupMessage = "а нам?"; + + const addressQueryService = { + tryHandle: vi.fn(async (message: string, options?: any) => { + calls.push({ message, options }); + if (message === followupMessage && options?.followupContext) { + return { + handled: true, + reply_text: "На ту же дату нам должны 125 000 руб.", + reply_type: "factual", + response_type: "FACTUAL_SUMMARY", + debug: { + detected_mode: "address_query", + detected_intent: "receivables_confirmed_as_of_date", + detected_intent_confidence: "high", + extracted_filters: { + as_of_date: "2026-04-16" + }, + selected_recipe: "address_receivables_confirmed_as_of_date_v1", + reasons: ["address_action_detected", "address_followup_context_applied"] + } + }; + } + return null; + }) + } as any; + + const normalizerService = { + normalize: vi.fn(async () => ({ + assistant_reply: "normalizer_fallback_should_not_be_used", + reply_type: "partial_coverage", + debug: {} + })) + } as any; + + const sessions = new AssistantSessionStore(); + const service = new AssistantService( + normalizerService, + sessions as any, + {} as any, + { persistSession: vi.fn() } as any, + addressQueryService + ); + + const sessionId = `asst-address-followup-a-nam-${Date.now()}`; + sessions.appendItem(sessionId, { + message_id: "msg-payables-seed", + session_id: sessionId, + role: "assistant", + text: "На сегодня мы должны поставщикам 87 000 руб.", + reply_type: "factual", + created_at: "2026-04-16T10:00:00.000Z", + trace_id: "address-payables-seed", + debug: { + detected_mode: "address_query", + detected_intent: "payables_confirmed_as_of_date", + extracted_filters: { + as_of_date: "2026-04-16" + }, + selected_recipe: "address_payables_confirmed_as_of_date_v1" + } + } as any); + + const response = await service.handleMessage({ + session_id: sessionId, + user_message: followupMessage, + useMock: true + } as any); + + expect(response.ok).toBe(true); + expect(response.reply_type).toBe("factual"); + expect(response.debug?.detected_intent).toBe("receivables_confirmed_as_of_date"); + expect(calls).toHaveLength(1); + expect(calls[0].message).toBe(followupMessage); + expect(calls[0].options?.followupContext?.previous_intent).toBe("receivables_confirmed_as_of_date"); + expect(calls[0].options?.followupContext?.previous_filters?.as_of_date).toBe("2026-04-16"); + expect(normalizerService.normalize).not.toHaveBeenCalled(); + }); + + it("keeps document intent for short counterparty retarget like 'а по свк'", async () => { + const calls: Array<{ message: string; options?: any }> = []; + const followupMessage = "а по свк"; + + const addressQueryService = { + tryHandle: vi.fn(async (message: string, options?: any) => { + calls.push({ message, options }); + if (message === followupMessage && options?.followupContext) { + return buildAddressLaneResult({ + reply_text: "Собран список документов по контрагенту СВК.", + debug: { + ...buildAddressLaneResult().debug, + extracted_filters: { + sort: "period_desc", + limit: 20, + counterparty: "свк" + }, + detected_intent: "list_documents_by_counterparty", + selected_recipe: "address_documents_by_counterparty_v1", + reasons: ["address_action_detected", "address_entity_detected", "address_followup_context_applied"] + } + }); + } + return null; + }) + } as any; + + const normalizerService = { + normalize: vi.fn(async () => ({ + assistant_reply: "normalizer_fallback_should_not_be_used", + reply_type: "partial_coverage", + debug: {} + })) + } as any; + + const sessions = new AssistantSessionStore(); + const service = new AssistantService( + normalizerService, + sessions as any, + {} as any, + { persistSession: vi.fn() } as any, + addressQueryService + ); + + const sessionId = `asst-address-followup-po-svk-${Date.now()}`; + sessions.appendItem(sessionId, { + message_id: "msg-docs-seed", + session_id: sessionId, + role: "assistant", + text: "Собран список документов по контрагенту Чапурнов.", + reply_type: "factual", + created_at: "2026-04-16T10:01:00.000Z", + trace_id: "address-docs-seed", + debug: { + detected_mode: "address_query", + detected_intent: "list_documents_by_counterparty", + extracted_filters: { + counterparty: "чапурнов", + sort: "period_desc", + limit: 20 + }, + selected_recipe: "address_documents_by_counterparty_v1", + anchor_type: "counterparty", + anchor_value_raw: "чапурнов", + anchor_value_resolved: "Чапурнов" + } + } as any); + + const response = await service.handleMessage({ + session_id: sessionId, + user_message: followupMessage, + useMock: true + } as any); + + expect(response.ok).toBe(true); + expect(response.reply_type).toBe("factual"); + expect(response.debug?.detected_intent).toBe("list_documents_by_counterparty"); + expect(calls).toHaveLength(1); + expect(calls[0].message).toBe(followupMessage); + expect(calls[0].options?.followupContext?.previous_intent).toBe("list_documents_by_counterparty"); + expect(calls[0].options?.followupContext?.previous_anchor_type).toBe("counterparty"); + expect(calls[0].options?.followupContext?.previous_anchor_value).toBe("Чапурнов"); + expect(normalizerService.normalize).not.toHaveBeenCalled(); + }); + + it("does not backfill stale counterparty anchors into inventory root temporal follow-ups", async () => { + const calls: Array<{ message: string; options?: any }> = []; + const followupMessage = "остатки РЅР° июль 2019"; + + const addressQueryService = { + tryHandle: vi.fn(async (message: string, options?: any) => { + calls.push({ message, options }); + if (options?.followupContext) { + return buildAddressLaneResult({ + reply_text: "РќР° 31.07.2019 РЅР° складе подтверждено 4 позиции.", + reply_type: "factual", + debug: { + ...buildAddressLaneResult().debug, + detected_intent: "inventory_on_hand_as_of_date", + selected_recipe: "address_inventory_on_hand_as_of_date_v1", + extracted_filters: { + organization: 'РћРћРћ "Альтернатива Плюс"', + period_from: "2019-07-01", + period_to: "2019-07-31", + as_of_date: "2019-07-31" + }, + reasons: ["inventory_on_hand_signal_detected", "address_followup_context_applied"] + } + }); + } + return null; + }) + } as any; + + const normalizerService = { + normalize: vi.fn(async () => ({ + assistant_reply: "normalizer_fallback_should_not_be_used", + reply_type: "partial_coverage", + debug: {} + })) + } as any; + + const sessions = new AssistantSessionStore(); + const service = new AssistantService( + normalizerService, + sessions as any, + {} as any, + { persistSession: vi.fn() } as any, + addressQueryService + ); + + const sessionId = `asst-address-followup-root-month-${Date.now()}`; + sessions.appendItem(sessionId, { + message_id: "msg-docs-seed", + session_id: sessionId, + role: "assistant", + text: "Собран СЃРїРёСЃРѕРє документов РїРѕ контрагенту РЎР’Рљ.", + reply_type: "factual", + created_at: "2026-04-16T09:55:00.000Z", + trace_id: "address-docs-seed", + debug: { + detected_mode: "address_query", + detected_intent: "list_documents_by_counterparty", + extracted_filters: { + counterparty: "СЃРІРє", + sort: "period_desc", + limit: 20 + }, + selected_recipe: "address_documents_by_counterparty_v1", + anchor_type: "counterparty", + anchor_value_raw: "СЃРІРє", + anchor_value_resolved: "РЎР’Рљ" + } + } as any); + sessions.appendItem(sessionId, { + message_id: "msg-inventory-root-seed", + session_id: sessionId, + role: "assistant", + text: "РќР° 16.04.2026 РЅР° складе подтверждено 11 позиций.", + reply_type: "factual", + created_at: "2026-04-16T10:00:00.000Z", + trace_id: "address-inventory-root-seed", + debug: { + detected_mode: "address_query", + detected_intent: "inventory_on_hand_as_of_date", + extracted_filters: { + organization: 'РћРћРћ "Альтернатива Плюс"', + as_of_date: "2026-04-16" + }, + selected_recipe: "address_inventory_on_hand_as_of_date_v1", + anchor_type: "organization", + anchor_value_raw: 'РћРћРћ "Альтернатива Плюс"', + anchor_value_resolved: 'РћРћРћ "Альтернатива Плюс"' + } + } as any); + sessions.setAddressNavigationState(sessionId, { + session_id: sessionId, + session_context: { + active_result_set_id: "rs-inventory-root", + active_focus_object: null, + last_confirmed_route: "address_inventory_on_hand_as_of_date_v1", + date_scope: { + as_of_date: "2026-04-16", + period_from: null, + period_to: null + }, + organization_scope: 'РћРћРћ "Альтернатива Плюс"' + }, + result_sets: [ + { + result_set_id: "rs-inventory-root", + type: "inventory_snapshot", + route_id: "address_inventory_on_hand_as_of_date_v1", + filters: { + organization: 'РћРћРћ "Альтернатива Плюс"', + as_of_date: "2026-04-16" + }, + entity_refs: [], + source_refs: [], + created_from_turn: 2, + created_at: "2026-04-16T10:00:00.000Z" + } + ], + navigation_history: [ + { + event_id: "nav-inventory-root", + action: "open", + source_result_set_id: null, + target_object_id: null, + derived_result_set_id: "rs-inventory-root", + turn_index: 2, + created_at: "2026-04-16T10:00:00.000Z" + } + ] + } as any); + + const response = await service.handleMessage({ + session_id: sessionId, + user_message: followupMessage, + useMock: true + } as any); + + expect(response.ok).toBe(true); + expect(response.reply_type).toBe("factual"); + expect(calls).toHaveLength(1); + expect(calls[0].options?.followupContext?.root_context_only).toBe(true); + expect(calls[0].options?.followupContext?.previous_intent).toBeUndefined(); + expect(calls[0].options?.followupContext?.target_intent).toBe("inventory_on_hand_as_of_date"); + expect(calls[0].options?.followupContext?.previous_filters?.counterparty).toBeUndefined(); + expect(calls[0].options?.followupContext?.previous_filters?.organization).toBe('РћРћРћ "Альтернатива Плюс"'); + expect(calls[0].options?.followupContext?.root_intent).toBe("inventory_on_hand_as_of_date"); + expect(calls[0].options?.followupContext?.root_filters?.counterparty).toBeUndefined(); + expect(normalizerService.normalize).not.toHaveBeenCalled(); + }); }); diff --git a/llm_normalizer/backend/tests/assistantAddressLaneRuntimeAdapter.test.ts b/llm_normalizer/backend/tests/assistantAddressLaneRuntimeAdapter.test.ts index 341de93..2c49292 100644 --- a/llm_normalizer/backend/tests/assistantAddressLaneRuntimeAdapter.test.ts +++ b/llm_normalizer/backend/tests/assistantAddressLaneRuntimeAdapter.test.ts @@ -80,6 +80,34 @@ describe("assistant address lane runtime adapter", () => { expect(runAddressLaneAttempt).toHaveBeenCalledTimes(3); }); + it("can retry with raw message after unsupported limited result", async () => { + const carryover: AssistantAddressFollowupCarryoverLike = { followupContext: { scope: "ctx" } }; + const runAddressLaneAttempt = vi + .fn() + .mockResolvedValueOnce(limitedLane("unsupported")) + .mockResolvedValueOnce(limitedLane("unsupported")) + .mockResolvedValueOnce(factualLane()); + + const result = await runAssistantAddressLaneRuntime({ + userMessage: "что нам отгружал чепурнов? какой товар или услугу?", + addressInputMessage: "Определить, что необходимо отгрузить контрагенту Чепурнов", + carryover, + shouldPreferContextualLane: false, + canRetryWithRawUserMessage: true, + runAddressLaneAttempt, + isRetryableAddressLimitedResult: (lane) => + ["missing_anchor", "empty_match", "unsupported"].includes( + String(lane?.debug?.limited_reason_category ?? "").trim() + ) + }); + + expect(result.handled).toBe(true); + expect(result.selection?.messageUsed).toBe("что нам отгружал чепурнов? какой товар или услугу?"); + expect(result.retryAudit.attempted).toBe(true); + expect(result.retryAudit.initial_limited_category).toBe("unsupported"); + expect(runAddressLaneAttempt).toHaveBeenCalledTimes(3); + }); + it("returns pending limited result when retry is disabled", async () => { const runAddressLaneAttempt = vi .fn() diff --git a/llm_normalizer/data/autorun_generators/history.json b/llm_normalizer/data/autorun_generators/history.json index 450cabb..288dd7d 100644 --- a/llm_normalizer/data/autorun_generators/history.json +++ b/llm_normalizer/data/autorun_generators/history.json @@ -1,4 +1,59 @@ [ + { + "generation_id": "gen-mo1t93wq-jy0453e", + "created_at": "2026-04-16T18:26:26.191Z", + "mode": "saved_user_sessions", + "title": "БОЛЬШОЙ ОБЩИЙ Ручная сессия 16.04.2026, 21:26:06", + "count": 31, + "domain": null, + "questions": [ + "приветик - че как там дела", + "расскажи что можешь интересного", + "кайф - что там на складе по остаткам?", + "а исторические остатки на другие даты умеешь?", + "давай на июль 2017", + "март 2016", + "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "а кому продали?", + "у тебя написано кто контрагент: рабочая станция - это ошибка?", + "ндс можешь прикинуть на дату покупки рабочей станции?", + "а какой ндс мы должны сгрузить на март 2020?", + "прикинь какой ндс нам надо заплатить на февраль 2017", + "кто у нас самый доходный клиент за все время", + "кто нам должен денег на май 2017", + "а какой ндс мы должны примерно заплатить за этот период?", + "мы должны комуто денег на сегодня?", + "а нам?", + "какой у нас самый доходный год", + "а за 2017 мы скок заработали?", + "сколько вообще денег мы заработали за все время?", + "ты умеешь считать дельту по договорам?", + "по чепурнову покажи все доки", + "а по свк", + "а сейчас у нас есть что на складе?", + "что нам отгружать чепурнов? какой товар или услугу?", + "какие остатки на складе на сегодня", + "остатки на март 2016", + "это по общей базе уже нужен вывод не по чепурнову", + "хвосты покажи по счету 60 на август 2022", + "Есть ли остатки товара, которые закупались очень давно", + "Какие конкретно номенклатуры формируют остаток по складу на май 2020" + ], + "generated_by": "manual_reviewer", + "saved_case_set_file": "assistant_autogen_saved_user_sessions_20260416182626_gen-mo1t93wq-jy0453e.json", + "context": { + "llm_provider": "local", + "model": "unsloth/qwen3-30b-a3b-instruct-2507", + "assistant_prompt_version": "address_query_runtime_v1", + "decomposition_prompt_version": "normalizer_v2_0_2", + "prompt_fingerprint": "Ты 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.||You are semantic-normalizer for accounting assistant NDC.\nReturn strict JSON only, no markdown, no comments.\n\nTarget schema: normalized_query_v2_0_2.\n\nCore behavior (v2.0.2):\n1. Decompose message into semantic fragments.\n2. Classify fragment domain relevance and business scope.\n3. Fill route-critical flags and candidate labels.\n4. For each fragment set execution state fields:\n - execution_readiness\n - clarification_reason\n - soft_assumption_used\n - route_status\n - no_route_reason\n5. Clarification must be rare and justified.\n\nExecution-state policy:\n- Every in-scope fragment must produce a consistent execution state.\n- If a fragment is routable, mark it as executable or executable_with_soft_assumptions.\n- Do not leave routable fragments in unresolved state.\n- If a fragment cannot be routed, set route_status=no_route and provide explicit no_route_reason.\n\nReadiness values:\n- executable\n- executable_with_soft_assumptions\n- needs_clarification\n- no_route\n\nRoute status values:\n- routed\n- no_route\n\nNo-route reason values:\n- out_of_scope\n- insufficient_specificity\n- missing_mapping\n- unsupported_fragment_type\n\nDo not over-require formality:\n- Do not require document IDs, exact periods, or exact object references for scan/review/anomaly/rule-check requests.\n- Colloquial accounting phrases like \"что висит\", \"что подозрительно\", \"что не сходится\", \"что криво\", \"что аукнется\" are executable if accounting area is understandable.\n\nFragment required fields:\n- fragment_id\n- raw_fragment_text\n- normalized_fragment_text\n- domain_relevance\n- business_scope\n- entity_hints\n- account_hints\n- document_hints\n- register_hints\n- time_scope\n- flags\n- candidate_labels\n- confidence\n- execution_readiness\n- clarification_reason\n- soft_assumption_used\n- route_status\n- no_route_reason\n\nSoft assumptions (`soft_assumption_used`) allowed values:\n- period_from_session_context\n- company_scope_defaulted\n- problem_scan_mode_enabled\n\nGlobal notes:\n- global_notes.needs_clarification should be true only when execution is truly blocked for all in-scope fragments.\n- global_notes.clarification_reason must explain the blocker.\n\nSchema version must be:\n- \"schema_version\": \"normalized_query_v2_0_2\"||Контекст домена: бухгалтерия 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 семантики.||v2.0.2: execution-state hardening + explicit route_status/no_route_reason. Схема normalized_query_v2_0_2.||Q: По каким поставщикам висят хвосты по 60, что подозрительно по цепочке оплат?\nA: in_scope fragment, execution_readiness=executable_with_soft_assumptions, route_status=routed, no_route_reason=null.\n\nQ: Покажи записи по 97, которые повисли и могут аукнуться.\nA: in_scope fragment, execution_readiness=executable_with_soft_assumptions, route_status=routed, no_route_reason=null.\n\nQ: Чекни, что у нас не так.\nA: unclear/in_scope fragment, execution_readiness=needs_clarification, route_status=no_route, no_route_reason=insufficient_specificity.\n\nQ: Как вообще по ФСБУ правильно?\nA: out_of_scope fragment, execution_readiness=no_route, route_status=no_route, no_route_reason=out_of_scope.", + "autogen_personality_id": null, + "autogen_personality_prompt": null, + "source_session_id": "asst-NhPaZfbRYr", + "saved_session_file": "assistant_saved_session_20260416182626_gen-mo1t93wq-jy0453e.json", + "saved_case_set_kind": "assistant_session_scenario" + } + }, { "generation_id": "gen-mo1s0m9z-ndf56a3", "created_at": "2026-04-16T17:51:50.476Z", diff --git a/llm_normalizer/data/autorun_generators/saved_sessions/assistant_saved_session_20260416182626_gen-mo1t93wq-jy0453e.json b/llm_normalizer/data/autorun_generators/saved_sessions/assistant_saved_session_20260416182626_gen-mo1t93wq-jy0453e.json new file mode 100644 index 0000000..4d857c7 --- /dev/null +++ b/llm_normalizer/data/autorun_generators/saved_sessions/assistant_saved_session_20260416182626_gen-mo1t93wq-jy0453e.json @@ -0,0 +1,19089 @@ +{ + "saved_at": "2026-04-16T18:26:26.187Z", + "generation_id": "gen-mo1t93wq-jy0453e", + "mode": "saved_user_sessions", + "title": "БОЛЬШОЙ ОБЩИЙ Ручная сессия 16.04.2026, 21:26:06", + "source_session_id": "asst-NhPaZfbRYr", + "questions": [ + "приветик - че как там дела", + "расскажи что можешь интересного", + "кайф - что там на складе по остаткам?", + "а исторические остатки на другие даты умеешь?", + "давай на июль 2017", + "март 2016", + "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "а кому продали?", + "у тебя написано кто контрагент: рабочая станция - это ошибка?", + "ндс можешь прикинуть на дату покупки рабочей станции?", + "а какой ндс мы должны сгрузить на март 2020?", + "прикинь какой ндс нам надо заплатить на февраль 2017", + "кто у нас самый доходный клиент за все время", + "кто нам должен денег на май 2017", + "а какой ндс мы должны примерно заплатить за этот период?", + "мы должны комуто денег на сегодня?", + "а нам?", + "какой у нас самый доходный год", + "а за 2017 мы скок заработали?", + "сколько вообще денег мы заработали за все время?", + "ты умеешь считать дельту по договорам?", + "по чепурнову покажи все доки", + "а по свк", + "а сейчас у нас есть что на складе?", + "что нам отгружать чепурнов? какой товар или услугу?", + "какие остатки на складе на сегодня", + "остатки на март 2016", + "это по общей базе уже нужен вывод не по чепурнову", + "хвосты покажи по счету 60 на август 2022", + "Есть ли остатки товара, которые закупались очень давно", + "Какие конкретно номенклатуры формируют остаток по складу на май 2020" + ], + "session": { + "session_id": "asst-NhPaZfbRYr", + "updated_at": "2026-04-16T18:26:06.068Z", + "items": [ + { + "message_id": "msg-vx0_iCIeWF", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "приветик - че как там дела", + "reply_type": null, + "created_at": "2026-04-16T18:03:20.725Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-IVq86z_Uxu", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Привет! 😊\nУ меня всё отлично — работаю, помогаю с 1С, анализом данных и другими задачами. А у тебя как дела? Чем могу помочь сегодня? 🚀", + "reply_type": "factual_with_explanation", + "created_at": "2026-04-16T18:03:35.557Z", + "trace_id": "chat-yByBNYgk22", + "debug": { + "trace_id": "chat-yByBNYgk22", + "prompt_version": "living_chat_router_v1", + "schema_version": "living_chat_router_v1", + "fallback_type": "none", + "detected_mode": "chat", + "detected_mode_confidence": "high", + "execution_lane": "living_chat", + "living_router_mode": "chat", + "living_router_reason": "non_domain_query_indexed", + "living_chat_response_source": "llm_chat", + "living_chat_script_guard_applied": false, + "living_chat_script_guard_reason": null, + "living_chat_grounding_guard_applied": false, + "living_chat_grounding_guard_reason": null, + "living_chat_data_scope_probe_status": null, + "living_chat_data_scope_probe_channel": null, + "living_chat_data_scope_probe_org_count": 0, + "living_chat_data_scope_probe_organizations": [], + "living_chat_data_scope_probe_error": null, + "living_chat_selected_organization": null, + "assistant_known_organizations": [], + "assistant_active_organization": null, + "address_llm_predecompose_attempted": true, + "address_llm_predecompose_applied": false, + "address_llm_predecompose_reason": "normalized_fragment_rejected_semantic_guard", + "address_llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "приветик - че как там дела", + "canonical_message": "приветик - че как там дела", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "address_semantic_extraction_contract": { + "schema_version": "address_semantic_extraction_contract_v1", + "source_message": "приветик - че как там дела", + "canonical_message": "приветик - че как там дела", + "canonical_rewrite_applied": false, + "extraction": { + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "aggregation_profile": "unknown" + }, + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "guard_hints": { + "source_data_signal_detected": false, + "canonical_data_signal_detected": false, + "data_scope_meta_query_detected": false, + "deep_investigation_signal_detected": false, + "required_anchor_missing": false, + "unsupported_low_confidence": true, + "semantic_drift_suspected": false + }, + "quality": "low", + "valid": false, + "apply_canonical_recommended": false, + "reason_codes": [ + "unsupported_low_confidence_contract" + ] + }, + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": "non_domain", + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "final_decision": { + "run_address_lane": false, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "non_domain_query_indexed", + "living_mode": "chat", + "living_reason": "non_domain_query_indexed" + } + }, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "non_domain_query_indexed", + "normalized": null, + "normalizer_output": null + } + }, + { + "message_id": "msg-FfSzIEqWxa", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "расскажи что можешь интересного", + "reply_type": null, + "created_at": "2026-04-16T18:03:37.538Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-B2hnmz7NuQ", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Я ассистент по анализу данных 1С в режиме чтения.\nЧто умею по группам:\n1. НДС: Расчеты и аналитика по НДС на основании данных 1С. (например: vat_period_snapshot, vat_liability_confirmed_for_tax_period, vat_payable_confirmed_as_of_date).\n2. Контрагенты: Срезы активности, платежей и документов по контрагентам. (например: list_documents_by_counterparty, bank_operations_by_counterparty, list_contracts_by_counterparty).\n3. Задолженности и расчеты: Аналитика закрытия расчетов, сальдо и признаков незакрытых цепочек. (например: settlement_closure_state, advance_offset_state, open_items_snapshot).\n4. Деньги и остатки: Остатки и динамика по денежным счетам и кассе. (например: balance_snapshot, turnover_by_period).\n5. Товары и складские остатки: Подтвержденные срезы товарных остатков по складам и организациям на дату. (например: inventory_on_hand_as_of_date, inventory_positions_by_warehouse).\n6. Ограничения: Операции, которые ассистент не выполняет в этом рантайме. (например: explain_boundary, suggest_safe_next_step).\nЕсли хотите, раскрою любую группу точечно и дам готовую формулировку запроса.\nЧто не делаю: не настраиваю 1С, не меняю конфигурацию, не создаю и не провожу документы, не выполняю админ-действия на сервере.", + "reply_type": "factual_with_explanation", + "created_at": "2026-04-16T18:03:50.437Z", + "trace_id": "chat-VT_eKURHUm", + "debug": { + "trace_id": "chat-VT_eKURHUm", + "prompt_version": "living_chat_router_v1", + "schema_version": "living_chat_router_v1", + "fallback_type": "none", + "detected_mode": "chat", + "detected_mode_confidence": "high", + "execution_lane": "living_chat", + "living_router_mode": "chat", + "living_router_reason": "assistant_capability_query_detected", + "living_chat_response_source": "deterministic_capability_contract", + "living_chat_script_guard_applied": false, + "living_chat_script_guard_reason": null, + "living_chat_grounding_guard_applied": false, + "living_chat_grounding_guard_reason": null, + "living_chat_data_scope_probe_status": null, + "living_chat_data_scope_probe_channel": null, + "living_chat_data_scope_probe_org_count": 0, + "living_chat_data_scope_probe_organizations": [], + "living_chat_data_scope_probe_error": null, + "living_chat_selected_organization": null, + "assistant_known_organizations": [], + "assistant_active_organization": null, + "address_llm_predecompose_attempted": true, + "address_llm_predecompose_applied": false, + "address_llm_predecompose_reason": "normalized_fragment_rejected_semantic_guard", + "address_llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "расскажи что можешь интересного", + "canonical_message": "расскажи что можешь интересного", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "address_semantic_extraction_contract": { + "schema_version": "address_semantic_extraction_contract_v1", + "source_message": "расскажи что можешь интересного", + "canonical_message": "расскажи что можешь интересного", + "canonical_rewrite_applied": false, + "extraction": { + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "aggregation_profile": "unknown" + }, + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "guard_hints": { + "source_data_signal_detected": false, + "canonical_data_signal_detected": false, + "data_scope_meta_query_detected": false, + "deep_investigation_signal_detected": false, + "required_anchor_missing": false, + "unsupported_low_confidence": true, + "semantic_drift_suspected": false + }, + "quality": "low", + "valid": false, + "apply_canonical_recommended": false, + "reason_codes": [ + "unsupported_low_confidence_contract" + ] + }, + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": "capability", + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "final_decision": { + "run_address_lane": false, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "assistant_capability_query_detected", + "living_mode": "chat", + "living_reason": "assistant_capability_query_detected" + } + }, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "assistant_capability_query_detected", + "normalized": null, + "normalizer_output": null + } + }, + { + "message_id": "msg-3hhgkGqEd2", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "кайф - что там на складе по остаткам?", + "reply_type": null, + "created_at": "2026-04-16T18:04:09.232Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-_YGK34Sgjq", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "На 16.04.2026 на складе подтверждено 11 позиций с остатком на 716.418,33 ₽.\n\nПозиции:\n1. Модуль прямоугольый 1400*110*750 | склад: Основной склад | количество: 22,000 | стоимость: 148.261,67 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n2. Конструкция трансформер рабочей станции 1300*900*2000 | склад: Основной склад | количество: 3,000 | стоимость: 498.472,50 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n3. Диван трехместный | склад: Основной склад | количество: 1,000 | стоимость: 34.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n4. Кресло орион | склад: Основной склад | количество: 1,000 | стоимость: 13.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n5. Зеркало для инвалидов поворотное травмобезопасное | склад: Основной склад | количество: 1,000 | стоимость: 7.250,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n6. Пуф арий | склад: Основной склад | количество: 1,000 | стоимость: 6.490,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n7. Столешница 600*3050*26 дуб ниагара | склад: Основной склад | количество: 1,000 | стоимость: 3.724,17 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n8. Столешница 600*3050*26 альмандин | склад: Основной склад | количество: 1,000 | стоимость: 3.075,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n9. Четки Пост (84*117) | склад: Основной склад | количество: 1,000 | стоимость: 833,33 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n10. Кромка с клеем 33 альмандин 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n11. Кромка с клеем 33 дуб ниагара 137 м | склад: Основной склад | количество: 1,000 | стоимость: 165,83 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2026-04-16T23:59:59Z\n\nПодтверждение:\n- Дата среза: 16.04.2026.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 11.\n- Уникальных складов: 1.\n- Суммарное количество: 34,000.", + "reply_type": "factual", + "created_at": "2026-04-16T18:04:18.998Z", + "trace_id": "address-O5DDue9wvg", + "debug": { + "trace_id": "address-O5DDue9wvg", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "inventory_on_hand_as_of_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "as_of_date": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_on_hand_as_of_date_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "unknown", + "anchor_value_raw": null, + "anchor_value_resolved": null, + "resolver_confidence": "low", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 11, + "raw_rows_received": 11, + "rows_after_account_scope": 11, + "rows_after_recipe_filter": 11, + "rows_materialized": 11, + "rows_matched": 11, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Номенклатура", + "Склад", + "Организация", + "Количество", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "strong", + "balance_confirmed": true, + "as_of_date_basis": "implicit_current_snapshot", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_on_hand_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": true, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "ogyZCTg8ZhpjNq", + "llm_decomposition_effective_message": "покажи остатки на складе", + "llm_decomposition_reason": "normalized_fragment_applied", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "кайф - что там на складе по остаткам?", + "canonical_message": "покажи остатки на складе", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "inventory_on_hand_as_of_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": null, + "period_to": null, + "as_of_date": "2026-04-16", + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "кайф - что там на складе по остаткам?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "inventory_on_hand_as_of_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "кайф - что там на складе по остаткам?", + "effective_message": "покажи остатки на складе", + "decision": "new_topic", + "decision_reasons": [ + "effective_message_rewritten_by_predecompose", + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "inventory_on_hand_as_of_date", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "ogyZCTg8ZhpjNq", + "prompt_version": "normalizer_v2_0_2", + "applied": true, + "effective_message": "покажи остатки на складе" + }, + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T1", + "transition_contract_title": "Root Query Entry", + "transition_contract_reason": [ + "capability_contract_root_or_new_entry" + ], + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T1", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ] + }, + "state_transition_id": "T1", + "state_transition_status": "applied", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ] + }, + "capability_binding_status": "bound", + "capability_binding_action": "allow", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "allow", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "confirmed_balance_exact_inventory_intent", + "organization_grounded_from_observed_rows" + ] + } + } + }, + { + "message_id": "msg-F4JUqfxV_D", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "а исторические остатки на другие даты умеешь?", + "reply_type": null, + "created_at": "2026-04-16T18:04:56.183Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-1x6MNtpv8_", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Да, могу. Сейчас мы уже смотрели складской срез по компании «ООО \\Альтернатива Плюс\\» на 16.04.2026.\nМогу показать исторические остатки по компании «ООО \\Альтернатива Плюс\\» за нужный месяц, дату или год.\nНапример:\n- `на март 2020`\n- `на июнь 2016`\n- `за 2017 год`\n- `сравни июнь 2016 с текущим срезом`\nЕсли хочешь, сразу покажу нужный исторический период.", + "reply_type": "factual_with_explanation", + "created_at": "2026-04-16T18:05:07.453Z", + "trace_id": "chat-0WSE0Sb-4l", + "debug": { + "trace_id": "chat-0WSE0Sb-4l", + "prompt_version": "living_chat_router_v1", + "schema_version": "living_chat_router_v1", + "fallback_type": "none", + "detected_mode": "chat", + "detected_mode_confidence": "high", + "execution_lane": "living_chat", + "living_router_mode": "chat", + "living_router_reason": "inventory_history_capability_followup_detected", + "living_chat_response_source": "deterministic_inventory_history_capability_contract", + "living_chat_script_guard_applied": false, + "living_chat_script_guard_reason": null, + "living_chat_grounding_guard_applied": false, + "living_chat_grounding_guard_reason": null, + "living_chat_data_scope_probe_status": null, + "living_chat_data_scope_probe_channel": null, + "living_chat_data_scope_probe_org_count": 0, + "living_chat_data_scope_probe_organizations": [], + "living_chat_data_scope_probe_error": null, + "living_chat_selected_organization": null, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_llm_predecompose_attempted": true, + "address_llm_predecompose_applied": true, + "address_llm_predecompose_reason": "normalized_fragment_applied", + "address_llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "а исторические остатки на другие даты умеешь?", + "canonical_message": "проверка возможности просмотра исторических остатков по произвольным датам", + "mode": "address_query", + "mode_confidence": "medium", + "query_shape": "VERIFY_FACTUAL", + "query_shape_confidence": "medium", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": null, + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "address_semantic_extraction_contract": { + "schema_version": "address_semantic_extraction_contract_v1", + "source_message": "а исторические остатки на другие даты умеешь?", + "canonical_message": "проверка возможности просмотра исторических остатков по произвольным датам", + "canonical_rewrite_applied": true, + "extraction": { + "mode": "address_query", + "mode_confidence": "medium", + "query_shape": "VERIFY_FACTUAL", + "query_shape_confidence": "medium", + "intent": "unknown", + "intent_confidence": "low", + "aggregation_profile": "unknown" + }, + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": null, + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "guard_hints": { + "source_data_signal_detected": false, + "canonical_data_signal_detected": false, + "data_scope_meta_query_detected": false, + "deep_investigation_signal_detected": false, + "required_anchor_missing": false, + "unsupported_low_confidence": false, + "semantic_drift_suspected": false + }, + "quality": "high", + "valid": true, + "apply_canonical_recommended": true, + "reason_codes": [] + }, + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": "capability", + "address_mode": "address_query", + "address_mode_confidence": "medium", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "final_decision": { + "run_address_lane": false, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "inventory_history_capability_followup_detected", + "living_mode": "chat", + "living_reason": "inventory_history_capability_followup_detected" + } + }, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "inventory_history_capability_followup_detected", + "normalized": null, + "normalizer_output": null + } + }, + { + "message_id": "msg-8FukoeHt4P", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "давай на июль 2017", + "reply_type": null, + "created_at": "2026-04-16T18:05:20.985Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-A0lvsGdivq", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "На 31.07.2017 на складе подтверждено 4 позиций с остатком на 1.048.998,35 ₽.\n\nПозиции:\n1. Секция отдельно-стоящая | склад: Основной склад | количество: 39,000 | стоимость: 224.349,15 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2017-07-31T23:59:59Z\n2. Шкаф для одежды 824*437*2010 | склад: Основной склад | количество: 11,000 | стоимость: 117.426,49 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2017-07-31T23:59:59Z\n3. Рабочая станция универсального специалиста (индивидуальное изготовление) | склад: Основной склад | количество: 3,000 | стоимость: 695.360,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2017-07-31T23:59:59Z\n4. Секция приставная для хранения документов из 2 модулей, Тип 4 | склад: Основной склад | количество: 2,000 | стоимость: 11.862,71 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2017-07-31T23:59:59Z\n\nПодтверждение:\n- Дата среза: 31.07.2017.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 4.\n- Уникальных складов: 1.\n- Суммарное количество: 55,000.", + "reply_type": "factual", + "created_at": "2026-04-16T18:05:32.192Z", + "trace_id": "address-JHJsyjDn9D", + "debug": { + "trace_id": "address-JHJsyjDn9D", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "inventory_on_hand_as_of_date", + "detected_intent_confidence": "low", + "extracted_filters": { + "sort": "period_desc", + "period_from": "2017-07-01", + "period_to": "2017-07-31", + "as_of_date": "2017-07-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_on_hand_as_of_date_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 4, + "raw_rows_received": 4, + "rows_after_account_scope": 4, + "rows_after_recipe_filter": 4, + "rows_materialized": 4, + "rows_matched": 4, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Номенклатура", + "Склад", + "Организация", + "Количество", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "strong", + "balance_confirmed": true, + "as_of_date_basis": "period_range", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_on_hand_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "9qkdwNI0u8JucB", + "llm_decomposition_effective_message": "давай на июль 2017", + "llm_decomposition_reason": "followup_raw_message_preferred_over_llm_rewrite", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "давай на июль 2017", + "canonical_message": "давай на июль 2017", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "range", + "period_from": "2017-07-01", + "period_to": "2017-07-31", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "none", + "anchor_kind": "none", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": false, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "давай на июль 2017", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "followup_context_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract", + "rewrite_without_structured_gain" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": false, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": true + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "followup_context_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "давай на июль 2017", + "effective_message": "давай на июль 2017", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected" + ], + "followup_context_applied": true, + "previous_intent": "inventory_on_hand_as_of_date", + "target_intent": "inventory_on_hand_as_of_date", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "unknown", + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "9qkdwNI0u8JucB", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "давай на июль 2017" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "inventory_root", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2026-04-16", + "period_from": null, + "period_to": null + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T2", + "transition_contract_title": "Root Follow-Up With Date Or Scope Change", + "transition_contract_reason": [ + "root_followup_continue_previous" + ], + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T2", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "state_transition_id": "T2", + "state_transition_status": "applied", + "effective_carryover_depth": "root_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T2", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T2", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "capability_binding_status": "bound", + "capability_binding_action": "allow", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "allow", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + } + } + }, + { + "message_id": "msg-1zWl13u0WI", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "март 2016", + "reply_type": null, + "created_at": "2026-04-16T18:05:47.514Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-lp9pIove6w", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "На 31.03.2016 на складе подтверждено 2 позиций с остатком на 812.786,49 ₽.\n\nПозиции:\n1. Шкаф для одежды 824*437*2010 | склад: Основной склад | количество: 11,000 | стоимость: 117.426,49 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2016-03-31T23:59:59Z\n2. Рабочая станция универсального специалиста (индивидуальное изготовление) | склад: Основной склад | количество: 3,000 | стоимость: 695.360,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | дата строки: 2016-03-31T23:59:59Z\n\nПодтверждение:\n- Дата среза: 31.03.2016.\n- Контур: остатки по счету 41.01 «Товары на складах».\n- Уникальных товаров: 2.\n- Уникальных складов: 1.\n- Суммарное количество: 14,000.", + "reply_type": "factual", + "created_at": "2026-04-16T18:05:58.615Z", + "trace_id": "address-K_O2TN2RgO", + "debug": { + "trace_id": "address-K_O2TN2RgO", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "inventory_on_hand_as_of_date", + "detected_intent_confidence": "low", + "extracted_filters": { + "sort": "period_desc", + "period_from": "2016-03-01", + "period_to": "2016-03-31", + "as_of_date": "2016-03-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_on_hand_as_of_date_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 2, + "raw_rows_received": 2, + "rows_after_account_scope": 2, + "rows_after_recipe_filter": 2, + "rows_materialized": 2, + "rows_matched": 2, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Номенклатура", + "Склад", + "Организация", + "Количество", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "strong", + "balance_confirmed": true, + "as_of_date_basis": "period_range", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_on_hand_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "7XTKzZ9YI2GeHk", + "llm_decomposition_effective_message": "март 2016", + "llm_decomposition_reason": "normalized_fragment_rejected_semantic_guard", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "март 2016", + "canonical_message": "март 2016", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "range", + "period_from": "2016-03-01", + "period_to": "2016-03-31", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "март 2016", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "followup_context_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": false, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": false, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": true + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "followup_context_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "март 2016", + "effective_message": "март 2016", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected" + ], + "followup_context_applied": true, + "previous_intent": "inventory_on_hand_as_of_date", + "target_intent": "inventory_on_hand_as_of_date", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "7XTKzZ9YI2GeHk", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "март 2016" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "inventory_root", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2017-07-31", + "period_from": "2017-07-01", + "period_to": "2017-07-31" + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T2", + "transition_contract_title": "Root Follow-Up With Date Or Scope Change", + "transition_contract_reason": [ + "root_followup_continue_previous" + ], + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T2", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "state_transition_id": "T2", + "state_transition_status": "applied", + "effective_carryover_depth": "root_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T2", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T2", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + }, + "capability_binding_status": "bound", + "capability_binding_action": "allow", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "allow", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent" + ] + } + } + }, + { + "message_id": "msg--4SYh61CVE", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "reply_type": null, + "created_at": "2026-04-16T18:06:20.751Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-lGYvANeRvu", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "По позиции Рабочая станция универсального специалиста (индивидуальное изготовление) до 16.04.2026 однозначный поставщик не подтвержден: в документах встречаются Авант мебель, ООО; ПромЭлитКонсалт, ООО; ГТК-Интер, ООО.\n\nПодтверждение:\n- Первая найденная дата закупки: 05.02.2015.\n- Последняя найденная дата закупки: 22.07.2015.\n- Документов поступления: 7.\n- Операций поступления: 7.\n- Поставщики в найденных документах: Авант мебель, ООО; ПромЭлитКонсалт, ООО; ГТК-Интер, ООО.\n- Для ответа учтены закупочные документы не позже 16.04.2026.\n- Без партионного учета нельзя однозначно связать остаток на 16.04.2026 с одним конкретным поступлением.\n\nОпорные документы:\n1. Поступление товаров и услуг 00000000101 от 22.07.2015 12:00:02 | дата: 22.07.2015 | сумма: 695.360,00 ₽ | организация: ООО \\Альтернатива Плюс\\\n2. Поступление товаров и услуг 00000000047 от 24.02.2015 12:03:34 | дата: 24.02.2015 | сумма: 2.989.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: Авант мебель, ООО\n3. Поступление товаров и услуг 00000000025 от 24.02.2015 12:03:32 | дата: 24.02.2015 | сумма: 20.510.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: ПромЭлитКонсалт, ООО\n4. Поступление товаров и услуг 00000000024 от 17.02.2015 13:41:08 | дата: 17.02.2015 | сумма: 13.052.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: ПромЭлитКонсалт, ООО\n5. Поступление товаров и услуг 00000000045 от 06.02.2015 12:00:05 | дата: 06.02.2015 | сумма: 24.320.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: ГТК-Интер, ООО\n6. Поступление товаров и услуг 00000000028 от 05.02.2015 12:00:09 | дата: 05.02.2015 | сумма: 2.065.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\\n7. Поступление товаров и услуг 00000000023 от 05.02.2015 0:00:00 | дата: 05.02.2015 | сумма: 15.504.000,00 ₽ | организация: ООО \\Альтернатива Плюс\\ | контрагент: ГТК-Интер, ООО", + "reply_type": "factual", + "created_at": "2026-04-16T18:06:33.141Z", + "trace_id": "address-Z0e_naq-jH", + "debug": { + "trace_id": "address-Z0e_naq-jH", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "inventory_purchase_provenance_for_item", + "detected_intent_confidence": "medium", + "extracted_filters": { + "sort": "period_desc", + "item": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_purchase_provenance_for_item_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "item", + "anchor_value_raw": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "anchor_value_resolved": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 7, + "raw_rows_received": 7, + "rows_after_account_scope": 7, + "rows_after_recipe_filter": 7, + "rows_materialized": 7, + "rows_matched": 7, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Номенклатура", + "Контрагент", + "Договор", + "Организация", + "Количество", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_SUMMARY", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "medium", + "balance_confirmed": true, + "as_of_date_basis": "period_end", + "capability_id": "inventory_inventory_purchase_provenance_for_item", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_trace_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_purchase_provenance_for_item_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "2yijFRweSypJsT", + "llm_decomposition_effective_message": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_drop", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "canonical_message": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "mode": "address_query", + "mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "inventory_purchase_provenance_for_item", + "intent_confidence": "medium", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "selected_object_scope", + "anchor_kind": "item", + "anchor_value": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "date_scope_kind": "none", + "date_basis_hint": null, + "self_scope_detected": false, + "selected_object_scope_detected": true + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "по выбранному объекту \"рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "medium", + "address_intent": "inventory_purchase_provenance_for_item", + "address_intent_confidence": "medium", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": true, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "effective_message": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "inventory_on_hand_as_of_date", + "target_intent": "inventory_purchase_provenance_for_item", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "2yijFRweSypJsT", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "inventory_root", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2016-03-31", + "period_from": "2016-03-01", + "period_to": "2016-03-31" + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T4", + "transition_contract_title": "Short Action Follow-Up On Selected Object", + "transition_contract_reason": [ + "selected_object_capability_continue_previous" + ], + "capability_contract_id": "inventory_inventory_purchase_provenance_for_item", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "object_only" + }, + "transition_contract_id": "T4", + "capability_contract_id": "inventory_inventory_purchase_provenance_for_item", + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "medium", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "inventory_inventory_purchase_provenance_for_item", + "transition_contract_id": "T4", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "medium", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "inventory_inventory_purchase_provenance_for_item", + "transition_contract_id": "T4", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T4", + "transition_title": "Short Action Follow-Up On Selected Object", + "application_status": "applied", + "declared_carryover_depth": "object_only", + "truth_gate_carryover_depth": "object_only", + "effective_carryover_depth": "object_only", + "required_prior_state": [ + "selected_object_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "reuse_selected_object_frame_state", + "route_to_compatible_item_action" + ], + "forbidden_carryover": [ + "generic_chat_fallback", + "data_scope_selection_fallback", + "object_focus_reset" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "reuse", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "medium", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T4", + "transition_title": "Short Action Follow-Up On Selected Object", + "application_status": "applied", + "declared_carryover_depth": "object_only", + "truth_gate_carryover_depth": "object_only", + "effective_carryover_depth": "object_only", + "required_prior_state": [ + "selected_object_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "reuse_selected_object_frame_state", + "route_to_compatible_item_action" + ], + "forbidden_carryover": [ + "generic_chat_fallback", + "data_scope_selection_fallback", + "object_focus_reset" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "reuse", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "medium", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": "T4", + "state_transition_status": "applied", + "effective_carryover_depth": "object_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "inventory_inventory_purchase_provenance_for_item", + "capability_contract_id": "inventory_inventory_purchase_provenance_for_item", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T4", + "transition_allowed": true, + "required_anchors": [ + "item" + ], + "provided_anchors": [ + "sort", + "item", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": true, + "focus_object_binding_status": "inferred_from_anchor", + "result_shape": "supplier_purchase_provenance_trace", + "answer_object_shape": "inventory_provenance_bundle", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "inventory_inventory_purchase_provenance_for_item", + "capability_contract_id": "inventory_inventory_purchase_provenance_for_item", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T4", + "transition_allowed": true, + "required_anchors": [ + "item" + ], + "provided_anchors": [ + "sort", + "item", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": true, + "focus_object_binding_status": "inferred_from_anchor", + "result_shape": "supplier_purchase_provenance_trace", + "answer_object_shape": "inventory_provenance_bundle", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "bound", + "capability_binding_action": "allow", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "allow", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "selected_object_inventory_followup_detected", + "shape_not_detected", + "inventory_selected_object_provenance_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-FpMh_3EPEI", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "а кому продали?", + "reply_type": null, + "created_at": "2026-04-16T18:06:56.507Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-ENroQsN_nr", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "По товару Конструкция трансформер рабочей станции. Тип 2. покупатель определен: Рабочая станция универсального специалиста (индивидуальное изготовление).\n\nПодтверждение:\n- Первая найденная дата выбытия: 09.02.2015.\n- Последняя найденная дата выбытия: 14.08.2018.\n- Документов выбытия: 7.\n- Операций выбытия: 7.\n- По доступным движениям товар отгружался покупателю: Рабочая станция универсального специалиста (индивидуальное изготовление).\n\nДокументы выбытия:\n1. Комплектация номенклатуры 00000000003 от 14.08.2018 12:00:02 | дата: 14.08.2018 | сумма: 695.360,00 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | контрагент: Рабочая станция универсального специалиста (индивидуальное изготовление)\n2. Реализация товаров и услуг 00000000012 от 25.02.2015 12:00:00 | дата: 25.02.2015 | сумма: 9.957.203,39 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | контрагент: Рабочая станция универсального специалиста (индивидуальное изготовление)\n3. Реализация товаров и услуг 00000000011 от 25.02.2015 11:59:34 | дата: 25.02.2015 | сумма: 9.957.203,39 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | контрагент: Рабочая станция универсального специалиста (индивидуальное изготовление)\n4. Реализация товаров и услуг 00000000009 от 18.02.2015 12:48:00 | дата: 18.02.2015 | сумма: 11.061.016,95 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | контрагент: Рабочая станция универсального специалиста (индивидуальное изготовление)\n5. Реализация товаров и услуг 00000000006 от 09.02.2015 12:00:42 | дата: 09.02.2015 | сумма: 13.235.665,07 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | контрагент: Рабочая станция универсального специалиста (индивидуальное изготовление)\n6. Реализация товаров и услуг 00000000005 от 09.02.2015 12:00:34 | дата: 09.02.2015 | сумма: 9.342.822,40 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | контрагент: Рабочая станция универсального специалиста (индивидуальное изготовление)\n7. Реализация товаров и услуг 00000000004 от 09.02.2015 12:00:14 | дата: 09.02.2015 | сумма: 13.235.665,07 ₽ | склад: Основной склад | организация: ООО \\Альтернатива Плюс\\ | контрагент: Рабочая станция универсального специалиста (индивидуальное изготовление)", + "reply_type": "factual", + "created_at": "2026-04-16T18:07:09.604Z", + "trace_id": "address-SsfxVvwwfZ", + "debug": { + "trace_id": "address-SsfxVvwwfZ", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "inventory_sale_trace_for_item", + "detected_intent_confidence": "low", + "extracted_filters": { + "sort": "period_desc", + "organization": "ООО \\Альтернатива Плюс\\", + "item": "Рабочая станция универсального специалиста (индивидуальное изготовление)" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_sale_trace_for_item_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "item", + "anchor_value_raw": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "anchor_value_resolved": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 7, + "raw_rows_received": 7, + "rows_after_account_scope": 7, + "rows_after_recipe_filter": 7, + "rows_materialized": 7, + "rows_matched": 7, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "СубконтоДт1", + "СубконтоДт2", + "СубконтоДт3", + "СубконтоКт1", + "СубконтоКт2", + "СубконтоКт3", + "Организация", + "Period", + "Registrator", + "AccountDt", + "AccountKt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "strong", + "balance_confirmed": true, + "as_of_date_basis": "implicit_current_snapshot", + "capability_id": "inventory_inventory_sale_trace_for_item", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_trace_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_sale_trace_for_item_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "YFoqfty_eSFNKN", + "llm_decomposition_effective_message": "а кому продали?", + "llm_decomposition_reason": "followup_raw_message_preferred_over_llm_rewrite", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "а кому продали?", + "canonical_message": "а кому продали?", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "none", + "anchor_kind": "none", + "anchor_value": null, + "date_scope_kind": "none", + "date_basis_hint": null, + "self_scope_detected": false, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "а кому продали?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_signal_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": false, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": true + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_signal_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "а кому продали?", + "effective_message": "а кому продали?", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected" + ], + "followup_context_applied": true, + "previous_intent": "inventory_purchase_provenance_for_item", + "target_intent": "inventory_purchase_provenance_for_item", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "item", + "anchor_value": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "YFoqfty_eSFNKN", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "а кому продали?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "inventory_drilldown", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2016-03-31", + "period_from": "2016-03-01", + "period_to": "2016-03-31" + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T4", + "transition_contract_title": "Short Action Follow-Up On Selected Object", + "transition_contract_reason": [ + "selected_object_capability_continue_previous" + ], + "capability_contract_id": "inventory_inventory_sale_trace_for_item", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "object_only" + }, + "transition_contract_id": "T4", + "capability_contract_id": "inventory_inventory_sale_trace_for_item", + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "inventory_inventory_sale_trace_for_item", + "transition_contract_id": "T4", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": "inventory_inventory_sale_trace_for_item", + "transition_contract_id": "T4", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T4", + "transition_title": "Short Action Follow-Up On Selected Object", + "application_status": "applied", + "declared_carryover_depth": "object_only", + "truth_gate_carryover_depth": "object_only", + "effective_carryover_depth": "object_only", + "required_prior_state": [ + "selected_object_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "reuse_selected_object_frame_state", + "route_to_compatible_item_action" + ], + "forbidden_carryover": [ + "generic_chat_fallback", + "data_scope_selection_fallback", + "object_focus_reset" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "reuse", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T4", + "transition_title": "Short Action Follow-Up On Selected Object", + "application_status": "applied", + "declared_carryover_depth": "object_only", + "truth_gate_carryover_depth": "object_only", + "effective_carryover_depth": "object_only", + "required_prior_state": [ + "selected_object_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "reuse_selected_object_frame_state", + "route_to_compatible_item_action" + ], + "forbidden_carryover": [ + "generic_chat_fallback", + "data_scope_selection_fallback", + "object_focus_reset" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "reuse", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "object_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": "T4", + "state_transition_status": "applied", + "effective_carryover_depth": "object_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "inventory_inventory_sale_trace_for_item", + "capability_contract_id": "inventory_inventory_sale_trace_for_item", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T4", + "transition_allowed": true, + "required_anchors": [ + "item" + ], + "provided_anchors": [ + "sort", + "organization", + "item", + "selected_object" + ], + "missing_anchors": [], + "requires_focus_object": true, + "focus_object_binding_status": "bound", + "result_shape": "buyer_sale_trace_for_selected_item", + "answer_object_shape": "inventory_sale_trace_bundle", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "inventory_inventory_sale_trace_for_item", + "capability_contract_id": "inventory_inventory_sale_trace_for_item", + "binding_status": "bound", + "binding_action": "allow", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T4", + "transition_allowed": true, + "required_anchors": [ + "item" + ], + "provided_anchors": [ + "sort", + "organization", + "item", + "selected_object" + ], + "missing_anchors": [], + "requires_focus_object": true, + "focus_object_binding_status": "bound", + "result_shape": "buyer_sale_trace_for_selected_item", + "answer_object_shape": "inventory_sale_trace_bundle", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "bound", + "capability_binding_action": "allow", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "allow", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_bound", + "binding_action_allow", + "transition_status_applied", + "transition_T4", + "selected_object_capability_continue_previous", + "debug_capability_id_matched_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_adjusted_to_inventory_followup_context", + "organization_from_followup_context", + "item_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-sp1iRCE5Vm", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "у тебя написано кто контрагент: рабочая станция - это ошибка?", + "reply_type": null, + "created_at": "2026-04-16T18:08:24.053Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-8fMZZYjc9y", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Чтобы ответ был точным, нужно чуть сильнее заякорить запрос.\n\nДля точного ответа нужен хотя бы один явный ориентир: контрагент, договор, счет или период.\n\nСигнал запроса: нужен срез документов/платежей по контрагенту.\n\nКонтекст запроса: организация ООО \\Альтернатива Плюс\\.\n\nЧто могу сделать сейчас: показать документы и платежи по контрагенту в документе; показать незакрытые договоры или хвосты на дату; уточните точное имя контрагента или добавьте ИНН.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:08:43.447Z", + "trace_id": "address-VSLiSRyzL5", + "debug": { + "trace_id": "address-VSLiSRyzL5", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "VERIFY_FACTUAL", + "query_shape_confidence": "medium", + "detected_intent": "list_documents_by_counterparty", + "detected_intent_confidence": "medium", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "counterparty": "в документе", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_documents_by_counterparty_v1", + "mcp_call_status_legacy": "materialized_but_not_matched", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "counterparty", + "anchor_value_raw": "в документе", + "anchor_value_resolved": "в документе", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "materialized_but_not_anchor_matched", + "match_failure_reason": "counterparty_anchor_not_matched_in_materialized_rows", + "mcp_call_status": "materialized_but_not_anchor_matched", + "rows_fetched": 1000, + "raw_rows_received": 1000, + "rows_after_account_scope": 124, + "rows_after_recipe_filter": 0, + "rows_materialized": 124, + "rows_matched": 0, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Контрагент", + "Договор", + "Period", + "Registrator", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": "missing_anchor", + "response_type": "LIMITED_WITH_REASON", + "capability_id": "documents_drilldown", + "capability_layer": "navigation", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "drilldown_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_documents_by_counterparty_v1" + ], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [ + "heuristic_candidates", + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": true, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "R0opDtHZy6sKpO", + "llm_decomposition_effective_message": "Проверить, является ли 'рабочая станция' корректным значением для поля контрагент в документе", + "llm_decomposition_reason": "normalized_fragment_applied", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "у тебя написано кто контрагент: рабочая станция - это ошибка?", + "canonical_message": "Проверить, является ли 'рабочая станция' корректным значением для поля контрагент в документе", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "VERIFY_FACTUAL", + "query_shape_confidence": "medium", + "intent": "list_documents_by_counterparty", + "intent_confidence": "medium", + "entities": { + "account": null, + "counterparty": "в документе", + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "list_lookup" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "у тебя написано кто контрагент: рабочая станция - это ошибка?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "list_documents_by_counterparty", + "address_intent_confidence": "medium", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "у тебя написано кто контрагент: рабочая станция - это ошибка?", + "effective_message": "Проверить, является ли 'рабочая станция' корректным значением для поля контрагент в документе", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "effective_message_rewritten_by_predecompose", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "inventory_sale_trace_for_item", + "target_intent": "list_documents_by_counterparty", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "item", + "anchor_value": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": true, + "reason": "limited_result_retry_with_raw_message", + "initial_limited_category": "missing_anchor", + "retry_message": "у тебя написано кто контрагент: рабочая станция - это ошибка?", + "retry_used_followup_context": true, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "R0opDtHZy6sKpO", + "prompt_version": "normalizer_v2_0_2", + "applied": true, + "effective_message": "Проверить, является ли 'рабочая станция' корректным значением для поля контрагент в документе" + }, + "address_followup_offer": { + "enabled": true, + "source_intent": "list_documents_by_counterparty", + "anchor_type": "counterparty", + "anchor_value": "в документе", + "suggested_intents": [ + "bank_operations_by_counterparty", + "list_contracts_by_counterparty" + ] + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "inventory_drilldown", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2016-03-31", + "period_from": "2016-03-01", + "period_to": "2016-03-31" + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T7", + "transition_contract_title": "Clarification Continuation", + "transition_contract_reason": [ + "missing_anchor_or_filter_requires_clarification" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "blocked_missing_anchor", + "carryover_eligibility": "none" + }, + "transition_contract_id": "T7", + "capability_contract_id": null, + "truth_gate_contract_status": "blocked_missing_anchor", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "blocked_missing_anchor", + "blocked_or_limited_explanation": "required_anchor_missing" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "clarification_required", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": "T7", + "may_state_confirmed_facts": false, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "clarifying_question", + "missing_anchors" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "blocked_missing_anchor", + "blocked_or_limited_explanation": "required_anchor_missing" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "clarification_required", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": "T7", + "may_state_confirmed_facts": false, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "clarifying_question", + "missing_anchors" + ], + "downgrade_only": true + }, + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "answer_shape": "clarification_required", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T7", + "transition_title": "Clarification Continuation", + "application_status": "clarification_required", + "declared_carryover_depth": "full", + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "full", + "required_prior_state": [ + "clarification_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "resume_target_route", + "update_or_clear_clarification_state" + ], + "forbidden_carryover": [ + "forget_suspended_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "preserve", + "meta_frame_state": "none", + "clarification_state": "update", + "coverage_gate_state": "create", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T7", + "transition_title": "Clarification Continuation", + "application_status": "clarification_required", + "declared_carryover_depth": "full", + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "full", + "required_prior_state": [ + "clarification_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "resume_target_route", + "update_or_clear_clarification_state" + ], + "forbidden_carryover": [ + "forget_suspended_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "preserve", + "meta_frame_state": "none", + "clarification_state": "update", + "coverage_gate_state": "create", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": "T7", + "state_transition_status": "clarification_required", + "effective_carryover_depth": "full", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "documents_drilldown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T7", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "counterparty", + "organization", + "selected_object" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "documents_drilldown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T7", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "counterparty", + "organization", + "selected_object" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_counterparty_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-lyOHJmjJGk", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "ндс можешь прикинуть на дату покупки рабочей станции?", + "reply_type": null, + "created_at": "2026-04-16T18:09:18.156Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-NEIdJ6wMYe", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Собран прогноз НДС к уплате: **0,00** ₽.\nПотенциальный перенос/переплата: **27.863,80** ₽.\nПериод оценки: не задан (использован доступный срез).\nРежим результата: предварительная оценка по проводкам 68.02*/19* (не подтвержденная сумма налога по декларации).\n\nБаза расчета:\n- Строк агрегата: **4**.\n- Оборот по кредиту 68*: **49.572.522,94** ₽.\n- Оборот по дебету 68*: **49.600.386,74** ₽.\n- Нетто НДС (**68** Кт - **68** Дт): -**27.863,80** ₽.\n- Справочно по 19*: дебет **44.507.658,46** ₽, кредит **44.506.925,13** ₽.\nВ выбранном окне дебет 68* превышает кредит 68*; сумма показана как перенос/переплата, к уплате **0,00** ₽.\n\nЧеклист проверки в 1С (почему к уплате **0**):\n1) Проверьте ОСВ/анализ счета по **68.02** и **19** за окно расчета.\n2) Проверьте наличие движений в РегистрБухгалтерии.Хозрасчетный по счетам 68.02*/19* (включая субсчета).\n3) Сверьте счета-фактуры, корректировки и момент принятия НДС к вычету (не попали ли в другой период).\n4) Сверьте книгу продаж/покупок и операции Помощника по учету НДС за тот же период.\n5) Убедитесь, что документы проведены, период закрыт корректно и нет неподтвержденных/неперепроведенных документов.", + "reply_type": "factual", + "created_at": "2026-04-16T18:09:32.118Z", + "trace_id": "address-tVGDq3QIkr", + "debug": { + "trace_id": "address-tVGDq3QIkr", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "vat_payable_forecast", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "period_to": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_vat_payable_forecast_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 4, + "raw_rows_received": 4, + "rows_after_account_scope": 4, + "rows_after_recipe_filter": 4, + "rows_materialized": 4, + "rows_matched": 4, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_SUMMARY", + "capability_id": "address_vat_payable_forecast", + "capability_layer": "conversational", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "generic_address_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_vat_payable_forecast_v1" + ], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "wFStR3bXvA-vXh", + "llm_decomposition_effective_message": "ндс можешь прикинуть на дату покупки рабочей станции?", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_conflict", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "ндс можешь прикинуть на дату покупки рабочей станции?", + "canonical_message": "ндс можешь прикинуть на дату покупки рабочей станции?", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "vat_payable_forecast", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": "2026-04-16", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_end", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "management_profile" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "ндс можешь прикинуть на дату покупки рабочей станции?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "vat_payable_forecast", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": false, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": true, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "ндс можешь прикинуть на дату покупки рабочей станции?", + "effective_message": "ндс можешь прикинуть на дату покупки рабочей станции?", + "decision": "new_topic", + "decision_reasons": [ + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "vat_payable_forecast", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "wFStR3bXvA-vXh", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "ндс можешь прикинуть на дату покупки рабочей станции?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_vat_payable_forecast", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_vat_payable_forecast", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-q7ZtWYG_4i", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "а какой ндс мы должны сгрузить на март 2020?", + "reply_type": null, + "created_at": "2026-04-16T18:10:10.155Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-7gpm1aaBvO", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Итого подтвержденный долг на 31.03.2020: **5.857.292,88** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез обязательств к оплате.\n\nБлок **2**. Что учтено\n- Дата среза: 31.03.2020.\n- Контур: обязательства по счетам 60/76.\n- В срез могут входить обязательства, возникшие до периода, если они оставались открытыми на дату среза.\n\nБлок **3**. Сводка\n- Строк в выборке: **11**.\n- Контрагентов с подтвержденным остатком к оплате: **8**.\n\nБлок **4**. Категории обязательств\n- поставщики/подрядчики: **6**.\n- банки/кредиты: **0**.\n- налоги/госорганы: **2**.\n- прочие: **0**.\n\nБлок **5**. Подтвержденные позиции к оплате\n1. Комитет государственных услуг г. Москвы | категория: налоги/госорганы | остаток: **3.677.454,14** ₽ | операций: **1** | последнее движение: 2020-03-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки\n\n2. Гамма-мебель, ООО | категория: поставщики/подрядчики | остаток: **1.275.000,00** ₽ | операций: **3** | последнее движение: 2020-03-31T23:59:59Z | основание: участие счета **60**, коммерческий контрагент в аналитике | договор: Договор № **3** от 08.04.2019 г. | документ: Остатки на дату | source refs: Поступление товаров и услуг **00000000104** от 20.12.2019 0:00:00; Поступление на расчетный счет **00000000069** от 11.12.2019 12:35:33\n\n3. ГКУ | категория: поставщики/подрядчики | остаток: **773.953,04** ₽ | операций: **2** | последнее движение: 2020-03-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ГКУ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки; Финансовое обеспечение контракта\n\n4. Финансовое обеспечение заявки | категория: налоги/госорганы | остаток: **115.185,00** ₽ | операций: **1** | последнее движение: 2020-03-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату\n\n5. Авант мебель, ООО | категория: поставщики/подрядчики | остаток: **7.271,20** ₽ | операций: **1** | последнее движение: 2020-03-31T23:59:59Z | основание: участие счета **60**, коммерческий контрагент в аналитике | договор: Договор АМ-2/15 от 22.01.15 | документ: Остатки на дату | source refs: Поступление товаров и услуг **00000000047** от 24.02.2015 12:03:34\n\n6. Держава АКБ, ПАО | категория: поставщики/подрядчики | остаток: **6.200,00** ₽ | операций: **1** | последнее движение: 2020-03-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: Договор № БГ 155822/2017 от 08.11.17 заявка **145822** | документ: Остатки на дату | source refs: Поступление товаров и услуг **00000000036** от 14.11.2017 0:00:00\n\n7. Скартел, ООО | категория: поставщики/подрядчики | остаток: **1.400,00** ₽ | операций: **1** | последнее движение: 2020-03-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Лицевой счет абонента № **1025043208**; Поступление товаров и услуг **00000000003** от 31.03.2020 12:00:02\n\n8. КОМПАНИЯ СИМПЛ, ООО | категория: поставщики/подрядчики | остаток: **829,50** ₽ | операций: **1** | последнее движение: 2020-03-31T23:59:59Z | основание: участие счета **60**, коммерческий контрагент в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: счет № SL11119332716 от 06.11.2019; Поступление товаров и услуг **00000000116** от 08.11.2019 12:00:02", + "reply_type": "factual", + "created_at": "2026-04-16T18:10:23.897Z", + "trace_id": "address-I9aS_f8fQG", + "debug": { + "trace_id": "address-I9aS_f8fQG", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "payables_confirmed_as_of_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "period_from": "2020-03-01", + "period_to": "2020-03-31", + "as_of_date": "2020-03-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_payables_confirmed_as_of_date_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 11, + "raw_rows_received": 11, + "rows_after_account_scope": 11, + "rows_after_recipe_filter": 11, + "rows_materialized": 11, + "rows_matched": 11, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "СубконтоДт1", + "СубконтоДт2", + "СубконтоДт3", + "СубконтоКт1", + "СубконтоКт2", + "СубконтоКт3", + "Организация", + "Period", + "Registrator", + "AccountKt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "strong", + "balance_confirmed": true, + "as_of_date_basis": "period_range", + "capability_id": "confirmed_payables_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "payables_confirmed_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_payables_confirmed_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "fXZ3mCPV-o04Iy", + "llm_decomposition_effective_message": "а какой ндс мы должны сгрузить на март 2020?", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_conflict", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "а какой ндс мы должны сгрузить на март 2020?", + "canonical_message": "а какой ндс мы должны сгрузить на март 2020?", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "payables_confirmed_as_of_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": "2020-03-01", + "period_to": "2020-03-31", + "as_of_date": "2020-03-31", + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "balance_snapshot" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "а какой ндс мы должны сгрузить на март 2020?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "payables_confirmed_as_of_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "а какой ндс мы должны сгрузить на март 2020?", + "effective_message": "а какой ндс мы должны сгрузить на март 2020?", + "decision": "new_topic", + "decision_reasons": [ + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "payables_confirmed_as_of_date", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "fXZ3mCPV-o04Iy", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "а какой ндс мы должны сгрузить на март 2020?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_payables_as_of_date", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_payables_as_of_date", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + } + } + }, + { + "message_id": "msg-dC97vI8gOT", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "прикинь какой ндс нам надо заплатить на февраль 2017", + "reply_type": null, + "created_at": "2026-04-16T18:11:13.055Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-3D0vP63Rrr", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Собран прогноз НДС к уплате: **0,00** ₽.\nПотенциальный перенос/переплата: **85.834,00** ₽.\nПериод оценки: 01.02.2017..28.02.2017.\nРежим результата: предварительная оценка по проводкам 68.02*/19* (не подтвержденная сумма налога по декларации).\n\nБаза расчета:\n- Строк агрегата: **4**.\n- Оборот по кредиту 68*: **0,00** ₽.\n- Оборот по дебету 68*: **85.834,00** ₽.\n- Нетто НДС (**68** Кт - **68** Дт): -**85.834,00** ₽.\n- Справочно по 19*: дебет **0,00** ₽, кредит **0,00** ₽.\nВ выбранном окне дебет 68* превышает кредит 68*; сумма показана как перенос/переплата, к уплате **0,00** ₽.\n\nЧеклист проверки в 1С (почему к уплате **0**):\n1) Проверьте ОСВ/анализ счета по **68.02** и **19** за окно 01.02.2017..28.02.2017.\n2) Проверьте наличие движений в РегистрБухгалтерии.Хозрасчетный по счетам 68.02*/19* (включая субсчета).\n3) Сверьте счета-фактуры, корректировки и момент принятия НДС к вычету (не попали ли в другой период).\n4) Сверьте книгу продаж/покупок и операции Помощника по учету НДС за тот же период.\n5) Убедитесь, что документы проведены, период закрыт корректно и нет неподтвержденных/неперепроведенных документов.", + "reply_type": "factual", + "created_at": "2026-04-16T18:11:25.828Z", + "trace_id": "address-cqGzucHnbo", + "debug": { + "trace_id": "address-cqGzucHnbo", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "vat_payable_forecast", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "period_from": "2017-02-01", + "period_to": "2017-02-28", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_vat_payable_forecast_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 4, + "raw_rows_received": 4, + "rows_after_account_scope": 4, + "rows_after_recipe_filter": 4, + "rows_materialized": 4, + "rows_matched": 4, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_SUMMARY", + "capability_id": "address_vat_payable_forecast", + "capability_layer": "conversational", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "generic_address_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_vat_payable_forecast_v1" + ], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "vc8qclon7G_7NI", + "llm_decomposition_effective_message": "прикинь какой ндс нам надо заплатить на февраль 2017", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_drop", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "прикинь какой ндс нам надо заплатить на февраль 2017", + "canonical_message": "прикинь какой ндс нам надо заплатить на февраль 2017", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "vat_payable_forecast", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "range", + "period_from": "2017-02-01", + "period_to": "2017-02-28", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "management_profile" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "прикинь какой ндс нам надо заплатить на февраль 2017", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "vat_payable_forecast", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": false, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": true, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "прикинь какой ндс нам надо заплатить на февраль 2017", + "effective_message": "прикинь какой ндс нам надо заплатить на февраль 2017", + "decision": "new_topic", + "decision_reasons": [ + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "vat_payable_forecast", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "vc8qclon7G_7NI", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "прикинь какой ндс нам надо заплатить на февраль 2017" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_vat_payable_forecast", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_vat_payable_forecast", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "forecast_tax_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-g5t1V98q5f", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "кто у нас самый доходный клиент за все время", + "reply_type": null, + "created_at": "2026-04-16T18:11:40.137Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-O1SY8j5C8d", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Запрос понятен, но для надежного ответа не хватает опорного ориентира.\n\nСмысл запроса понятен, но без уточнения (контрагент, договор, счет или период) риск ошибки слишком высокий.\n\nКонтекст запроса: организация ООО \\Альтернатива Плюс\\.\n\nЧто могу сделать сейчас: показать документы и платежи по контрагенту за все время; показать незакрытые договоры или хвосты на дату; уточните точное имя контрагента или добавьте ИНН.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:11:52.301Z", + "trace_id": "address-QV4YarJ8nU", + "debug": { + "trace_id": "address-QV4YarJ8nU", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "counterparty_activity_lifecycle", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "counterparty": "за все время", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_counterparty_activity_lifecycle_v1", + "mcp_call_status_legacy": "materialized_but_not_matched", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "counterparty", + "anchor_value_raw": "за все время", + "anchor_value_resolved": "за все время", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "materialized_but_not_anchor_matched", + "match_failure_reason": "counterparty_anchor_not_matched_in_materialized_rows", + "mcp_call_status": "materialized_but_not_anchor_matched", + "rows_fetched": 125, + "raw_rows_received": 125, + "rows_after_account_scope": 125, + "rows_after_recipe_filter": 0, + "rows_materialized": 125, + "rows_matched": 0, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Контрагент", + "Period", + "Registrator", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": "missing_anchor", + "response_type": "LIMITED_WITH_REASON", + "capability_id": "address_counterparty_activity_lifecycle", + "capability_layer": "conversational", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "generic_address_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "not_found", + "route_expectation_reason": "route_expectation_not_defined_for_intent", + "route_expectation_expected_selected_recipes": [], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "3XG9igSO6h_h_w", + "llm_decomposition_effective_message": "кто у нас самый доходный клиент за все время", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_conflict", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "кто у нас самый доходный клиент за все время", + "canonical_message": "кто у нас самый доходный клиент за все время", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "counterparty_activity_lifecycle", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": "за все время", + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "all_time", + "period_from": null, + "period_to": "2026-04-16", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_end", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "management_profile" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "кто у нас самый доходный клиент за все время", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "counterparty_activity_lifecycle", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": true, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "кто у нас самый доходный клиент за все время", + "effective_message": "кто у нас самый доходный клиент за все время", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "vat_payable_forecast", + "target_intent": "counterparty_activity_lifecycle", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "3XG9igSO6h_h_w", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "кто у нас самый доходный клиент за все время" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "generic", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2016-03-31", + "period_from": "2016-03-01", + "period_to": "2016-03-31" + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T7", + "transition_contract_title": "Clarification Continuation", + "transition_contract_reason": [ + "missing_anchor_or_filter_requires_clarification" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "blocked_missing_anchor", + "carryover_eligibility": "none" + }, + "transition_contract_id": "T7", + "capability_contract_id": null, + "truth_gate_contract_status": "blocked_missing_anchor", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ], + "source_truth_gate_status": "blocked_missing_anchor", + "blocked_or_limited_explanation": "required_anchor_missing" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "clarification_required", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": "T7", + "may_state_confirmed_facts": false, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "clarifying_question", + "missing_anchors" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ], + "source_truth_gate_status": "blocked_missing_anchor", + "blocked_or_limited_explanation": "required_anchor_missing" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "clarification_required", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": "T7", + "may_state_confirmed_facts": false, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "clarifying_question", + "missing_anchors" + ], + "downgrade_only": true + }, + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "answer_shape": "clarification_required", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T7", + "transition_title": "Clarification Continuation", + "application_status": "clarification_required", + "declared_carryover_depth": "full", + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "full", + "required_prior_state": [ + "clarification_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "resume_target_route", + "update_or_clear_clarification_state" + ], + "forbidden_carryover": [ + "forget_suspended_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "preserve", + "meta_frame_state": "none", + "clarification_state": "update", + "coverage_gate_state": "create", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T7", + "transition_title": "Clarification Continuation", + "application_status": "clarification_required", + "declared_carryover_depth": "full", + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "full", + "required_prior_state": [ + "clarification_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "resume_target_route", + "update_or_clear_clarification_state" + ], + "forbidden_carryover": [ + "forget_suspended_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "preserve", + "meta_frame_state": "none", + "clarification_state": "update", + "coverage_gate_state": "create", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "state_transition_id": "T7", + "state_transition_status": "clarification_required", + "effective_carryover_depth": "full", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_counterparty_activity_lifecycle", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T7", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "counterparty", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_counterparty_activity_lifecycle", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T7", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "counterparty", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "counterparty_activity_lifecycle_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-3EcDa9lM0J", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "кто нам должен денег на май 2017", + "reply_type": null, + "created_at": "2026-04-16T18:12:09.457Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-wzLeNYw9tJ", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Итого подтвержденная дебиторская задолженность на 31.05.2017: **3.859.710,06** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез дебиторской задолженности.\n\nБлок **2**. Что учтено\n- Дата среза: 31.05.2017.\n- Контур: дебиторская задолженность по счетам 62/76.\n- В срез могут входить задолженности, возникшие до периода, если они оставались открытыми на дату среза.\n\nБлок **3**. Сводка\n- Строк в выборке: **18**.\n- Контрагентов с подтвержденным остатком к получению: **4**.\n\nБлок **4**. Категории дебиторской задолженности\n- покупатели/заказчики: **2**.\n- банки/финансовые: **1**.\n- бюджет/госорганы: **1**.\n- прочие: **0**.\n\nБлок **5**. Подтвержденные позиции к получению\n1. Комитет государственных услуг г. Москвы | категория: бюджет/госорганы | остаток к получению: **3.677.454,14** ₽ | операций: **14** | последнее движение: 2017-05-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки; Списание с расчетного счета **00000000015** от 27.01.2015 12:00:03\n\n2. Финансовое обеспечение заявки | категория: банки/финансовые | остаток к получению: **154.264,12** ₽ | операций: **2** | последнее движение: 2017-05-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Списание с расчетного счета **00000000253** от 29.10.2015 12:00:00\n\n3. ГКУ | категория: покупатели/заказчики | остаток к получению: **24.991,80** ₽ | операций: **1** | последнее движение: 2017-05-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ГКУ | документ: Остатки на дату | source refs: Финансовое обеспечение контракта; Списание с расчетного счета **00000000243** от 11.11.2016 11:54:48\n\n4. СервисКонсалт, ООО | категория: покупатели/заказчики | остаток к получению: **3.000,00** ₽ | операций: **1** | последнее движение: 2017-05-31T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: бух.обслуж-е 02/01УС от 09.01.17 | документ: Остатки на дату | source refs: Списание с расчетного счета **00000000073** от 16.05.2017 12:00:02", + "reply_type": "factual", + "created_at": "2026-04-16T18:12:23.766Z", + "trace_id": "address-NyhN_-YSQZ", + "debug": { + "trace_id": "address-NyhN_-YSQZ", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "receivables_confirmed_as_of_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "period_from": "2017-05-01", + "period_to": "2017-05-31", + "as_of_date": "2017-05-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_receivables_confirmed_as_of_date_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 18, + "raw_rows_received": 18, + "rows_after_account_scope": 18, + "rows_after_recipe_filter": 18, + "rows_materialized": 18, + "rows_matched": 18, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "СубконтоДт1", + "СубконтоДт2", + "СубконтоДт3", + "СубконтоКт1", + "СубконтоКт2", + "СубконтоКт3", + "Организация", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "strong", + "balance_confirmed": true, + "as_of_date_basis": "period_range", + "capability_id": "confirmed_receivables_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "receivables_confirmed_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_receivables_confirmed_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "IU0_dtn9gIXotk", + "llm_decomposition_effective_message": "кто нам должен денег на май 2017", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_drop", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "кто нам должен денег на май 2017", + "canonical_message": "кто нам должен денег на май 2017", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "receivables_confirmed_as_of_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": "2017-05-01", + "period_to": "2017-05-31", + "as_of_date": "2017-05-31", + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "balance_snapshot" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "кто нам должен денег на май 2017", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "receivables_confirmed_as_of_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "кто нам должен денег на май 2017", + "effective_message": "кто нам должен денег на май 2017", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "counterparty_activity_lifecycle", + "target_intent": "receivables_confirmed_as_of_date", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "counterparty", + "anchor_value": "за все время", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "IU0_dtn9gIXotk", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "кто нам должен денег на май 2017" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T2", + "transition_contract_title": "Root Follow-Up With Date Or Scope Change", + "transition_contract_reason": [ + "root_followup_continue_previous" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T2", + "capability_contract_id": null, + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ] + }, + "state_transition_id": "T2", + "state_transition_status": "applied", + "effective_carryover_depth": "root_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_receivables_as_of_date", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_receivables_as_of_date", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "receivables_signal_detected", + "receivables_debt_lifecycle_signal_detected", + "receivables_signal_detected_flexible_phrase", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_receivables_intent" + ] + } + } + }, + { + "message_id": "msg-f2YPrXdS2G", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "а какой ндс мы должны примерно заплатить за этот период?", + "reply_type": null, + "created_at": "2026-04-16T18:12:45.773Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-Z3NEdWcRbR", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Итого подтвержденный НДС к уплате на 16.04.2026: **0,00** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез НДС к уплате по состоянию на дату.\n\nБлок **2**. Что учтено\n- Дата среза: 16.04.2026.\n- Контур: остатки по счетам НДС к уплате (68*).\n\nБлок **2.1**. MCP-проверка VAT-источников\n- VAT-объектов в метаданных 1С: **11** (документы: **0**, регистры: **11**).\n- Пробных прямых источников проверено: **4**.\n- Источников с движениями до даты среза: **4**.\n1. РегистрНакопления.НДСЗаписиКнигиПродаж (НДС Продажи) | есть движения | последнее движение: 2021-03-22T12:00:02Z | пример: Реализация товаров и услуг **00000000001** от 22.03.2021 12:00:02\n2. РегистрНакопления.НДСЗаписиКнигиПокупок (НДС Покупки) | есть движения | последнее движение: 2026-03-31T00:00:00Z | пример: Счет-фактура полученный **00000000001** от 31.03.2026 0:00:00\n3. РегистрНакопления.НДСПредъявленный (НДС предъявленный) | есть движения | последнее движение: 2026-03-31T00:00:00Z | пример: Счет-фактура полученный **00000000001** от 31.03.2026 0:00:00\n4. РегистрНакопления.НДСВключенныйВСтоимость (НДС, включенный в стоимость) | есть движения | последнее движение: 2022-04-18T12:00:00Z | пример: Поступление товаров и услуг **00000000007** от 18.04.2022 12:00:00\n\nБлок **3**. Сводка\n- Строк в выборке: **0**.\n- Подтвержденных позиций по НДС: **0**.\n\nБлок **4**. Подтвержденные позиции\n- Подтвержденный остаток НДС к уплате на дату среза не найден.", + "reply_type": "factual", + "created_at": "2026-04-16T18:13:09.478Z", + "trace_id": "address-NZE6gDkvLt", + "debug": { + "trace_id": "address-NZE6gDkvLt", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "vat_payable_confirmed_as_of_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "as_of_date": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_vat_payable_confirmed_as_of_date_v1", + "mcp_call_status_legacy": "no_raw_rows", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "no_raw_rows", + "rows_fetched": 0, + "raw_rows_received": 0, + "rows_after_account_scope": 0, + "rows_after_recipe_filter": 0, + "rows_materialized": 0, + "rows_matched": 0, + "raw_row_keys_sample": [], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "strong", + "balance_confirmed": true, + "as_of_date_basis": "implicit_current_snapshot", + "capability_id": "confirmed_vat_payable_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "vat_payable_confirmed_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_vat_payable_confirmed_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "VlGK9KszOUXzdz", + "llm_decomposition_effective_message": "а какой ндс мы должны примерно заплатить за этот период?", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_drop", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "а какой ндс мы должны примерно заплатить за этот период?", + "canonical_message": "а какой ндс мы должны примерно заплатить за этот период?", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "vat_payable_confirmed_as_of_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": null, + "period_to": null, + "as_of_date": "2026-04-16", + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "balance_snapshot" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "а какой ндс мы должны примерно заплатить за этот период?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "vat_payable_confirmed_as_of_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "а какой ндс мы должны примерно заплатить за этот период?", + "effective_message": "а какой ндс мы должны примерно заплатить за этот период?", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "receivables_confirmed_as_of_date", + "target_intent": "vat_payable_confirmed_as_of_date", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "VlGK9KszOUXzdz", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "а какой ндс мы должны примерно заплатить за этот период?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T2", + "transition_contract_title": "Root Follow-Up With Date Or Scope Change", + "transition_contract_reason": [ + "root_followup_continue_previous" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T2", + "capability_contract_id": null, + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ] + }, + "state_transition_id": "T2", + "state_transition_status": "applied", + "effective_carryover_depth": "root_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_vat_payable_as_of_date", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_vat_payable_as_of_date", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "vat_payable_confirmed_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_vat_payable_intent" + ] + } + } + }, + { + "message_id": "msg-1SlTqTEK_k", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "мы должны комуто денег на сегодня?", + "reply_type": null, + "created_at": "2026-04-16T18:13:53.855Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-38-tMpnFD0", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Итого подтвержденный долг на 16.04.2026: **4.584.066,11** ₽.\n\nБлок **1**. Статус результата\n- Результат: подтвержденный срез обязательств к оплате.\n\nБлок **2**. Что учтено\n- Дата среза: 16.04.2026.\n- Контур: обязательства по счетам 60/76.\n- В срез могут входить обязательства, возникшие до периода, если они оставались открытыми на дату среза.\n\nБлок **3**. Сводка\n- Строк в выборке: **10**.\n- Контрагентов с подтвержденным остатком к оплате: **7**.\n\nБлок **4**. Категории обязательств\n- поставщики/подрядчики: **5**.\n- банки/кредиты: **0**.\n- налоги/госорганы: **2**.\n- прочие: **0**.\n\nБлок **5**. Подтвержденные позиции к оплате\n1. Комитет государственных услуг г. Москвы | категория: налоги/госорганы | остаток: **3.677.454,14** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки\n\n2. ГКУ | категория: поставщики/подрядчики | остаток: **773.953,04** ₽ | операций: **2** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ГКУ | документ: Остатки на дату | source refs: Финансовое обеспечение заявки; Финансовое обеспечение контракта\n\n3. Финансовое обеспечение заявки | категория: налоги/госорганы | остаток: **115.185,00** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), налог/госорган в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату\n\n4. Авант мебель, ООО | категория: поставщики/подрядчики | остаток: **7.271,20** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **60**, коммерческий контрагент в аналитике | договор: Договор АМ-2/15 от 22.01.15 | документ: Остатки на дату | source refs: Поступление товаров и услуг **00000000047** от 24.02.2015 12:03:34\n\n5. Держава АКБ, ПАО | категория: поставщики/подрядчики | остаток: **6.200,00** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: Договор № БГ 155822/2017 от 08.11.17 заявка **145822** | документ: Остатки на дату | source refs: Поступление товаров и услуг **00000000036** от 14.11.2017 0:00:00\n\n6. Скартел, ООО | категория: поставщики/подрядчики | остаток: **3.173,23** ₽ | операций: **3** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **76** (прочие расчеты), коммерческий контрагент в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: Лицевой счет абонента № **1025043208**; Поступление товаров и услуг **00000000009** от 31.08.2022 12:00:00\n\n7. КОМПАНИЯ СИМПЛ, ООО | категория: поставщики/подрядчики | остаток: **829,50** ₽ | операций: **1** | последнее движение: 2026-04-16T23:59:59Z | основание: участие счета **60**, коммерческий контрагент в аналитике | договор: ООО \\Альтернатива Плюс\\ | документ: Остатки на дату | source refs: счет № SL11119332716 от 06.11.2019; Поступление товаров и услуг **00000000116** от 08.11.2019 12:00:02", + "reply_type": "factual", + "created_at": "2026-04-16T18:14:06.362Z", + "trace_id": "address-TEOpfzj8G8", + "debug": { + "trace_id": "address-TEOpfzj8G8", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "payables_confirmed_as_of_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "as_of_date": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_payables_confirmed_as_of_date_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 10, + "raw_rows_received": 10, + "rows_after_account_scope": 10, + "rows_after_recipe_filter": 10, + "rows_materialized": 10, + "rows_matched": 10, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "СубконтоДт1", + "СубконтоДт2", + "СубконтоДт3", + "СубконтоКт1", + "СубконтоКт2", + "СубконтоКт3", + "Организация", + "Period", + "Registrator", + "AccountKt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "strong", + "balance_confirmed": true, + "as_of_date_basis": "implicit_current_snapshot", + "capability_id": "confirmed_payables_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "payables_confirmed_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_payables_confirmed_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "_5ULrV2C_Gggbd", + "llm_decomposition_effective_message": "мы должны комуто денег на сегодня?", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_conflict", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "мы должны комуто денег на сегодня?", + "canonical_message": "мы должны комуто денег на сегодня?", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "payables_confirmed_as_of_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": null, + "period_to": null, + "as_of_date": "2026-04-16", + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "balance_snapshot" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "мы должны комуто денег на сегодня?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "payables_confirmed_as_of_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "мы должны комуто денег на сегодня?", + "effective_message": "мы должны комуто денег на сегодня?", + "decision": "new_topic", + "decision_reasons": [ + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "payables_confirmed_as_of_date", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "_5ULrV2C_Gggbd", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "мы должны комуто денег на сегодня?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_payables_as_of_date", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_payables_as_of_date", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "payables_signal_detected", + "payables_debt_lifecycle_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_payables_intent" + ] + } + } + }, + { + "message_id": "msg-D9IeA0sMwZ", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "а нам?", + "reply_type": null, + "created_at": "2026-04-16T18:14:18.190Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-d8oJ5mNof1", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Итого подтвержденная кредиторская задолженность на 16.04.2026: **4.584.066,11** ₽.\n\nБлок **1**. Статус результата — Результат: подтвержденный срез кредиторской задолженности (должны кому-то).\nБлок **2**. Что учтено —\n- Дата среза: 16.04.2026\n- Контур: обязательства перед поставщиками, подрядчиками и другими кредиторами\n\n✅ Подтверждено: вы должны 4 584 066,11 ₽ на текущую дату (16 апреля 2026 года).\n⚠️ Уточнение: данные актуальны по состоянию на указанную дату. Точная структура долгов (кто и сколько) требует детализации по счетам или субконто, которую можно получить через отчеты в 1С.\n\nЕсли нужно — могу помочь сформировать запрос для получения полного списка кредиторов.", + "reply_type": "factual_with_explanation", + "created_at": "2026-04-16T18:14:38.852Z", + "trace_id": "chat-fr8oMQjaeQ", + "debug": { + "trace_id": "chat-fr8oMQjaeQ", + "prompt_version": "living_chat_router_v1", + "schema_version": "living_chat_router_v1", + "fallback_type": "none", + "detected_mode": "chat", + "detected_mode_confidence": "high", + "execution_lane": "living_chat", + "living_router_mode": "chat", + "living_router_reason": "non_domain_query_indexed", + "living_chat_response_source": "llm_chat", + "living_chat_script_guard_applied": false, + "living_chat_script_guard_reason": null, + "living_chat_grounding_guard_applied": false, + "living_chat_grounding_guard_reason": null, + "living_chat_data_scope_probe_status": null, + "living_chat_data_scope_probe_channel": null, + "living_chat_data_scope_probe_org_count": 0, + "living_chat_data_scope_probe_organizations": [], + "living_chat_data_scope_probe_error": null, + "living_chat_selected_organization": null, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_llm_predecompose_attempted": true, + "address_llm_predecompose_applied": true, + "address_llm_predecompose_reason": "normalized_fragment_applied", + "address_llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "а нам?", + "canonical_message": "что требуется для нашей компании?", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "none", + "date_basis_hint": null, + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "address_semantic_extraction_contract": { + "schema_version": "address_semantic_extraction_contract_v1", + "source_message": "а нам?", + "canonical_message": "что требуется для нашей компании?", + "canonical_rewrite_applied": true, + "extraction": { + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "aggregation_profile": "unknown" + }, + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "none", + "date_basis_hint": null, + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "guard_hints": { + "source_data_signal_detected": false, + "canonical_data_signal_detected": false, + "data_scope_meta_query_detected": false, + "deep_investigation_signal_detected": false, + "required_anchor_missing": false, + "unsupported_low_confidence": true, + "semantic_drift_suspected": false + }, + "quality": "medium", + "valid": true, + "apply_canonical_recommended": true, + "reason_codes": [ + "unsupported_low_confidence_contract", + "rewrite_without_structured_gain" + ] + }, + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": "non_domain", + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "final_decision": { + "run_address_lane": false, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "non_domain_query_indexed", + "living_mode": "chat", + "living_reason": "non_domain_query_indexed" + } + }, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "non_domain_query_indexed", + "normalized": null, + "normalizer_output": null + } + }, + { + "message_id": "msg-9KAN2U57lg", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "какой у нас самый доходный год", + "reply_type": null, + "created_at": "2026-04-16T18:14:58.265Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg--59Ab8z_hm", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Топ-3 лет по сумме поступлений:\nСобран профиль поступлений от заказчиков (bank-doc value aggregate).\nСтрок источника: 20.\nУникальных контрагентов: 5.\n1. 2021 | сумма: 8560025 | операций: 13 | контрагентов: 1 | макс: 1882400\n2. 2022 | сумма: 6044715 | операций: 4 | контрагентов: 4 | макс: 2254115\n3. 2020 | сумма: 3664900 | операций: 3 | контрагентов: 1 | макс: 3248300", + "reply_type": "factual", + "created_at": "2026-04-16T18:15:09.340Z", + "trace_id": "address-xNnDXdnX57", + "debug": { + "trace_id": "address-xNnDXdnX57", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "customer_revenue_and_payments", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "period_to": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_customer_revenue_and_payments_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 20, + "raw_rows_received": 20, + "rows_after_account_scope": 20, + "rows_after_recipe_filter": 20, + "rows_materialized": 20, + "rows_matched": 20, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Контрагент", + "Договор", + "Period", + "Registrator", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "capability_id": "address_customer_revenue_and_payments", + "capability_layer": "conversational", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "generic_address_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "not_found", + "route_expectation_reason": "route_expectation_not_defined_for_intent", + "route_expectation_expected_selected_recipes": [], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "s_WFecuAp8LF7F", + "llm_decomposition_effective_message": "какой у нас самый доходный год", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_drop", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "какой у нас самый доходный год", + "canonical_message": "какой у нас самый доходный год", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "customer_revenue_and_payments", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": "2026-04-16", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_end", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "management_profile" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "какой у нас самый доходный год", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "customer_revenue_and_payments", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": true, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "какой у нас самый доходный год", + "effective_message": "какой у нас самый доходный год", + "decision": "new_topic", + "decision_reasons": [ + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "customer_revenue_and_payments", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "s_WFecuAp8LF7F", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "какой у нас самый доходный год" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "unknown", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "unknown", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "unknown", + "blocked_or_limited_explanation": "truth_gate_not_confirmed" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "unknown", + "blocked_or_limited_explanation": "truth_gate_not_confirmed" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_customer_revenue_and_payments", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_customer_revenue_and_payments", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-PaU60QJykf", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "а за 2017 мы скок заработали?", + "reply_type": null, + "created_at": "2026-04-16T18:15:46.310Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-d0ns1b9TYm", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Топ-6 заказчиков по сумме поступлений:\nСобран профиль поступлений от заказчиков (bank-doc value aggregate).\nСтрок источника: 20.\nУникальных контрагентов: 6.\n1. ГКУ | сумма: 11158349.58 | операций: 10 | средний чек: 1115834.96 | макс: 2749857.69\n2. ГБУ \\Многофункциональный центр\\ | сумма: 458900 | операций: 4 | средний чек: 114725.00 | макс: 157400\n3. Единая электронная торговая площадка, АО | сумма: 230890 | операций: 3 | средний чек: 76963.33 | макс: 172000\n4. Элмаш-К | сумма: 94000 | операций: 1 | средний чек: 94000.00 | макс: 94000\n5. АкваСервис, ООО | сумма: 56000 | операций: 1 | средний чек: 56000.00 | макс: 56000\n6. Финансовое обеспечение заявки | сумма: 39079.12 | операций: 1 | средний чек: 39079.12 | макс: 39079.12", + "reply_type": "factual", + "created_at": "2026-04-16T18:16:00.181Z", + "trace_id": "address-MO0nvfP-a4", + "debug": { + "trace_id": "address-MO0nvfP-a4", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "customer_revenue_and_payments", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "period_from": "2017-01-01", + "period_to": "2017-12-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_customer_revenue_and_payments_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 20, + "raw_rows_received": 20, + "rows_after_account_scope": 20, + "rows_after_recipe_filter": 20, + "rows_materialized": 20, + "rows_matched": 20, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Контрагент", + "Договор", + "Period", + "Registrator", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "capability_id": "address_customer_revenue_and_payments", + "capability_layer": "conversational", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "generic_address_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "not_found", + "route_expectation_reason": "route_expectation_not_defined_for_intent", + "route_expectation_expected_selected_recipes": [], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "j9SWl4QfViFzk3", + "llm_decomposition_effective_message": "а за 2017 мы скок заработали?", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_drop", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "а за 2017 мы скок заработали?", + "canonical_message": "а за 2017 мы скок заработали?", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "customer_revenue_and_payments", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "year", + "period_from": "2017-01-01", + "period_to": "2017-12-31", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "management_profile" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "а за 2017 мы скок заработали?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "customer_revenue_and_payments", + "address_intent_confidence": "high", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": false, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": true, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "а за 2017 мы скок заработали?", + "effective_message": "а за 2017 мы скок заработали?", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "customer_revenue_and_payments", + "target_intent": "customer_revenue_and_payments", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "j9SWl4QfViFzk3", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "а за 2017 мы скок заработали?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T2", + "transition_contract_title": "Root Follow-Up With Date Or Scope Change", + "transition_contract_reason": [ + "root_followup_continue_previous" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "unknown", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T2", + "capability_contract_id": null, + "truth_gate_contract_status": "unknown", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "unknown", + "blocked_or_limited_explanation": "truth_gate_not_confirmed" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "unknown", + "blocked_or_limited_explanation": "truth_gate_not_confirmed" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": "T2", + "state_transition_status": "applied", + "effective_carryover_depth": "root_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_customer_revenue_and_payments", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_customer_revenue_and_payments", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-IuAeIF5K4v", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "сколько вообще денег мы заработали за все время?", + "reply_type": null, + "created_at": "2026-04-16T18:16:58.854Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-odo0BpjiSO", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Топ-5 заказчиков по сумме поступлений:\nСобран профиль поступлений от заказчиков (bank-doc value aggregate).\nСтрок источника: 20.\nУникальных контрагентов: 5.\n1. Группа | сумма: 12224925 | операций: 16 | средний чек: 764057.81 | макс: 3248300\n2. НОРТОН | сумма: 2254115 | операций: 1 | средний чек: 2254115.00 | макс: 2254115\n3. МНН | сумма: 1699940 | операций: 1 | средний чек: 1699940.00 | макс: 1699940\n4. СервисКонсалт, ООО | сумма: 1200000 | операций: 1 | средний чек: 1200000.00 | макс: 1200000\n5. Чепурнов П.Д. | сумма: 890660 | операций: 1 | средний чек: 890660.00 | макс: 890660", + "reply_type": "factual", + "created_at": "2026-04-16T18:17:11.307Z", + "trace_id": "address-iYgAPZF1oB", + "debug": { + "trace_id": "address-iYgAPZF1oB", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "customer_revenue_and_payments", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [], + "selected_recipe": "address_customer_revenue_and_payments_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 20, + "raw_rows_received": 20, + "rows_after_account_scope": 20, + "rows_after_recipe_filter": 20, + "rows_materialized": 20, + "rows_matched": 20, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Контрагент", + "Договор", + "Period", + "Registrator", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "capability_id": "address_customer_revenue_and_payments", + "capability_layer": "conversational", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "generic_address_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "not_found", + "route_expectation_reason": "route_expectation_not_defined_for_intent", + "route_expectation_expected_selected_recipes": [], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "V8iNM0fKLm64l4", + "llm_decomposition_effective_message": "сколько вообще денег мы заработали за все время?", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_drop", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "сколько вообще денег мы заработали за все время?", + "canonical_message": "сколько вообще денег мы заработали за все время?", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "customer_revenue_and_payments", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "all_time", + "period_from": null, + "period_to": "2026-04-16", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_end", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "management_profile" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "сколько вообще денег мы заработали за все время?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "customer_revenue_and_payments", + "address_intent_confidence": "high", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": false, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": true, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "сколько вообще денег мы заработали за все время?", + "effective_message": "сколько вообще денег мы заработали за все время?", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "customer_revenue_and_payments", + "target_intent": "customer_revenue_and_payments", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "V8iNM0fKLm64l4", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "сколько вообще денег мы заработали за все время?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T2", + "transition_contract_title": "Root Follow-Up With Date Or Scope Change", + "transition_contract_reason": [ + "root_followup_continue_previous" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "unknown", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T2", + "capability_contract_id": null, + "truth_gate_contract_status": "unknown", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ], + "source_truth_gate_status": "unknown", + "blocked_or_limited_explanation": "truth_gate_not_confirmed" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ], + "source_truth_gate_status": "unknown", + "blocked_or_limited_explanation": "truth_gate_not_confirmed" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_unknown", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "state_transition_id": "T2", + "state_transition_status": "applied", + "effective_carryover_depth": "root_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_customer_revenue_and_payments", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_customer_revenue_and_payments", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_unknown", + "truth_mode_confirmed", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "shape_not_detected", + "customer_revenue_and_payments_signal_detected", + "organization_from_followup_context", + "period_cleared_by_all_time_followup", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-QAjpQ0Q86k", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "ты умеешь считать дельту по договорам?", + "reply_type": null, + "created_at": "2026-04-16T18:17:57.701Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-ThSOYzPJvV", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Чтобы ответ был точным, нужно чуть сильнее заякорить запрос.\n\nДля точного ответа нужен хотя бы один явный ориентир: договор.\n\nСигнал запроса: нужен срез документов/платежей по договору.\n\nКонтекст запроса: организация ООО \\Альтернатива Плюс\\.\n\nЧто могу сделать сейчас: уточнить ориентир: договор; показать документы/платежи по контрагенту или договору; показать незакрытые договоры или хвосты на дату.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:18:09.267Z", + "trace_id": "address-3WZf3JFOJl", + "debug": { + "trace_id": "address-3WZf3JFOJl", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "VERIFY_FACTUAL", + "query_shape_confidence": "medium", + "detected_intent": "list_documents_by_contract", + "detected_intent_confidence": "medium", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "organization": "ООО \\Альтернатива Плюс\\" + }, + "missing_required_filters": [ + "contract" + ], + "selected_recipe": "address_documents_by_contract_v1", + "mcp_call_status_legacy": "skipped", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "ООО \\Альтернатива Плюс\\", + "anchor_value_resolved": "ООО \\Альтернатива Плюс\\", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "skipped", + "rows_fetched": 0, + "raw_rows_received": 0, + "rows_after_account_scope": 0, + "rows_after_recipe_filter": 0, + "rows_materialized": 0, + "rows_matched": 0, + "raw_row_keys_sample": [], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": "missing_anchor", + "response_type": "LIMITED_WITH_REASON", + "capability_id": "documents_drilldown", + "capability_layer": "navigation", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "drilldown_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_documents_by_contract_v1" + ], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [ + "heuristic_candidates", + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": true, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "vQ-5nFGAMwpAhi", + "llm_decomposition_effective_message": "проверить возможность расчета дельты по договорам", + "llm_decomposition_reason": "normalized_fragment_semantic_guard_raw_fragment_preferred", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "ты умеешь считать дельту по договорам?", + "canonical_message": "проверить возможность расчета дельты по договорам", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "VERIFY_FACTUAL", + "query_shape_confidence": "medium", + "intent": "list_documents_by_contract", + "intent_confidence": "medium", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "list_lookup" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "ты умеешь считать дельту по договорам?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "list_documents_by_contract", + "address_intent_confidence": "medium", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "required_anchor_missing_for_intent" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "ты умеешь считать дельту по договорам?", + "effective_message": "проверить возможность расчета дельты по договорам", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "effective_message_rewritten_by_predecompose", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "customer_revenue_and_payments", + "target_intent": "list_documents_by_contract", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": true, + "reason": "limited_result_retry_with_raw_message", + "initial_limited_category": "missing_anchor", + "retry_message": "ты умеешь считать дельту по договорам?", + "retry_used_followup_context": true, + "retry_result_category": "missing_anchor" + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "vQ-5nFGAMwpAhi", + "prompt_version": "normalizer_v2_0_2", + "applied": true, + "effective_message": "проверить возможность расчета дельты по договорам" + }, + "address_followup_offer": { + "enabled": true, + "source_intent": "list_documents_by_contract", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "suggested_intents": [ + "bank_operations_by_contract" + ] + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "ООО \\Альтернатива Плюс\\", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "generic", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2016-03-31", + "period_from": "2016-03-01", + "period_to": "2016-03-31" + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T7", + "transition_contract_title": "Clarification Continuation", + "transition_contract_reason": [ + "missing_anchor_or_filter_requires_clarification" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "blocked_missing_anchor", + "carryover_eligibility": "none" + }, + "transition_contract_id": "T7", + "capability_contract_id": null, + "truth_gate_contract_status": "blocked_missing_anchor", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ], + "source_truth_gate_status": "blocked_missing_anchor", + "blocked_or_limited_explanation": "required_anchor_missing" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "clarification_required", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": "T7", + "may_state_confirmed_facts": false, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "clarifying_question", + "missing_anchors" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ], + "source_truth_gate_status": "blocked_missing_anchor", + "blocked_or_limited_explanation": "required_anchor_missing" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "clarification_required", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": "T7", + "may_state_confirmed_facts": false, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "clarifying_question", + "missing_anchors" + ], + "downgrade_only": true + }, + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "answer_shape": "clarification_required", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T7", + "transition_title": "Clarification Continuation", + "application_status": "clarification_required", + "declared_carryover_depth": "full", + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "full", + "required_prior_state": [ + "clarification_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "resume_target_route", + "update_or_clear_clarification_state" + ], + "forbidden_carryover": [ + "forget_suspended_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "preserve", + "meta_frame_state": "none", + "clarification_state": "update", + "coverage_gate_state": "create", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ] + }, + "reason_codes": [ + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T7", + "transition_title": "Clarification Continuation", + "application_status": "clarification_required", + "declared_carryover_depth": "full", + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "full", + "required_prior_state": [ + "clarification_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "resume_target_route", + "update_or_clear_clarification_state" + ], + "forbidden_carryover": [ + "forget_suspended_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "preserve", + "selected_object_frame_state": "preserve", + "meta_frame_state": "none", + "clarification_state": "update", + "coverage_gate_state": "create", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "blocked", + "evidence_grade": "none", + "grounding_status": "partial", + "truth_mode": "clarification_required", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ] + }, + "reason_codes": [ + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ] + }, + "state_transition_id": "T7", + "state_transition_status": "clarification_required", + "effective_carryover_depth": "full", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "documents_drilldown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T7", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "documents_drilldown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T7", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_clarification_required", + "transition_T7", + "missing_anchor_or_filter_requires_clarification", + "debug_capability_id_has_no_contract", + "truth_gate_blocked_missing_anchor", + "truth_mode_clarification_required", + "missing_filter_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "verify_signal_detected", + "documents_by_contract_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "missing_required_filters" + ] + } + } + }, + { + "message_id": "msg-nf3V_2zNfA", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "по чепурнову покажи все доки", + "reply_type": null, + "created_at": "2026-04-16T18:18:48.894Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-Cyv-MjBpGM", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Найдено документов по контрагенту: 1.\n1. 2022-01-20T12:00:03Z | Поступление на расчетный счет 00000000001 от 20.01.2022 12:00:03 | 0 / 0 | 890660 | аналитика: Чепурнов П.Д.; Договор № 11/1 от 25.11.2020 г.", + "reply_type": "factual", + "created_at": "2026-04-16T18:19:02.371Z", + "trace_id": "address-a-HawICUXc", + "debug": { + "trace_id": "address-a-HawICUXc", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "DOCUMENT_LIST", + "query_shape_confidence": "medium", + "detected_intent": "list_documents_by_counterparty", + "detected_intent_confidence": "medium", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "counterparty": "Чепурнов", + "organization": "чепурнов" + }, + "missing_required_filters": [], + "selected_recipe": "address_documents_by_counterparty_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "counterparty", + "anchor_value_raw": "Чепурнов", + "anchor_value_resolved": "Чепурнов П.Д.", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 1000, + "raw_rows_received": 1000, + "rows_after_account_scope": 124, + "rows_after_recipe_filter": 1, + "rows_materialized": 124, + "rows_matched": 1, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Контрагент", + "Договор", + "Period", + "Registrator", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "capability_id": "documents_drilldown", + "capability_layer": "navigation", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "drilldown_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_documents_by_counterparty_v1" + ], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [ + "heuristic_candidates", + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": true, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "AXUtVimPCrQPQf", + "llm_decomposition_effective_message": "показать все документы по контрагенту Чепурнов", + "llm_decomposition_reason": "normalized_fragment_applied", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "по чепурнову покажи все доки", + "canonical_message": "показать все документы по контрагенту Чепурнов", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "DOCUMENT_LIST", + "query_shape_confidence": "medium", + "intent": "list_documents_by_counterparty", + "intent_confidence": "medium", + "entities": { + "account": null, + "counterparty": "Чепурнов", + "contract": null, + "document_type": null, + "document_ref": null, + "organization": "чепурнов" + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "explicit_anchor", + "anchor_kind": "organization", + "anchor_value": "чепурнов", + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": false, + "selected_object_scope_detected": false + }, + "aggregation_profile": "list_lookup" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "по чепурнову покажи все доки", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "list_documents_by_counterparty", + "address_intent_confidence": "medium", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "по чепурнову покажи все доки", + "effective_message": "показать все документы по контрагенту Чепурнов", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected", + "effective_message_rewritten_by_predecompose", + "llm_contract_intent_available" + ], + "followup_context_applied": true, + "previous_intent": "list_documents_by_contract", + "target_intent": "list_documents_by_counterparty", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "ООО \\Альтернатива Плюс\\", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "AXUtVimPCrQPQf", + "prompt_version": "normalizer_v2_0_2", + "applied": true, + "effective_message": "показать все документы по контрагенту Чепурнов" + }, + "address_followup_offer": { + "enabled": true, + "source_intent": "list_documents_by_counterparty", + "anchor_type": "counterparty", + "anchor_value": "Чепурнов П.Д.", + "suggested_intents": [ + "bank_operations_by_counterparty", + "list_contracts_by_counterparty" + ] + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\" + ], + "assistant_active_organization": "чепурнов", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "generic", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2016-03-31", + "period_from": "2016-03-01", + "period_to": "2016-03-31" + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T2", + "transition_contract_title": "Root Follow-Up With Date Or Scope Change", + "transition_contract_reason": [ + "root_followup_continue_previous" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T2", + "capability_contract_id": null, + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ] + }, + "state_transition_id": "T2", + "state_transition_status": "applied", + "effective_carryover_depth": "root_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "documents_drilldown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "counterparty", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "documents_drilldown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "counterparty", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "document_list_signal_detected", + "documents_by_counterparty_signal_detected" + ] + } + } + }, + { + "message_id": "msg-3V8K_p9bt0", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "а по свк", + "reply_type": null, + "created_at": "2026-04-16T18:19:29.258Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-tNxiZZnrkH", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Найдено банковских операций по контрагенту: 26.\nСобран список банковских операций по контрагенту (live address lane).\nСтрок отобрано: 26.\n1. 2021-11-10T12:00:07Z | Поступление на расчетный счет 00000000013 от 10.11.2021 12:00:07 | 0 / 0 | 20000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n2. 2021-09-29T12:00:03Z | Поступление на расчетный счет 00000000012 от 29.09.2021 12:00:03 | 0 / 0 | 50000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n3. 2021-08-31T12:00:04Z | Поступление на расчетный счет 00000000011 от 31.08.2021 12:00:04 | 0 / 0 | 120500 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n4. 2021-06-22T12:00:00Z | Поступление на расчетный счет 00000000010 от 22.06.2021 12:00:00 | 0 / 0 | 498630 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n5. 2021-06-09T12:00:05Z | Поступление на расчетный счет 00000000009 от 09.06.2021 12:00:05 | 0 / 0 | 418960 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n6. 2021-04-28T12:00:08Z | Поступление на расчетный счет 00000000008 от 28.04.2021 12:00:08 | 0 / 0 | 564300 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n7. 2021-04-22T12:00:00Z | Поступление на расчетный счет 00000000007 от 22.04.2021 12:00:00 | 0 / 0 | 982420 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n8. 2021-04-13T12:00:11Z | Поступление на расчетный счет 00000000006 от 13.04.2021 12:00:11 | 0 / 0 | 1882400 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n9. 2021-03-25T12:00:02Z | Поступление на расчетный счет 00000000005 от 25.03.2021 12:00:02 | 0 / 0 | 644315 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n10. 2021-03-24T12:00:03Z | Поступление на расчетный счет 00000000004 от 24.03.2021 12:00:03 | 0 / 0 | 1219990 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n11. 2021-03-18T12:00:00Z | Поступление на расчетный счет 00000000003 от 18.03.2021 12:00:00 | 0 / 0 | 1425310 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n12. 2021-03-12T12:00:03Z | Поступление на расчетный счет 00000000002 от 12.03.2021 12:00:03 | 0 / 0 | 214600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n13. 2021-02-19T12:00:01Z | Поступление на расчетный счет 00000000001 от 19.02.2021 12:00:01 | 0 / 0 | 518600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n14. 2020-12-30T12:00:00Z | Поступление на расчетный счет 00000000044 от 30.12.2020 12:00:00 | 0 / 0 | 3248300 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n15. 2020-12-16T16:20:53Z | Поступление на расчетный счет 00000000043 от 16.12.2020 16:20:53 | 0 / 0 | 216600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n16. 2020-12-14T12:00:00Z | Поступление на расчетный счет 00000000042 от 14.12.2020 12:00:00 | 0 / 0 | 200000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n17. 2020-11-30T12:00:07Z | Поступление на расчетный счет 00000000041 от 30.11.2020 12:00:07 | 0 / 0 | 38900 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n18. 2020-11-19T12:00:04Z | Поступление на расчетный счет 00000000039 от 19.11.2020 12:00:04 | 0 / 0 | 3320600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n19. 2020-11-18T12:00:05Z | Поступление на расчетный счет 00000000038 от 18.11.2020 12:00:05 | 0 / 0 | 745300 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n20. 2020-11-18T12:00:04Z | Поступление на расчетный счет 00000000037 от 18.11.2020 12:00:04 | 0 / 0 | 320000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n21. 2020-11-13T12:00:03Z | Поступление на расчетный счет 00000000036 от 13.11.2020 12:00:03 | 0 / 0 | 313600 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n22. 2020-11-10T15:39:13Z | Поступление на расчетный счет 00000000035 от 10.11.2020 15:39:13 | 0 / 0 | 328300 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n23. 2020-10-26T12:00:00Z | Поступление на расчетный счет 00000000034 от 26.10.2020 12:00:00 | 0 / 0 | 175000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n24. 2020-08-20T12:00:06Z | Поступление на расчетный счет 00000000032 от 20.08.2020 12:00:06 | 0 / 0 | 3126005 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n25. 2020-07-30T12:00:00Z | Поступление на расчетный счет 00000000029 от 30.07.2020 12:00:00 | 0 / 0 | 20000 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020\n26. 2020-07-27T12:00:00Z | Поступление на расчетный счет 00000000028 от 27.07.2020 12:00:00 | 0 / 0 | 40860 | аналитика: Группа Договор № 1-ПМ/2020 от 05.06.2020", + "reply_type": "factual", + "created_at": "2026-04-16T18:19:43.942Z", + "trace_id": "address-cMQKNY7Y3p", + "debug": { + "trace_id": "address-cMQKNY7Y3p", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "none", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "grounded", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "bank_operations_by_counterparty", + "detected_intent_confidence": "low", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "counterparty": "свк", + "organization": "чепурнов" + }, + "missing_required_filters": [], + "selected_recipe": "address_bank_operations_by_counterparty_v1", + "mcp_call_status_legacy": "matched_non_empty", + "account_scope_mode": "preferred", + "account_scope_fallback_applied": false, + "anchor_type": "counterparty", + "anchor_value_raw": "свк", + "anchor_value_resolved": "Группа СВК", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "matched_non_empty", + "rows_fetched": 1000, + "raw_rows_received": 1000, + "rows_after_account_scope": 124, + "rows_after_recipe_filter": 26, + "rows_materialized": 124, + "rows_matched": 26, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Контрагент", + "Договор", + "Period", + "Registrator", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": null, + "response_type": "FACTUAL_LIST", + "capability_id": "bank_operations_drilldown", + "capability_layer": "navigation", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "drilldown_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_bank_operations_by_counterparty_v1" + ], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [ + "heuristic_candidates", + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "vuZI5yctm0p2NC", + "llm_decomposition_effective_message": "а по свк", + "llm_decomposition_reason": "normalized_fragment_rejected_semantic_guard", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "а по свк", + "canonical_message": "а по свк", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "а по свк", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "followup_context_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": false, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": false, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": true + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "followup_context_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "а по свк", + "effective_message": "а по свк", + "decision": "switch_to_suggested", + "decision_reasons": [ + "followup_context_detected", + "implicit_continuation_by_llm" + ], + "followup_context_applied": true, + "previous_intent": "list_documents_by_counterparty", + "target_intent": "bank_operations_by_counterparty", + "intent_selection_mode": "switch_to_suggested_intent", + "anchor_type": "counterparty", + "anchor_value": "Чепурнов П.Д.", + "implicit_continuation_signal": true + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "vuZI5yctm0p2NC", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "а по свк" + }, + "address_followup_offer": { + "enabled": true, + "source_intent": "bank_operations_by_counterparty", + "anchor_type": "counterparty", + "anchor_value": "Группа СВК", + "suggested_intents": [ + "list_documents_by_counterparty", + "list_contracts_by_counterparty" + ] + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\", + "чепурнов" + ], + "assistant_active_organization": "чепурнов", + "address_root_frame_context": { + "root_intent": "inventory_on_hand_as_of_date", + "current_frame_kind": "generic", + "organization": "ООО \\Альтернатива Плюс\\", + "as_of_date": "2016-03-31", + "period_from": "2016-03-01", + "period_to": "2016-03-31" + }, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "full_confirmed", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "full_confirmed", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "full_confirmed", + "blocked_or_limited_explanation": null + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "confirmed_factual", + "reply_type": "factual", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": false, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_basis" + ], + "downgrade_only": true + }, + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "answer_shape": "confirmed_factual", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "full", + "evidence_grade": "strong", + "grounding_status": "grounded", + "truth_mode": "confirmed", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "bank_operations_drilldown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "counterparty", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "bank_operations_drilldown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "counterparty", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "factual", + "guarded_reply_type": "factual", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_full_confirmed", + "truth_mode_confirmed", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "intent_from_followup_context", + "organization_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-2jxBtI0yYt", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "а сейчас у нас есть что на складе?", + "reply_type": null, + "created_at": "2026-04-16T18:20:37.881Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-dFuxhtDZr6", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "В текущем срезе данных по этому запросу совпадения не найдены.\n\nпо указанному якорю и фильтрам в выборке данных нет строк.\n\nСигнал запроса: нужен подтвержденный срез товаров на складе на дату.\n\nКонтекст запроса: организация чепурнов, срез на 2026-04-16.\n\nЧто могу сделать сейчас: показать подтвержденный срез товаров на складах на дату по остатку счета 41.01; показать документы/платежи по контрагенту или договору; показать незакрытые договоры или хвосты на дату.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:20:49.753Z", + "trace_id": "address-uVRcOblKmU", + "debug": { + "trace_id": "address-uVRcOblKmU", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "inventory_on_hand_as_of_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "as_of_date": "2026-04-16", + "organization": "чепурнов" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_on_hand_as_of_date_v1", + "mcp_call_status_legacy": "materialized_but_not_matched", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "чепурнов", + "anchor_value_resolved": "чепурнов", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "materialized_but_not_anchor_matched", + "match_failure_reason": "organization_anchor_not_matched_in_materialized_rows", + "mcp_call_status": "materialized_but_not_anchor_matched", + "rows_fetched": 11, + "raw_rows_received": 11, + "rows_after_account_scope": 11, + "rows_after_recipe_filter": 0, + "rows_materialized": 11, + "rows_matched": 0, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Номенклатура", + "Склад", + "Организация", + "Количество", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": "empty_match", + "response_type": "LIMITED_WITH_REASON", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "weak", + "balance_confirmed": false, + "as_of_date_basis": "implicit_current_snapshot", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_on_hand_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": true, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "-zOZH0tv5tEGW8", + "llm_decomposition_effective_message": "покажи текущие остатки товаров на складе", + "llm_decomposition_reason": "normalized_fragment_applied", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "а сейчас у нас есть что на складе?", + "canonical_message": "покажи текущие остатки товаров на складе", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "inventory_on_hand_as_of_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": null, + "period_to": null, + "as_of_date": "2026-04-16", + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "а сейчас у нас есть что на складе?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "inventory_on_hand_as_of_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "а сейчас у нас есть что на складе?", + "effective_message": "покажи текущие остатки товаров на складе", + "decision": "new_topic", + "decision_reasons": [ + "effective_message_rewritten_by_predecompose", + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "inventory_on_hand_as_of_date", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": true, + "reason": "limited_result_retry_with_raw_message", + "initial_limited_category": "empty_match", + "retry_message": "а сейчас у нас есть что на складе?", + "retry_used_followup_context": false, + "retry_result_category": "empty_match" + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "-zOZH0tv5tEGW8", + "prompt_version": "normalizer_v2_0_2", + "applied": true, + "effective_message": "покажи текущие остатки товаров на складе" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\", + "чепурнов" + ], + "assistant_active_organization": "чепурнов", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T1", + "transition_contract_title": "Root Query Entry", + "transition_contract_reason": [ + "capability_contract_root_or_new_entry" + ], + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "partial_supported", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T1", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "truth_gate_contract_status": "partial_supported", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + }, + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "answer_shape": "limited_with_reason", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "state_transition_id": "T1", + "state_transition_status": "applied", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound_with_limits", + "binding_action": "limit", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound_with_limits", + "binding_action": "limit", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "capability_binding_status": "bound_with_limits", + "capability_binding_action": "limit", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "limit", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response", + "capability_binding_guard_limited_reply_type" + ] + } + } + }, + { + "message_id": "msg-P7B7gQhcSX", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "что нам отгружать чепурнов? какой товар или услугу?", + "reply_type": null, + "created_at": "2026-04-16T18:21:21.399Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-sIoLnfJCKU", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Для такого формата запроса нужен более широкий аналитический контур, иначе ответ будет ненадежным.\n\nСценарий пока не закрыт текущими адресными маршрутами без потери точности.\n\nСигнал запроса: поиск конкретных объектов.\n\nКонтекст запроса: организация чепурнов.\n\nЧто могу сделать сейчас: показать документы и платежи по контрагенту Чепурнов; показать незакрытые договоры или хвосты на дату; могу проверить близкие сценарии: документы/платежи по контрагенту, договоры или остаток по счету.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:21:43.533Z", + "trace_id": "address-Syf4EnlE-x", + "debug": { + "trace_id": "address-Syf4EnlE-x", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "OBJECT_LOOKUP", + "query_shape_confidence": "medium", + "detected_intent": "unknown", + "detected_intent_confidence": "low", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "counterparty": "Чепурнов", + "organization": "чепурнов" + }, + "missing_required_filters": [], + "selected_recipe": null, + "mcp_call_status_legacy": "skipped", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "counterparty", + "anchor_value_raw": "Чепурнов", + "anchor_value_resolved": "Чепурнов", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "skipped", + "rows_fetched": 0, + "raw_rows_received": 0, + "rows_after_account_scope": 0, + "rows_after_recipe_filter": 0, + "rows_materialized": 0, + "rows_matched": 0, + "raw_row_keys_sample": [], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "DEEP_ONLY", + "limited_reason_category": "unsupported", + "response_type": "LIMITED_WITH_REASON", + "capability_id": "address_unknown", + "capability_layer": "conversational", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "generic_address_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "not_found", + "route_expectation_reason": "route_expectation_not_defined_for_intent", + "route_expectation_expected_selected_recipes": [], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [], + "execution_lane": "address_query", + "llm_decomposition_applied": true, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "a1hrmlpTjjyu0Z", + "llm_decomposition_effective_message": "Определить, что необходимо отгрузить контрагенту Чепурнов", + "llm_decomposition_reason": "normalized_fragment_semantic_guard_raw_fragment_preferred", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "что нам отгружать чепурнов? какой товар или услугу?", + "canonical_message": "Определить, что необходимо отгрузить контрагенту Чепурнов", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "OBJECT_LOOKUP", + "query_shape_confidence": "medium", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": "Чепурнов", + "contract": null, + "document_type": null, + "document_ref": null, + "organization": "чепурнов" + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "explicit_anchor", + "anchor_kind": "organization", + "anchor_value": "чепурнов", + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": false, + "selected_object_scope_detected": false + }, + "aggregation_profile": "list_lookup" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "что нам отгружать чепурнов? какой товар или услугу?", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_signal_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": false, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_signal_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "что нам отгружать чепурнов? какой товар или услугу?", + "effective_message": "Определить, что необходимо отгрузить контрагенту Чепурнов", + "decision": "new_topic", + "decision_reasons": [ + "effective_message_rewritten_by_predecompose" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": null, + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "a1hrmlpTjjyu0Z", + "prompt_version": "normalizer_v2_0_2", + "applied": true, + "effective_message": "Определить, что необходимо отгрузить контрагенту Чепурнов" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\", + "чепурнов" + ], + "assistant_active_organization": "чепурнов", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "partial_supported", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "partial_supported", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + }, + "truth_mode": "limited", + "carryover_eligibility": "none", + "answer_shape": "limited_with_reason", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_unknown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "counterparty", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_unknown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "counterparty", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "object_signal_detected", + "intent_not_supported_in_v1", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-DaoY2FVMLn", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "какие остатки на складе на сегодня", + "reply_type": null, + "created_at": "2026-04-16T18:22:03.980Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-3O50MQfy_B", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "В текущем срезе данных по этому запросу совпадения не найдены.\n\nпо указанному якорю и фильтрам в выборке данных нет строк.\n\nСигнал запроса: нужен подтвержденный срез товаров на складе на дату.\n\nКонтекст запроса: организация чепурнов, срез на 2026-04-16.\n\nЧто могу сделать сейчас: показать подтвержденный срез товаров на складах на дату по остатку счета 41.01; показать документы/платежи по контрагенту или договору; показать незакрытые договоры или хвосты на дату.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:22:16.105Z", + "trace_id": "address-tvsqwDGBZx", + "debug": { + "trace_id": "address-tvsqwDGBZx", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "inventory_on_hand_as_of_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "as_of_date": "2026-04-16", + "organization": "чепурнов" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_on_hand_as_of_date_v1", + "mcp_call_status_legacy": "materialized_but_not_matched", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "чепурнов", + "anchor_value_resolved": "чепурнов", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "materialized_but_not_anchor_matched", + "match_failure_reason": "organization_anchor_not_matched_in_materialized_rows", + "mcp_call_status": "materialized_but_not_anchor_matched", + "rows_fetched": 11, + "raw_rows_received": 11, + "rows_after_account_scope": 11, + "rows_after_recipe_filter": 0, + "rows_materialized": 11, + "rows_matched": 0, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Номенклатура", + "Склад", + "Организация", + "Количество", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": "empty_match", + "response_type": "LIMITED_WITH_REASON", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "weak", + "balance_confirmed": false, + "as_of_date_basis": "implicit_current_snapshot", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_on_hand_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": true, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "MDDJtpFcExFrND", + "llm_decomposition_effective_message": "Какие остатки по складу на текущую дату?", + "llm_decomposition_reason": "normalized_fragment_applied", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "какие остатки на складе на сегодня", + "canonical_message": "Какие остатки по складу на текущую дату?", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "inventory_on_hand_as_of_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": null, + "period_to": null, + "as_of_date": "2026-04-16", + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "какие остатки на складе на сегодня", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "inventory_on_hand_as_of_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "какие остатки на складе на сегодня", + "effective_message": "Какие остатки по складу на текущую дату?", + "decision": "new_topic", + "decision_reasons": [ + "effective_message_rewritten_by_predecompose", + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "inventory_on_hand_as_of_date", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": true, + "reason": "limited_result_retry_with_raw_message", + "initial_limited_category": "empty_match", + "retry_message": "какие остатки на складе на сегодня", + "retry_used_followup_context": false, + "retry_result_category": "empty_match" + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "MDDJtpFcExFrND", + "prompt_version": "normalizer_v2_0_2", + "applied": true, + "effective_message": "Какие остатки по складу на текущую дату?" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\", + "чепурнов" + ], + "assistant_active_organization": "чепурнов", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T1", + "transition_contract_title": "Root Query Entry", + "transition_contract_reason": [ + "capability_contract_root_or_new_entry" + ], + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "partial_supported", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T1", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "truth_gate_contract_status": "partial_supported", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + }, + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "answer_shape": "limited_with_reason", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "state_transition_id": "T1", + "state_transition_status": "applied", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound_with_limits", + "binding_action": "limit", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound_with_limits", + "binding_action": "limit", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "capability_binding_status": "bound_with_limits", + "capability_binding_action": "limit", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "limit", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "shape_not_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response", + "capability_binding_guard_limited_reply_type" + ] + } + } + }, + { + "message_id": "msg-5qkxAkXomO", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "остатки на март 2016", + "reply_type": null, + "created_at": "2026-04-16T18:22:27.722Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-HN7xXmGTuB", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Для такого формата запроса нужен более широкий аналитический контур, иначе ответ будет ненадежным.\n\nСценарий пока не закрыт текущими адресными маршрутами без потери точности.\n\nКонтекст запроса: организация чепурнов, период 2016-03-01..2016-03-31.\n\nЧто могу сделать сейчас: показать документы/платежи по контрагенту или договору; показать незакрытые договоры или хвосты на дату; могу проверить близкие сценарии: документы/платежи по контрагенту, договоры или остаток по счету.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:22:39.456Z", + "trace_id": "address-KaiTQ1dX-f", + "debug": { + "trace_id": "address-KaiTQ1dX-f", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "detected_intent": "unknown", + "detected_intent_confidence": "low", + "extracted_filters": { + "sort": "period_desc", + "limit": 20, + "period_from": "2016-03-01", + "period_to": "2016-03-31", + "organization": "чепурнов" + }, + "missing_required_filters": [], + "selected_recipe": null, + "mcp_call_status_legacy": "skipped", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "чепурнов", + "anchor_value_resolved": "чепурнов", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "none", + "match_failure_reason": null, + "mcp_call_status": "skipped", + "rows_fetched": 0, + "raw_rows_received": 0, + "rows_after_account_scope": 0, + "rows_after_recipe_filter": 0, + "rows_materialized": 0, + "rows_matched": 0, + "raw_row_keys_sample": [], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "DEEP_ONLY", + "limited_reason_category": "unsupported", + "response_type": "LIMITED_WITH_REASON", + "capability_id": "address_unknown", + "capability_layer": "conversational", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "generic_address_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "not_found", + "route_expectation_reason": "route_expectation_not_defined_for_intent", + "route_expectation_expected_selected_recipes": [], + "route_expectation_expected_requested_result_modes": [], + "route_expectation_expected_result_modes": [], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "L_uxpVZqxwGjMi", + "llm_decomposition_effective_message": "остатки на март 2016", + "llm_decomposition_reason": "followup_raw_message_preferred_over_llm_rewrite", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "остатки на март 2016", + "canonical_message": "остатки на март 2016", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "range", + "period_from": "2016-03-01", + "period_to": "2016-03-31", + "as_of_date": null, + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "none", + "anchor_kind": "none", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": false, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "остатки на март 2016", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_signal_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": false, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": true + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_signal_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "остатки на март 2016", + "effective_message": "остатки на март 2016", + "decision": "continue_previous", + "decision_reasons": [ + "followup_context_detected" + ], + "followup_context_applied": true, + "previous_intent": "inventory_on_hand_as_of_date", + "target_intent": "inventory_on_hand_as_of_date", + "intent_selection_mode": "carry_previous_intent", + "anchor_type": "organization", + "anchor_value": "чепурнов", + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "L_uxpVZqxwGjMi", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "остатки на март 2016" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\", + "чепурнов" + ], + "assistant_active_organization": "чепурнов", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T2", + "transition_contract_title": "Root Follow-Up With Date Or Scope Change", + "transition_contract_reason": [ + "root_followup_continue_previous" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "debug_capability_id_has_no_contract" + ], + "truth_gate_contract_status": "partial_supported", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T2", + "capability_contract_id": null, + "truth_gate_contract_status": "partial_supported", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": null, + "transition_contract_id": "T2", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + }, + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "answer_shape": "limited_with_reason", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T2", + "transition_title": "Root Follow-Up With Date Or Scope Change", + "application_status": "applied", + "declared_carryover_depth": "root_only", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "root_only", + "required_prior_state": [ + "root_frame_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "update_root_frame_state", + "run_exact_route", + "refresh_coverage_gate_state" + ], + "forbidden_carryover": [ + "incompatible_selected_object_route" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "update", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": "T2", + "state_transition_status": "applied", + "effective_carryover_depth": "root_only", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_unknown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "period_from", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "address_unknown", + "capability_contract_id": null, + "binding_status": "contract_missing", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "address_exact", + "execution_adapter": null, + "transition_id": "T2", + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [ + "sort", + "limit", + "period_from", + "period_to", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [ + "capability_contract_missing" + ], + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "contract_missing", + "capability_binding_action": "observe_only", + "capability_binding_violations": [ + "capability_contract_missing" + ], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "observe_only", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_contract_missing", + "binding_action_observe_only", + "capability_contract_missing", + "transition_status_applied", + "transition_T2", + "root_followup_continue_previous", + "debug_capability_id_has_no_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_not_defined_for_intent", + "no_address_or_deep_signal", + "address_mode_from_followup_context", + "shape_not_detected", + "intent_not_supported_in_v1", + "organization_from_followup_context", + "address_followup_context_applied" + ] + } + } + }, + { + "message_id": "msg-2xh3sbTF_V", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "это по общей базе уже нужен вывод не по чепурнову", + "reply_type": null, + "created_at": "2026-04-16T18:22:55.940Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-33Rp1ntsiF", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Коротко: Сейчас у меня нет надежного доменного маршрута по этому запросу, поэтому даю мягкий отказ вместо шаблонной технички.\n\nЧто именно проверено:\n- Проверен доступный контур 1С и возможность маршрутизации запроса.\n- Надежный доменный путь для текущей формулировки не подтвержден.\n\nЧто найдено:\n- Взаиморасчеты 60/62: найти хвосты, незакрытые оплаты и рисковые связки по контрагентам.\n- НДС 19/68: проверить цепочку документ -> счет-фактура -> регистр -> книга.\n- Закрытие месяца 20/44: проверить распределение затрат и остатки после регламентных операций.\n\nЧто пока не доказано:\n- Запрос не подтвержден в поддерживаемом контуре как надежный бухгалтерский сценарий.\n\nЧто могу сделать сейчас:\n- Взаиморасчеты 60/62 — найти хвосты, незакрытые оплаты и рисковые связки по контрагентам.\n- НДС 19/68 — проверить цепочку документ -> счет-фактура -> регистр -> книга.\n- Закрытие месяца 20/44 — проверить распределение затрат и остатки после регламентных операций.", + "reply_type": "clarification_required", + "created_at": "2026-04-16T18:23:26.399Z", + "trace_id": "xkBqFMQmF4CJwa", + "debug": { + "trace_id": "xkBqFMQmF4CJwa", + "prompt_version": "address_query_runtime_v1", + "schema_version": "v1", + "fallback_type": "clarification", + "route_summary": null, + "fragments": [], + "requirements_extracted": [ + { + "requirement_id": "R1", + "source_fragment_id": null, + "requirement_text": "это по общей базе уже нужен вывод не по чепурнову", + "subject_tokens": [], + "status": "clarification_needed", + "route": null + } + ], + "coverage_report": { + "requirements_total": 1, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [ + "R1" + ], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "no_grounded_answer", + "route_subject_match": true, + "missing_requirements": [ + "R1" + ], + "reasons": [ + "Ни одно требование не получило подтвержденного покрытия.", + "В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.", + "Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).", + "Недостаточно подтвержденных данных для уверенного ответа.", + "Не хватило целевых подтверждений по выбранному сценарию." + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "question_type_class": "unknown", + "company_anchors": { + "contract_numbers": [], + "document_numbers": [], + "dates": [], + "amounts": [], + "accounts": [], + "periods": [], + "document_types": [], + "all": [] + }, + "analysis_context_applied": false, + "analysis_context": null, + "business_scope_raw": [], + "business_scope_resolved": [ + "company_specific_accounting" + ], + "company_grounding_applied": true, + "scope_resolution_reason": [ + "settlement_claim_company_scope_recovery" + ], + "company_scope_resolution_reason": [ + "settlement_claim_company_scope_recovery" + ], + "raw_time_anchor": null, + "raw_time_scope": null, + "resolved_time_anchor": null, + "resolved_primary_period": null, + "effective_primary_period": null, + "temporal_guard_input": null, + "temporal_alignment_status": "conflicting", + "temporal_resolution_source": "normalized_time_scope:missing", + "temporal_guard_basis": "none", + "temporal_guard_applied": false, + "temporal_guard_outcome": "passed", + "temporal_guard": { + "raw_time_anchor": null, + "raw_time_scope": null, + "resolved_time_anchor": null, + "resolved_primary_period": null, + "effective_primary_period": null, + "temporal_guard_input": null, + "temporal_alignment_status": "conflicting", + "temporal_resolution_source": "normalized_time_scope:missing", + "temporal_guard_basis": "none", + "temporal_guard_applied": false, + "temporal_guard_outcome": "passed", + "primary_period_window": null, + "allowed_context_window": null, + "controlled_temporal_expansion_enabled": false, + "context_expansion_reasons_allowed": [ + "prehistory", + "carryover", + "post_period_closure", + "long_running_contract_context" + ], + "normalized_anchor_drift_detected": false, + "reason_codes": [ + "missing_resolved_primary_period" + ] + }, + "raw_numeric_tokens": [], + "classified_numeric_tokens": [], + "rejected_as_non_accounts": [], + "resolved_account_anchors": [], + "domain_polarity_guard": { + "applied": false, + "polarity": "not_applicable", + "outcome": "not_applicable", + "supplier_score": 0, + "customer_score": 0, + "account_scope": [], + "raw_numeric_tokens": [], + "classified_numeric_tokens": [], + "rejected_as_non_accounts": [], + "resolved_account_anchors": [], + "rejected_problem_units": 0, + "rejected_evidence": 0, + "critical_contradiction": false, + "reason_codes": [] + }, + "claim_anchor_audit": { + "claim_type": "prove_settlement_closure_state", + "settlement_role": "unknown", + "settlement_role_resolution_reason": [ + "settlement_role_resolved_unknown" + ], + "polarity_resolution_status": "unknown", + "required_anchors": [ + "period", + "account_scope", + "counterparty_scope_or_contract", + "closure_signal" + ], + "resolved_anchors": { + "period": [], + "account_scope": [], + "amounts": [], + "contract": [], + "document_numbers": [], + "document_types": [], + "counterparty_scope": [], + "advance_signal": [], + "closure_signal": [], + "vat_signal": [], + "chain_signal": [], + "close_signal": [], + "cost_scope": [], + "rbp_signal": [], + "writeoff_signal": [], + "fixed_asset_signal": [], + "amortization_signal": [], + "expected_fa_set": [], + "actual_fa_set": [] + }, + "missing_anchors": [ + "period", + "account_scope", + "counterparty_scope_or_contract", + "closure_signal" + ], + "claim_anchor_resolution_rate": 0, + "primary_period": null, + "allowed_context_window": null, + "context_expansion_reasons_allowed": [ + "prehistory", + "carryover", + "post_period_closure", + "long_running_contract_context" + ], + "reason_codes": [ + "claim_missing_required_anchors", + "claim_anchor_resolution_low", + "unresolved_supplier_customer_polarity" + ] + }, + "settlement_role": "unknown", + "settlement_role_resolution_reason": [ + "settlement_role_resolved_unknown" + ], + "polarity_resolution_status": "unknown", + "targeted_evidence_acquisition": { + "claim_type": "prove_settlement_closure_state", + "required_checks": [ + "payment_document_found", + "contract_matched", + "settlement_object_matched", + "closing_document_found", + "register_closure_entry_found", + "posting_link_found" + ], + "check_status": { + "payment_document_found": "not_found", + "contract_matched": "not_found", + "settlement_object_matched": "not_found", + "closing_document_found": "not_found", + "register_closure_entry_found": "not_found", + "posting_link_found": "not_found" + }, + "targeted_item_hits": 0, + "targeted_evidence_hits": 0, + "targeted_evidence_hit_rate": 0, + "targeted_evidence_source_refs": [], + "reason_codes": [ + "targeted_evidence_not_found", + "targeted_evidence_hit_rate_low" + ] + }, + "evidence_admissibility_gate": { + "candidate_evidence_total": 0, + "admissible_evidence_count": 0, + "rejected_evidence_count": 0, + "rejected_item_count": 0, + "reject_breakdown": { + "wrong_period": 0, + "wrong_domain": 0, + "wrong_account_scope": 0, + "weak_source_mapping": 0, + "zero_live_match": 0, + "future_dated_or_out_of_window": 0 + }, + "category_breakdown": { + "hard_evidence": 0, + "supporting_signal": 0, + "inadmissible_noise": 0 + }, + "reason_codes": [ + "no_admissible_evidence_for_grounded_answer" + ] + }, + "eligibility_time_basis": "none", + "grounded_answer_eligibility_guard": { + "eligible": false, + "temporal_passed": true, + "eligibility_time_basis": "none", + "business_scope_passed": true, + "polarity_passed": true, + "claim_anchors_passed": false, + "claim_anchor_resolution_rate": 0, + "missing_required_anchors": 4, + "admissible_evidence_count": 0, + "critical_contradiction": false, + "outcome": "limited_or_insufficient_evidence", + "grounding_mode": "limited_or_insufficient_evidence", + "reason_codes": [ + "claim_anchor_coverage_insufficient", + "admissible_evidence_count_zero", + "targeted_evidence_hit_rate_zero" + ] + }, + "problem_centric_answer_applied": false, + "problem_units_used_count": 0, + "problem_answer_mode": "stage1_policy_v11", + "address_llm_predecompose_attempted": true, + "address_llm_predecompose_applied": false, + "address_llm_predecompose_reason": "normalized_fragment_rejected_semantic_guard", + "address_llm_predecompose_provider": "local", + "address_fallback_rule_hit": null, + "address_tool_gate_decision": "run_address_lane", + "address_tool_gate_reason": "followup_context_detected", + "address_llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "это по общей базе уже нужен вывод не по чепурнову", + "canonical_message": "это по общей базе уже нужен вывод не по чепурнову", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "unknown", + "intent_confidence": "low", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "none", + "date_basis_hint": null, + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "address_semantic_extraction_contract": null, + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "unknown", + "address_intent_confidence": "low", + "strong_data_signal_detected": false, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": false, + "semantic_apply_canonical_recommended": false, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": false, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": true + }, + "followup_context_detected": true, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "followup_context_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "assistant_outcome_class_v1": "BLOCKED_BY_AMBIGUITY", + "assistant_orchestration_contracts_v1": { + "query_frame": { + "schema_version": "assistant_query_frame_v1", + "original_user_question": "это по общей базе уже нужен вывод не по чепурнову", + "normalized_question": "это по общей базе уже нужен вывод не по чепурнову", + "route_summary_mode": "none", + "fragments_total": 0, + "dropped_intent_segments": [], + "analysis_context": null + }, + "execution_plan": { + "schema_version": "assistant_execution_plan_v1", + "steps": [], + "requirements_total": 1 + }, + "evidence_bundle": { + "schema_version": "assistant_evidence_bundle_v1", + "retrieval_calls_total": 0, + "retrieval_results_total": 0, + "retrieval_status_breakdown": { + "ok": 0, + "partial": 0, + "empty": 0, + "error": 0 + }, + "evidence_total": 0, + "source_refs_total": 0, + "limitation_total": 0, + "error_total": 0 + }, + "coverage": { + "schema_version": "assistant_coverage_contract_v1", + "coverage_report": { + "requirements_total": 1, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [ + "R1" + ], + "out_of_scope_requirements": [] + }, + "grounding": { + "status": "no_grounded_answer", + "route_subject_match": true, + "missing_requirements": [ + "R1" + ], + "reasons": [ + "Ни одно требование не получило подтвержденного покрытия.", + "В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.", + "Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).", + "Недостаточно подтвержденных данных для уверенного ответа.", + "Не хватило целевых подтверждений по выбранному сценарию." + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "outcome_class": "BLOCKED_BY_AMBIGUITY" + } + }, + "answer_contract_stage4_v1": { + "schema_version": "stage4_answer_contract_audit_v1", + "stage4_blocks_expected": [ + "Коротко", + "Что именно проверено", + "Что найдено", + "Что пока не доказано", + "Что проверить первым/Что могу сделать сейчас" + ], + "stage4_blocks_present": [ + "Коротко", + "Что именно проверено", + "Что найдено", + "Что пока не доказано", + "Что проверить первым/Что могу сделать сейчас" + ], + "stage4_blocks_missing": [], + "legacy_blocks_present": [], + "is_stage4_shape": true + }, + "answer_structure_v11": { + "schema_version": "answer_structure_v1_1", + "answer_summary": "Нужны уточнения: без сужения фокуса надежный вывод невозможен.", + "direct_answer": "Есть признаки проблемы, но без уточнений по периоду и объекту вывод ненадежен.", + "mechanism_block": { + "status": "unresolved", + "mechanism_notes": [], + "limitation_reason_codes": [] + }, + "evidence_block": { + "evidence_ids": [], + "source_refs": [], + "mechanism_notes": [], + "coverage_note": "coverage_partial_or_limited" + }, + "uncertainty_block": { + "open_uncertainties": [ + "R1", + "missing_anchor:period", + "missing_anchor:account", + "missing_anchor:document_or_object", + "missing_anchor:counterparty" + ], + "limitations": [ + "Ни одно требование не получило подтвержденного покрытия.", + "В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.", + "Не хватает ключевых ориентиров в вопросе (период, объект или контрагент).", + "Недостаточно подтвержденных данных для уверенного ответа.", + "Не хватило целевых подтверждений по выбранному сценарию." + ] + }, + "next_step_block": { + "recommended_actions": [ + "Дайте недостающие якоря (период/счет/объект), иначе сильный factual вывод невозможен." + ], + "clarification_questions": [ + "Уточните период проверки (например, июль 2020).", + "Уточните счет или группу счетов (например, 19, 60, 62).", + "Укажите документ/GUID/конкретный объект для трассировки.", + "Укажите контрагента или группу контрагентов.", + "Закройте уточнения для требований: R1." + ] + } + }, + "investigation_state_snapshot": { + "schema_version": "investigation_state_v1", + "session_id": "asst-NhPaZfbRYr", + "status": "active", + "turn_index": 1, + "updated_at": "2026-04-16T18:23:26.395Z", + "question_id": "msg-2xh3sbTF_V", + "question_scope_id": "s:это по общей базе уже нужен вывод не по чепурнову", + "scope_origin": "underspecified", + "focus": { + "domain": null, + "period": null, + "primary_accounts": [], + "active_query_subject": "это по общей базе уже нужен вывод не по чепурнову" + }, + "narrowing_status": "unknown", + "evidence_refs": [], + "open_uncertainties": [ + "clarify:R1" + ], + "last_answer_mode": "clarification_required", + "followup_context": { + "previous_question_id": null, + "last_user_message": "это по общей базе уже нужен вывод не по чепурнову", + "referenced_requirement_ids": [ + "R1" + ], + "active_domain": null, + "active_requirement_ids": [ + "R1" + ], + "uncovered_requirement_ids": [ + "R1" + ], + "last_problem_unit_id": null, + "settlement_next_actions": [], + "evidence_summary": [], + "question_scope_id": "s:это по общей базе уже нужен вывод не по чепурнову", + "scope_origin": "underspecified" + }, + "query_mode_hint": "investigation_candidate" + }, + "normalized": null, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "capability_contract_not_resolved" + ], + "truth_gate_contract_status": "limited_temporal_or_contextual", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "limited_temporal_or_contextual", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "no_grounded_answer", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "не_хватает_ключевых_ориентиров_в_вопросе_период_объект_или_контрагент_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "coverage_clarification_r1" + ], + "source_truth_gate_status": "limited_temporal_or_contextual", + "blocked_or_limited_explanation": "temporal_or_contextual_limit" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "deep_analysis", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "no_grounded_answer", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "не_хватает_ключевых_ориентиров_в_вопросе_период_объект_или_контрагент_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "coverage_clarification_r1" + ], + "source_truth_gate_status": "limited_temporal_or_contextual", + "blocked_or_limited_explanation": "temporal_or_contextual_limit" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "deep_analysis", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + }, + "truth_mode": "limited", + "carryover_eligibility": "none", + "answer_shape": "limited_with_reason", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "no_grounded_answer", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "не_хватает_ключевых_ориентиров_в_вопросе_период_объект_или_контрагент_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "coverage_clarification_r1" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "не_хватает_ключевых_ориентиров_в_вопросе_период_объект_или_контрагент_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "coverage_clarification_r1" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "no_grounded_answer", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "не_хватает_ключевых_ориентиров_в_вопросе_период_объект_или_контрагент_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "coverage_clarification_r1" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "не_хватает_ключевых_ориентиров_в_вопросе_период_объект_или_контрагент_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "coverage_clarification_r1" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": null, + "capability_contract_id": null, + "binding_status": "not_applicable", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "unknown", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [], + "reason_codes": [ + "binding_status_not_applicable", + "binding_action_observe_only", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "не_хватает_ключевых_ориентиров_в_вопросе_период_объект_или_контрагент_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "coverage_clarification_r1" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": null, + "capability_contract_id": null, + "binding_status": "not_applicable", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "unknown", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [], + "reason_codes": [ + "binding_status_not_applicable", + "binding_action_observe_only", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "не_хватает_ключевых_ориентиров_в_вопросе_период_объект_или_контрагент_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "coverage_clarification_r1" + ] + }, + "capability_binding_status": "not_applicable", + "capability_binding_action": "observe_only", + "capability_binding_violations": [] + } + }, + { + "message_id": "msg-u2tKa8i2un", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "хвосты покажи по счету 60 на август 2022", + "reply_type": null, + "created_at": "2026-04-16T18:23:55.251Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-qeLq_qTjr0", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "Коротко: По сценарию взаиморасчетов 60/62 пока не хватает подтвержденной опоры для надежного вывода.\n\nЧто именно проверено:\n- Проверен сценарий взаиморасчетов 60/62 в текущем контуре 1С.\n- Оценена достаточность подтвержденной опоры для прямого вывода.\n\nЧто найдено:\n- Взаиморасчеты 60/62: найти хвосты, незакрытые оплаты и рисковые связки по контрагентам.\n- НДС 19/68: проверить цепочку документ -> счет-фактура -> регистр -> книга.\n\nЧто пока не доказано:\n- Добавь контрагента или договор, чтобы зафиксировать контур проверки.\n- Укажи документ или объект, от которого строить проверку цепочки.\n- Уточни тип отклонения: разрыв цепочки, неверное закрытие или аномальный хвост.\n- Закрой уточнения для требований: R1.\n\nЧто могу сделать сейчас:\n- Взаиморасчеты 60/62 — найти хвосты, незакрытые оплаты и рисковые связки по контрагентам.\n- НДС 19/68 — проверить цепочку документ -> счет-фактура -> регистр -> книга.\n- Закрытие месяца 20/44 — проверить распределение затрат и остатки после регламентных операций.", + "reply_type": "clarification_required", + "created_at": "2026-04-16T18:24:30.547Z", + "trace_id": "pLbyYu0qF3AqJ4", + "debug": { + "trace_id": "pLbyYu0qF3AqJ4", + "prompt_version": "address_query_runtime_v1", + "schema_version": "v1", + "fallback_type": "clarification", + "route_summary": null, + "fragments": [], + "requirements_extracted": [ + { + "requirement_id": "R1", + "source_fragment_id": null, + "requirement_text": "хвосты покажи по счету 60 на август 2022", + "subject_tokens": [ + "anomaly" + ], + "status": "clarification_needed", + "route": null + } + ], + "coverage_report": { + "requirements_total": 1, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [ + "R1" + ], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "no_grounded_answer", + "route_subject_match": true, + "missing_requirements": [ + "R1" + ], + "reasons": [ + "Ни одно требование не получило подтвержденного покрытия.", + "В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.", + "Часть контекста вопроса не подтверждена напрямую в найденных данных: anomaly", + "Не удалось однозначно определить сторону расчета (нам должны или мы должны).", + "Недостаточно подтвержденных данных для уверенного ответа.", + "Не хватило целевых подтверждений по выбранному сценарию.", + "Есть противоречие по выбранному домену или контуру счета." + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "question_type_class": "unknown", + "company_anchors": { + "contract_numbers": [], + "document_numbers": [], + "dates": [], + "amounts": [], + "accounts": [], + "periods": [ + "2022" + ], + "document_types": [], + "all": [ + "period:2022" + ] + }, + "analysis_context_applied": false, + "analysis_context": null, + "business_scope_raw": [], + "business_scope_resolved": [ + "company_specific_accounting" + ], + "company_grounding_applied": true, + "scope_resolution_reason": [ + "settlement_claim_company_scope_recovery" + ], + "company_scope_resolution_reason": [ + "settlement_claim_company_scope_recovery" + ], + "raw_time_anchor": null, + "raw_time_scope": null, + "resolved_time_anchor": null, + "resolved_primary_period": null, + "effective_primary_period": null, + "temporal_guard_input": null, + "temporal_alignment_status": "conflicting", + "temporal_resolution_source": "normalized_time_scope:missing", + "temporal_guard_basis": "none", + "temporal_guard_applied": false, + "temporal_guard_outcome": "passed", + "temporal_guard": { + "raw_time_anchor": null, + "raw_time_scope": null, + "resolved_time_anchor": null, + "resolved_primary_period": null, + "effective_primary_period": null, + "temporal_guard_input": null, + "temporal_alignment_status": "conflicting", + "temporal_resolution_source": "normalized_time_scope:missing", + "temporal_guard_basis": "none", + "temporal_guard_applied": false, + "temporal_guard_outcome": "passed", + "primary_period_window": null, + "allowed_context_window": null, + "controlled_temporal_expansion_enabled": false, + "context_expansion_reasons_allowed": [ + "prehistory", + "carryover", + "post_period_closure", + "long_running_contract_context" + ], + "normalized_anchor_drift_detected": false, + "reason_codes": [ + "missing_resolved_primary_period" + ] + }, + "raw_numeric_tokens": [ + "60", + "2022" + ], + "classified_numeric_tokens": [ + { + "token": "60", + "classification": "other_numeric" + } + ], + "rejected_as_non_accounts": [ + "60" + ], + "resolved_account_anchors": [], + "domain_polarity_guard": { + "applied": true, + "polarity": "mixed_or_unresolved", + "outcome": "limited_unresolved_polarity", + "supplier_score": 0, + "customer_score": 0, + "account_scope": [], + "raw_numeric_tokens": [ + "60", + "2022" + ], + "classified_numeric_tokens": [ + { + "token": "60", + "classification": "other_numeric" + } + ], + "rejected_as_non_accounts": [ + "60" + ], + "resolved_account_anchors": [], + "rejected_problem_units": 0, + "rejected_evidence": 0, + "critical_contradiction": true, + "reason_codes": [ + "unresolved_supplier_customer_polarity", + "supplier_customer_signals_absent" + ] + }, + "claim_anchor_audit": { + "claim_type": "prove_settlement_closure_state", + "settlement_role": "unknown", + "settlement_role_resolution_reason": [ + "settlement_role_resolved_unknown" + ], + "polarity_resolution_status": "unknown", + "required_anchors": [ + "period", + "account_scope", + "counterparty_scope_or_contract", + "closure_signal" + ], + "resolved_anchors": { + "period": [ + "2022" + ], + "account_scope": [], + "amounts": [], + "contract": [], + "document_numbers": [], + "document_types": [], + "counterparty_scope": [], + "advance_signal": [], + "closure_signal": [ + "closure" + ], + "vat_signal": [], + "chain_signal": [], + "close_signal": [], + "cost_scope": [], + "rbp_signal": [], + "writeoff_signal": [], + "fixed_asset_signal": [], + "amortization_signal": [], + "expected_fa_set": [], + "actual_fa_set": [] + }, + "missing_anchors": [ + "account_scope", + "counterparty_scope_or_contract" + ], + "claim_anchor_resolution_rate": 0.5, + "primary_period": null, + "allowed_context_window": null, + "context_expansion_reasons_allowed": [ + "prehistory", + "carryover", + "post_period_closure", + "long_running_contract_context" + ], + "reason_codes": [ + "claim_missing_required_anchors", + "claim_anchor_resolution_low", + "unresolved_supplier_customer_polarity" + ] + }, + "settlement_role": "unknown", + "settlement_role_resolution_reason": [ + "settlement_role_resolved_unknown" + ], + "polarity_resolution_status": "unknown", + "targeted_evidence_acquisition": { + "claim_type": "prove_settlement_closure_state", + "required_checks": [ + "payment_document_found", + "contract_matched", + "settlement_object_matched", + "closing_document_found", + "register_closure_entry_found", + "posting_link_found" + ], + "check_status": { + "payment_document_found": "not_found", + "contract_matched": "not_found", + "settlement_object_matched": "not_found", + "closing_document_found": "not_found", + "register_closure_entry_found": "not_found", + "posting_link_found": "not_found" + }, + "targeted_item_hits": 0, + "targeted_evidence_hits": 0, + "targeted_evidence_hit_rate": 0, + "targeted_evidence_source_refs": [], + "reason_codes": [ + "targeted_evidence_not_found", + "targeted_evidence_hit_rate_low" + ] + }, + "evidence_admissibility_gate": { + "candidate_evidence_total": 0, + "admissible_evidence_count": 0, + "rejected_evidence_count": 0, + "rejected_item_count": 0, + "reject_breakdown": { + "wrong_period": 0, + "wrong_domain": 0, + "wrong_account_scope": 0, + "weak_source_mapping": 0, + "zero_live_match": 0, + "future_dated_or_out_of_window": 0 + }, + "category_breakdown": { + "hard_evidence": 0, + "supporting_signal": 0, + "inadmissible_noise": 0 + }, + "reason_codes": [ + "no_admissible_evidence_for_grounded_answer" + ] + }, + "eligibility_time_basis": "none", + "grounded_answer_eligibility_guard": { + "eligible": false, + "temporal_passed": true, + "eligibility_time_basis": "none", + "business_scope_passed": true, + "polarity_passed": false, + "claim_anchors_passed": true, + "claim_anchor_resolution_rate": 0.5, + "missing_required_anchors": 2, + "admissible_evidence_count": 0, + "critical_contradiction": true, + "outcome": "limited_or_insufficient_evidence", + "grounding_mode": "limited_or_insufficient_evidence", + "reason_codes": [ + "polarity_guard_limited_unresolved_polarity", + "admissible_evidence_count_zero", + "targeted_evidence_hit_rate_zero", + "critical_domain_or_account_contradiction" + ] + }, + "problem_centric_answer_applied": false, + "problem_units_used_count": 0, + "problem_answer_mode": "stage1_policy_v11", + "address_llm_predecompose_attempted": true, + "address_llm_predecompose_applied": true, + "address_llm_predecompose_reason": "normalized_fragment_applied", + "address_llm_predecompose_provider": "local", + "address_fallback_rule_hit": null, + "address_tool_gate_decision": "skip_address_lane", + "address_tool_gate_reason": "deep_analysis_signal_fallback_to_deep", + "address_llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "хвосты покажи по счету 60 на август 2022", + "canonical_message": "покажи остатки (хвосты) по счету 60 за август 2022 года", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "UNKNOWN", + "query_shape_confidence": "low", + "intent": "account_balance_snapshot", + "intent_confidence": "high", + "entities": { + "account": "60", + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": "2022-08-01", + "period_to": "2022-08-31", + "as_of_date": "2022-08-31", + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "balance_snapshot" + }, + "address_semantic_extraction_contract": null, + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "account_balance_snapshot", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [ + "deep_investigation_signal_detected" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": false, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": true, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": true, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": false, + "tool_gate_decision": "skip_address_lane", + "tool_gate_reason": "deep_analysis_signal_fallback_to_deep", + "living_mode": "deep_analysis", + "living_reason": "deep_analysis_signal_fallback_to_deep" + } + }, + "assistant_outcome_class_v1": "BLOCKED_BY_AMBIGUITY", + "assistant_orchestration_contracts_v1": { + "query_frame": { + "schema_version": "assistant_query_frame_v1", + "original_user_question": "хвосты покажи по счету 60 на август 2022", + "normalized_question": "хвосты покажи по счету 60 на август 2022", + "route_summary_mode": "none", + "fragments_total": 0, + "dropped_intent_segments": [], + "analysis_context": null + }, + "execution_plan": { + "schema_version": "assistant_execution_plan_v1", + "steps": [], + "requirements_total": 1 + }, + "evidence_bundle": { + "schema_version": "assistant_evidence_bundle_v1", + "retrieval_calls_total": 0, + "retrieval_results_total": 0, + "retrieval_status_breakdown": { + "ok": 0, + "partial": 0, + "empty": 0, + "error": 0 + }, + "evidence_total": 0, + "source_refs_total": 0, + "limitation_total": 0, + "error_total": 0 + }, + "coverage": { + "schema_version": "assistant_coverage_contract_v1", + "coverage_report": { + "requirements_total": 1, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [ + "R1" + ], + "out_of_scope_requirements": [] + }, + "grounding": { + "status": "no_grounded_answer", + "route_subject_match": true, + "missing_requirements": [ + "R1" + ], + "reasons": [ + "Ни одно требование не получило подтвержденного покрытия.", + "В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.", + "Часть контекста вопроса не подтверждена напрямую в найденных данных: anomaly", + "Не удалось однозначно определить сторону расчета (нам должны или мы должны).", + "Недостаточно подтвержденных данных для уверенного ответа.", + "Не хватило целевых подтверждений по выбранному сценарию.", + "Есть противоречие по выбранному домену или контуру счета." + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "outcome_class": "BLOCKED_BY_AMBIGUITY" + } + }, + "answer_contract_stage4_v1": { + "schema_version": "stage4_answer_contract_audit_v1", + "stage4_blocks_expected": [ + "Коротко", + "Что именно проверено", + "Что найдено", + "Что пока не доказано", + "Что проверить первым/Что могу сделать сейчас" + ], + "stage4_blocks_present": [ + "Коротко", + "Что именно проверено", + "Что найдено", + "Что пока не доказано", + "Что проверить первым/Что могу сделать сейчас" + ], + "stage4_blocks_missing": [], + "legacy_blocks_present": [], + "is_stage4_shape": true + }, + "answer_structure_v11": { + "schema_version": "answer_structure_v1_1", + "answer_summary": "Нужны уточнения: без сужения фокуса надежный вывод невозможен.", + "direct_answer": "Есть признаки проблемы, но без уточнений по периоду и объекту вывод ненадежен.", + "mechanism_block": { + "status": "unresolved", + "mechanism_notes": [], + "limitation_reason_codes": [] + }, + "evidence_block": { + "evidence_ids": [], + "source_refs": [], + "mechanism_notes": [], + "coverage_note": "coverage_partial_or_limited" + }, + "uncertainty_block": { + "open_uncertainties": [ + "R1", + "missing_anchor:document_or_object", + "missing_anchor:counterparty" + ], + "limitations": [ + "Ни одно требование не получило подтвержденного покрытия.", + "В текущей выборке не хватает явных подтверждений, почему записи попали в ответ.", + "Часть контекста вопроса не подтверждена напрямую в найденных данных: anomaly", + "Не удалось однозначно определить сторону расчета (нам должны или мы должны).", + "Недостаточно подтвержденных данных для уверенного ответа.", + "Не хватило целевых подтверждений по выбранному сценарию.", + "Есть противоречие по выбранному домену или контуру счета.", + "Часть якорей запроса пока не подтверждена в опоре: 2022, period:2022." + ] + }, + "next_step_block": { + "recommended_actions": [ + "Дайте недостающие якоря (период/счет/объект), иначе сильный factual вывод невозможен." + ], + "clarification_questions": [ + "Укажите документ/GUID/конкретный объект для трассировки.", + "Укажите контрагента или группу контрагентов.", + "Закройте уточнения для требований: R1." + ] + } + }, + "investigation_state_snapshot": { + "schema_version": "investigation_state_v1", + "session_id": "asst-NhPaZfbRYr", + "status": "active", + "turn_index": 2, + "updated_at": "2026-04-16T18:24:30.546Z", + "question_id": "msg-u2tKa8i2un", + "question_scope_id": "d:settlements_60_62|p:2022|a:60|s:хвосты покажи по счету 60 на август 2022", + "scope_origin": "explicit_from_message", + "focus": { + "domain": "settlements_60_62", + "period": "2022", + "primary_accounts": [ + "60" + ], + "active_query_subject": "хвосты покажи по счету 60 на август 2022" + }, + "narrowing_status": "unknown", + "evidence_refs": [], + "open_uncertainties": [ + "clarify:R1" + ], + "last_answer_mode": "clarification_required", + "followup_context": { + "previous_question_id": "msg-2xh3sbTF_V", + "last_user_message": "хвосты покажи по счету 60 на август 2022", + "referenced_requirement_ids": [ + "R1" + ], + "active_domain": "settlements_60_62", + "active_requirement_ids": [ + "R1" + ], + "uncovered_requirement_ids": [ + "R1" + ], + "last_problem_unit_id": null, + "settlement_next_actions": [ + "Проверьте договор и объект расчетов по платежу.", + "Сверьте регистр расчетов и привязку платежа к закрывающему документу.", + "Проверьте зачет аванса или взаимозачет по связке 60/62." + ], + "evidence_summary": [], + "question_scope_id": "d:settlements_60_62|p:2022|a:60|s:хвосты покажи по счету 60 на август 2022", + "scope_origin": "explicit_from_message" + }, + "query_mode_hint": "investigation_candidate" + }, + "normalized": null, + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": null, + "transition_contract_title": null, + "transition_contract_reason": [ + "transition_contract_not_resolved" + ], + "capability_contract_id": null, + "capability_contract_reason": [ + "capability_contract_not_resolved" + ], + "truth_gate_contract_status": "limited_temporal_or_contextual", + "carryover_eligibility": "none" + }, + "transition_contract_id": null, + "capability_contract_id": null, + "truth_gate_contract_status": "limited_temporal_or_contextual", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "no_grounded_answer", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "часть_контекста_вопроса_не_подтверждена_напрямую_в_найденных_данных:_anomaly", + "не_удалось_однозначно_определить_сторону_расчета_нам_должны_или_мы_должны_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "есть_противоречие_по_выбранному_домену_или_контуру_счета.", + "coverage_clarification_r1" + ], + "source_truth_gate_status": "limited_temporal_or_contextual", + "blocked_or_limited_explanation": "temporal_or_contextual_limit" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "deep_analysis", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "no_grounded_answer", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "часть_контекста_вопроса_не_подтверждена_напрямую_в_найденных_данных:_anomaly", + "не_удалось_однозначно_определить_сторону_расчета_нам_должны_или_мы_должны_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "есть_противоречие_по_выбранному_домену_или_контуру_счета.", + "coverage_clarification_r1" + ], + "source_truth_gate_status": "limited_temporal_or_contextual", + "blocked_or_limited_explanation": "temporal_or_contextual_limit" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "deep_analysis", + "capability_contract_id": null, + "transition_contract_id": null, + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": false, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + }, + "truth_mode": "limited", + "carryover_eligibility": "none", + "answer_shape": "limited_with_reason", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "no_grounded_answer", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "часть_контекста_вопроса_не_подтверждена_напрямую_в_найденных_данных:_anomaly", + "не_удалось_однозначно_определить_сторону_расчета_нам_должны_или_мы_должны_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "есть_противоречие_по_выбранному_домену_или_контуру_счета.", + "coverage_clarification_r1" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "часть_контекста_вопроса_не_подтверждена_напрямую_в_найденных_данных:_anomaly", + "не_удалось_однозначно_определить_сторону_расчета_нам_должны_или_мы_должны_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "есть_противоречие_по_выбранному_домену_или_контуру_счета.", + "coverage_clarification_r1" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": null, + "transition_title": null, + "application_status": "unresolved", + "declared_carryover_depth": null, + "truth_gate_carryover_depth": "none", + "effective_carryover_depth": "none", + "required_prior_state": [], + "expected_answer_mode": null, + "state_mutations": [], + "forbidden_carryover": [ + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "none", + "root_frame_state": "none", + "selected_object_frame_state": "none", + "meta_frame_state": "none", + "clarification_state": "none", + "coverage_gate_state": "none", + "answer_context_state": "none" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "no_grounded_answer", + "truth_mode": "limited", + "carryover_eligibility": "none", + "reason_codes": [ + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "часть_контекста_вопроса_не_подтверждена_напрямую_в_найденных_данных:_anomaly", + "не_удалось_однозначно_определить_сторону_расчета_нам_должны_или_мы_должны_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "есть_противоречие_по_выбранному_домену_или_контуру_счета.", + "coverage_clarification_r1" + ] + }, + "reason_codes": [ + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "часть_контекста_вопроса_не_подтверждена_напрямую_в_найденных_данных:_anomaly", + "не_удалось_однозначно_определить_сторону_расчета_нам_должны_или_мы_должны_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "есть_противоречие_по_выбранному_домену_или_контуру_счета.", + "coverage_clarification_r1" + ] + }, + "state_transition_id": null, + "state_transition_status": "unresolved", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": null, + "capability_contract_id": null, + "binding_status": "not_applicable", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "unknown", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [], + "reason_codes": [ + "binding_status_not_applicable", + "binding_action_observe_only", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "часть_контекста_вопроса_не_подтверждена_напрямую_в_найденных_данных:_anomaly", + "не_удалось_однозначно_определить_сторону_расчета_нам_должны_или_мы_должны_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "есть_противоречие_по_выбранному_домену_или_контуру_счета.", + "coverage_clarification_r1" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": null, + "capability_contract_id": null, + "binding_status": "not_applicable", + "binding_action": "observe_only", + "runtime_lane_expected": null, + "runtime_lane_observed": "unknown", + "execution_adapter": null, + "transition_id": null, + "transition_allowed": false, + "required_anchors": [], + "provided_anchors": [], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": null, + "answer_object_shape": null, + "truth_gate_behavior": null, + "truth_fallback_allowed": null, + "answer_shape_compatible": false, + "violations": [], + "reason_codes": [ + "binding_status_not_applicable", + "binding_action_observe_only", + "transition_status_unresolved", + "transition_unresolved", + "transition_contract_not_resolved", + "capability_contract_not_resolved", + "truth_gate_limited_temporal_or_contextual", + "truth_mode_limited", + "ни_одно_требование_не_получило_подтвержденного_покрытия.", + "в_текущей_выборке_не_хватает_явных_подтверждений_почему_записи_попали_в_ответ.", + "часть_контекста_вопроса_не_подтверждена_напрямую_в_найденных_данных:_anomaly", + "не_удалось_однозначно_определить_сторону_расчета_нам_должны_или_мы_должны_.", + "недостаточно_подтвержденных_данных_для_уверенного_ответа.", + "не_хватило_целевых_подтверждений_по_выбранному_сценарию.", + "есть_противоречие_по_выбранному_домену_или_контуру_счета.", + "coverage_clarification_r1" + ] + }, + "capability_binding_status": "not_applicable", + "capability_binding_action": "observe_only", + "capability_binding_violations": [] + } + }, + { + "message_id": "msg-BypS9Y0Di-", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "Есть ли остатки товара, которые закупались очень давно", + "reply_type": null, + "created_at": "2026-04-16T18:25:30.156Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-WAGYi0G2xn", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "По заданным фильтрам в текущем срезе совпадений пока нет.\n\nпо указанному якорю и фильтрам в выборке данных нет строк.\n\nСигнал запроса: проверка фактического состояния по данным.\n\nКонтекст запроса: организация чепурнов.\n\nЧто могу сделать сейчас: показать документы/платежи по контрагенту или договору; показать незакрытые договоры или хвосты на дату; уточните период или снимите часть фильтров.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:25:45.535Z", + "trace_id": "address-W9s6Ui3t8s", + "debug": { + "trace_id": "address-W9s6Ui3t8s", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "medium", + "query_shape": "VERIFY_FACTUAL", + "query_shape_confidence": "medium", + "detected_intent": "inventory_aging_by_purchase_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_asc", + "organization": "чепурнов" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_aging_by_purchase_date_v1", + "mcp_call_status_legacy": "materialized_but_not_matched", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "чепурнов", + "anchor_value_resolved": "чепурнов", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "materialized_but_not_anchor_matched", + "match_failure_reason": "organization_anchor_not_matched_in_materialized_rows", + "mcp_call_status": "materialized_but_not_anchor_matched", + "rows_fetched": 500, + "raw_rows_received": 500, + "rows_after_account_scope": 500, + "rows_after_recipe_filter": 0, + "rows_materialized": 500, + "rows_matched": 0, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "СубконтоДт1", + "СубконтоДт2", + "СубконтоДт3", + "СубконтоКт1", + "СубконтоКт2", + "СубконтоКт3", + "Организация", + "Period", + "Registrator", + "AccountDt", + "AccountKt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": "empty_match", + "response_type": "LIMITED_WITH_REASON", + "capability_id": "inventory_inventory_aging_by_purchase_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_aging_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_aging_by_purchase_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": false, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "EIKbsNs9L-zjqR", + "llm_decomposition_effective_message": "Есть ли остатки товара, которые закупались очень давно", + "llm_decomposition_reason": "normalized_fragment_rejected_intent_drop", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "Есть ли остатки товара, которые закупались очень давно", + "canonical_message": "Есть ли остатки товара, которые закупались очень давно", + "mode": "unsupported", + "mode_confidence": "low", + "query_shape": "VERIFY_FACTUAL", + "query_shape_confidence": "medium", + "intent": "inventory_aging_by_purchase_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "unspecified", + "period_from": null, + "period_to": null, + "as_of_date": null, + "has_explicit_period": false + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "implicit_current", + "date_basis_hint": "implicit_current_snapshot", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "unknown" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "есть ли остатки товара, которые закупались очень давно", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "unsupported", + "address_mode_confidence": "low", + "address_intent": "inventory_aging_by_purchase_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": false, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [ + "unsupported_low_confidence_contract" + ], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": false, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_intent_resolver_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "Есть ли остатки товара, которые закупались очень давно", + "effective_message": "Есть ли остатки товара, которые закупались очень давно", + "decision": "new_topic", + "decision_reasons": [ + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "inventory_aging_by_purchase_date", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": false, + "reason": null, + "initial_limited_category": null, + "retry_message": null, + "retry_used_followup_context": false, + "retry_result_category": null + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "EIKbsNs9L-zjqR", + "prompt_version": "normalizer_v2_0_2", + "applied": false, + "effective_message": "Есть ли остатки товара, которые закупались очень давно" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\", + "чепурнов" + ], + "assistant_active_organization": "чепурнов", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T1", + "transition_contract_title": "Root Query Entry", + "transition_contract_reason": [ + "capability_contract_root_or_new_entry" + ], + "capability_contract_id": "inventory_inventory_aging_by_purchase_date", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "partial_supported", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T1", + "capability_contract_id": "inventory_inventory_aging_by_purchase_date", + "truth_gate_contract_status": "partial_supported", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": "inventory_inventory_aging_by_purchase_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": "inventory_inventory_aging_by_purchase_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + }, + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "answer_shape": "limited_with_reason", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "state_transition_id": "T1", + "state_transition_status": "applied", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "inventory_inventory_aging_by_purchase_date", + "capability_contract_id": "inventory_inventory_aging_by_purchase_date", + "binding_status": "bound_with_limits", + "binding_action": "limit", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "oldest_first_inventory_aging_list", + "answer_object_shape": "inventory_aging_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "inventory_inventory_aging_by_purchase_date", + "capability_contract_id": "inventory_inventory_aging_by_purchase_date", + "binding_status": "bound_with_limits", + "binding_action": "limit", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "oldest_first_inventory_aging_list", + "answer_object_shape": "inventory_aging_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied" + ] + }, + "capability_binding_status": "bound_with_limits", + "capability_binding_action": "limit", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "limit", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "no_address_or_deep_signal", + "address_mode_from_resolved_intent", + "verify_signal_detected", + "inventory_aging_signal_detected_strong", + "organization_from_followup_context", + "address_followup_context_applied", + "capability_binding_guard_limited_reply_type" + ] + } + } + }, + { + "message_id": "msg-gVtF5_ZuY1", + "session_id": "asst-NhPaZfbRYr", + "role": "user", + "text": "Какие конкретно номенклатуры формируют остаток по складу на май 2020", + "reply_type": null, + "created_at": "2026-04-16T18:25:52.573Z", + "trace_id": null, + "debug": null + }, + { + "message_id": "msg-irmAz56n7i", + "session_id": "asst-NhPaZfbRYr", + "role": "assistant", + "text": "В текущем срезе данных по этому запросу совпадения не найдены.\n\nпо указанному якорю и фильтрам в выборке данных нет строк.\n\nСигнал запроса: нужен подтвержденный срез товаров на складе на дату.\n\nКонтекст запроса: организация чепурнов, срез на 2020-05-31.\n\nЧто могу сделать сейчас: показать подтвержденный срез товаров на складах на дату по остатку счета 41.01; показать документы/платежи по контрагенту или договору; показать незакрытые договоры или хвосты на дату.", + "reply_type": "partial_coverage", + "created_at": "2026-04-16T18:26:06.068Z", + "trace_id": "address-PmL7KRDOmy", + "debug": { + "trace_id": "address-PmL7KRDOmy", + "prompt_version": "address_query_runtime_v1", + "schema_version": "address_query_runtime_v1", + "fallback_type": "partial", + "route_summary": null, + "fragments": [], + "requirements_extracted": [], + "coverage_report": { + "requirements_total": 0, + "requirements_covered": 0, + "requirements_uncovered": [], + "requirements_partially_covered": [], + "clarification_needed_for": [], + "out_of_scope_requirements": [] + }, + "routes": [], + "retrieval_status": [], + "retrieval_results": [], + "answer_grounding_check": { + "status": "partial", + "route_subject_match": true, + "missing_requirements": [], + "reasons": [ + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "why_included_summary": [], + "selection_reason_summary": [] + }, + "dropped_intent_segments": [], + "detected_mode": "address_query", + "detected_mode_confidence": "high", + "query_shape": "AGGREGATE_LOOKUP", + "query_shape_confidence": "high", + "detected_intent": "inventory_on_hand_as_of_date", + "detected_intent_confidence": "high", + "extracted_filters": { + "sort": "period_desc", + "period_from": "2020-05-01", + "period_to": "2020-05-31", + "as_of_date": "2020-05-31", + "organization": "чепурнов" + }, + "missing_required_filters": [], + "selected_recipe": "address_inventory_on_hand_as_of_date_v1", + "mcp_call_status_legacy": "materialized_but_not_matched", + "account_scope_mode": "strict", + "account_scope_fallback_applied": false, + "anchor_type": "organization", + "anchor_value_raw": "чепурнов", + "anchor_value_resolved": "чепурнов", + "resolver_confidence": "medium", + "ambiguity_count": 0, + "match_failure_stage": "materialized_but_not_anchor_matched", + "match_failure_reason": "organization_anchor_not_matched_in_materialized_rows", + "mcp_call_status": "materialized_but_not_anchor_matched", + "rows_fetched": 10, + "raw_rows_received": 10, + "rows_after_account_scope": 10, + "rows_after_recipe_filter": 0, + "rows_materialized": 10, + "rows_matched": 0, + "raw_row_keys_sample": [ + "Период", + "Регистратор", + "СчетДт", + "СчетКт", + "Сумма", + "Номенклатура", + "Склад", + "Организация", + "Количество", + "Period", + "Registrator", + "AccountDt", + "Amount" + ], + "materialization_drop_reason": "none", + "account_token_raw": null, + "account_token_normalized": null, + "account_scope_fields_checked": [ + "account_dt", + "account_kt", + "registrator", + "analytics" + ], + "account_scope_match_strategy": "account_code_regex_plus_alias_map_v1", + "account_scope_drop_reason": "not_applicable", + "runtime_readiness": "LIVE_QUERYABLE_WITH_LIMITS", + "limited_reason_category": "empty_match", + "response_type": "LIMITED_WITH_REASON", + "requested_result_mode": "confirmed_balance", + "result_mode": "confirmed_balance", + "evidence_strength": "weak", + "balance_confirmed": false, + "as_of_date_basis": "period_range", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_layer": "compute", + "capability_route_mode": "exact", + "capability_route_enabled": true, + "capability_route_reason": "inventory_on_hand_route_enabled", + "shadow_route_status": "skipped", + "route_expectation_status": "matched", + "route_expectation_reason": "route_expectation_matched", + "route_expectation_expected_selected_recipes": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "route_expectation_expected_requested_result_modes": [ + "confirmed_balance" + ], + "route_expectation_expected_result_modes": [ + "confirmed_balance" + ], + "execution_lane": "address_query", + "llm_decomposition_applied": true, + "llm_decomposition_attempted": true, + "llm_provider_used": "local", + "llm_decomposition_trace_id": "kWSV0LNJKzGBHg", + "llm_decomposition_effective_message": "Определить номенклатуру, которая формирует остаток на складе на май 2020 года", + "llm_decomposition_reason": "normalized_fragment_applied", + "llm_canonical_candidate_detected": true, + "llm_predecompose_contract": { + "schema_version": "address_llm_predecompose_contract_v1", + "source_message": "Какие конкретно номенклатуры формируют остаток по складу на май 2020", + "canonical_message": "Определить номенклатуру, которая формирует остаток на складе на май 2020 года", + "mode": "address_query", + "mode_confidence": "high", + "query_shape": "AGGREGATE_LOOKUP", + "query_shape_confidence": "high", + "intent": "inventory_on_hand_as_of_date", + "intent_confidence": "high", + "entities": { + "account": null, + "counterparty": null, + "contract": null, + "document_type": null, + "document_ref": null, + "organization": null + }, + "period": { + "scope": "as_of", + "period_from": "2020-05-01", + "period_to": "2020-05-31", + "as_of_date": "2020-05-31", + "has_explicit_period": true + }, + "semantics": { + "scope_kind": "implicit_self_scope", + "anchor_kind": "self_scope", + "anchor_value": null, + "date_scope_kind": "explicit", + "date_basis_hint": "period_range", + "self_scope_detected": true, + "selected_object_scope_detected": false + }, + "aggregation_profile": "management_profile" + }, + "fallback_rule_hit": null, + "sanitized_user_message": "какие конкретно номенклатуры формируют остаток по складу на май 2020", + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "orchestration_contract_v1": { + "schema_version": "assistant_orchestration_contract_v1", + "hard_meta_mode": null, + "address_mode": "address_query", + "address_mode_confidence": "high", + "address_intent": "inventory_on_hand_as_of_date", + "address_intent_confidence": "high", + "strong_data_signal_detected": true, + "data_retrieval_signal_detected": true, + "semantic_contract_valid": true, + "semantic_apply_canonical_recommended": true, + "semantic_reason_codes": [], + "semantic_route_arbitration": { + "supported_address_intent_detected": true, + "strict_deep_investigation_bypass_allowed": false, + "semantic_deep_investigation_hint_detected": false, + "semantic_aggregate_shape_detected": true, + "followup_semantic_override_to_deep_allowed": false + }, + "followup_context_detected": false, + "unsupported_address_intent_fallback_to_deep": false, + "deep_analysis_signal_fallback_to_deep": false, + "aggregate_analytics_signal_fallback_to_deep": false, + "deep_session_continuation_fallback_to_deep": false, + "final_decision": { + "run_address_lane": true, + "tool_gate_decision": "run_address_lane", + "tool_gate_reason": "address_mode_classifier_detected", + "living_mode": "address_data", + "living_reason": "address_lane_triggered" + } + }, + "dialog_continuation_contract_v2": { + "schema_version": "address_dialog_continuation_contract_v2", + "source_message": "Какие конкретно номенклатуры формируют остаток по складу на май 2020", + "effective_message": "Определить номенклатуру, которая формирует остаток на складе на май 2020 года", + "decision": "new_topic", + "decision_reasons": [ + "effective_message_rewritten_by_predecompose", + "llm_contract_intent_available" + ], + "followup_context_applied": false, + "previous_intent": null, + "target_intent": "inventory_on_hand_as_of_date", + "intent_selection_mode": null, + "anchor_type": null, + "anchor_value": null, + "implicit_continuation_signal": false + }, + "address_retry_audit": { + "attempted": true, + "reason": "limited_result_retry_with_raw_message", + "initial_limited_category": "empty_match", + "retry_message": "Какие конкретно номенклатуры формируют остаток по складу на май 2020", + "retry_used_followup_context": false, + "retry_result_category": "empty_match" + }, + "answer_structure_v11": null, + "investigation_state_snapshot": null, + "normalized": null, + "normalizer_output": { + "trace_id": "kWSV0LNJKzGBHg", + "prompt_version": "normalizer_v2_0_2", + "applied": true, + "effective_message": "Определить номенклатуру, которая формирует остаток на складе на май 2020 года" + }, + "assistant_known_organizations": [ + "ООО \\Альтернатива Плюс\\", + "чепурнов" + ], + "assistant_active_organization": "чепурнов", + "assistant_runtime_contract_v1": { + "schema_version": "assistant_runtime_contracts_v1", + "transition_contract_id": "T1", + "transition_contract_title": "Root Query Entry", + "transition_contract_reason": [ + "capability_contract_root_or_new_entry" + ], + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_reason": [ + "debug_capability_id_matched_contract" + ], + "truth_gate_contract_status": "partial_supported", + "carryover_eligibility": "root_only" + }, + "transition_contract_id": "T1", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "truth_gate_contract_status": "partial_supported", + "assistant_truth_answer_policy_v1": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "truth_gate": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + } + }, + "coverage_gate_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ], + "source_truth_gate_status": "partial_supported", + "blocked_or_limited_explanation": "evidence_or_coverage_is_partial" + }, + "answer_shape_contract": { + "schema_version": "assistant_truth_answer_policy_runtime_v1", + "policy_owner": "assistantTruthAnswerPolicyRuntimeAdapter", + "answer_shape": "limited_with_reason", + "reply_type": "partial_coverage", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "transition_contract_id": "T1", + "may_state_confirmed_facts": true, + "must_include_limitation": true, + "may_power_followup": true, + "required_sections": [ + "direct_answer", + "evidence_window", + "limitations" + ], + "downgrade_only": true + }, + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "answer_shape": "limited_with_reason", + "assistant_state_transition_v1": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "state_transition_contract": { + "schema_version": "assistant_state_transition_runtime_v1", + "state_owner": "assistantStateTransitionRuntimeAdapter", + "transition_id": "T1", + "transition_title": "Root Query Entry", + "application_status": "applied", + "declared_carryover_depth": "none", + "truth_gate_carryover_depth": "root_only", + "effective_carryover_depth": "none", + "required_prior_state": [ + "living_mode_state" + ], + "expected_answer_mode": "confirmed", + "state_mutations": [ + "create_root_frame_state", + "clear_selected_object_frame_state", + "create_coverage_gate_state" + ], + "forbidden_carryover": [ + "stale_focus_object", + "stale_object_intent", + "implicit_followup_reuse" + ], + "state_actions": { + "living_mode_state": "update", + "root_frame_state": "create", + "selected_object_frame_state": "clear", + "meta_frame_state": "clear", + "clarification_state": "clear", + "coverage_gate_state": "create", + "answer_context_state": "create" + }, + "coverage_gate_state": { + "coverage_status": "partial", + "evidence_grade": "weak", + "grounding_status": "partial", + "truth_mode": "limited", + "carryover_eligibility": "root_only", + "reason_codes": [ + "truth_gate_partial_supported", + "truth_mode_limited", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "reason_codes": [ + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "state_transition_id": "T1", + "state_transition_status": "applied", + "effective_carryover_depth": "none", + "assistant_capability_binding_v1": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound_with_limits", + "binding_action": "limit", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "capability_binding_contract": { + "schema_version": "assistant_capability_runtime_binding_v1", + "binding_owner": "assistantCapabilityRuntimeBindingAdapter", + "capability_id": "confirmed_inventory_on_hand_as_of_date", + "capability_contract_id": "confirmed_inventory_on_hand_as_of_date", + "binding_status": "bound_with_limits", + "binding_action": "limit", + "runtime_lane_expected": "address_exact", + "runtime_lane_observed": "address_exact", + "execution_adapter": "AddressQueryService", + "transition_id": "T1", + "transition_allowed": true, + "required_anchors": [], + "provided_anchors": [ + "sort", + "period_from", + "period_to", + "as_of_date", + "organization" + ], + "missing_anchors": [], + "requires_focus_object": false, + "focus_object_binding_status": "not_required", + "result_shape": "item_list_with_quantity_cost_warehouse_organization", + "answer_object_shape": "inventory_stock_snapshot", + "truth_gate_behavior": "partial_or_blocked_if_evidence_insufficient", + "truth_fallback_allowed": true, + "answer_shape_compatible": true, + "violations": [], + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response" + ] + }, + "capability_binding_status": "bound_with_limits", + "capability_binding_action": "limit", + "capability_binding_violations": [], + "capability_binding_response_guard": { + "schema_version": "assistant_capability_binding_response_guard_v1", + "guard_owner": "assistantCapabilityBindingResponseGuard", + "applied": false, + "action": "limit", + "original_reply_type": "partial_coverage", + "guarded_reply_type": "partial_coverage", + "reason_codes": [ + "binding_status_bound_with_limits", + "binding_action_limit", + "transition_status_applied", + "transition_T1", + "capability_contract_root_or_new_entry", + "debug_capability_id_matched_contract", + "truth_gate_partial_supported", + "truth_mode_limited", + "route_expectation_matched", + "address_action_detected", + "address_entity_detected", + "aggregate_signal_detected", + "inventory_on_hand_signal_detected", + "organization_from_followup_context", + "address_followup_context_applied", + "confirmed_balance_exact_inventory_intent", + "exact_inventory_mode_limited_response", + "capability_binding_guard_limited_reply_type" + ] + } + } + } + ], + "investigation_state": { + "schema_version": "investigation_state_v1", + "session_id": "asst-NhPaZfbRYr", + "status": "active", + "turn_index": 2, + "updated_at": "2026-04-16T18:24:30.546Z", + "question_id": "msg-u2tKa8i2un", + "question_scope_id": "d:settlements_60_62|p:2022|a:60|s:хвосты покажи по счету 60 на август 2022", + "scope_origin": "explicit_from_message", + "focus": { + "domain": "settlements_60_62", + "period": "2022", + "primary_accounts": [ + "60" + ], + "active_query_subject": "хвосты покажи по счету 60 на август 2022" + }, + "narrowing_status": "unknown", + "evidence_refs": [], + "open_uncertainties": [ + "clarify:R1" + ], + "last_answer_mode": "clarification_required", + "followup_context": { + "previous_question_id": "msg-2xh3sbTF_V", + "last_user_message": "хвосты покажи по счету 60 на август 2022", + "referenced_requirement_ids": [ + "R1" + ], + "active_domain": "settlements_60_62", + "active_requirement_ids": [ + "R1" + ], + "uncovered_requirement_ids": [ + "R1" + ], + "last_problem_unit_id": null, + "settlement_next_actions": [ + "Проверьте договор и объект расчетов по платежу.", + "Сверьте регистр расчетов и привязку платежа к закрывающему документу.", + "Проверьте зачет аванса или взаимозачет по связке 60/62." + ], + "evidence_summary": [], + "question_scope_id": "d:settlements_60_62|p:2022|a:60|s:хвосты покажи по счету 60 на август 2022", + "scope_origin": "explicit_from_message" + }, + "query_mode_hint": "investigation_candidate" + }, + "address_navigation_state": { + "schema_version": "address_navigation_state_v1", + "session_id": "asst-NhPaZfbRYr", + "updated_at": "2026-04-16T18:26:06.068Z", + "session_context": { + "active_result_set_id": "rs-msg-irmAz56n7i", + "active_focus_object": { + "object_type": "organization", + "object_id": "organization:чепурнов", + "label": "чепурнов", + "provenance_result_set_id": "rs-msg-irmAz56n7i", + "selected_at": "2026-04-16T18:26:06.068Z" + }, + "last_confirmed_route": "address_inventory_on_hand_as_of_date_v1", + "date_scope": { + "as_of_date": "2020-05-31", + "period_from": "2020-05-01", + "period_to": "2020-05-31" + }, + "organization_scope": "чепурнов" + }, + "result_sets": [ + { + "result_set_id": "rs-msg-_YGK34Sgjq", + "type": "inventory_snapshot", + "intent": "inventory_on_hand_as_of_date", + "route_id": "address_inventory_on_hand_as_of_date_v1", + "filters": { + "sort": "period_desc", + "as_of_date": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "item", + "value": "Модуль прямоугольый 1400*110*750" + }, + { + "index": 2, + "entity_type": "item", + "value": "Конструкция трансформер рабочей станции 1300*900*2000" + }, + { + "index": 3, + "entity_type": "item", + "value": "Диван трехместный" + }, + { + "index": 4, + "entity_type": "item", + "value": "Кресло орион" + }, + { + "index": 5, + "entity_type": "item", + "value": "Зеркало для инвалидов поворотное травмобезопасное" + }, + { + "index": 6, + "entity_type": "item", + "value": "Пуф арий" + }, + { + "index": 7, + "entity_type": "item", + "value": "Столешница 600*3050*26 дуб ниагара" + }, + { + "index": 8, + "entity_type": "item", + "value": "Столешница 600*3050*26 альмандин" + }, + { + "index": 9, + "entity_type": "item", + "value": "Четки Пост (84*117)" + }, + { + "index": 10, + "entity_type": "item", + "value": "Кромка с клеем 33 альмандин 137 м" + }, + { + "index": 11, + "entity_type": "item", + "value": "Кромка с клеем 33 дуб ниагара 137 м" + } + ], + "created_from_turn": 5, + "created_at": "2026-04-16T18:04:18.998Z" + }, + { + "result_set_id": "rs-msg-A0lvsGdivq", + "type": "inventory_snapshot", + "intent": "inventory_on_hand_as_of_date", + "route_id": "address_inventory_on_hand_as_of_date_v1", + "filters": { + "sort": "period_desc", + "period_from": "2017-07-01", + "period_to": "2017-07-31", + "as_of_date": "2017-07-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "item", + "value": "Секция отдельно-стоящая" + }, + { + "index": 2, + "entity_type": "item", + "value": "Шкаф для одежды 824*437*2010" + }, + { + "index": 3, + "entity_type": "item", + "value": "Рабочая станция универсального специалиста (индивидуальное изготовление)" + }, + { + "index": 4, + "entity_type": "item", + "value": "Секция приставная для хранения документов из 2 модулей, Тип 4" + } + ], + "created_from_turn": 9, + "created_at": "2026-04-16T18:05:32.192Z" + }, + { + "result_set_id": "rs-msg-lp9pIove6w", + "type": "inventory_snapshot", + "intent": "inventory_on_hand_as_of_date", + "route_id": "address_inventory_on_hand_as_of_date_v1", + "filters": { + "sort": "period_desc", + "period_from": "2016-03-01", + "period_to": "2016-03-31", + "as_of_date": "2016-03-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "item", + "value": "Шкаф для одежды 824*437*2010" + }, + { + "index": 2, + "entity_type": "item", + "value": "Рабочая станция универсального специалиста (индивидуальное изготовление)" + } + ], + "created_from_turn": 11, + "created_at": "2026-04-16T18:05:58.615Z" + }, + { + "result_set_id": "rs-msg-lGYvANeRvu", + "type": "inventory_trace", + "intent": "inventory_purchase_provenance_for_item", + "route_id": "address_inventory_purchase_provenance_for_item_v1", + "filters": { + "sort": "period_desc", + "item": "Рабочая станция универсального специалиста (индивидуальное изготовление)", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_inventory_purchase_provenance_for_item_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "item", + "value": "Поступление товаров и услуг 00000000101 от 22.07.2015 12:00:02" + }, + { + "index": 2, + "entity_type": "item", + "value": "Поступление товаров и услуг 00000000047 от 24.02.2015 12:03:34" + }, + { + "index": 3, + "entity_type": "item", + "value": "Поступление товаров и услуг 00000000025 от 24.02.2015 12:03:32" + }, + { + "index": 4, + "entity_type": "item", + "value": "Поступление товаров и услуг 00000000024 от 17.02.2015 13:41:08" + }, + { + "index": 5, + "entity_type": "item", + "value": "Поступление товаров и услуг 00000000045 от 06.02.2015 12:00:05" + }, + { + "index": 6, + "entity_type": "item", + "value": "Поступление товаров и услуг 00000000028 от 05.02.2015 12:00:09" + }, + { + "index": 7, + "entity_type": "item", + "value": "Поступление товаров и услуг 00000000023 от 05.02.2015 0:00:00" + } + ], + "created_from_turn": 13, + "created_at": "2026-04-16T18:06:33.141Z" + }, + { + "result_set_id": "rs-msg-ENroQsN_nr", + "type": "inventory_trace", + "intent": "inventory_sale_trace_for_item", + "route_id": "address_inventory_sale_trace_for_item_v1", + "filters": { + "sort": "period_desc", + "organization": "ООО \\Альтернатива Плюс\\", + "item": "Рабочая станция универсального специалиста (индивидуальное изготовление)" + }, + "source_refs": [ + "address_inventory_sale_trace_for_item_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "item", + "value": "Комплектация номенклатуры 00000000003 от 14.08.2018 12:00:02" + }, + { + "index": 2, + "entity_type": "item", + "value": "Реализация товаров и услуг 00000000012 от 25.02.2015 12:00:00" + }, + { + "index": 3, + "entity_type": "item", + "value": "Реализация товаров и услуг 00000000011 от 25.02.2015 11:59:34" + }, + { + "index": 4, + "entity_type": "item", + "value": "Реализация товаров и услуг 00000000009 от 18.02.2015 12:48:00" + }, + { + "index": 5, + "entity_type": "item", + "value": "Реализация товаров и услуг 00000000006 от 09.02.2015 12:00:42" + }, + { + "index": 6, + "entity_type": "item", + "value": "Реализация товаров и услуг 00000000005 от 09.02.2015 12:00:34" + }, + { + "index": 7, + "entity_type": "item", + "value": "Реализация товаров и услуг 00000000004 от 09.02.2015 12:00:14" + } + ], + "created_from_turn": 15, + "created_at": "2026-04-16T18:07:09.604Z" + }, + { + "result_set_id": "rs-msg-8fMZZYjc9y", + "type": "document_list", + "intent": "list_documents_by_counterparty", + "route_id": "address_documents_by_counterparty_v1", + "filters": { + "sort": "period_desc", + "limit": 20, + "counterparty": "в документе", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_documents_by_counterparty_v1" + ], + "entity_refs": [], + "created_from_turn": 17, + "created_at": "2026-04-16T18:08:43.447Z" + }, + { + "result_set_id": "rs-msg-NEIdJ6wMYe", + "type": "profile_summary", + "intent": "vat_payable_forecast", + "route_id": "address_vat_payable_forecast_v1", + "filters": { + "sort": "period_desc", + "period_to": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_vat_payable_forecast_v1" + ], + "entity_refs": [], + "created_from_turn": 19, + "created_at": "2026-04-16T18:09:32.118Z" + }, + { + "result_set_id": "rs-msg-7gpm1aaBvO", + "type": "balance_snapshot", + "intent": "payables_confirmed_as_of_date", + "route_id": "address_payables_confirmed_as_of_date_v1", + "filters": { + "sort": "period_desc", + "limit": 20, + "period_from": "2020-03-01", + "period_to": "2020-03-31", + "as_of_date": "2020-03-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_payables_confirmed_as_of_date_v1" + ], + "entity_refs": [], + "created_from_turn": 21, + "created_at": "2026-04-16T18:10:23.897Z" + }, + { + "result_set_id": "rs-msg-3D0vP63Rrr", + "type": "profile_summary", + "intent": "vat_payable_forecast", + "route_id": "address_vat_payable_forecast_v1", + "filters": { + "sort": "period_desc", + "period_from": "2017-02-01", + "period_to": "2017-02-28", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_vat_payable_forecast_v1" + ], + "entity_refs": [], + "created_from_turn": 23, + "created_at": "2026-04-16T18:11:25.828Z" + }, + { + "result_set_id": "rs-msg-O1SY8j5C8d", + "type": "counterparty_list", + "intent": "counterparty_activity_lifecycle", + "route_id": "address_counterparty_activity_lifecycle_v1", + "filters": { + "sort": "period_desc", + "counterparty": "за все время", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_counterparty_activity_lifecycle_v1" + ], + "entity_refs": [], + "created_from_turn": 25, + "created_at": "2026-04-16T18:11:52.301Z" + }, + { + "result_set_id": "rs-msg-wzLeNYw9tJ", + "type": "balance_snapshot", + "intent": "receivables_confirmed_as_of_date", + "route_id": "address_receivables_confirmed_as_of_date_v1", + "filters": { + "sort": "period_desc", + "limit": 20, + "period_from": "2017-05-01", + "period_to": "2017-05-31", + "as_of_date": "2017-05-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_receivables_confirmed_as_of_date_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "counterparty", + "value": "Комитет государственных услуг г. Москвы" + }, + { + "index": 2, + "entity_type": "counterparty", + "value": "Финансовое обеспечение заявки" + }, + { + "index": 3, + "entity_type": "counterparty", + "value": "ГКУ" + }, + { + "index": 4, + "entity_type": "counterparty", + "value": "СервисКонсалт, ООО" + } + ], + "created_from_turn": 27, + "created_at": "2026-04-16T18:12:23.766Z" + }, + { + "result_set_id": "rs-msg-Z3NEdWcRbR", + "type": "balance_snapshot", + "intent": "vat_payable_confirmed_as_of_date", + "route_id": "address_vat_payable_confirmed_as_of_date_v1", + "filters": { + "sort": "period_desc", + "limit": 20, + "as_of_date": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_vat_payable_confirmed_as_of_date_v1" + ], + "entity_refs": [], + "created_from_turn": 29, + "created_at": "2026-04-16T18:13:09.478Z" + }, + { + "result_set_id": "rs-msg-38-tMpnFD0", + "type": "balance_snapshot", + "intent": "payables_confirmed_as_of_date", + "route_id": "address_payables_confirmed_as_of_date_v1", + "filters": { + "sort": "period_desc", + "limit": 20, + "as_of_date": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_payables_confirmed_as_of_date_v1" + ], + "entity_refs": [], + "created_from_turn": 31, + "created_at": "2026-04-16T18:14:06.362Z" + }, + { + "result_set_id": "rs-msg--59Ab8z_hm", + "type": "counterparty_list", + "intent": "customer_revenue_and_payments", + "route_id": "address_customer_revenue_and_payments_v1", + "filters": { + "sort": "period_desc", + "period_to": "2026-04-16", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_customer_revenue_and_payments_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "counterparty", + "value": "2021" + }, + { + "index": 2, + "entity_type": "counterparty", + "value": "2022" + }, + { + "index": 3, + "entity_type": "counterparty", + "value": "2020" + } + ], + "created_from_turn": 35, + "created_at": "2026-04-16T18:15:09.340Z" + }, + { + "result_set_id": "rs-msg-d0ns1b9TYm", + "type": "counterparty_list", + "intent": "customer_revenue_and_payments", + "route_id": "address_customer_revenue_and_payments_v1", + "filters": { + "sort": "period_desc", + "period_from": "2017-01-01", + "period_to": "2017-12-31", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_customer_revenue_and_payments_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "counterparty", + "value": "ГКУ" + }, + { + "index": 2, + "entity_type": "counterparty", + "value": "ГБУ \\Многофункциональный центр\\" + }, + { + "index": 3, + "entity_type": "counterparty", + "value": "Единая электронная торговая площадка, АО" + }, + { + "index": 4, + "entity_type": "counterparty", + "value": "Элмаш-К" + }, + { + "index": 5, + "entity_type": "counterparty", + "value": "АкваСервис, ООО" + }, + { + "index": 6, + "entity_type": "counterparty", + "value": "Финансовое обеспечение заявки" + } + ], + "created_from_turn": 37, + "created_at": "2026-04-16T18:16:00.181Z" + }, + { + "result_set_id": "rs-msg-odo0BpjiSO", + "type": "counterparty_list", + "intent": "customer_revenue_and_payments", + "route_id": "address_customer_revenue_and_payments_v1", + "filters": { + "sort": "period_desc", + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_customer_revenue_and_payments_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "counterparty", + "value": "Группа" + }, + { + "index": 2, + "entity_type": "counterparty", + "value": "НОРТОН" + }, + { + "index": 3, + "entity_type": "counterparty", + "value": "МНН" + }, + { + "index": 4, + "entity_type": "counterparty", + "value": "СервисКонсалт, ООО" + }, + { + "index": 5, + "entity_type": "counterparty", + "value": "Чепурнов П.Д." + } + ], + "created_from_turn": 39, + "created_at": "2026-04-16T18:17:11.307Z" + }, + { + "result_set_id": "rs-msg-ThSOYzPJvV", + "type": "document_list", + "intent": "list_documents_by_contract", + "route_id": "address_documents_by_contract_v1", + "filters": { + "sort": "period_desc", + "limit": 20, + "organization": "ООО \\Альтернатива Плюс\\" + }, + "source_refs": [ + "address_documents_by_contract_v1" + ], + "entity_refs": [], + "created_from_turn": 41, + "created_at": "2026-04-16T18:18:09.267Z" + }, + { + "result_set_id": "rs-msg-Cyv-MjBpGM", + "type": "document_list", + "intent": "list_documents_by_counterparty", + "route_id": "address_documents_by_counterparty_v1", + "filters": { + "sort": "period_desc", + "limit": 20, + "counterparty": "Чепурнов", + "organization": "чепурнов" + }, + "source_refs": [ + "address_documents_by_counterparty_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "document_ref", + "value": "2022-01-20T12:00:03Z" + } + ], + "created_from_turn": 43, + "created_at": "2026-04-16T18:19:02.371Z" + }, + { + "result_set_id": "rs-msg-tNxiZZnrkH", + "type": "bank_operations_list", + "intent": "bank_operations_by_counterparty", + "route_id": "address_bank_operations_by_counterparty_v1", + "filters": { + "sort": "period_desc", + "limit": 20, + "counterparty": "свк", + "organization": "чепурнов" + }, + "source_refs": [ + "address_bank_operations_by_counterparty_v1" + ], + "entity_refs": [ + { + "index": 1, + "entity_type": "document_ref", + "value": "2021-11-10T12:00:07Z" + }, + { + "index": 2, + "entity_type": "document_ref", + "value": "2021-09-29T12:00:03Z" + }, + { + "index": 3, + "entity_type": "document_ref", + "value": "2021-08-31T12:00:04Z" + }, + { + "index": 4, + "entity_type": "document_ref", + "value": "2021-06-22T12:00:00Z" + }, + { + "index": 5, + "entity_type": "document_ref", + "value": "2021-06-09T12:00:05Z" + }, + { + "index": 6, + "entity_type": "document_ref", + "value": "2021-04-28T12:00:08Z" + }, + { + "index": 7, + "entity_type": "document_ref", + "value": "2021-04-22T12:00:00Z" + }, + { + "index": 8, + "entity_type": "document_ref", + "value": "2021-04-13T12:00:11Z" + }, + { + "index": 9, + "entity_type": "document_ref", + "value": "2021-03-25T12:00:02Z" + }, + { + "index": 10, + "entity_type": "document_ref", + "value": "2021-03-24T12:00:03Z" + }, + { + "index": 11, + "entity_type": "document_ref", + "value": "2021-03-18T12:00:00Z" + }, + { + "index": 12, + "entity_type": "document_ref", + "value": "2021-03-12T12:00:03Z" + }, + { + "index": 13, + "entity_type": "document_ref", + "value": "2021-02-19T12:00:01Z" + }, + { + "index": 14, + "entity_type": "document_ref", + "value": "2020-12-30T12:00:00Z" + }, + { + "index": 15, + "entity_type": "document_ref", + "value": "2020-12-16T16:20:53Z" + }, + { + "index": 16, + "entity_type": "document_ref", + "value": "2020-12-14T12:00:00Z" + }, + { + "index": 17, + "entity_type": "document_ref", + "value": "2020-11-30T12:00:07Z" + }, + { + "index": 18, + "entity_type": "document_ref", + "value": "2020-11-19T12:00:04Z" + }, + { + "index": 19, + "entity_type": "document_ref", + "value": "2020-11-18T12:00:05Z" + }, + { + "index": 20, + "entity_type": "document_ref", + "value": "2020-11-18T12:00:04Z" + }, + { + "index": 21, + "entity_type": "document_ref", + "value": "2020-11-13T12:00:03Z" + }, + { + "index": 22, + "entity_type": "document_ref", + "value": "2020-11-10T15:39:13Z" + }, + { + "index": 23, + "entity_type": "document_ref", + "value": "2020-10-26T12:00:00Z" + }, + { + "index": 24, + "entity_type": "document_ref", + "value": "2020-08-20T12:00:06Z" + }, + { + "index": 25, + "entity_type": "document_ref", + "value": "2020-07-30T12:00:00Z" + }, + { + "index": 26, + "entity_type": "document_ref", + "value": "2020-07-27T12:00:00Z" + } + ], + "created_from_turn": 45, + "created_at": "2026-04-16T18:19:43.942Z" + }, + { + "result_set_id": "rs-msg-dFuxhtDZr6", + "type": "inventory_snapshot", + "intent": "inventory_on_hand_as_of_date", + "route_id": "address_inventory_on_hand_as_of_date_v1", + "filters": { + "sort": "period_desc", + "as_of_date": "2026-04-16", + "organization": "чепурнов" + }, + "source_refs": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "entity_refs": [], + "created_from_turn": 47, + "created_at": "2026-04-16T18:20:49.753Z" + }, + { + "result_set_id": "rs-msg-3O50MQfy_B", + "type": "inventory_snapshot", + "intent": "inventory_on_hand_as_of_date", + "route_id": "address_inventory_on_hand_as_of_date_v1", + "filters": { + "sort": "period_desc", + "as_of_date": "2026-04-16", + "organization": "чепурнов" + }, + "source_refs": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "entity_refs": [], + "created_from_turn": 51, + "created_at": "2026-04-16T18:22:16.105Z" + }, + { + "result_set_id": "rs-msg-WAGYi0G2xn", + "type": "inventory_trace", + "intent": "inventory_aging_by_purchase_date", + "route_id": "address_inventory_aging_by_purchase_date_v1", + "filters": { + "sort": "period_asc", + "organization": "чепурнов" + }, + "source_refs": [ + "address_inventory_aging_by_purchase_date_v1" + ], + "entity_refs": [], + "created_from_turn": 59, + "created_at": "2026-04-16T18:25:45.535Z" + }, + { + "result_set_id": "rs-msg-irmAz56n7i", + "type": "inventory_snapshot", + "intent": "inventory_on_hand_as_of_date", + "route_id": "address_inventory_on_hand_as_of_date_v1", + "filters": { + "sort": "period_desc", + "period_from": "2020-05-01", + "period_to": "2020-05-31", + "as_of_date": "2020-05-31", + "organization": "чепурнов" + }, + "source_refs": [ + "address_inventory_on_hand_as_of_date_v1" + ], + "entity_refs": [], + "created_from_turn": 61, + "created_at": "2026-04-16T18:26:06.068Z" + } + ], + "navigation_history": [ + { + "event_id": "nav-wum4sbhuEt", + "action": "open", + "source_result_set_id": null, + "target_object_id": null, + "derived_result_set_id": "rs-msg-_YGK34Sgjq", + "turn_index": 5, + "created_at": "2026-04-16T18:04:18.998Z" + }, + { + "event_id": "nav-sNOpY6JClZ", + "action": "drilldown", + "source_result_set_id": "rs-msg-_YGK34Sgjq", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-A0lvsGdivq", + "turn_index": 9, + "created_at": "2026-04-16T18:05:32.192Z" + }, + { + "event_id": "nav-uSEBz1DSLF", + "action": "drilldown", + "source_result_set_id": "rs-msg-A0lvsGdivq", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-lp9pIove6w", + "turn_index": 11, + "created_at": "2026-04-16T18:05:58.615Z" + }, + { + "event_id": "nav-37DFnGvNst", + "action": "drilldown", + "source_result_set_id": "rs-msg-lp9pIove6w", + "target_object_id": "item:рабочая станция универсального специалиста (индивидуальное изготовление)", + "derived_result_set_id": "rs-msg-lGYvANeRvu", + "turn_index": 13, + "created_at": "2026-04-16T18:06:33.141Z" + }, + { + "event_id": "nav-qXTRO8HwXJ", + "action": "drilldown", + "source_result_set_id": "rs-msg-lGYvANeRvu", + "target_object_id": "item:рабочая станция универсального специалиста (индивидуальное изготовление)", + "derived_result_set_id": "rs-msg-ENroQsN_nr", + "turn_index": 15, + "created_at": "2026-04-16T18:07:09.604Z" + }, + { + "event_id": "nav-IlsOrXnO4T", + "action": "drilldown", + "source_result_set_id": "rs-msg-ENroQsN_nr", + "target_object_id": "counterparty:в документе", + "derived_result_set_id": "rs-msg-8fMZZYjc9y", + "turn_index": 17, + "created_at": "2026-04-16T18:08:43.447Z" + }, + { + "event_id": "nav-qgSX6nPf0U", + "action": "open", + "source_result_set_id": "rs-msg-8fMZZYjc9y", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-NEIdJ6wMYe", + "turn_index": 19, + "created_at": "2026-04-16T18:09:32.118Z" + }, + { + "event_id": "nav-kUlRyiwyZv", + "action": "open", + "source_result_set_id": "rs-msg-NEIdJ6wMYe", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-7gpm1aaBvO", + "turn_index": 21, + "created_at": "2026-04-16T18:10:23.897Z" + }, + { + "event_id": "nav-LBAS3xFu-7", + "action": "open", + "source_result_set_id": "rs-msg-7gpm1aaBvO", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-3D0vP63Rrr", + "turn_index": 23, + "created_at": "2026-04-16T18:11:25.828Z" + }, + { + "event_id": "nav-GuS476ZcTN", + "action": "drilldown", + "source_result_set_id": "rs-msg-3D0vP63Rrr", + "target_object_id": "counterparty:за все время", + "derived_result_set_id": "rs-msg-O1SY8j5C8d", + "turn_index": 25, + "created_at": "2026-04-16T18:11:52.301Z" + }, + { + "event_id": "nav-nTFGkWu5et", + "action": "drilldown", + "source_result_set_id": "rs-msg-O1SY8j5C8d", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-wzLeNYw9tJ", + "turn_index": 27, + "created_at": "2026-04-16T18:12:23.766Z" + }, + { + "event_id": "nav-TmP5WpnmXI", + "action": "drilldown", + "source_result_set_id": "rs-msg-wzLeNYw9tJ", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-Z3NEdWcRbR", + "turn_index": 29, + "created_at": "2026-04-16T18:13:09.478Z" + }, + { + "event_id": "nav-lMBUfOUuLQ", + "action": "open", + "source_result_set_id": "rs-msg-Z3NEdWcRbR", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-38-tMpnFD0", + "turn_index": 31, + "created_at": "2026-04-16T18:14:06.362Z" + }, + { + "event_id": "nav-KBSFH8KI3r", + "action": "open", + "source_result_set_id": "rs-msg-38-tMpnFD0", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg--59Ab8z_hm", + "turn_index": 35, + "created_at": "2026-04-16T18:15:09.340Z" + }, + { + "event_id": "nav-a1Bsl5alAw", + "action": "drilldown", + "source_result_set_id": "rs-msg--59Ab8z_hm", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-d0ns1b9TYm", + "turn_index": 37, + "created_at": "2026-04-16T18:16:00.181Z" + }, + { + "event_id": "nav-O_UrRhOwqt", + "action": "drilldown", + "source_result_set_id": "rs-msg-d0ns1b9TYm", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-odo0BpjiSO", + "turn_index": 39, + "created_at": "2026-04-16T18:17:11.307Z" + }, + { + "event_id": "nav-G7mTI8TMLG", + "action": "drilldown", + "source_result_set_id": "rs-msg-odo0BpjiSO", + "target_object_id": "organization:ооо \\альтернатива плюс\\", + "derived_result_set_id": "rs-msg-ThSOYzPJvV", + "turn_index": 41, + "created_at": "2026-04-16T18:18:09.267Z" + }, + { + "event_id": "nav-9_OnSmXPOs", + "action": "drilldown", + "source_result_set_id": "rs-msg-ThSOYzPJvV", + "target_object_id": "counterparty:чепурнов п.д.", + "derived_result_set_id": "rs-msg-Cyv-MjBpGM", + "turn_index": 43, + "created_at": "2026-04-16T18:19:02.371Z" + }, + { + "event_id": "nav-CBSaCfDeyA", + "action": "refine", + "source_result_set_id": "rs-msg-Cyv-MjBpGM", + "target_object_id": "counterparty:группа свк", + "derived_result_set_id": "rs-msg-tNxiZZnrkH", + "turn_index": 45, + "created_at": "2026-04-16T18:19:43.942Z" + }, + { + "event_id": "nav-0nsQSsYVG5", + "action": "open", + "source_result_set_id": "rs-msg-tNxiZZnrkH", + "target_object_id": "organization:чепурнов", + "derived_result_set_id": "rs-msg-dFuxhtDZr6", + "turn_index": 47, + "created_at": "2026-04-16T18:20:49.753Z" + }, + { + "event_id": "nav-781tzPaD2L", + "action": "open", + "source_result_set_id": "rs-msg-dFuxhtDZr6", + "target_object_id": "organization:чепурнов", + "derived_result_set_id": "rs-msg-3O50MQfy_B", + "turn_index": 51, + "created_at": "2026-04-16T18:22:16.105Z" + }, + { + "event_id": "nav-rCjR-qRbGW", + "action": "open", + "source_result_set_id": "rs-msg-3O50MQfy_B", + "target_object_id": "organization:чепурнов", + "derived_result_set_id": "rs-msg-WAGYi0G2xn", + "turn_index": 59, + "created_at": "2026-04-16T18:25:45.535Z" + }, + { + "event_id": "nav-A4RB8DIQEo", + "action": "open", + "source_result_set_id": "rs-msg-WAGYi0G2xn", + "target_object_id": "organization:чепурнов", + "derived_result_set_id": "rs-msg-irmAz56n7i", + "turn_index": 61, + "created_at": "2026-04-16T18:26:06.068Z" + } + ] + } + } +} \ No newline at end of file diff --git a/llm_normalizer/data/eval_cases/assistant_autogen_saved_user_sessions_20260416182626_gen-mo1t93wq-jy0453e.json b/llm_normalizer/data/eval_cases/assistant_autogen_saved_user_sessions_20260416182626_gen-mo1t93wq-jy0453e.json new file mode 100644 index 0000000..f272e6e --- /dev/null +++ b/llm_normalizer/data/eval_cases/assistant_autogen_saved_user_sessions_20260416182626_gen-mo1t93wq-jy0453e.json @@ -0,0 +1,117 @@ +{ + "suite_id": "assistant_saved_session_gen-mo1t93wq-jy0453e", + "suite_version": "0.1.0", + "schema_version": "assistant_saved_session_suite_v0_1", + "generated_at": "2026-04-16T18:26:26.186Z", + "generation_id": "gen-mo1t93wq-jy0453e", + "mode": "saved_user_sessions", + "title": "БОЛЬШОЙ ОБЩИЙ Ручная сессия 16.04.2026, 21:26:06", + "scenario_count": 1, + "case_ids": [ + "SAVED-001" + ], + "cases": [ + { + "case_id": "SAVED-001", + "scenario_tag": "saved_user_sessions", + "title": "БОЛЬШОЙ ОБЩИЙ Ручная сессия 16.04.2026, 21:26:06", + "question_type": "followup", + "broadness_level": "medium", + "turns": [ + { + "user_message": "приветик - че как там дела" + }, + { + "user_message": "расскажи что можешь интересного" + }, + { + "user_message": "кайф - что там на складе по остаткам?" + }, + { + "user_message": "а исторические остатки на другие даты умеешь?" + }, + { + "user_message": "давай на июль 2017" + }, + { + "user_message": "март 2016" + }, + { + "user_message": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?" + }, + { + "user_message": "а кому продали?" + }, + { + "user_message": "у тебя написано кто контрагент: рабочая станция - это ошибка?" + }, + { + "user_message": "ндс можешь прикинуть на дату покупки рабочей станции?" + }, + { + "user_message": "а какой ндс мы должны сгрузить на март 2020?" + }, + { + "user_message": "прикинь какой ндс нам надо заплатить на февраль 2017" + }, + { + "user_message": "кто у нас самый доходный клиент за все время" + }, + { + "user_message": "кто нам должен денег на май 2017" + }, + { + "user_message": "а какой ндс мы должны примерно заплатить за этот период?" + }, + { + "user_message": "мы должны комуто денег на сегодня?" + }, + { + "user_message": "а нам?" + }, + { + "user_message": "какой у нас самый доходный год" + }, + { + "user_message": "а за 2017 мы скок заработали?" + }, + { + "user_message": "сколько вообще денег мы заработали за все время?" + }, + { + "user_message": "ты умеешь считать дельту по договорам?" + }, + { + "user_message": "по чепурнову покажи все доки" + }, + { + "user_message": "а по свк" + }, + { + "user_message": "а сейчас у нас есть что на складе?" + }, + { + "user_message": "что нам отгружать чепурнов? какой товар или услугу?" + }, + { + "user_message": "какие остатки на складе на сегодня" + }, + { + "user_message": "остатки на март 2016" + }, + { + "user_message": "это по общей базе уже нужен вывод не по чепурнову" + }, + { + "user_message": "хвосты покажи по счету 60 на август 2022" + }, + { + "user_message": "Есть ли остатки товара, которые закупались очень давно" + }, + { + "user_message": "Какие конкретно номенклатуры формируют остаток по складу на май 2020" + } + ] + } + ] +} \ No newline at end of file diff --git a/llm_normalizer/data/eval_cases/assistant_saved_session_runtime_job-efdquR6lxo.json b/llm_normalizer/data/eval_cases/assistant_saved_session_runtime_job-efdquR6lxo.json new file mode 100644 index 0000000..81e8d3f --- /dev/null +++ b/llm_normalizer/data/eval_cases/assistant_saved_session_runtime_job-efdquR6lxo.json @@ -0,0 +1,114 @@ +{ + "suite_id": "assistant_saved_session_runtime_job-efdquR6lxo", + "suite_version": "0.1.0", + "schema_version": "assistant_saved_session_runtime_v0_1", + "title": "БОЛЬШОЙ ОБЩИЙ Ручная сессия 16.04.2026, 21:26:06", + "scenario_count": 1, + "case_ids": [ + "SAVED-001" + ], + "cases": [ + { + "case_id": "SAVED-001", + "scenario_tag": "saved_user_sessions_runtime", + "title": "БОЛЬШОЙ ОБЩИЙ Ручная сессия 16.04.2026, 21:26:06", + "question_type": "followup", + "broadness_level": "medium", + "turns": [ + { + "user_message": "приветик - че как там дела" + }, + { + "user_message": "расскажи что можешь интересного" + }, + { + "user_message": "кайф - что там на складе по остаткам?" + }, + { + "user_message": "а исторические остатки на другие даты умеешь?" + }, + { + "user_message": "давай на июль 2017" + }, + { + "user_message": "март 2016" + }, + { + "user_message": "По выбранному объекту \"Рабочая станция универсального специалиста (индивидуальное изготовление)\": где взяли это?" + }, + { + "user_message": "а кому продали?" + }, + { + "user_message": "у тебя написано кто контрагент: рабочая станция - это ошибка?" + }, + { + "user_message": "ндс можешь прикинуть на дату покупки рабочей станции?" + }, + { + "user_message": "а какой ндс мы должны сгрузить на март 2020?" + }, + { + "user_message": "прикинь какой ндс нам надо заплатить на февраль 2017" + }, + { + "user_message": "кто у нас самый доходный клиент за все время" + }, + { + "user_message": "кто нам должен денег на май 2017" + }, + { + "user_message": "а какой ндс мы должны примерно заплатить за этот период?" + }, + { + "user_message": "мы должны комуто денег на сегодня?" + }, + { + "user_message": "а нам?" + }, + { + "user_message": "какой у нас самый доходный год" + }, + { + "user_message": "а за 2017 мы скок заработали?" + }, + { + "user_message": "сколько вообще денег мы заработали за все время?" + }, + { + "user_message": "ты умеешь считать дельту по договорам?" + }, + { + "user_message": "по чепурнову покажи все доки" + }, + { + "user_message": "а по свк" + }, + { + "user_message": "а сейчас у нас есть что на складе?" + }, + { + "user_message": "что нам отгружать чепурнов? какой товар или услугу?" + }, + { + "user_message": "какие остатки на складе на сегодня" + }, + { + "user_message": "остатки на март 2016" + }, + { + "user_message": "это по общей базе уже нужен вывод не по чепурнову" + }, + { + "user_message": "хвосты покажи по счету 60 на август 2022" + }, + { + "user_message": "Есть ли остатки товара, которые закупались очень давно" + }, + { + "user_message": "Какие конкретно номенклатуры формируют остаток по складу на май 2020" + } + ] + } + ] +} \ No newline at end of file