diff --git a/config.py b/config.py index dfefac7..93f6b6b 100644 --- a/config.py +++ b/config.py @@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.691" +SYSTEM_VERSION = "V10.692" 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 6866336..783eff2 100644 --- a/docs/AI_INTELLIGENCE_MODULE_SOT.md +++ b/docs/AI_INTELLIGENCE_MODULE_SOT.md @@ -768,3 +768,4 @@ POSTGRES_HOST=momo-db | 2026-06-25 | 舊覆核資料輸出層也要清洗價格語意 | V10.689 起 dashboard template 會在輸出 `unit_price_insight.summary` 時清除舊資料殘留的反向價格詞,避免快取或歷史 row 繼續把錯誤字句顯示給營運使用者。 | | 2026-06-25 | Google Drive 背景匯入不得尋找本機瀏覽器 | V10.690 起 `GoogleDriveService.authenticate()` 預設拒絕背景 OAuth;即使人工明確開啟互動授權,也使用 `open_browser=False` 並輸出授權網址,不在 scheduler/app 容器內尋找 runnable browser。 | | 2026-06-25 | 全頁價格方向統一為 PChome 成長視角 | V10.691 起 AI Intelligence、Daily Sales、Growth Analysis、Dashboard、Telegram 與 AI 報告 prompt 不再使用「PChome 價格壓力 / MOMO 價格優勢 / MOMO 更便宜 / PChome 有優勢」等易混淆詞;統一為「PChome 價格優勢」與「MOMO 低價壓力」。 | +| 2026-06-25 | 候選比較卡與價格語意必須有測試防線 | V10.692 起 `tests/test_pchome_revenue_growth_service.py` 鎖定 `/ai_intelligence` 模板必須提供 PChome/MOMO 雙賣場連結、雙開賣場操作與白話候選理由,且不得再出現 `variant_selection_review`、`focused_exact_identity`、`source_code`、`momo_reference` 或反向價格詞。 | diff --git a/docs/guides/google_drive_setup.md b/docs/guides/google_drive_setup.md index c58414d..5a64cf9 100644 --- a/docs/guides/google_drive_setup.md +++ b/docs/guides/google_drive_setup.md @@ -20,12 +20,13 @@ --- ## 🛠️ 首次認證步驟 -正式排程不可啟動瀏覽器;只有人工在可互動環境重新授權時,才允許開啟 OAuth 瀏覽器。 +正式排程不可啟動瀏覽器;只有人工在可互動環境重新授權時,才允許進入 OAuth 授權流程,而且仍只印出授權網址。 若 `config/google_token.json` 遺失或過期,執行以下指令: ```bash GOOGLE_DRIVE_ALLOW_INTERACTIVE_AUTH=true python3 -c "from services.google_drive_service import drive_service; drive_service.authenticate()" ``` -執行後會彈出瀏覽器要求授權。 +執行後系統會在 terminal 印出 Google 授權網址;請手動複製到可登入 Google 的瀏覽器完成授權。 +正式排程與容器內不會自動尋找或啟動本機瀏覽器。 若正式環境仍只有舊版 `config/google_token.pickle`,需在可信任的正式容器中做一次性轉換: ```bash diff --git a/tests/test_pchome_revenue_growth_service.py b/tests/test_pchome_revenue_growth_service.py index b2e42e0..ae688d5 100644 --- a/tests/test_pchome_revenue_growth_service.py +++ b/tests/test_pchome_revenue_growth_service.py @@ -492,11 +492,24 @@ def test_ai_intelligence_template_uses_pchome_growth_name_and_endpoint(): assert "MOMO 待確認候選" in template assert "確認同款" in template assert "不是同款" in template - assert "同時開兩個賣場" in template + assert "雙開賣場" in template assert "openReviewCandidateStores" in template + assert "data-pchome-url" in template + assert "data-momo-url" in template + assert "PChome 賣場" in template + assert "MOMO 賣場" in template + assert "開 PChome" in template + assert "開 MOMO" in template assert "row.match_reason_labels" in template assert "row.match_reasons" not in template assert "variant_selection_review" not in template + assert "focused_exact_identity" not in template + assert "momo_reference" not in template + assert "source_code" not in template + assert "PChome 價格壓力" not in template + assert "MOMO 價格優勢" not in template + assert "MOMO 更便宜" not in template + assert "PChome 有優勢" not in template assert "review-candidate-compare" in template assert "review_external_candidate" in template assert "focusReviewCandidate" in template