From 92c8f3776fc68d2db12a678152d245c30a164f5e Mon Sep 17 00:00:00 2001 From: ogt Date: Thu, 25 Jun 2026 14:11:01 +0800 Subject: [PATCH] fix: hide raw review reason codes --- config.py | 2 +- docs/AI_INTELLIGENCE_MODULE_SOT.md | 1 + services/external_market_offer_service.py | 2 +- tests/test_pchome_revenue_growth_service.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 31d8db8..c742883 100644 --- a/config.py +++ b/config.py @@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.672" +SYSTEM_VERSION = "V10.673" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/docs/AI_INTELLIGENCE_MODULE_SOT.md b/docs/AI_INTELLIGENCE_MODULE_SOT.md index accb1dc..b212048 100644 --- a/docs/AI_INTELLIGENCE_MODULE_SOT.md +++ b/docs/AI_INTELLIGENCE_MODULE_SOT.md @@ -749,3 +749,4 @@ POSTGRES_HOST=momo-db | 2026-06-25 | 可見操作頁不可把權杖、DB、Agent、Pipeline 當成主語 | V10.670 起 AI 助手、日報、銷售分析、缺貨、部署監控與觀測台頁面進一步改用「用量、產出紀錄、AI 分工、部署流程、知識命中」等營運可讀語言。 | | 2026-06-25 | Google Drive 自動匯入不可在正式排程開瀏覽器 | V10.671 起背景匯入缺少 `config/google_token.json` 時 fail-closed 並提示一次性授權檔轉換;正式 scheduler 不再嘗試 `run_local_server()`,且 token refresh 必須能寫回共用 `config/` 掛載,避免主機重啟後再次出現 `could not locate runnable browser` 或授權檔遺失。 | | 2026-06-25 | 待確認候選必須能一眼比對雙平台賣場 | V10.672 起 MOMO 待確認候選回傳 PChome/MOMO 兩個賣場連結與白話檢核點,前台改成雙欄比對並提供「同時開兩個賣場」,不再顯示 `variant_selection_review` 等工程 matcher tag。 | +| 2026-06-25 | 待確認候選 API 不可回傳 raw matcher code | V10.673 起 `match_reasons` 相容欄位也改回白話理由,避免前台或檢視 payload 時再次看到 `variant_selection_review`、`focused_exact_identity_*` 等工程代碼。 | diff --git a/services/external_market_offer_service.py b/services/external_market_offer_service.py index da82ea0..9f70ccd 100644 --- a/services/external_market_offer_service.py +++ b/services/external_market_offer_service.py @@ -1584,7 +1584,7 @@ def list_momo_review_candidates(engine, *, limit: int = 20) -> dict[str, Any]: "alert_tier": raw_payload.get("alert_tier") or "identity_review", "price_basis": raw_payload.get("price_basis") or "manual_review", "gap_pct": gap_pct, - "match_reasons": reasons[:5], + "match_reasons": reason_labels, "match_reason_labels": reason_labels, "reason_summary": "、".join(reason_labels), "observed_at": str(row.get("observed_at") or ""), diff --git a/tests/test_pchome_revenue_growth_service.py b/tests/test_pchome_revenue_growth_service.py index 57adb35..a12e031 100644 --- a/tests/test_pchome_revenue_growth_service.py +++ b/tests/test_pchome_revenue_growth_service.py @@ -220,6 +220,7 @@ def test_momo_review_candidates_return_dual_store_links_and_plain_reasons(): assert row["momo_url"] == "https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=MOMO-REVIEW" assert row["match_reason_labels"] assert all("_" not in label for label in row["match_reason_labels"]) + assert all("_" not in label for label in row["match_reasons"]) assert "色號" in row["reason_summary"] or "款式" in row["reason_summary"]