АДРЕСНЫЙ РЕЖИМ -ADDRESS:Шаг 1 - ЛЛМ ФЕРСТ + feat(address): стабилизация wave1 dynamic resolver контрагентов, follow-up carryover и актуализация docs/tests

This commit is contained in:
2026-04-02 23:11:49 +03:00
parent 53716e548e
commit 88094c09f8
243 changed files with 94296 additions and 181 deletions
@@ -0,0 +1,28 @@
# 2026-04-02_Address_ReverseVariations_BeforeFix
Generated at: 2026-04-02T20:37:24
Questions file: X:\1C\NDC_1C\docs\ADDRESS\question_sets\temp_reverse_variations_2026-04-02.json
Backend URL: http://127.0.0.1:8787/api/assistant/message
LLM: local / qwen2.5-14b-instruct-1m @ http://127.0.0.1:1234
Strict policy: route
## Totals
- questions_total: 4
- ok_200_count: 4
- semantic_pass_count: 3
- semantic_pass_rate: 0.75
- route_pass_count: 3
- route_pass_rate: 0.75
- strict_pass_count: 3
- strict_pass_rate: 0.75
- factual_count: 3
- partial_coverage_count: 0
- clarification_required_count: 1
- http_error_count: 0
- llm_decomposition_applied_count: 1
- avg_elapsed_ms: 6469
## Files
- run_summary.json
- full_live_results.json
- failures_only.json
@@ -0,0 +1,388 @@
[
{
"index": 4,
"id": "R004",
"question": "Какие разделы учета наименее заполнены?",
"session": null,
"session_id": "asst-2026-04-02_Address_ReverseVariations_BeforeFix-r004",
"status_code": 200,
"ok": true,
"elapsed_ms": 10610,
"reply_type": "clarification_required",
"trace_id": "apY-eOJF6ZJW1y",
"assistant_reply": "Коротко: Наиболее вероятный механизм проблемы подтвержден частично и требует первичной проверки. Что сломано:\n- Есть признаки проблемы, но без уточнений по периоду и объекту вывод ненадежен. Почему это похоже на проблему:\n- Сигнал проблемы есть, но механизм подтвержден не полностью. На чем это основано:\n- Опора частичная: часть требований покрыта не полностью.\n- Отдельно не подтверждено или покрыто частично: R1. Что проверить первым:\n- Уточните период проверки, чтобы подтвердить проблему без лишнего шума.\n- Проверьте связку документов и проводок по проблемному участку в указанном периоде.\n- Уточните период проверки (например, июль 2020). Ограничения:\n- Ни одно требование не получило подтвержденного покрытия.\n- Нет explainable-сигналов why_included в результатах выборки.\n- required anchors claim-bound grounding.\n- evidence.\n- Targeted evidence acquisition claim target path.",
"assistant_reply_first_line": "Коротко: Наиболее вероятный механизм проблемы подтвержден частично и требует первичной проверки. Что сломано:",
"expected_intent": null,
"actual_intent": null,
"intent_match": true,
"expected_mode": "address_query",
"actual_mode": null,
"mode_match": false,
"expected_reply_type": null,
"reply_match": true,
"semantic_pass": false,
"route_pass": false,
"route_health": "blocked_clarification",
"strict_policy": "route",
"strict_pass": false,
"selected_recipe": null,
"missing_required_filters": null,
"match_failure_stage": null,
"match_failure_reason": null,
"rows_fetched": null,
"rows_matched": null,
"mcp_call_status": null,
"limited_reason_category": null,
"llm_decomposition_applied": null,
"llm_decomposition_reason": null,
"fallback_rule_hit": null,
"debug_payload": {
"trace_id": "apY-eOJF6ZJW1y",
"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": [
"Ни одно требование не получило подтвержденного покрытия.",
"Нет explainable-сигналов why_included в результатах выборки.",
"Недостаточно покрытия required anchors для claim-bound grounding.",
"Недостаточно допустимого evidence для обоснованного ответа.",
"Targeted evidence acquisition не дал допустимых попаданий по claim target path."
],
"why_included_summary": [],
"selection_reason_summary": []
},
"dropped_intent_segments": [],
"question_type_class": "why_breaks",
"company_anchors": {
"contract_numbers": [],
"document_numbers": [],
"dates": [],
"amounts": [],
"accounts": [],
"periods": [],
"document_types": [],
"all": []
},
"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",
"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": [
"Ни одно требование не получило подтвержденного покрытия.",
"Нет explainable-сигналов why_included в результатах выборки.",
"Недостаточно покрытия required anchors для claim-bound grounding.",
"Недостаточно допустимого evidence для обоснованного ответа.",
"Targeted evidence acquisition не дал допустимых попаданий по claim target path."
]
},
"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-2026-04-02_Address_ReverseVariations_BeforeFix-r004",
"status": "active",
"turn_index": 1,
"updated_at": "2026-04-02T17:37:24.517Z",
"question_id": "msg-JafenTpNZ2",
"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
},
"error_code": null,
"error_message": null
}
]
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
# Response Audit: 2026-04-02_Address_ReverseVariations_BeforeFix
| id | strict | route_health | reply_type | intent | limited_reason | question | assistant_first_line |
|---|---|---|---|---|---|---|---|
| R001 | True | ok_or_factual | factual | list_documents_by_counterparty | None | Какой год самый пассивный по количеству документов? | Точный якорь не подтвердился в текущем окне live-данных; показаны ближайшие доступные документы/операции по выбранному типу. |
| R002 | True | ok_or_factual | factual | bank_operations_by_counterparty | None | Какой месяц самый пассивный по количеству операций? | Точный якорь не подтвердился в текущем окне live-данных; показаны ближайшие доступные документы/операции по выбранному типу. |
| R003 | True | ok_or_factual | factual | document_type_and_account_section_profile | None | Какие типы документов используются реже всего в базе? | Профиль типов документов и разделов учета собран (movement-based aggregate). |
| R004 | False | blocked_clarification | clarification_required | None | None | Какие разделы учета наименее заполнены? | Коротко: Наиболее вероятный механизм проблемы подтвержден частично и требует первичной проверки. Что сломано: |
@@ -0,0 +1,51 @@
{
"run_id": "2026-04-02_Address_ReverseVariations_BeforeFix",
"generated_at": "2026-04-02T20:37:24",
"source_questions_file": "X:\\1C\\NDC_1C\\docs\\ADDRESS\\question_sets\\temp_reverse_variations_2026-04-02.json",
"backend_url": "http://127.0.0.1:8787/api/assistant/message",
"llm_provider": "local",
"llm_model": "qwen2.5-14b-instruct-1m",
"llm_base_url": "http://127.0.0.1:1234",
"strict_policy": "route",
"totals": {
"questions_total": 4,
"ok_200_count": 4,
"semantic_pass_count": 3,
"semantic_pass_rate": 0.75,
"route_pass_count": 3,
"route_pass_rate": 0.75,
"strict_pass_count": 3,
"strict_pass_rate": 0.75,
"factual_count": 3,
"partial_coverage_count": 0,
"clarification_required_count": 1,
"http_error_count": 0,
"llm_decomposition_applied_count": 1,
"avg_elapsed_ms": 6469
},
"distributions": {
"reply_type": {
"factual": 3,
"clarification_required": 1
},
"actual_intent": {
"list_documents_by_counterparty": 1,
"bank_operations_by_counterparty": 1,
"document_type_and_account_section_profile": 1,
"None": 1
},
"actual_mode": {
"address_query": 3,
"None": 1
},
"mcp_call_status": {
"matched_non_empty": 3,
"None": 1
},
"limited_reason_category": {},
"route_health": {
"ok_or_factual": 3,
"blocked_clarification": 1
}
}
}