V10.517 強化近門檻商品比對防線

This commit is contained in:
OoO
2026-05-31 22:44:56 +08:00
parent ea1043ef7c
commit c91d20f26b
5 changed files with 94 additions and 1 deletions

View File

@@ -576,6 +576,11 @@ def test_marketplace_matcher_promotes_focused_exact_pack_rows_to_total_price():
"台隆手創館 CANMAKE淚袋專用盤(淚袋眼影盤)",
"focused_exact_identity_canmake_tear_bag_palette",
),
(
"【Lab52 齒妍堂】小頭軟毛嬰幼兒牙刷2入/組(幼兒專用/牙齒清潔/柔軟刷毛/汪汪隊牙刷/呵護幼兒牙齦)",
"Lab52齒妍堂 汪汪隊立大功小頭軟毛嬰幼兒牙刷(2入/組)",
"focused_exact_identity_lab52_paw_patrol_baby_toothbrush_2pack",
),
]
for momo_name, competitor_name, expected_reason in cases:
@@ -2437,6 +2442,25 @@ def test_marketplace_matcher_promotes_safe_aroma_lamps_to_total_price():
assert "focused_exact_identity_hooome_classic_white_wax_lamp_bulbs_giftbox" in hooome.reasons
def test_marketplace_matcher_blocks_aroma_lamp_style_selection_from_recoverable():
from services.marketplace_product_matcher import score_marketplace_match
named_style_gap = score_marketplace_match(
"【Les nez 香鼻子】香氛融蠟燈 流金歲月(香氛/融蠟燈/交換禮物)",
"【Les nez 香鼻子】香氛融蠟燈 暮光琥珀(手工玻璃)",
)
single_sided_style_gap = score_marketplace_match(
"【Les nez 香鼻子】北歐香氛融蠟燈(香氛/融蠟燈)",
"【Les nez 香鼻子】北歐香氛水晶燈融蠟燈 流光玫瑰金",
)
for diagnostics in (named_style_gap, single_sided_style_gap):
assert diagnostics.hard_veto is False
assert diagnostics.price_basis == "manual_review" or diagnostics.score < 0.76
assert "aroma_lamp_style_selection_gap" in diagnostics.reasons
assert "variant_selection_review" in diagnostics.reasons
def test_marketplace_matcher_keeps_recipe_box_child_polish_catalog_in_review():
from services.marketplace_product_matcher import score_marketplace_match
@@ -2625,6 +2649,10 @@ def test_marketplace_matcher_blocks_scent_and_core_line_conflicts():
"【AUS LIFE 澳思萊】檸檬草滾珠精油 5.3ml",
"【AUS LIFE澳思萊】茶樹滾珠精油5.3ml",
)
candle_scent_gap = score_marketplace_match(
"【Time Leisure】聖誕節交換禮物香薰蠟燭擺飾禮盒",
"Time Leisure 聖誕節交換禮物香薰蠟燭擺飾禮盒 英國梨小蒼蘭",
)
ingredient_gap = score_marketplace_match(
"【NOW娜奧】純椰子油膏207ml-Now Foods",
"【NOW 娜奧】Now Foods 純乳木果油油膏 207ml",
@@ -2636,6 +2664,8 @@ def test_marketplace_matcher_blocks_scent_and_core_line_conflicts():
assert rolling_oil_scent_gap.hard_veto is True
assert "aroma_scent_variant_conflict" in rolling_oil_scent_gap.reasons
assert candle_scent_gap.hard_veto is True
assert "aroma_scent_variant_conflict" in candle_scent_gap.reasons
assert ingredient_gap.hard_veto is True
assert "core_ingredient_line_conflict" in ingredient_gap.reasons
assert powder_line_gap.hard_veto is True