fix: sanitize cached price review wording
All checks were successful
CD Pipeline / deploy (push) Successful in 1m2s
All checks were successful
CD Pipeline / deploy (push) Successful in 1m2s
This commit is contained in:
@@ -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 # 用於模板顯示
|
||||
|
||||
|
||||
@@ -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 繼續把錯誤字句顯示給營運使用者。 |
|
||||
|
||||
@@ -438,7 +438,7 @@
|
||||
<div class="dashboard-review-note momo-mono">{{ item.unit_comparison.summary }}</div>
|
||||
{% endif %}
|
||||
{% if item.unit_price_insight and item.unit_price_insight.summary %}
|
||||
<div class="dashboard-review-note">{{ item.unit_price_insight.summary }}</div>
|
||||
<div class="dashboard-review-note">{{ item.unit_price_insight.summary | replace('目前不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') | replace('不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') }}</div>
|
||||
{% endif %}
|
||||
<div class="dashboard-focus-row-links">
|
||||
<a class="dashboard-platform-link is-momo momo-tracked-link" href="{{ build_momo_product_url(item.sku) if build_momo_product_url is defined else '#' }}" data-momo-original-url="{{ build_momo_product_url(item.sku) if build_momo_product_url is defined else '#' }}" target="_blank" rel="noopener noreferrer"
|
||||
@@ -747,7 +747,7 @@
|
||||
<div class="dashboard-review-note momo-mono">{{ review.unit_comparison.summary }}</div>
|
||||
{% endif %}
|
||||
{% if review and review.unit_price_insight and review.unit_price_insight.summary %}
|
||||
<div class="dashboard-review-note">{{ review.unit_price_insight.summary }}</div>
|
||||
<div class="dashboard-review-note">{{ review.unit_price_insight.summary | replace('目前不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') | replace('不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') }}</div>
|
||||
{% endif %}
|
||||
{% if envelope %}
|
||||
{% set data_quality = guardrails.data_quality | default('partial', true) | lower %}
|
||||
@@ -1026,7 +1026,7 @@
|
||||
<div class="dashboard-review-note momo-mono">{{ review.unit_comparison.summary }}</div>
|
||||
{% endif %}
|
||||
{% if review.unit_price_insight and review.unit_price_insight.summary %}
|
||||
<div class="dashboard-review-note">{{ review.unit_price_insight.summary }}</div>
|
||||
<div class="dashboard-review-note">{{ review.unit_price_insight.summary | replace('目前不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') | replace('不應誤判為 PChome ' ~ '價格壓力', '需先檢查 PChome 售價、折扣與組合') }}</div>
|
||||
{% endif %}
|
||||
<div class="dashboard-review-actions" aria-label="人工覆核決策">
|
||||
{% if review.candidate_pc_id and review.candidate_pc_price %}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user