Усилить reliability pack маржинальности
This commit is contained in:
@@ -3,8 +3,28 @@
|
||||
"pack_id": "agent_margin_profitability_reliability_20260524",
|
||||
"domain": "margin_profitability",
|
||||
"title": "AGENT | margin profitability wrong-domain traps",
|
||||
"description": "Минимальный reliability pack для проверки, что вопросы про маржинальность номенклатуры не утекают в ОС, амортизацию, банк, оплаты или взаиморасчёты.",
|
||||
"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": "товар"
|
||||
@@ -18,6 +38,24 @@
|
||||
"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",
|
||||
@@ -27,7 +65,16 @@
|
||||
"step_id": "step_01",
|
||||
"title": "Маржинальность номенклатуры",
|
||||
"question": "Какая номенклатура была самой маржинальной за {{bindings.period}}?",
|
||||
"semantic_tags": ["margin_profitability", "inventory", "wrong_domain_trap"],
|
||||
"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",
|
||||
@@ -37,7 +84,7 @@
|
||||
"forbidden_answer_patterns": [
|
||||
"(?i)(амортизац|основн(ые|ых)? средств|объект ОС|оплат[аы]|банк|settlement|payment_document)"
|
||||
],
|
||||
"notes": "Если точного расчёта нет, допустим честный limited answer, но не уход в ОС/банк/оплаты."
|
||||
"notes": "Если точного расчета нет, допустим честный limited answer, но не уход в ОС/банк/оплаты."
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -49,10 +96,21 @@
|
||||
"step_id": "step_01",
|
||||
"title": "Запрос маржинальности",
|
||||
"question": "Покажи топ товаров по марже за {{bindings.period}}.",
|
||||
"semantic_tags": ["margin_profitability", "inventory"],
|
||||
"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)"
|
||||
]
|
||||
@@ -61,8 +119,14 @@
|
||||
"step_id": "step_02",
|
||||
"title": "Почему именно так",
|
||||
"question": "А из чего ты это посчитал и чего не хватает для точной маржи?",
|
||||
"depends_on": ["step_01"],
|
||||
"semantic_tags": ["margin_profitability", "evidence", "scope_guard"],
|
||||
"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",
|
||||
@@ -74,6 +138,60 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 должен удержать товарный контур и не строить ответ вокруг амортизации."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Business Answer Contract",
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": ["schema_version", "contract_id", "domain", "answer_surface", "detectors"],
|
||||
"properties": {
|
||||
"schema_version": {
|
||||
"const": "business_answer_contract_v1"
|
||||
},
|
||||
"contract_id": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"domain": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"purpose": {
|
||||
"type": "string"
|
||||
},
|
||||
"answer_surface": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": ["required_fields"],
|
||||
"properties": {
|
||||
"must_start_with": {
|
||||
"type": "string"
|
||||
},
|
||||
"required_fields": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": ["field", "meaning"],
|
||||
"properties": {
|
||||
"field": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"meaning": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"must_not_contain": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"limited_answer_rule": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root_layers": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"detectors": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
},
|
||||
"acceptance": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "Domain Scenario Pack",
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": ["schema_version", "pack_id", "domain", "scenarios"],
|
||||
"properties": {
|
||||
"schema_version": {
|
||||
"const": "domain_scenario_pack_v1"
|
||||
},
|
||||
"pack_id": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"domain": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"source_contract_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"issue_codes_under_test": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"detectors_under_test": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"rerun_matrix": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"analysis_context": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"acceptance": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"scenarios": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": ["scenario_id", "steps"],
|
||||
"properties": {
|
||||
"scenario_id": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"steps": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"required": ["step_id", "question"],
|
||||
"properties": {
|
||||
"step_id": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"question": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"expected_business_answer_contract": {
|
||||
"type": "string"
|
||||
},
|
||||
"semantic_tags": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"forbidden_answer_patterns": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user