Commit Graph

115 Commits

Author SHA1 Message Date
OoO
c7d6db31f2 feat(p11): RAG 自主學習 + Promotion Gate 4 階段護欄(feature flag OFF)
Some checks are pending
CD Pipeline / deploy (push) Has started running
Operation Ollama-First v5.0 / Phase 11 / RAG 自主學習迴圈

services/rag_service.py (532 行)
- RAGService.query() — bge-m3 embed + cosine 0.85 threshold + top_k=5
- get_embedding_signature() — v5.0 護欄 #3 一致性檢查 (SHA1[:12])
- fire-and-forget rag_query_log INSERT (不阻塞主流程)
- feedback() — Telegram 👍/👎 寫回 feedback_score
- RAG_ENABLED 預設 OFF(戰前行為不變)

services/learning_pipeline.py (750 行)
- Distiller — 純 Hermes 規則引擎,零 LLM 成本
  Quality 規則:MCP >200 字 0.8 / LLM JSON ok 0.9 / TextRank 0.6 / 👍 1.0 / 👎 0.0
- PromotionGate — Owen v5.0 護欄 #1 鐵律
  Stage 1: quality_score >= 0.7
  Stage 2: 無幻覺檢測(規則引擎,零 LLM)
  Stage 3: 與既有 insight 相似度 < 0.95(Stage 3 在 episode embed 後啟用)
  Stage 4: weight >= 0.8 必經 Telegram 👍/👎
- expire_stale_reviews() — 24h 無回應自動降級 weight=0.5
- hash_human_approver — Telegram username SHA1[:8] PII 保護

services/hermes_analyst_service.py — 新增 analyze() RAG-first
- RAG hit → return synthesize(不燒 LLM)
- RAG miss → 既有 LLM 路徑 + enqueue learning_episodes

services/openclaw_strategist_service.py — Q&A 入口接 RAG-first
- 不動週/月/年報(敘事報告 RAG hit 機率低)

services/telegram_templates.py
- rag_feedback_keyboard() — 👍/👎 inline keyboard
- promotion_review_keyboard() — Stage 4 人工驗收按鈕

routes/openclaw_bot_routes.py — 3 組 callback handler
- rag_fb:{id}:{score} → rag_service.feedback()
- pg_ok:{episode_id} → PromotionGate.promote()
- pg_no:{episode_id} → PromotionGate.reject()

70 unit tests 全綠 + 全戰役 196 tests zero regression(4:17 跑完)

剩餘 limitations(Phase 12+ 補):
1. learning_episodes.embedding 寫入路徑(Stage 3 dedup 暫 skip)
2. PromotionGate worker cron 未掛
3. Telegram awaiting_review 推播未接(callback handler 已就位)

灰度開啟條件(建議 1 週後):
- ANTHROPIC_API_KEY 設定 + RAG_ENABLED=true + threshold=0.90 保守
- feedback_score >= 4 比率 > 70% → threshold 降至 0.85

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 23:56:12 +08:00
OoO
838267c293 feat(p1+p3): logger 接 13 caller + Q&A/Nemotron/日報 feature flag 灰度
Phase 1 A4 — 13 個呼叫點接 ai_call_logger(覆蓋率 11.8% → 預估 50%+)
- TOP-1 nemoton_dispatcher: nemotron_dispatch caller (NIM 配額追蹤)
- TOP-2 openclaw_strategist: 4 reports (daily/weekly/monthly/meta) + qa caller
- TOP-3 hermes_analyst: hermes_analyst + hermes_intent (順修 commit 00591c5 殘留 bug)
- TOP-4 code_review_pipeline: code_review_hermes/openclaw/elephant 三鏈 (request_id 串)
- TOP-5 openclaw_bot_routes: openclaw_bot_main/gemini/nim 三層 fallback

Phase 3 A7 — OpenClaw Q&A → qwen3:14b(feature flag OFF)
- OPENCLAW_QA_OLLAMA_FIRST 灰度開關
- 繁中強制 system prompt + Gemini fallback chain
- _is_low_quality_response 品質守門(簡體字檢測 + 拒答訊號 + 結構分數)
- 黃金集 A/B 對照測試框架(10 樣本去 PII)

Phase 3 A8 — OpenClaw 日報 → Hermes 模板(feature flag OFF)
- OPENCLAW_DAILY_HERMES_TEMPLATE 灰度開關
- _compute_daily_kpi 純 SQL + Hermes 規則引擎
- _compute_gemini_insight 精簡 200 字洞察 prompt
- templates/daily_report_v2.j2 + _SafeUndefined 缺欄位優雅降級
- scripts/compare_daily_report_versions.py 雙版本盲測

Phase 3 A9 — Nemotron NIM → qwen3:14b(feature flag OFF)
- NEMOTRON_OLLAMA_FIRST 灰度開關(A2 紅燈:deepseek-r1 假支援,改 qwen3)
- _call_qwen3_dispatch + 既有 NIM tool_calls 解析共用
- 保留 ADR-004「🟡 [降級模式]」Hermes 規則引擎兜底

H6 PII fix — chat_id 進 ai_calls.meta 改 SHA1[:8](4 處 Bot Q&A)

Code Review pipeline — N3 動態 provider tag(gcp/secondary/111)+ A4 logger 三鏈

37 unit tests 全綠(routing 15 + golden 5 + qwen3 8 + daily template 8 + nemotron 1)

Operation Ollama-First v5.0 / Phase 1 A4 + Phase 3 A7+A8+A9

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 23:05:38 +08:00
OoO
8b76e3872f feat(ppt): competitor v4 — 5-forces strategic analysis (Wave 4 partial)
All checks were successful
CD Pipeline / deploy (push) Successful in 2m49s
Wave 4 部分完成:competitor v4 五力升級(戰略視角)

generate_competitor_v4_ppt — 7 頁
- P1 封面:含整體領先/勢均力敵/落後徽章 + 三句話戰略指引
- P2 五力雷達圖(matplotlib polar)+ 右側 6 維度分數明細表(含雙條視覺化)
- P3 商品力 + 價格力(雙卡)
- P4 行銷力 + 服務力(雙卡)
- P5 品牌力 + 財務力(雙卡含 momo 8454/PChome 8044/蝦皮 SE/酷澎基本面)
- P6 AI 戰略整合(差異化建議)
- P7 附錄

新增 helper:_mpl_radar_png()
- matplotlib polar projection 五力雷達
- momo 焦糖橘 + 競品蜂蜜金
- 0-10 分尺度,含格線/標籤/圖例

