{ "schema_version": "domain_scenario_pack_v1", "pack_id": "agent_margin_profitability_reliability_20260524", "domain": "margin_profitability", "title": "AGENT | margin profitability wrong-domain traps", "description": "Минимальный reliability pack для проверки, что вопросы про маржинальность номенклатуры не утекают в ОС, амортизацию, банк, оплаты или взаиморасчеты.", "source_contract_id": "margin_profitability_v1", "issue_codes_under_test": [ "margin_domain_leak_accounting_route", "business_next_step_missing", "technical_garbage_in_answer" ], "detectors_under_test": [ "margin_domain_leak_accounting_route", "margin_required_fields_missing", "margin_next_action_missing", "margin_payment_document_false_source", "margin_os_amortization_leak", "runtime_tokens_in_user_answer", "capability_ids_in_user_answer" ], "rerun_matrix": [ "failed_margin_scenario", "margin_neighbor_pack", "wrong_domain_trap_pack", "accepted_smoke_pack" ], "bindings": { "period": "2020 год", "item": "товар" }, "analysis_context": { "expected_business_answer_contract": "margin_profitability_v1", "semantic_focus": [ "direct_answer_first", "margin_domain_purity", "honest_unknowns", "wrong_domain_traps" ] }, "acceptance": { "min_score": 80, "max_unresolved_p0": 0, "require_all_critical_steps_pass": true, "must_have": [ "direct_answer_first", "period_or_honest_period_clarification", "revenue_cogs_gross_profit_margin_or_honest_unknown", "next_action_if_limited", "detector_results_fail_or_review_on_real_defect" ], "must_not_have": [ "fixed_assets_leak", "amortization_leak", "payment_document_as_margin_source", "route_or_capability_ids_in_user_answer" ] }, "scenarios": [ { "scenario_id": "margin_root_wrong_domain_trap", "title": "Root margin question must not leak into accounting domains", "steps": [ { "step_id": "step_01", "title": "Маржинальность номенклатуры", "question": "Какая номенклатура была самой маржинальной за {{bindings.period}}?", "semantic_tags": [ "margin_profitability", "inventory", "wrong_domain_trap" ], "expected_intents": [ "inventory_margin_ranking_for_nomenclature" ], "expected_capability": "inventory_inventory_margin_ranking_for_nomenclature", "expected_recipe": "address_inventory_margin_ranking_for_nomenclature_v1", "expected_result_mode": "ranking_or_limited_accounting_answer", "expected_business_answer_contract": "margin_profitability_v1", "required_answer_shape": "direct_answer_first", "required_answer_patterns_any": [ "(?i)(марж|прибыл|выруч|себестоим|не могу подтвердить|не хватает)" ], "forbidden_answer_patterns": [ "(?i)(амортизац|основн(ые|ых)? средств|объект ОС|оплат[аы]|банк|settlement|payment_document)" ], "notes": "Если точного расчета нет, допустим честный limited answer, но не уход в ОС/банк/оплаты." } ] }, { "scenario_id": "margin_followup_contract_boundary", "title": "Follow-up must keep margin contract and state limitations", "steps": [ { "step_id": "step_01", "title": "Запрос маржинальности", "question": "Покажи топ товаров по марже за {{bindings.period}}.", "semantic_tags": [ "margin_profitability", "inventory" ], "expected_intents": [ "inventory_margin_ranking_for_nomenclature" ], "expected_capability": "inventory_inventory_margin_ranking_for_nomenclature", "expected_recipe": "address_inventory_margin_ranking_for_nomenclature_v1", "expected_result_mode": "ranking_or_limited_accounting_answer", "expected_business_answer_contract": "margin_profitability_v1", "required_answer_shape": "direct_answer_first", "required_answer_patterns_any": [ "(?i)(марж|прибыл|выруч|себестоим|не могу подтвердить|не хватает)" ], "forbidden_answer_patterns": [ "(?i)(амортизац|объект ОС|payment_document|settlement)" ] }, { "step_id": "step_02", "title": "Почему именно так", "question": "А из чего ты это посчитал и чего не хватает для точной маржи?", "depends_on": [ "step_01" ], "semantic_tags": [ "margin_profitability", "evidence", "scope_guard" ], "expected_result_mode": "evidence_or_honest_boundary", "expected_business_answer_contract": "margin_profitability_v1", "required_answer_shape": "direct_answer_first", "required_answer_patterns_any": [ "(?i)(выруч|себестоим|валов|марж|не хватает|не подтвержден)" ], "forbidden_answer_patterns": [ "(?i)(route_id|capability_id|runtime_|debug|амортизац|объект ОС)" ] } ] }, { "scenario_id": "margin_false_source_traps", "title": "Margin must reject payment and fixed-assets false sources", "steps": [ { "step_id": "step_01_payment_source_trap", "title": "Оплаты не являются источником маржи", "question": "Можно быстро понять маржинальность товаров за {{bindings.period}} по оплатам и банку?", "semantic_tags": [ "margin_profitability", "wrong_domain_trap", "payment_false_source" ], "expected_result_mode": "honest_boundary_with_next_action", "expected_business_answer_contract": "margin_profitability_v1", "required_answer_shape": "direct_answer_first", "required_answer_patterns_any": [ "(?i)(оплат|банк).{0,120}(не источник|нельзя|недостаточ|не подтвержд)", "(?i)(выруч|себестоим|валов|марж)" ], "forbidden_answer_patterns": [ "(?i)(оплат[аы]|банк|payment_document).{0,80}(источник|достаточ|посчитал|марж[ау])", "(?i)(route_id|capability_id|runtime_|debug)" ], "notes": "Платежи могут помогать сверить денежный поток, но не являются достаточной базой для валовой маржи по номенклатуре." }, { "step_id": "step_02_fixed_asset_source_trap", "title": "ОС и амортизация не должны попасть в товарную маржу", "question": "Посчитай маржинальность товарной номенклатуры за {{bindings.period}}, не ОС и не амортизацию.", "semantic_tags": [ "margin_profitability", "wrong_domain_trap", "fixed_asset_false_source" ], "expected_intents": [ "inventory_margin_ranking_for_nomenclature" ], "expected_capability": "inventory_inventory_margin_ranking_for_nomenclature", "expected_recipe": "address_inventory_margin_ranking_for_nomenclature_v1", "expected_result_mode": "ranking_or_limited_accounting_answer", "expected_business_answer_contract": "margin_profitability_v1", "required_answer_shape": "direct_answer_first", "required_answer_patterns_any": [ "(?i)(марж|выруч|себестоим|валов|не могу подтвердить|не хватает)" ], "forbidden_answer_patterns": [ "(?i)(амортизац|объект ОС|основн(ые|ых)? средств).{0,80}(марж|себестоим|валов)", "(?i)(route_id|capability_id|runtime_|debug)" ], "notes": "Даже если пользователь сам сказал `не ОС`, runtime должен удержать товарный контур и не строить ответ вокруг амортизации." } ] } ] }