Commit Graph

83 Commits

Author SHA1 Message Date
OoO
abd722986e fix(autoheal): preflight + shell || true 結合性 — 解 24h 100% no-op
All checks were successful
CD Pipeline / deploy (push) Successful in 2m23s
Debugger 五階段方法論 root cause(2026-05-03):
ADR-020 政策層 100% 達成(reasoning 全 auto_fix=enabled),但 AiderHeal
執行層 24 小時 0 次 push 成功,全部 silent fail。

兩根因疊加:
  #1 (config) AIDER_REPO_PATH=/home/wooo/ewoooc 在 110 主機不存在
            → 寫 SOP docs/runbooks/aider-heal-110-setup-sop.md 給統帥手動執行
  #2 (code)  setup_cmds 結尾 `git stash 2>&1 || true` 因 shell 結合性等同
            `(A && B && C && D) || true`,cd 失敗整 chain rc=0 被吞,
            line 261 if rc != 0 永不觸發 → setup_failed 從未被 log
  #4 (code)  缺 preflight,環境壞掉時靜默走完整 pipeline 印 no_diff

本次程式碼修復:
  • execute_code_fix 開頭加 L0 preflight(test -d $REPO/.git)
    失敗 fail-fast + Telegram 嚴重告警 + 指向 SOP
  • setup_cmds 改 `A && B && C && (D || true)` 用 subshell 限縮 || true
  • 全檔 5 處 `cd $REPO_PATH` 統一改 `cd shlex.quote(REPO_PATH)`
    避免下次有人複製 cd chain 又踩同類 shell quoting bug

SOP 同步處理 critic High-2 + Medium-6:
  • 步驟 2 改用 SSH clone(git clone gitea-autoheal:...)
    避免 HTTP clone 在 private repo 卡帳密 + 跟步驟 1 部署的 key 不關聯
  • 步驟 4b 修引號嵌套(heredoc + 單引號保護),原版永遠 false positive