query_competitor_5forces — 半實作
- 商品力:momo SKU 數從 DB 算 / 競品靜態 fallback
- 價格力:靜態(待擴 competitor_price_history 整合)
- 行銷力 / 服務力:靜態知識(電視購物頻道 / 24h 物流 / 訂閱制)
- 品牌力:靜態 + 預留 mcp_collector 整合空間
- 財務力:上市公司公開資訊(momo 8454 富邦集團、PChome 8044、SEA、酷澎)

每個維度自動算 momo - 競品差異 → 識別最大優勢力與最大劣勢力

_ppt_ai_analysis 加 is_5forces 分支
- 角色:BCG/麥肯錫資深戰略顧問
- 結構:整體競爭態勢 / 優勢加碼 / 劣勢補強或避戰 / SMART 三層 / 競爭風險
- max_tokens 2400

路由:
- /ppt competitor_v4         vs PChome(預設)
- /ppt competitor_v4 蝦皮    vs 蝦皮
- /ppt competitor_v4 酷澎    vs 酷澎

Telegram 按鈕:「⚔️ 競業五力 v4」

bump TEMPLATE_VERSIONS['competitor_v4'] = v4.0.0(新類型獨立版本)

簡化限制:商品力/價格力/品牌力的競品具體數據需後續擴 mcp_collector
(PChome SKU API、Dcard 品牌討論度量化等),靜態 fallback 已維持結構完整性

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 13:10:15 +08:00
OoO
16b169d3ee feat(ppt): price_elasticity sweet spot report v3.1.0 (simplified)
All checks were successful
CD Pipeline / deploy (push) Successful in 2m56s
Wave 3.3:價格彈性簡化版(採購/PM 定價策略用)

generate_price_elasticity_ppt — 7 頁
- P1 封面:含集中度徽章(過度集中/主流明確/分布健康)+ 三句話結論
- P2 KPI:SKU 數/總訂單/甜蜜點價位/甜蜜點 SKU 數
- P3 各價位桶訂單分布橫條(找甜蜜點,焦糖橘=最高訂單桶)
- P4 各價位桶業績分布橫條(評估高價帶健康度,業界基準 30-50%)
- P5 甜蜜點 TOP 5 SKU(明星價位代表商品,新品設計參考)
- P6 AI 採購策略洞察
- P7 附錄

query_price_elasticity(category, days)
- 對 SKU 算平均售價(總業績 / 數量)
- 7 個價位桶分組(< 200 / 200-500 / 500-1K / 1K-2K / 2K-5K / 5K-10K / > 10K)
- 識別「訂單數最多」的桶 = 價格甜蜜點
- 計算高價帶(>NT$2K)業績佔比(業界基準健康 30-50%)
- 選 sweet_spot 桶內 TOP 5 SKU 作為代表

簡化版限制(為後續 ADR 註明):
- 非完整 price_elasticity(需要時間序列定價變化資料)
- 但能展示「該品類消費者最買單的價位帶」這個關鍵採購洞察

_ppt_ai_analysis 加 is_price_elast 分支
- 角色:採購主管 + PM
- 結構:甜蜜點解讀 / 高低價帶結構 / SMART 三層 / 風險預警
- 含「斷層補強」概念(識別 SKU 數明顯偏少的價位區間)
- max_tokens 1700

路由:
- /ppt price_elasticity                 全平台 90 天
- /ppt price_elasticity 美妝保養        單品類 90 天
- /ppt price_elasticity 美妝保養 30     自訂天數

Telegram 按鈕:「💰 價格彈性報告」

bump TEMPLATE_VERSIONS['price_elasticity'] = v3.1.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 12:48:15 +08:00
OoO
fe3cba8496 feat(ppt): market_intel_weekly external signal aggregation v3.1.0
All checks were successful
CD Pipeline / deploy (push) Successful in 3m6s
Wave 3.2:市場情報週報 — 把 mcp_collector 所有外部 API 彙整成一份內部簡報。

generate_market_intel_weekly_ppt — 7 頁
- P1 封面:本週重點/市場機會/風險警訊三句話(從 AI 自動抽)
- P2 節慶日曆 + 季節情境(雙卡)
- P3 電商新聞 + Google 熱搜(雙卡)
- P4 Dcard 口碑 + YouTube 爆紅(雙卡)
- P5 天氣 + 匯率(雙卡,影響消費行為)
- P6 AI 整合洞察與行動建議
- P7 附錄

外部資料來源(mcp_collector_service / mcp_context_service):
- mcp_collector.get_holiday_context()  節慶日曆(靜態)
- mcp_collector.get_seasonal_context() 季節情境(靜態)
- get_ecommerce_news()  電商產業新聞(Gemini Grounding)
- get_taiwan_trends()   Google 台灣熱搜
- get_dcard_trends()    Dcard 熱門討論
- get_youtube_trending() YouTube 爆紅商品
- get_taiwan_weather()  台灣天氣
- get_twbank_exchange_rates() 台幣匯率

每個外部 API 用 _safe() wrapper,失敗時填預設文字「(本次擷取失敗或無資料)」。

_ppt_ai_analysis 加 is_market_intel 分支
- 角色:行銷情報分析師 + BU 主管
- 結構:本週市場大事 / 消費者情緒口碑 / 競爭態勢差異化 / SMART 三層 /
  外部風險預警
- max_tokens 2000

路由:
- /ppt market_intel    本週情報週報(自動對齊週一)

Telegram 按鈕:「🌐 市場情報週報」

bump TEMPLATE_VERSIONS['market_intel'] = v3.1.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 12:39:57 +08:00
OoO
95a74c3502 feat(ppt): new_product 30-day tracking report v3.1.0
All checks were successful
CD Pipeline / deploy (push) Successful in 2m35s
Wave 3.1:新品追蹤報告(PM/採購用)

generate_new_product_ppt — 9 頁
- P1 封面:含新品力徽章(強勁/穩健/偏弱/疲弱,依業績佔比)+ 三亮點
- P2 KPI:新品總數/業績/佔比/平均單品業績 + AI 解讀
- P3 新品整體日業績曲線(爬榜軌跡 matplotlib)
- P4 新品依品類分佈橫條
- P5-P7 新品 TOP 50(自動分頁)
- P8 AI PM 戰術洞察
- P9 附錄

query_new_products(days_recent=30, days_baseline=60)
- PostgreSQL CTE:recent EXCEPT early
  recent = 近 30 天有銷售
  early  = 31-90 天前有銷售
