diff --git a/config.py b/config.py index 6a9b2e3..1ec589e 100644 --- a/config.py +++ b/config.py @@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.688" +SYSTEM_VERSION = "V10.689" 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 ae38fd0..4ed78b3 100644 --- a/docs/AI_INTELLIGENCE_MODULE_SOT.md +++ b/docs/AI_INTELLIGENCE_MODULE_SOT.md @@ -765,3 +765,4 @@ POSTGRES_HOST=momo-db | 2026-06-25 | MOMO 待確認候選必須是營運比對卡 | V10.686 起首頁候選區需以 PChome/MOMO 左右對照、商品圖、價格差異徽章、同款可信度、中文確認重點與「雙開賣場 / 單開賣場」操作呈現;前端不得把 `variant_selection_review`、`source_code`、`momo_reference` 等工程 key 或資料欄位名直接顯示給營運使用者。 | | 2026-06-25 | 價格語意不得反轉 | V10.687 起 dashboard 的 `gap_pct >= 5` 一律顯示為「PChome 價格優勢」與 win tone;`gap_pct <= -5` 一律顯示為「MOMO 低價壓力」與 risk tone,避免把 PChome 較便宜誤標為價格壓力。 | | 2026-06-25 | 覆核 note 不得保留反向價格詞 | V10.688 起單位價覆核 note 不再使用「不應誤判為 PChome 價格壓力」這類否定式錯誤詞,改用「需先檢查 PChome 售價、折扣與組合」等可執行語句。 | +| 2026-06-25 | 舊覆核資料輸出層也要清洗價格語意 | V10.689 起 dashboard template 會在輸出 `unit_price_insight.summary` 時清除舊資料殘留的反向價格詞,避免快取或歷史 row 繼續把錯誤字句顯示給營運使用者。 | diff --git a/templates/dashboard_v2.html b/templates/dashboard_v2.html index 4d4697c..7a8fd71 100644 --- a/templates/dashboard_v2.html +++ b/templates/dashboard_v2.html @@ -438,7 +438,7 @@
{{ item.unit_comparison.summary }}
{% endif %} {% if item.unit_price_insight and item.unit_price_insight.summary %} -
{{ item.unit_price_insight.summary }}
+
{{ item.unit_price_insight.summary | replace('目前不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') | replace('不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') }}
{% endif %} {% endif %} {% if review and review.unit_price_insight and review.unit_price_insight.summary %} -
{{ review.unit_price_insight.summary }}
+
{{ review.unit_price_insight.summary | replace('目前不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') | replace('不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') }}
{% endif %} {% if envelope %} {% set data_quality = guardrails.data_quality | default('partial', true) | lower %} @@ -1026,7 +1026,7 @@
{{ review.unit_comparison.summary }}
{% endif %} {% if review.unit_price_insight and review.unit_price_insight.summary %} -
{{ review.unit_price_insight.summary }}
+
{{ review.unit_price_insight.summary | replace('目前不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') | replace('不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') }}
{% endif %}
{% if review.candidate_pc_id and review.candidate_pc_price %} diff --git a/tests/test_frontend_v2_assets.py b/tests/test_frontend_v2_assets.py index 03ed72b..bb7272d 100644 --- a/tests/test_frontend_v2_assets.py +++ b/tests/test_frontend_v2_assets.py @@ -735,8 +735,8 @@ def test_dashboard_v2_shows_pchome_competitor_pricing_and_links(): assert "competitor_product_id" in route_source assert "https://24h.pchome.com.tw/prod/" in route_source assert "_build_competitor_decision(" in route_source - assert "PChome 價格壓力" in route_source - assert "MOMO 價格優勢" in route_source + assert "PChome 價格優勢" in route_source + assert "MOMO 低價壓力" in route_source assert "item['pchome_competitor']" in route_source assert "item['competitor_decision']" in route_source