Critic 審過 Approve to commit;Medium-2/3/4(速率限制 / log 加 stderr /
新增 preflight unit test)排 follow-up,不阻擋本次。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 01:55:34 +08:00
OoO
9010a4e6fa docs(adr): add ADR-022 PPT v3 redesign + warm paper + matplotlib + cache versioning
紀錄本次 PPT 全面重做的架構決策:
- 視覺:暖紙風(_BG_PAPER #F3EEE2)取代暖墨黑封面
- 圖表:matplotlib 暖色系(橫條/折線/帕雷托)取代 python-pptx 原生
- 字型:lxml 直寫 a:latin/a:ea 中英分軌(Consolas + JhengHei)
- 快取:TEMPLATE_VERSIONS 字典自動注入 cache key (tpl_ver)
- AI prompt:升級到顧問深度(市場趨勢脈絡 + SMART 框架)
- 安全:admin 白名單(OPENCLAW_ADMIN_USER_IDS)+ cleanup dry_run 預設

涵蓋 8 commit chain:38967ce → 3b0b4b352c06f61c81866b5a2b09c7b7cee92b80355a7012f

Critic 全清紀錄:0 critical / 2 HIGH / 4 medium / 3 info 全部修補。

對應 memory:
- reference_ppt_system.md(既存)已更新到 v3 實況
- project_ppt_v3_campaign_20260502.md(新建)戰役紀錄含三大踩坑
- feedback_template_version_cache_pattern.md(新建)可重用設計模式

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:25:09 +08:00
OoO
00591c5489 feat(ea-hitl): ADR-021 EA 升級審核 pre-fetch + 競價告警金額影響量化
根治 2026-05-02 統帥反映的三層 EA escalation 訊息空泛問題:

1. _escalate_to_human 對 price_drop_alert / market_opportunity /
   threat_escalation 三類觸發,送 Telegram 前先 await Hermes 取具體
   SKU 清單覆蓋 plan 元流程文字(5s 短超時,失敗 fallback 原 plan)
2. NemoTron 競價告警新增 _compute_business_impact helper:
   過去 7 日營收流失(gap_pct>0 才算)+ 跟進競品建議價,
   dispatch 主路徑 / 防線二 / Hermes rule fallback 三條全部 Python
   獨裁注入,告警含「📉 NT$ X」「🎯 NT$ Y」具體金額
3. 補實 telegram_bot_service.handle_callback 的 momo:eig: prefix
   handler,HITL「🛑 忽略此事件」按鈕首次有對應 audit 寫入

Critic 審查通過(5 項必修全綠):
- Critical-1: user_label HTML escape 防 Telegram username XSS
- High-1: pre-fetch 改 asyncio.wait_for(5s) 防阻塞 escalation
- High-2: 全部行缺金額時 return None 觸發 plan fallback
- Medium-2: 空 event_id callback 拒絕避免 audit 污染
- Medium-3: gap_pct≤0 時 revenue_loss_7d 強制歸 0 不誤導降價

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:03:38 +08:00
OoO
6cad59f83e feat(code-review): ADR-020 全自動修復政策 — 拆掉 CRITICAL/HIGH HITL 閘門
All checks were successful
CD Pipeline / deploy (push) Successful in 2m23s
post-deploy code review pipeline 改為「任何 finding 一律觸發 AiderHeal」,
局部覆寫 ADR-012 L3 HITL(不影響 schema migration / 流量切換 /
customer-facing 廣播 / AIOps prod SSH 等其他 L3 場景)。安全網改為
Git revert + Gitea CI/CD 健康檢查 + 主開關 CODE_REVIEW_AUTO_FIX_ENABLED。

實作:
  • _ea_orchestrate / _guard_ea_decision / rule fallback 三條路徑統一為
    has_findings AND AUTO_FIX_ENABLED → auto_fix=true
  • _guard 強制 LLM 即使回 auto_fix=False 也升級為 true(核心保證)
  • CODE_REVIEW_AUTO_FIX_ENABLED 預設 false → true
  • Telegram 文案移除「需人工審查」,改顯示主開關狀態
  • action_plan status pending_review → auto_disabled(語意對齊)
  • aider_heal_executor 標頭 ADR-014 → ADR-020、補「直推 main」分支策略

文件:
  • 新增 docs/adr/ADR-020-code-review-full-autoheal.md
  • ADR-012 加 Note 行反向引用 ADR-020
  • README 索引收錄

測試:tests/test_code_review_pipeline_security.py 反轉 HITL 期望,
新增 5 case(含 LLM 降級被 guard 拒絕、LLM human_review_needed=true 被改 false)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 23:44:01 +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
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
7d46ff9ba5 feat(competitor): persist match attempts
All checks were successful
CD Pipeline / deploy (push) Successful in 2m9s
2026-05-01 20:56:17 +08:00
OoO
b9d6186d68 feat(frontend): sync latest MOMO Pro prototype styling
All checks were successful
CD Pipeline / deploy (push) Successful in 2m18s
2026-05-01 20:32:23 +08:00
OoO
9e2337764b fix(ai): supersede old product picks
All checks were successful
CD Pipeline / deploy (push) Successful in 2m48s
2026-05-01 16:24:15 +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
6bce46bbc7 fix(runtime): 強化健康檢查監控韌性
All checks were successful
CD Pipeline / deploy (push) Successful in 2m29s
2026-05-01 14:46:49 +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
b5de8d5d61 fix(ai): 價格調整轉人工覆核
All checks were successful
CD Pipeline / deploy (push) Successful in 2m16s
2026-05-01 14:09:54 +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
OoO
82d759d3b1 feat(ai): 建立 PChome 銷售挑品清單
All checks were successful
CD Pipeline / deploy (push) Successful in 2m24s
2026-05-01 10:05:16 +08:00
OoO
a821b733ad docs(frontend): 記錄廠商缺貨清單 V2 2026-05-01 00:12:28 +08:00
OoO
c9247f7a79 feat(frontend): 新增廠商缺貨 V2 feature flag 2026-05-01 00:06:46 +08:00
OoO
3398c15a75 feat(frontend): 新增 EDM V2 feature flag 2026-04-30 23:56:17 +08:00
OoO
d5a836e8da fix(frontend): 掛載 Flask web static assets 2026-04-30 23:53:23 +08:00
OoO
41a08886cc fix(frontend): 掛載 V2 static assets 2026-04-30 23:50:52 +08:00
OoO
0e18ff304c feat(frontend): 新增 V2 dashboard feature flag 2026-04-30 23:45:49 +08:00
OoO
13f17d62e7 docs(frontend): 建立 V2 視覺基準 2026-04-30 23:37:52 +08:00
OoO
73c7ddcee0 fix(cd): 使用 inplace rsync 保留 bind mount inode 2026-04-30 23:32:59 +08:00
OoO
d06c7016dc fix(cd): 修復 sync 版本 mount drift 2026-04-30 23:24:54 +08:00
OoO
dd35306399 refactor(openclaw): 抽出選單鍵盤 builders
All checks were successful
CD Pipeline / deploy (push) Successful in 1m46s
2026-04-30 23:17:19 +08:00
OoO
8b4fafdf13 fix(cd): 讓 HUP 熱重載載入新版 app
All checks were successful
CD Pipeline / deploy (push) Successful in 9m40s
2026-04-30 15:17:00 +08:00
OoO
f282ddc18c fix(cd): sync 模式改用 app 熱重載
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-04-30 15:11:57 +08:00
OoO
661755fac9 docs(ops): 記錄 runner label 隔離 2026-04-30 14:53:08 +08:00
OoO
db3a7e5df1 fix(db): 補齊 action_plans schema drift
All checks were successful
CD Pipeline / deploy (push) Successful in 5m10s
2026-04-30 14:45:40 +08:00
OoO
2b9991096b fix(monitoring): 移除失效 blackbox 目標
All checks were successful
CD Pipeline / deploy (push) Successful in 1m46s
2026-04-30 14:39:33 +08:00
OoO
f30ee955ff fix(monitoring): 恢復 exporter scrape 目標
All checks were successful
CD Pipeline / deploy (push) Successful in 1m41s
2026-04-30 14:35:09 +08:00
OoO
5695ead4dc fix(edm): 修正活動看板排序 endpoint
All checks were successful
CD Pipeline / deploy (push) Successful in 1m42s
2026-04-30 14:29:40 +08:00
OoO
fb9c4ad1b5 refactor(openclaw): 抽出 Telegram API helper
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-04-30 14:24:45 +08:00
OoO
19535a0763 chore(cleanup): 移除 legacy 5888 測試入口
All checks were successful
CD Pipeline / deploy (push) Successful in 1m36s
2026-04-30 14:12:21 +08:00
OoO
c2e38be43d docs(modularization): 建立模組化治理守門
All checks were successful
CD Pipeline / deploy (push) Successful in 1m36s
2026-04-30 14:07:10 +08:00
OoO
db21e7e8e8 fix(devops): 移除 startup 腳本危險 compose 操作
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-04-30 14:05:41 +08:00
OoO
89e7f2ccd2 fix(ai): 擴大 ElephantAlpha 暫時性 fallback
All checks were successful
CD Pipeline / deploy (push) Successful in 1m46s
2026-04-30 13:59:12 +08:00
OoO
d8f93df4ec fix(metrics): 輸出 AI 自動化 baseline 指標
All checks were successful
CD Pipeline / deploy (push) Successful in 1m35s
2026-04-30 10:32:43 +08:00
OoO
e73cd6e6a3 fix(stability): 補強 scheduler 例外記錄
All checks were successful
CD Pipeline / deploy (push) Successful in 1m36s
2026-04-30 10:28:37 +08:00
OoO
18b0fa8af2 chore(config): 補齊 Phase 3f env 範例契約 2026-04-30 10:25:21 +08:00
OoO
72fa166729 fix(ai): 遷移 Ollama embedding 至 api embed
All checks were successful
CD Pipeline / deploy (push) Successful in 1m46s
2026-04-30 10:24:15 +08:00