- 自動回傳:新品 TOP 50 / 子品類分佈 / 日業績曲線
- 含 ANY array 查詢新品集合的整體日業績

_ppt_ai_analysis 加 is_new_prod 分支
- 角色:PM 商品經理 + 採購主管
- 結構:新品力評估 / 明星新品識別 / 品類分佈與機會 / SMART 三層 / 風險預警
- SMART 行動含:加碼 TOP3 / 觀察排名 11-30 / 數據追蹤
- max_tokens 1800

業界基準:新品業績佔比 5-10% 為健康,>8% 強勁,<3% 偏弱

路由:
- /ppt new_product       預設近 30 天
- /ppt new_product 14    自訂追蹤天數

Telegram 按鈕:「🆕 新品 30 天追蹤」

bump TEMPLATE_VERSIONS['new_product'] = v3.1.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 12:37:06 +08:00
OoO
958f705c8e feat(ppt): promo_compare multi-promo ROI report v3.1.0
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Wave 2.2:N 場促銷活動橫向比較(行銷主管覆盤用)。

generate_promo_compare_ppt — 5 頁
- P1 封面:含活動數徽章 + 排名亮點(最高拉抬/最低拉抬/最佳毛利)
- P2 並排 KPI 表:8 欄(活動/期間/天數/業績/訂單/毛利/業績拉抬/訂單拉抬)
  支援 14 場以下並排顯示
- P3 業績拉抬橫條圖(matplotlib,按拉抬 % 排序)
- P4 AI 跨活動洞察(成功要素 / 失敗診斷 / SMART 三層)
- P5 附錄

路由:
- /ppt promo_compare 母親節:2026/05/05-2026/05/14|520:2026/05/18-2026/05/22|618:2026/06/14-2026/06/22

每場活動透過 query_promo_comparison 取 ROI 數據,自動產生 4 個排名。

_ppt_ai_analysis 加 is_promo_cmp 分支
- 角色:資深行銷主管
- 結構:整體比較 / 勝出活動成功要素 / 失敗活動診斷 / SMART 三層
- max_tokens 1600

Telegram 按鈕:「🆚 多活動比較」(await:promo_compare)

bump TEMPLATE_VERSIONS['promo_compare'] = v3.1.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 12:28:17 +08:00
OoO
9f04dc3951 feat(ppt): forecast_pre_event report v3.1.0 (BU pre-event battle plan)
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Wave 2.1:檔期前瞻報告 — 給 BU 主管在檔期前 14 天決定備戰策略。

generate_forecast_pre_event_ppt — 7 頁
- P1 封面:含倒數天數徽章(備戰期/衝刺期/檔期中/已結束)+ 三段預期業績
- P2 KPI 三段對比:本期預期 / 去年同檔期 / Baseline 日均 / 已執行業績
- P3 去年同檔期業績曲線(matplotlib 折線,預測基準視覺化)
- P4 庫存盤點 TOP 30(基於 baseline 期銷量)
- P5 AI 戰術洞察
- P6 附錄

query_forecast_pre_event(event_name, event_date)
- baseline 期:檔期前 60-30 天(去除檔期前期效應)
- 去年同檔期:去年同日期 ± 7 天
- 本期準備窗口:檔期前 14 天到檔期後 7 天
- 預期業績 = baseline 日均 × 21 天 × lift_factor
- lift_factor 靜態知識(母親節 1.40 / 618 1.45 / 雙11 1.65 / 黑五 1.45 等)

_ppt_ai_analysis 加 is_forecast 分支
- 角色:BU 主管 + 行銷投放主管 + 採購三合一
- 結構:檔期定位 / 準備窗口進度 / 庫存戰術 / 廣告滿額門檻 /
  SMART 三層(檔期前7/當日+3/檔期後7)/ 風險預警
- max_tokens 2000

路由:
- /ppt forecast 母親節 2026/05/12
- /ppt forecast 618 2026/06/18

Telegram 按鈕:「🎯 檔期前瞻報告」(await:forecast_event)

bump TEMPLATE_VERSIONS['forecast_pre_event'] = v3.1.0

煙霧測試:7 頁 140KB 全綠。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 12:25:42 +08:00
OoO
48e3dacfc9 feat(ppt): customer analytics report v3.1.0 (simplified RFM, no user_id)
All checks were successful
CD Pipeline / deploy (push) Successful in 2m49s
Wave 1.4:客戶/訂單分析報告(行銷主管用)— 受限於資料層無 user_id,
做訂單級分析而非完整 RFM。

generate_customer_analytics_ppt — 7 頁
- P1 封面:含客單定位徽章(高/中/低)+ 限制聲明(無 user_id 註腳)
- P2 KPI:總訂單/總業績/平均客單/高客單訂單數
- P3 客單價分佈:6 級分桶橫條(< NT$500 / 500-1K / 1-2K / 2-5K / 5-10K / >10K)
- P4 消費星期分佈:matplotlib 橫條(找熱門時段)
- P5 商品復購排行 TOP 30:同商品在多筆獨立訂單中的次數
- P6 AI 行銷洞察
- P7 附錄

query_customer_analytics
- AOV 分桶(CASE WHEN bucket)
- DOW 星期聚合(PostgreSQL EXTRACT(DOW))
- 復購商品(GROUP BY 商品名稱 HAVING COUNT(訂單) >= 5)

_ppt_ai_analysis 加 is_customer 分支
- 角色:資深行銷主管(10 年 RFM/CRM 經驗)
- 結構:訂單規模解讀 / 消費熱點 / 商品復購信號 / SMART 三層
- 長期建議:建立會員系統取得 user_id 升級完整 RFM

路由:
- /ppt customer            預設近 30 天
- /ppt customer 2026/04    指定月份

Telegram 按鈕:「👥 客戶/訂單分析」

bump TEMPLATE_VERSIONS['customer'] = v3.1.0

煙霧測試:7 頁 100KB 全綠。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 02:17:48 +08:00
OoO
d8260fcd25 feat(ppt): category deep dive report v3.1.0 (90-day single category)
All checks were successful
CD Pipeline / deploy (push) Successful in 3m31s
Wave 1.3:單一品類 90 天縱向深度分析(PM/採購用)。

