OoO
1c81866541
fix(ppt): final critic cleanup — Medium-1 OOXML order + Info-1/2 docs
...
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
3b0b4b3d42
fix(ppt): address critic findings on commit 38967ce (HIGH-1, HIGH-2, Medium-4)
...
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
...
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
673982d83b
Fix OpenClaw callback command path from NL dispatch regression
CD Pipeline / deploy (push) Successful in 4m17s
2026-05-02 15:59:54 +08:00
OoO
76304602b1
fix(ppt): footer→bottom, font spec (Courier New/Microsoft JhengHei), 50-item paginated table, remove old single-page remnant
CD Pipeline / deploy (push) Successful in 2m41s
2026-05-02 15:32:54 +08:00
OoO
0b82350745
style(ppt): comprehensive warm-tone redesign - caramel KPI cards, warm paper MCP/AI pages, revenue ratio bars in product table, chart→caramel orange, cover with warm decorative bands
2026-05-02 15:20:02 +08:00
OoO
4c6e4ca5fb
style(ppt): align PPT palette perfectly with MOMO Pro v2 design tokens (Beige, Warm Ink, Caramel Orange) as per frontend upgrade roadmap
2026-05-02 15:01:55 +08:00
OoO
934adc957c
style(ppt): redesign ppt layouts, align palette with frontend, and add dedicated MCP RAG slide
2026-05-02 14:59:45 +08:00
OoO
9068d463bb
feat(ea): execute Phase 3 C-series architecture fixes to prevent recurrence
...
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
9158bbe1a6
fix(ea): execute Phase 2 B-series data quality and gate improvements
...
CD Pipeline / deploy (push) Successful in 2m40s
- B1 & B2: Updated SQL column names from 銷售金額 to 總業績 in openclaw_strategist_service.py and chart_generator_service.py
- B3: Removed bare except statements in DB fetchers to raise errors instead of failing silently
- B4: Implemented freshness gate (MAX(snapshot_date) < CURRENT_DATE - 2) in daily_sales_snapshot to prevent generating stale reports and send data stalled alerts
- B5: Replaced hardcoded 45.0 system load percentage with actual psutil CPU metric
2026-05-02 14:34:30 +08:00
OoO
e6df2fad28
fix(ea): remove weekly_strategy/meta_analysis from autonomous engine triggers (Phase 1 stopgap)
...
CD Pipeline / deploy (push) Successful in 2m39s
Critic-approved 3-point revision (REVISE → adopted):
1. Disable weekly_insight trigger at definition (line 279-285) — EA no
longer evaluates the 6h / >=5 ai_insights condition that fired
_generate_strategy_report without force_tg_alert=True.
2. Remove the openclaw weekly/meta dispatch table branches (line 591-606).
The 5 actions (generate_strategic_analysis, generate_weekly_strategy,
generate_market_analysis, generate_pricing_strategy,
generate_meta_analysis) now fall through to the existing
`raise ValueError(f"Unrecognized step: ...")` at line 631, which
_execute_decision's try/except converts into a circuit-breaker failure.
This is the correct failure semantics critic asked for.
3. Convert _generate_strategy_report / _generate_meta_report into hard
RuntimeError raisers and drop their imports of
openclaw_strategist_service. Deep insurance: any future caller crashes
immediately instead of silently bypassing dedupe.
Evidence: ai_insights logged 35+ duplicate weekly_strategy sends in 7 days
because EA's `_generate_strategy_report` invoked
generate_weekly_strategy_report() without force_tg_alert=True, bypassing
the run_scheduler.py weekly dedupe gate.
Out of scope (per task contract):
- run_scheduler.py:115 Monday 06:00 schedule — preserved (sole owner)
- services/openclaw_strategist_service.py — owned by B-series (SQL)
- Other EA triggers (price_drop_alert / market_opportunity /
threat_escalation / code_exception / resource_optimization) — preserved
- Other dispatch branches (hermes / nemotron / auto_heal / code_fix /
price_adjustment review) — preserved
- Did NOT add force_tg_alert=True defensive layer (critic flagged as
anti-pattern)
- Did NOT touch _TRIGGER_TO_DECISION_TYPE / _ALLOWED_ACTION_TYPES
Not pushed, not deployed. D1 deployment will be issued separately and
must use `docker compose up -d --no-deps --force-recreate momo-scheduler`
(per feedback_compose_restart_vs_up).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-02 13:12:14 +08:00
OoO
477aab3f6f
refactor(telegram): migrate edm_notifier text path to EventRouter (ADR-019 Phase 5)
...
CD Pipeline / deploy (push) Has been cancelled
services/edm_notifier.py 的 _send_telegram() 處理 EDM 媒體告警,原本 if/else
分流 sendPhoto / sendMessage。
行為變化:
- 純文字分支(無 image_path):改走 services.event_router.dispatch_sync()
event_type=edm_media_alert, severity=warning
- 含圖片分支(sendPhoto with multipart file upload):依 ADR-019 任務指示
保留直連 Telegram API(EventRouter 不支援 file upload,列為 known skip)
- caller 行為不變,失敗仍 logger.error 不阻斷主線
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-02 13:09:34 +08:00
OoO
3e9d53c98c
refactor(telegram): migrate aider_heal_executor sender to EventRouter (ADR-019 Phase 5)
...
services/aider_heal_executor.py 的 _notify_telegram() 為 ADR-013 AutoHeal 閉環
通知出口(aider 自動修復進度)。原直接 POST sendMessage,timeout=5s(非阻塞)。
改走 services.event_router.dispatch_sync()。
行為變化:
- 失敗仍靜默 pass,caller(execute_code_fix 等)行為完全不變
- severity=warning 會被 EventRouter classify 為 L0 或 L1(無 trace 時 L0),
輕量分流不會拖慢自動修復流程
- 享 EventRouter 內建 retry + JSONL queue replay;舊版 timeout=5 失敗即丟訊息
的問題改善(可從 queue 重送)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-02 13:09:34 +08:00
OoO
edfe38e87d
refactor(telegram): migrate nemoton_dispatcher sender to EventRouter (ADR-019 Phase 5)
...
NemoTron Dispatcher 的 _send_telegram() 原本直接 POST Telegram Bot API(含 MarkdownV2
跳脫)+ 透過 self.nm 走 NotificationManager 兩條路。改為統一走 services.event_router.
dispatch_sync(),享 EventRouter 的 retry + 失敗 JSONL queue replay + AI 三層分流。
行為變化:
- 從 _exec_trigger_price_alert / _exec_add_to_recommendation / _exec_flag_for_human_review
三個工具實作流入 EventRouter,event_type=nemoton_dispatch_alert,severity=alert
- 移除 self.nm._send_telegram_messages() 的 short-circuit;改由 EventRouter 內建
通道處理 chat_ids/token 解析
- 失敗時保留 logger.error + log fallback,不阻斷主線(同舊行為)
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
...
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
...
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
1a886d962b
fix(telegram): dedupe webhook+polling updates via shared DB guard
...
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
...
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
7d46ff9ba5
feat(competitor): persist match attempts
CD Pipeline / deploy (push) Successful in 2m9s
2026-05-01 20:56:17 +08:00
OoO
2ac7410d40
fix(dashboard): prewarm cache and expose pick evidence
CD Pipeline / deploy (push) Successful in 2m20s
2026-05-01 16:34:13 +08:00
OoO
9e2337764b
fix(ai): supersede old product picks
CD Pipeline / deploy (push) Successful in 2m48s
2026-05-01 16:24:15 +08:00
OoO
3920701e1a
feat(dashboard): optimize cache and AI pick confidence
CD Pipeline / deploy (push) Successful in 2m46s
2026-05-01 16:01:52 +08:00
OoO
a5de082437
feat(dashboard): 顯示 50 品 AI 挑品清單
CD Pipeline / deploy (push) Successful in 3m12s
2026-05-01 15:08:41 +08:00
OoO
ea15aa6437
refactor(vendor): 抽出廠商管理查詢服務
CD Pipeline / deploy (push) Failing after 8m57s
2026-05-01 14:20:09 +08:00
OoO
fbc85fcedc
refactor(vendor): 抽出缺貨 API 查詢服務
CD Pipeline / deploy (push) Successful in 2m11s
2026-05-01 14:12:56 +08:00
OoO
b5de8d5d61
fix(ai): 價格調整轉人工覆核
CD Pipeline / deploy (push) Successful in 2m16s
2026-05-01 14:09:54 +08:00
OoO
62f8f1d52d
refactor(vendor): 抽出缺貨 V2 查詢服務
CD Pipeline / deploy (push) Has been cancelled
2026-05-01 14:07:10 +08:00
OoO
8a3d50933b
feat(ai): 自動補抓並重算 PChome 挑品
CD Pipeline / deploy (push) Successful in 2m18s
2026-05-01 14:02:37 +08:00
OoO
043a7dc915
feat(ai): 補抓 PChome 待比對商品
CD Pipeline / deploy (push) Successful in 2m20s
2026-05-01 13:40:37 +08:00
OoO
9f9e0727e7
fix(ai): 自動偵測挑品銷售欄位
CD Pipeline / deploy (push) Successful in 1m50s
2026-05-01 10:18:07 +08:00
OoO
70de91f1f6
fix(ai): 修正挑品清單銷售日期查詢
CD Pipeline / deploy (push) Successful in 2m14s
2026-05-01 10:12:32 +08:00
OoO
20f6b2ded2
fix(feeder): 控制 PChome 多關鍵字搜尋成本
CD Pipeline / deploy (push) Successful in 2m16s
2026-05-01 10:08:24 +08:00
OoO
82d759d3b1
feat(ai): 建立 PChome 銷售挑品清單
CD Pipeline / deploy (push) Successful in 2m24s
2026-05-01 10:05:16 +08:00
OoO
55855ef508
feat(frontend): 保存 PChome 競品價格歷史
CD Pipeline / deploy (push) Successful in 1m39s
2026-05-01 00:53:37 +08:00
OoO
dd35306399
refactor(openclaw): 抽出選單鍵盤 builders
CD Pipeline / deploy (push) Successful in 1m46s
2026-04-30 23:17:19 +08:00
OoO
d88dcc8f75
fix(devops): 清理舊端口與危險 compose 操作
CD Pipeline / deploy (push) Successful in 1m45s
2026-04-30 14:24:53 +08:00
OoO
fb9c4ad1b5
refactor(openclaw): 抽出 Telegram API helper
CD Pipeline / deploy (push) Has been cancelled
2026-04-30 14:24:45 +08:00
OoO
89e7f2ccd2
fix(ai): 擴大 ElephantAlpha 暫時性 fallback
CD Pipeline / deploy (push) Successful in 1m46s
2026-04-30 13:59:12 +08:00
OoO
72fa166729
fix(ai): 遷移 Ollama embedding 至 api embed
CD Pipeline / deploy (push) Successful in 1m46s
2026-04-30 10:24:15 +08:00
OoO
91ad98e621
feat(ai): 強化 ElephantAlpha NIM fallback
CD Pipeline / deploy (push) Successful in 1m48s
2026-04-30 09:33:39 +08:00
OoO
d5f4fd7198
加入 AI Smoke 每日摘要推播
CD Pipeline / deploy (push) Successful in 1m15s
2026-04-29 23:57:36 +08:00
OoO
10bbd55f5b
補齊 AI Smoke 趨勢管理
CD Pipeline / deploy (push) Successful in 1m13s
2026-04-29 23:54:23 +08:00
OoO
81159b5b3d
保存 AI Smoke 趨勢紀錄
CD Pipeline / deploy (push) Successful in 1m14s
2026-04-29 23:50:44 +08:00
OoO
cde8b0cd3e
新增 AI 自動化 Smoke Dashboard
CD Pipeline / deploy (push) Successful in 1m16s
2026-04-29 23:46:48 +08:00
OoO
e6a1c9d09f
補齊 AI 自動化可觀測性指標
CD Pipeline / deploy (push) Successful in 1m15s
2026-04-29 23:41:03 +08:00
OoO
162a76b8f9
落地 L2 安全記憶動作
CD Pipeline / deploy (push) Successful in 1m9s
2026-04-29 23:29:45 +08:00
OoO
5b25f55340
補齊 EventRouter 失敗通知回放
CD Pipeline / deploy (push) Successful in 1m10s
2026-04-29 23:26:02 +08:00
OoO
d4865983d8
補強 ElephantAlpha 執行與通知閉環
CD Pipeline / deploy (push) Successful in 1m10s
2026-04-29 23:14:09 +08:00
OoO
78eebfbcfc
加入告警去重與洞察向量回補
CD Pipeline / deploy (push) Successful in 1m19s
2026-04-29 23:10:27 +08:00
OoO
0c2e9bbced
串接 AI 洞察向量化與漏通知入口
CD Pipeline / deploy (push) Successful in 1m13s
2026-04-29 23:05:46 +08:00