From 8d9984dc0450410efa5faa33a7bd68c779975d60 Mon Sep 17 00:00:00 2001 From: OoO Date: Sun, 24 May 2026 13:54:53 +0800 Subject: [PATCH] V10.411 rescue focused marketplace matches --- config.py | 2 +- docs/memory/history_logs.md | 1 + services/marketplace_product_matcher.py | 28 +++++++++++++++ tests/test_marketplace_product_matcher.py | 42 +++++++++++++++++++++++ 4 files changed, 72 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 5a263fe..b03b88b 100644 --- a/config.py +++ b/config.py @@ -325,7 +325,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.410" +SYSTEM_VERSION = "V10.411" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/docs/memory/history_logs.md b/docs/memory/history_logs.md index 14e4730..3c80f65 100644 --- a/docs/memory/history_logs.md +++ b/docs/memory/history_logs.md @@ -13,6 +13,7 @@ ## 📅 詳細更新日誌 (考古存檔) ### 2026-05-24:PChome 近門檻身份回收第二輪 +- **V10.411 rom&nd / Summer’s Eve / Solone 近門檻 review-only 回收**: marketplace matcher 追加三條窄範圍 focused identity:rom&nd 果汁唇釉 2.0 catalog、Summer’s Eve 舒摩兒全肌防護浴潔露 2入、Solone 持久眼線筆;皆只進 `identity_review` / manual-review,不直接價格告警。production pilot 已回刷 3/3,`matched` 1616→1619、`true_low_confidence` 763→760;rom&nd 染眉膏 ZO&FRIENDS 色號、Summer’s Eve 雙天王任選、Lactacyd 清新舒涼 vs 生理呵護、MAC 柔霧 vs 緞光、NIVEA / 曼秀雷敦包數差異仍不自動救回,維持準確率優先。 - **V10.410 Code Review timeout 梯度改為保護 111**: 部署後實測顯示 GCP-A 從 188 失聯時,Code Review 仍會先等 primary 45s,GCP-B 完整審查 prompt 又常因 25s 太短而 timeout,最後轉落 111。`CODE_REVIEW_OLLAMA_TIMEOUT` 預設收斂為 `15s`,`CODE_REVIEW_OLLAMA_SECONDARY_TIMEOUT` 放寬為 `60s`;Hermes LLM scan 若啟用則 primary `15s`、secondary `45s`。目標是 A 掛時更快讓位給 B,並給 B 足夠時間完成,避免過早壓到 111。 - **V10.409 MCP fetch target review gate**: 新增 `mcp_fetch_target_review` read-only builder、GET/POST endpoint、UI target review 審核面板與 deployment readiness smoke target,讓 manual fetch handoff 通過後,先審核 adapter registry 公開入口、每平台節流、樣本數、timeout 與 rollback plan;API/UI 不保存 payload、不發外部 request、不開 DB、不寫入、不掛 scheduler,也不會自動打開 manual fetch。 - **V10.408 OPI 指甲油 catalog review-only 回收**: marketplace matcher 針對 OPI 類光繚指甲油加入同系列 catalog focused identity,只在「白日夢遊」或「驕傲果凍」系列名雙方一致時進 `identity_review`;12色/11色視為可選色號數差異,不當作販售件數,跨系列仍維持 suppress。production pilot 已回刷 KATE 怪獸級持色唇膏限量款與兩個 OPI SKU 共 3/3,`matched` 1613→1616、`true_low_confidence` 766→763,三筆皆為 `alert_tier_identity_review` / `price_basis_manual_review`,不進 Hermes 直接價格告警。 diff --git a/services/marketplace_product_matcher.py b/services/marketplace_product_matcher.py index b0480d0..ad099e8 100644 --- a/services/marketplace_product_matcher.py +++ b/services/marketplace_product_matcher.py @@ -471,7 +471,10 @@ FOCUSED_IDENTITY_REVIEW_ONLY_REASONS = { "so_natural_fixx_setting_spray_catalog", "kate_monster_lipstick_catalog", "opi_gel_polish_series_catalog", + "romand_juicy_lip_tint_2_catalog", + "solone_longlasting_eyeliner", "shu_auto_hard_formula_refill_catalog", + "summer_eve_full_skin_wash_2pack", "the_forest_maple_diffuser_flower_brandless", } @@ -2753,6 +2756,8 @@ def _has_focused_low_score_exact_identity_line(left: ProductIdentity, right: Pro left_text = left.searchable_name right_text = right.searchable_name pair_text = f"{left_text} {right_text}" + left_raw = left.original_name.lower() + right_raw = right.original_name.lower() brand_tokens = left.brand_tokens | right.brand_tokens if ( @@ -2959,6 +2964,20 @@ def _has_focused_low_score_exact_identity_line(left: ProductIdentity, right: Pro and any(series in left_text and series in right_text for series in ("白日夢遊", "驕傲果凍")) ): return "opi_gel_polish_series_catalog" + if ( + ("rom" in (left.brand_tokens & right.brand_tokens) or "romand" in (left.brand_tokens & right.brand_tokens)) + and "果汁唇釉" in left_text + and "果汁唇釉" in right_text + and "2.0" in left_text + and "2.0" in right_text + ): + return "romand_juicy_lip_tint_2_catalog" + if ( + "solone" in (left.brand_tokens & right.brand_tokens) + and "持久眼線筆" in left_text + and "持久眼線筆" in right_text + ): + return "solone_longlasting_eyeliner" if ( {"shu uemura", "植村秀"} & (left.brand_tokens & right.brand_tokens) and "自動武士刀眉筆" in left_text @@ -2967,6 +2986,15 @@ def _has_focused_low_score_exact_identity_line(left: ProductIdentity, right: Pro and "筆蕊" in right_text ): return "shu_auto_hard_formula_refill_catalog" + if ( + {"summer", "eve", "舒摩兒"} & (left.brand_tokens & right.brand_tokens) + and "浴潔露" in left_text + and "浴潔露" in right_text + and "全肌防護" in left_raw + and "全肌防護" in right_raw + and _has_exact_count_alignment(left, right) + ): + return "summer_eve_full_skin_wash_2pack" if ( "焦糖楓葉香氛擴香花禮盒" in left_text and "焦糖楓葉香氛擴香花禮盒" in right_text diff --git a/tests/test_marketplace_product_matcher.py b/tests/test_marketplace_product_matcher.py index 2e8b9fe..19e6d29 100644 --- a/tests/test_marketplace_product_matcher.py +++ b/tests/test_marketplace_product_matcher.py @@ -895,6 +895,18 @@ def test_marketplace_matcher_keeps_catalog_variant_recoveries_in_identity_review "【O.P.I】類光繚指甲油 12色任選1瓶(小銀蓋/如膠似漆驕傲果凍系列指彩/官方直營)", "OPI 如膠似漆驕傲果凍系列 類光繚指甲油11色任選", ), + ( + "即期品【Summer’s Eve 舒摩兒】全肌防護浴潔露2入(私密清潔 經典防護王)無外盒裸瓶包裝", + "eve舒摩兒 賦活美學浴潔露-全肌防護 2入組", + ), + ( + "【rom&nd】果汁唇釉 2.0(the juicy 果汁唇釉 romand)", + "rom&nd 果汁唇釉2.0_3.5g_多款可選", + ), + ( + "【Solone】持久眼線筆(眼線膠 超防暈推薦)", + "Solone 持久眼線筆 1.5g", + ), ] for momo_name, competitor_name in cases: @@ -1217,6 +1229,21 @@ def test_marketplace_matcher_promotes_focused_low_score_exact_identity_lines(): "OPI 如膠似漆驕傲果凍系列 類光繚指甲油11色任選", "focused_exact_identity_opi_gel_polish_series_catalog", ), + ( + "即期品【Summer’s Eve 舒摩兒】全肌防護浴潔露2入(私密清潔 經典防護王)無外盒裸瓶包裝", + "eve舒摩兒 賦活美學浴潔露-全肌防護 2入組", + "focused_exact_identity_summer_eve_full_skin_wash_2pack", + ), + ( + "【rom&nd】果汁唇釉 2.0(the juicy 果汁唇釉 romand)", + "rom&nd 果汁唇釉2.0_3.5g_多款可選", + "focused_exact_identity_romand_juicy_lip_tint_2_catalog", + ), + ( + "【Solone】持久眼線筆(眼線膠 超防暈推薦)", + "Solone 持久眼線筆 1.5g", + "focused_exact_identity_solone_longlasting_eyeliner", + ), ( "【GATSBY】爆水擦澡濕巾24張入(涼感乾洗澡)", "GATSBY 爆水擦澡濕巾24張入(240g)", @@ -1274,6 +1301,18 @@ def test_marketplace_matcher_keeps_high_variant_low_score_lines_outside_focused_ "【O.P.I】類光繚指甲油 12色任選1瓶(小銀蓋/如膠似漆白日夢遊系列指彩/官方直營)", "OPI 如膠似漆驕傲果凍系列 類光繚指甲油11色任選", ) + romand_line_gap = score_marketplace_match( + "【rom&nd】水感唇釉", + "rom&nd 果汁唇釉5.5g_多款可選", + ) + summer_eve_variant_gap = score_marketplace_match( + "即期品【Summer’s Eve 舒摩兒】全肌防護浴潔露2入(私密清潔 經典防護王)無外盒裸瓶包裝", + "eve舒摩兒 生理呵護浴潔露 2入組", + ) + solone_type_gap = score_marketplace_match( + "【Solone】持久眼線筆(眼線膠 超防暈推薦)", + "Solone 斜角眉筆 0.35g", + ) for diagnostics in ( lush, @@ -1286,6 +1325,9 @@ def test_marketplace_matcher_keeps_high_variant_low_score_lines_outside_focused_ mac_finish_gap, ysl_powder_variant_guard, opi_series_gap, + romand_line_gap, + summer_eve_variant_gap, + solone_type_gap, ): assert diagnostics.score < 0.76 assert not any(reason.startswith("focused_exact_identity_") for reason in diagnostics.reasons)