generate_category_deep_ppt(services/ppt_generator.py)— 12 頁
- P1 封面:含品類定位徽章(主力/成長/長尾)+ 新進榜商品 hero box
- P2 執行摘要:4 KPI(業績/訂單/毛利/SKU 數)+ AI 高階解讀
- P3 90 天日業績走勢(matplotlib 折線 + 日均線 + 高低點)+ 結論帶
- P4 子品類結構:橫條 + 帕雷托雙視圖
- P5-P7 TOP 50 商品(自動分頁)
- P8 TOP 30 廠商
- P9 新進榜商品專頁(近 30 天進榜,過去 60 天無交易判定)
- P10 AI 採購/PM 視角洞察
- P11 附錄

query_category_deep(routes/openclaw_bot_routes.py)
- 一次拉齊:kpis / daily(逐日) / top_products(50) / top_vendors(30) /
  sub_categories(L2) / new_products(近 30 天 vs 60 天前比對)
- 用 PostgreSQL CTE 做新進榜判定(recent EXCEPT early)

_ppt_ai_analysis 加 is_category 分支
- 角色:採購主管 + PM 商品經理
- 結構:品類整體 / 90 天趨勢 / 子品類結構 / SKU 與廠商組合 /
  SMART 三層 / 風險預警
- max_tokens 1800

路由:
- /ppt category 美妝保養        90 天深度(預設)
- /ppt category 美妝保養 30     自訂期間

Telegram 按鈕:「🗂 品類深度報告」(await:category_deep)
TODO:實作 await:category_deep 對應品類選擇互動(下一波)

bump TEMPLATE_VERSIONS['category'] = v3.1.0

煙霧測試:12 頁 300KB 全綠。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 02:14:07 +08:00
OoO
1af96f5be4 feat(ppt): period_review unified generator for quarterly/half/annual/ttm
All checks were successful
CD Pipeline / deploy (push) Successful in 3m37s
Wave 1.2:用一份 generator 解 4 種時間維度報表(季/半年/年/TTM)。

generate_period_review_ppt(services/ppt_generator.py)— 12 頁
- 期間類型徽章自動切換(季報/半年報/年報/TTM 滾動)
- P1 封面:含業績狀態徽章 + elevator pitch + 期間動能
- P2 執行摘要:KPI v2 含 △% (vs 上季/上半/去年) + AI 解讀 + YoY 對比帶
- P3 月度業績走勢(matplotlib 折線:本期 + 上期 + 月均線 + 高低點)+ 4 卡指標
- P4 品類分析:橫條 + 帕雷托雙視圖
- P5-P7 TOP 50 商品(自動分頁)
- P8 TOP 30 廠商
- P9 MCP 市場情報
- P10 AI 結構化洞察
- P11 附錄

query_period_summary(routes/openclaw_bot_routes.py)
- 一次拉齊:kpis / monthly_breakdown / top_products(50) / top_categories(8) /
  top_vendors(30)
- 自動算月度聚合(PostgreSQL TO_CHAR)

路由層加 4 種 sub_type 分支:
- /ppt quarterly [YYYY/Q1-4]    當季或指定季
- /ppt half_yearly [YYYY/H1-2]  當半年或指定半年
- /ppt annual [YYYY]            當年或指定年
- /ppt ttm                      最近 12 個月(自動算到本月底)

每種自動抓三段資料:本期 + 上期同等 + 去年同期
- quarterly: 上季 + 去年同季
- half_yearly: 上半年 + 去年同半年
- annual: 去年 + 前年
- ttm: 上一個 TTM (24-12 月前) + 同上

_ppt_ai_analysis 加 is_period 分支
- 角色:策略顧問 + BU 主管 + CFO 三合一視角
- 結構:整體解讀 / 市場趨勢對位 / 月度走勢分析 / 品類結構 / 戰略級 SMART /
  風險預警
- SMART 行動分三層:下期立即啟動(30 天)/ 下期戰略(60-90 天)/
  下下期預備(6-12 月)
- max_tokens 2600,字數 1000-1300

Telegram 按鈕:報表選單加 4 顆季/半/年/TTM 按鈕

bump TEMPLATE_VERSIONS:quarterly / half_yearly / annual / ttm 全 v3.1.0

煙霧測試:4 種全綠,每份 12 頁 220KB。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 02:10:14 +08:00
OoO
b6fdb4f473 feat(ppt): awaken vendor report + v3.1.0 procurement strategy upgrade
All checks were successful
CD Pipeline / deploy (push) Successful in 2m32s
Wave 1.1:把沉睡的 vendor generator 喚醒並全面升 v3.1.0:

generate_vendor_ppt(services/ppt_generator.py)— 8 頁
- P1 封面:含集中度警示徽章(健康分散 / 偏高 / 過高)+ 三句話策略要點
- P2 執行摘要:4 KPI 含 △% vs 上期 + 帕雷托 80/20 集中度結論帶
- P3 廠商業績排行:橫條 + 帕雷托雙視圖(matplotlib 暖色系)
- P4-P5 廠商明細表 TOP 30:含 △ 排名變化、🆕 新進榜、業績佔比 bar、
  毛利率紅綠燈(綠 ≥15% / 黃 8~15% / 紅 <8%)
- P6 AI 採購策略洞察(結構化 8 段)
- P7 附錄

query_vendor_summary(routes/openclaw_bot_routes.py)
- 期間(單月/自訂日期區間)廠商業績聚合
- 計算 sales / profit / margin / qty / orders
- 同步抓上期同等期間做 vs 上期 △ 比對

_ppt_ai_analysis 加 is_vendor 分支
- 角色:採購主管 + 供應鏈管理顧問
- 結構:整體解讀 / 集中度與供應風險 / 議價優先 / SMART 行動 / 風險預警
- SMART 行動分三層:立即執行 / 中期強化 / 長期結構(含 OEM/ODM 自有品牌)
- 引用 MARKET_TREND_2026 共用知識基底
- max_tokens 1800,字數 800-1000

路由綁定 _generate_ppt_cmd
- /ppt vendor          當月廠商報告
- /ppt vendor 2026/04  指定月份
- /ppt vendor 2026/04/01-2026/04/15  自訂期間
- 自動抓上期同等期間做 △ 比對

Telegram 按鈕(menu_keyboards.py 的 _submenu_reports)
- 新增「🏭 廠商業績報告」進報表選單

bump TEMPLATE_VERSIONS['vendor'] v2.0 (DEPRECATED) → v3.1.0

