Commit Graph

104 Commits

Author SHA1 Message Date
OoO
86f1fd5f50 fix(p33): admin observability auth hardening — Critic CRITICAL 修正
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Critic 1 CRITICAL 發現:6 個觀測端點零認證 + csrf_exempt
→ Flask 一旦對外可達,任何人可 POST 晉升 episode / 改月預算
→ X-Forwarded-User header client 偽造 = 偽造 admin 身份

修正:
1. 全 8 個 route handler 加 @login_required(session-based auth)
   - GET: ai_calls / promotion_review / quality_trend / host_health /
          budget / ppt_audit_history
   - POST: promotion_review/approve, .../reject, budget/update/<id>
2. promotion_review_approve approver_hash 改從 Flask session 取
   (get_current_user().username)— 不再信 X-Forwarded-User header
3. app.py 移除 csrf.exempt(admin_observability_bp)
4. 12 tests(10 原 + 2 新 auth gate)全 PASS:
   - test_anon_get_redirects_to_login: 6 GET 路由匿名 → 302
   - test_anon_post_blocked: 3 POST mutation 匿名 → 302
2026-05-04 14:19:54 +08:00
OoO
48b8fda7db feat(p27+28): Admin Observability Dashboard — 4 個前端頁互補 Telegram
All checks were successful
CD Pipeline / deploy (push) Successful in 2m25s
Operation Ollama-First v5.0 / Phase 27 + 28 — 戰役觀測前端化

routes/admin_observability_routes.py (新檔, 200+ 行)
- admin_observability_bp blueprint,url_prefix='/admin'
- /admin/ai_calls            — Phase 27 主入口(KPI / by provider / TOP 100)
- /admin/promotion_review    — Phase 28 PromotionGate 待審列表 + 通過/拒絕按鈕
- /admin/quality_trend       — Phase 25 caller 反饋趨勢視覺化
- /admin/host_health         — 三主機 + MCP + cost throttle 即時健康
- 失敗安全:DB 查詢失敗回空清單 + 警告 banner(不 raise)
- promotion_review_approve/reject 走 hash_human_approver SHA1[:8] 不存原 username

templates/admin/ (4 個新檔)
- ai_calls_dashboard.html   篩選 bar + 6 KPI cards + by provider + recent 100
- promotion_review.html     卡片列表 + 通過/拒絕 AJAX 按鈕(即時 UI feedback)
- quality_trend.html        avg score 升序排列 + 進度條 bar + 智能建議區
- host_health.html          三主機 HTTP probe + 已載入模型 + MCP + throttle

統帥提問「需要哪些前端讓兩者互補互動」答覆:
  6 項最該前端化(已實作 4 項,剩 2 項為後續):
     ai_calls 即時查詢          → /admin/ai_calls
     PromotionGate 待審核         → /admin/promotion_review (互動最強)
     caller 反饋趨勢             → /admin/quality_trend
     三主機 + MCP + throttle     → /admin/host_health
     ai_call_budgets 預算管理   → Phase 29 補
     PPT 視覺審核結果列表        → Phase 29 補

互補 Telegram 哲學:
  Telegram = push(重要事件主動通知)
  Web = pull(統帥隨時可查 / 互動審核 / 找問題)
  PromotionGate Stage 4:Telegram 推 awaiting_review + Web 批次審核(兩者皆可)

app.py blueprint 註冊 + CSRF exempt(AJAX POST 走 server-side check)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 13:36:51 +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
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
d6782ee710 feat(ai): move recommendation page to v2 shell
All checks were successful
CD Pipeline / deploy (push) Successful in 2m13s
2026-05-01 21:08:44 +08:00
OoO
9b3e0a4565 feat(ai): move history page to v2 shell
All checks were successful
CD Pipeline / deploy (push) Successful in 2m19s
2026-05-01 21:06:17 +08:00
OoO
939ed5eef5 feat(ai): move intelligence page to v2 shell
All checks were successful
CD Pipeline / deploy (push) Successful in 2m18s
2026-05-01 21:03:19 +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
c1f43b0ae4 fix(campaign): persist full crawl snapshots
All checks were successful
CD Pipeline / deploy (push) Successful in 2m22s
2026-05-01 20:48:28 +08:00
OoO
bb99dfeab6 feat(campaign): restore operations table signals
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-05-01 20:43:46 +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
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
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
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
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
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
9f9e0727e7 fix(ai): 自動偵測挑品銷售欄位
All checks were successful
CD Pipeline / deploy (push) Successful in 1m50s
2026-05-01 10:18:07 +08:00
OoO
70de91f1f6 fix(ai): 修正挑品清單銷售日期查詢
All checks were successful
CD Pipeline / deploy (push) Successful in 2m14s
2026-05-01 10:12:32 +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
55855ef508 feat(frontend): 保存 PChome 競品價格歷史
All checks were successful
CD Pipeline / deploy (push) Successful in 1m39s
2026-05-01 00:53:37 +08:00
OoO
6b8e511246 feat(frontend): 補齊活動看板篩選與價格歷史區間
All checks were successful
CD Pipeline / deploy (push) Successful in 1m44s
2026-05-01 00:43:38 +08:00
OoO
4945aeed3b fix(frontend): 還原商品看板價格歷史圖表
All checks were successful
CD Pipeline / deploy (push) Successful in 1m45s
2026-05-01 00:35:04 +08:00
OoO
8e9fb3dd17 feat(frontend): 將 V2 設為正式預設介面
All checks were successful
CD Pipeline / deploy (push) Successful in 1m46s
2026-05-01 00:28:56 +08:00
OoO
15b3bae9cb feat(frontend): 新增廠商缺貨匯入 V2
All checks were successful
CD Pipeline / deploy (push) Successful in 1m42s
2026-05-01 00:21:26 +08:00
OoO
99d5bc8e81 feat(frontend): 新增廠商缺貨清單 V2 2026-05-01 00:12:06 +08:00
OoO
c9247f7a79 feat(frontend): 新增廠商缺貨 V2 feature flag 2026-05-01 00:06:46 +08:00
OoO
6c73c57a91 feat(frontend): 新增廠商缺貨 V2 入口 2026-05-01 00:04:12 +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
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