煙霧測試:本機 venv 跑 vendor PPT 生成 8 頁 200KB 全綠。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 02:04:41 +08:00
OoO
993bdda1fd feat(ppt-ai): inject shared 2026 Taiwan e-commerce market knowledge to all 6 prompts
All checks were successful
CD Pipeline / deploy (push) Successful in 2m25s
完成 project memory 待補事項:抽取共用市場趨勢常數 + 補齊未升級的 prompt。

新增 MARKET_TREND_2026 共用常數(routes/openclaw_bot_routes.py):
- 6 大關鍵檔期 + 拉動幅度(母親節 +30~50% 美妝 / 618 全品類 +30~50% / 雙11 +50~80%)
- 6 條 2026 熱門賽道(永續美妝/母嬰高端/機能性食品/IP 聯名/男性保養/寵物經濟)
- 4 大平台競爭定位(蝦皮/PChome/酷澎/momo)

Inject 到 5 條 prompt(monthly/strategy/promo/competitor/else):
- 月報、策略、促銷:原 prompt + MARKET_TREND_2026 知識基底
- 競品比較:補上 2026 熱門賽道做美妝/保健/母嬰專項分析的事實基礎
- daily/weekly(else 分支):完整重寫從 250 字 → 350-450 字 SMART 框架
  + 含市場機會與風險段(檔期卡位 + 競品風險)

bump 版本(所有 6 種 v3.x):
- daily   v3.0.2 → v3.1.0
- weekly  v3.0.2 → v3.1.0
- monthly v3.1.3 → v3.1.4
- strategy v3.0   → v3.1.0
- competitor v3.0 → v3.1.0
- promo   v3.0   → v3.1.0

效果:6 種報表 AI 分析現在都有共同的市場事實基底,跨報表敘事一致;
單一資料來源避免「不同報表給的市場數字打架」問題。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 01:42:43 +08:00
OoO
92b80352cb feat(ppt-ai): upgrade prompts to professional sales/marketing depth + 2026 market trends
All checks were successful
CD Pipeline / deploy (push) Successful in 2m33s
需求:簡報 AI 分析必須詳盡且專業,能直接幫助銷售/行銷策略制定,
反映 2026 年台灣電商當下市場方向與趨勢。

升級三份 prompt(monthly / strategy / promo):

【共通強化】
- 角色從單純「分析師」升級為三合一:
  策略顧問(BCG/麥肯錫經驗)+ 行銷主管(廣告 ROI、檔期)+ 採購(選品邏輯)
- 明確指明客戶與用途:「BU 主管會用本報告做下週的庫存與行銷預算決策」
- 全部加「市場趨勢脈絡」段,必須觸及:
  (a) 當期關鍵檔期(母親節/520/618/雙11/雙12)對品類的歷史拉抬幅度
  (b) 2026 熱門賽道:永續美妝、母嬰高端化、IP 聯名、敏弱肌、銀髮保健、
     男性保養、寵物經濟、機能性食品
  (c) 平台競爭:vs 蝦皮/PChome/酷澎 的免運門檻、直播帶貨、會員訂閱
- 行動建議升級為 SMART 框架(Specific / Measurable / Achievable /
  Relevant / Time-bound),每條必須含商品名 + 量化目標 + 期限
- 禁用「可能/也許/建議考慮」等模糊用詞,要明確「必須做X、目標Y、期限Z」

【月報 monthly】
- 段落結構從 5 段擴為 7 段:整體解讀 / 市場趨勢 / 品類結構 / 熱銷洞察 /
  MCP 整合 / SMART 行動建議 / 競爭定位與風險
- 行動建議從 6 條(每段2條)擴為 9 條(每段3條),含本週/本月/下月分層
- 字數 500-700 → 900-1200,max_tokens 1600 → 2400

【策略 strategy】
- 加市場趨勢脈絡段、SMART 框架行動建議
- 字數 400 → 600-800,max_tokens 900 → 1400

【促銷 promo】
- 市場信號解讀段升級為三段式(檔期對位 / 品類熱度 / 價格敏感度)
- 結合 2026 台灣電商熱搜賽道

效果:報告從「描述業績」升級為「告訴 BU 主管下週要做什麼、目標多少、何時完成」。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:08:36 +08:00
OoO
1c81866541 fix(ppt): final critic cleanup — Medium-1 OOXML order + Info-1/2 docs
All checks were successful
CD Pipeline / deploy (push) Successful in 2m29s
清掉剩餘 critic finding(Medium-1 + Info-1 + Info-2):

Medium-1: _set_run_fonts 違反 OOXML CT_TextCharacterProperties 子元素順序
- 抽出 _insert_rpr_child(rPr, tag) helper:依 ECMA-376 §21.1.2.3 規定
  的順序表(_RPR_CHILD_ORDER)找正確位置插入
- 找第一個排在 target 之後的子元素 → insert 前面;否則 append
- 當前 from-scratch 場景安全;未來改讀模板 .pptx 時也不會踩雷
- 驗證:產生 monthly v3.1,399 個 rPr 全部符合 schema 順序,0 違反

Info-1: cleanup_expired_ppt_cache docstring 補語意說明
- 明確說明 dry_run=True/False 時 deleted_files / deleted_rows / freed_bytes
  欄位語意分別為「將刪除」預估值 vs「已實刪」實際值

Info-2: TEMPLATE_VERSIONS 標記退役 type
- growth / vendor / bcg 三個 type 從未實際落地(依 ADR-014 校正 2026-04-28)
- 加 DEPRECATED 註解,避免後人誤以為已支援

Info-3 SKIP(評估後不做):
- get_template_version import 改放模組頂部會 trigger ppt_generator 模組級
  REPORTS_DIR.mkdir() 副作用,read-only filesystem 環境會掛
- 保留延遲 import 是 graceful degradation 的 intentional 設計

至此 critic 38967ce 審查清單全綠:
- 0 critical, 2 HIGH (3b0b4b3), 4 medium (52c06f6 + 本 commit), 3 info

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:39:27 +08:00
OoO
52c06f6861 fix(ppt): admin guard for destructive /cache commands (critic Medium-3)
All checks were successful
CD Pipeline / deploy (push) Successful in 2m14s
Critic Medium-3:群組內任意成員可執行破壞性快取指令的問題。

新增機制:
- ADMIN_USER_IDS:新增 OPENCLAW_ADMIN_USER_IDS 環境變數
  逗號分隔的 user_id;未設時退回 ALLOWED_USERS(向後兼容)
- _is_admin(user_id):fail-closed 判定函式
- _CURRENT_USER_ID_CTX:ContextVar 在 webhook 入口(msg + callback)
  set 當前 user_id,避免改 handle_cmd 30+ 處呼叫端簽名

權限模型:
| 指令                              | 權限    | 行為                |
| /cache status                     | 已授權  | 任何已授權用戶可看  |
| /cache cleanup [days]             | 已授權  | 預設乾跑可預覽      |
| /cache flush <type>               | admin   | 拒絕非 admin        |
| /cache cleanup [days] confirm     | admin   | 拒絕非 admin        |
| /cache cleanup [days<1] confirm   | -       | 強制乾跑(防呆)    |

非 admin 嘗試破壞性指令時,回傳清楚錯誤訊息引導設定環境變數。
admin 操作會額外寫 sys_log.warning 留軌跡(含 user_id)。

煙霧測試:
- syntax OK
- _is_admin(None) / _is_admin("abc") / _is_admin(unknown_id) 皆 False
- ContextVar set/get 行為正確

剩餘 Medium 1/2 + Info 類後續再處理(非緊急)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:35:48 +08:00
OoO
3b0b4b3d42 fix(ppt): address critic findings on commit 38967ce (HIGH-1, HIGH-2, Medium-4)
All checks were successful
CD Pipeline / deploy (push) Successful in 2m27s
Critic 審查 38967ce 找出 2 HIGH + 4 medium,本 commit 修最緊急三項:

HIGH-2: cleanup_expired_ppt_cache 預設 dry_run=False 危險
- 函式 default 改 dry_run=True(呼叫方需明確傳 False 才實刪)
- launchd 排程腳本改用 DRY_RUN 環境變數,預設 false→實刪,
  但測試時可 DRY_RUN=true 安全跑
- /cache cleanup Telegram 指令預設乾跑,需加 confirm 才實刪
- /cache cleanup days<1 強制乾跑(防呆)

HIGH-1: matplotlib 三個 helper 缺 try/finally → 渲染失敗洩漏 figure
- _mpl_horiz_bar_png / _mpl_line_chart_png / _mpl_pareto_chart_png
  全部用 try/except/finally 包住,例外時 plt.close() 仍執行
- 同時讓渲染失敗回 None(呼叫端自然 fallback 到原生 chart)

Medium-4: scripts/ppt_cleanup.sh PROJECT_DIR 寫死
- 改用相對路徑解析(cd $SCRIPT_DIR/..),手動執行不再需要設環境變數
- VENV_PY 找不到時 fallback 到系統 python3(容器友善)
- 新增 DRY_RUN 環境變數開關(預設 false)

煙霧測試:
- syntax OK (services/ppt_generator.py + routes/openclaw_bot_routes.py)
- monthly v3.1 重生 10 頁 290KB
- cleanup_expired_ppt_cache dry_run default = True ✓

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:23:02 +08:00
OoO
38967ceea3 feat(ppt): redesign all 6 reports to professional standard + cache versioning
All checks were successful
CD Pipeline / deploy (push) Successful in 13m18s
PPT 模板全面升版至市場專業標準(McKinsey / BCG 月報級別):

Monthly v3.1(10 頁)
- 暖紙感封面(去黑底)+ elevator pitch(亮點/警訊/動能徽章)
- KPI 卡含 △% vs 上月 + 紅綠燈、YoY 同期對比帶
- matplotlib 業績趨勢折線(本月+上月+日均線+高低點)
- 品類分析雙視圖:橫條 + 帕雷托累計(80% 主力線)
- TOP 50 商品(自動分頁)+ vs 上月 △ 排名變化 / 🆕 新進榜
- MCP 情報 4 卡片結構化、AI 行動結構化分區、附錄頁

Daily / Weekly / Strategy / Promo / Competitor v3.0
- 統一暖紙封面、AI 頁去黑底改暖紙 + 焦糖橘色條
- 日週改 matplotlib 折線(含日均線、高低點)
- 全部加附錄頁(資料來源 / 計算口徑 / 模板版本)

Cache 版本控制
- TEMPLATE_VERSIONS 字典自動注入 cache key (tpl_ver)
- 模板升版舊快取自動 miss → 重生
- 新增 _invalidate_ppt_cache() 與 cleanup_expired_ppt_cache() helper
- 新增 /cache status / flush / cleanup Telegram 指令

字型系統
- _set_run_fonts() 用 lxml 直寫 a:latin/a:ea,中英分軌
- 中文走 Microsoft JhengHei,數字/英文走 Consolas(點陣等寬)
- Dockerfile 加 fonts-noto-cjk + fonts-noto-cjk-extra

部署排程
- scripts/install_ppt_cleanup.sh 一鍵安裝 launchd(每日 03:15)
- scripts/ppt_cleanup.sh 清 7 天前過期 PPT 檔 + DB row

資料層
- routes monthly: query_monthly_summary LIMIT 10 → 50,補 orders 欄位
- routes monthly: 拉 prev_month / prev_year 比較資料供 KPI △ 與商品 △ 計算

煙霧測試 6/6 全綠:
- 日報 v3.0 (5 頁) / 週報 v3.0 (6 頁) / 月報 v3.1 (10 頁)
- 策略 v3.0 (6 頁) / 促銷 v3.0 (6 頁) / 競品 v3.0 (5 頁)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 16:26:27 +08:00
OoO
3f40089d8c fix(openclaw): show full main menu for wakeup phrases
All checks were successful
CD Pipeline / deploy (push) Successful in 2m44s
2026-05-02 16:12:30 +08:00
OoO
7b6423fa67 fix(openclaw): route wakeup phrases back to menu
All checks were successful
CD Pipeline / deploy (push) Successful in 2m55s
2026-05-02 16:03:49 +08:00
OoO
673982d83b Fix OpenClaw callback command path from NL dispatch regression
All checks were successful
CD Pipeline / deploy (push) Successful in 4m17s
2026-05-02 15:59:54 +08:00
OoO
ccc0cef9be feat(ppt): upgrade monthly AI prompt to 7-section expert template with MCP RAG integration, enrich data_summary with category/product breakdown
All checks were successful
CD Pipeline / deploy (push) Successful in 2m47s
2026-05-02 15:06:16 +08:00
OoO
9068d463bb feat(ea): execute Phase 3 C-series architecture fixes to prevent recurrence
All checks were successful
CD Pipeline / deploy (push) Successful in 2m37s
- C1: Removed weekly_strategy and meta_analysis from Elephant Alpha's SAFE_ACTIONS (orchestrator prompt and engine _ACTION_ZH) to prevent autonomous generation of scheduled reports
- C2: Removed hardcoded 0.85 confidence example from orchestrator prompt and implemented bounding validation (0.0~1.0) in _parse_strategic_decision
- C3: Expanded ADR-019 data freshness gate (_ppt_check_data_freshness) to cover /ppt weekly and /ppt strategy routes, proactively warning users of stale data
2026-05-02 14:39:10 +08:00
OoO
84786be06f refactor(telegram): migrate cicd_routes sender to EventRouter (ADR-019 Phase 5)
routes/cicd_routes.py 的 send_telegram_message() 用於 CI/CD pipeline 失敗 / Drone
build 異常等告警。原本直接 POST sendMessage,改走 services.event_router.
dispatch_sync()(event_type=cicd_pipeline_alert, severity=alert)。

行為變化:
- parse_mode 從 Markdown 改 HTML(EventRouter 統一);既有訊息中的 *bold* 等
  Markdown 控制字元會以純文字顯示,可讀性不受顯著影響
- 失敗保留 print + return False 同舊行為,不阻斷 caller(send_pipeline_failure_alert
  等)的 try/except 結構

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:09:34 +08:00
OoO
ea78d0814b refactor(telegram): migrate alert_routes sender to EventRouter (ADR-019 Phase 5)
routes/alert_routes.py 的 send_telegram_message() 是 Alertmanager webhook 通用告警
出口,原本直接 POST sendMessage 並對每個 chat_id 迴圈。改走 services.event_router.
dispatch_sync() 統一入口(event_type=alertmanager_webhook, severity=alert)。

行為變化:
- 移除手動 chat_id 迴圈,改傳 admin_chat_ids 給 EventRouter(內部仍逐一發)
- 新增 ADR-012 三層分流(L0/L1/L2)+ JSONL queue replay 失敗重送
- parse_mode 參數保留簽名向後相容,但實際統一走 EventRouter HTML 模板
- caller(Alertmanager webhook handler)的 try/except 結構未動

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:09:34 +08:00
OoO
e12e6a8f96 feat(telegram): ADR-019 Phase 6 - daily data freshness probe + cron 09:05
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
ADR-019 Phase 6:每日 09:05 OpenClawBot scheduler 主動巡檢 realtime_sales_monthly
最新資料日期,落後超過閾值時透過 EventRouter 發 Telegram 警告。

新增 services/data_freshness_probe.py:
- gap == 0:靜默不發(資料齊全)
- gap == 1:info(昨日資料齊,正常)
- gap == 2~3:warning
- gap >= 4:alert(P2,ETL 大概率出問題)
- latest_date 取不到:alert(DB 連線異常)

routes/openclaw_bot_routes.py 加 cron job openclaw_data_freshness_probe
(hour=9 minute=5,避開 09:00 的其他既有 job)。

從『用戶月初按按鈕踩坑才發現資料缺口』的被動模式,轉成 agent 主動巡檢通知。
配合 Phase 1(PPT freshness gate)+ Phase 2(agent tool)+ Phase 3(cmd 路徑
agent dispatch)+ Phase 4(對話 state),Telegram Bot 互動層的『rigid default
+ 靜默空白』反模式根除。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:07:30 +08:00
OoO
14195b65fd feat(telegram): ADR-019 Phase 4 - conversation memory + chat_id propagation
All checks were successful
CD Pipeline / deploy (push) Successful in 2m51s
ADR-019 Phase 4:新增 services/openclaw_session.py 管理 chat_id 級別的多輪
對話歷史與 carry-over slot。In-memory,30 分鐘 TTL,重啟清空(臨時對話 state
不該污染 ai_insights 永久記憶)。

openclaw_answer 簽章加 chat_id=None 可選參數:
- 傳入時 agent 會看到該 chat 最近 5 輪對話歷史,注入 system prompt
- Ollama / Gemini FC 兩條路徑都會在生成成功後 append_turn 寫回 session
- system prompt 加決策規則:「若歷史顯示用戶剛被問參數,優先用該答案接續執行」

Caller 全部更新傳 chat_id:
- routes/openclaw_bot_routes.py:5479 (handle_cmd 不認識指令 fallback)
- routes/openclaw_bot_routes.py:5916 (webhook NL 路徑)
- routes/openclaw_bot_routes.py:_agent_dispatch_cmd (Phase 3 hook)
- services/telegram_bot_service.py:934 (polling NL fallback)

向下相容:chat_id=None 時行為與舊版完全相同(無 multi-turn 記憶)。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:04:18 +08:00
OoO
38f4033eb0 feat(telegram): ADR-019 Phase 3 - feature-flagged agent dispatch for cmd:X
All checks were successful
CD Pipeline / deploy (push) Successful in 2m47s
ADR-019 Phase 3:在 handle_cmd 入口插入 agent dispatch hook,將白名單 cmd 翻成
NL question 交 OpenClaw agent 處理。Agent 自動透過 Phase 2 的 check_data_freshness
tool probe 資料缺口,缺資料時主動詢問用戶,避免靜默產出空白結果。

新增:
- 環境變數 OPENCLAW_AGENT_DISPATCH (預設 0)、OPENCLAW_AGENT_DISPATCH_CMDS (逗號分隔)
- _CMD_TO_NL 翻譯字典:sales / top / vendor 三 cmd 起步
- _agent_dispatch_cmd() helper:feature flag + 白名單 + agent 呼叫 + 失敗 fallback

設計考量:
- 預設 OFF,零 prod regression 風險
- Agent 失敗自動回原 handler,不卡用戶
- 灰度路徑:先在 staging 開 OPENCLAW_AGENT_DISPATCH=1 + CMDS=sales 觀察一週
- 21 cmd 不需要全部翻譯,只翻譯有「資料缺口可能性」或「參數需確認」的

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:00:02 +08:00
OoO
b3348ae77d feat(telegram): ADR-019 Phase 2 - check_data_freshness tool for OpenClaw
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
ADR-019 Phase 2:把資料新鮮度查詢註冊為 OpenClaw 的第 4 個 Function Calling
tool。Agent 在回答任何特定時段業績問題前可主動 probe,避免月初/季初時編造
「業績為零」這類因 ETL 尚未匯入造成的虛假結論。

新增:
- _FC_TOOLS 加入 check_data_freshness 宣告
- _execute_tool 對應分支:回傳 latest_data_date / available_months /
  current_month_has_data / data_freshness_warning
- 系統 prompt 更新:明示 4 個工具與「相對時間詞先 probe」決策規則

與 Phase 1 互補:Phase 1 是 PPT cmd 路徑寫死的補丁,Phase 2 讓 NL 對話路徑
透過 agent 自己決策,是 ADR-019「Agent-First」原則的真正起點。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 12:58:06 +08:00
OoO
db02ecf2cf feat(telegram): ADR-019 Phase 1 - PPT data freshness gate + store_insight fix
All checks were successful
CD Pipeline / deploy (push) Successful in 2m55s
ADR-019 Phase 1 (止血):PPT 生成前 probe 資料新鮮度。月初/缺資料期間用戶按
ppt:monthly/daily 不再產出空白報告,改主動 inline keyboard 詢問:
  - 改看最新有資料的月份/日期(一鍵)
  - 自訂月份/日期(接 await:date_ppt_*)
  - 取消

新增 PPTDataInsufficientError exception + _ppt_check_data_freshness() helper。
_generate_ppt_cmd 簽章加 _reply_to=None;_ppt_background 靜默吞此例外。

順手修同檔 :1976/:1993 兩處 store_insight() positional args 錯位 bug —
原本 (date, report_type, ai_text) 對應 signature (insight_type, content, period)
完全錯位,導致 period varchar(50) 被 2000 字 AI 內容截斷、INSERT 失敗、
ai_insights 表寫入永久失敗。改成 kwargs 呼叫。

ADR-019 (Telegram Bot Agentic Conversation Layer) 同步落地,Status: Accepted。
六 Phase 路線圖見 ADR 文件,本 commit 完成 Phase 1。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 12:52:45 +08:00
OoO
1a886d962b fix(telegram): dedupe webhook+polling updates via shared DB guard
All checks were successful
CD Pipeline / deploy (push) Successful in 8m50s
Webhook (Flask) and polling (momo-telegram-bot) consumed the same
Telegram update_id, causing /menu callbacks to fire twice. Add a
shared dedup module backed by telegram_update_dedup table (300s TTL,
60s cleanup) with in-memory fallback, wired into both paths.

Polling launcher now skips startup when webhook is configured to
prevent dual-consumption at the source.

38 tests across webhook, menu keyboards, telegram_api, dedup guard,
and trend bot service.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 12:01:04 +08:00
OoO
75de76ac12 fix(momo): block EC404 auto-open with end-to-end URL guard
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
- normalize URLs at write time (scheduler crawlers, routes) to drop
  javascript:/EC404/placeholder i_code (momo_/manual_/pchome_)
- add global click+auxclick guard in base.html and ewoooc_base.html
  that intercepts blocked MOMO URLs and redirects to safe i_code URL
- per-page dashboards reuse the same isLikelyMomoIcode validation
- /api/track_momo_link records blocked events for diagnosis
- ship sanitize_momo_urls.py to clean existing polluted DB rows

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 12:00:34 +08:00
OoO
026d0e7539 feat(reports): move monthly analysis to v2 shell
All checks were successful
CD Pipeline / deploy (push) Successful in 2m14s
2026-05-01 21:13:18 +08:00
OoO
4e853a233f perf(dashboard): speed up competitor overview
All checks were successful
CD Pipeline / deploy (push) Successful in 2m12s
2026-05-01 20:36:25 +08:00
OoO
066cf1846f feat(dashboard): show AI pick evidence gaps
All checks were successful
CD Pipeline / deploy (push) Successful in 2m18s
2026-05-01 17:17:03 +08:00
OoO
e86075d59d fix(dashboard): avoid redundant prewarm rebuilds
All checks were successful
CD Pipeline / deploy (push) Successful in 2m15s
2026-05-01 16:36:58 +08:00
OoO
2ac7410d40 fix(dashboard): prewarm cache and expose pick evidence
All checks were successful
CD Pipeline / deploy (push) Successful in 2m20s
2026-05-01 16:34:13 +08:00
OoO
b3d00a011c fix(dashboard): warm cache after AI pick refresh
All checks were successful
CD Pipeline / deploy (push) Successful in 3m37s
2026-05-01 16:16:39 +08:00
OoO
b447aefcfb fix(ai): clear dashboard cache after pick regeneration
All checks were successful
CD Pipeline / deploy (push) Successful in 2m27s
2026-05-01 16:10:51 +08:00
OoO
3920701e1a feat(dashboard): optimize cache and AI pick confidence
All checks were successful
CD Pipeline / deploy (push) Successful in 2m46s
2026-05-01 16:01:52 +08:00
OoO
0334051aa7 feat(dashboard): 匯出 AI 挑品操作清單
All checks were successful
CD Pipeline / deploy (push) Successful in 2m39s
2026-05-01 15:43:57 +08:00
OoO
1d1a7f6e94 feat(dashboard): 強化 AI 挑品清單決策資訊
All checks were successful
CD Pipeline / deploy (push) Successful in 2m22s
2026-05-01 15:22:21 +08:00
OoO
a5de082437 feat(dashboard): 顯示 50 品 AI 挑品清單
All checks were successful
CD Pipeline / deploy (push) Successful in 3m12s
2026-05-01 15:08:41 +08:00
OoO
77b085f813 fix(dashboard): 快取比價決策總覽
All checks were successful
CD Pipeline / deploy (push) Successful in 2m28s
2026-05-01 14:32:51 +08:00
OoO
ea15aa6437 refactor(vendor): 抽出廠商管理查詢服務
Some checks failed
CD Pipeline / deploy (push) Failing after 8m57s
2026-05-01 14:20:09 +08:00
OoO
1012d609d4 feat(dashboard): 顯示 PChome 比價決策總覽
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-05-01 14:19:18 +08:00
OoO
fbc85fcedc refactor(vendor): 抽出缺貨 API 查詢服務
All checks were successful
CD Pipeline / deploy (push) Successful in 2m11s
2026-05-01 14:12:56 +08:00
OoO
62f8f1d52d refactor(vendor): 抽出缺貨 V2 查詢服務
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-05-01 14:07:10 +08:00
OoO
8a3d50933b feat(ai): 自動補抓並重算 PChome 挑品
All checks were successful
CD Pipeline / deploy (push) Successful in 2m18s
2026-05-01 14:02:37 +08:00
OoO
043a7dc915 feat(ai): 補抓 PChome 待比對商品
All checks were successful
CD Pipeline / deploy (push) Successful in 2m20s
2026-05-01 13:40:37 +08:00