Commit Graph

52 Commits

Author SHA1 Message Date
OoO
dcabebbcf2 Expose PChome rescore review metrics 2026-05-24 21:12:27 +08:00
OoO
c5db3eb0da Keep external BI links inside momo pro
Some checks failed
CD Pipeline / deploy (push) Failing after 10m17s
2026-05-24 17:43:25 +08:00
OoO
b389a50e07 V10.429 complete runtime governance docs
All checks were successful
CD Pipeline / deploy (push) Successful in 1m3s
2026-05-24 16:15:23 +08:00
OoO
7090f08dba V10.418 skip 111 in embedding consistency checks 2026-05-24 15:03:10 +08:00
OoO
353e565e52 V10.417 protect embedding fallback routing
All checks were successful
CD Pipeline / deploy (push) Successful in 1m4s
2026-05-24 14:53:43 +08:00
OoO
b73dc6df3f V10.415 protect Hermes fallback routing
All checks were successful
CD Pipeline / deploy (push) Successful in 1m5s
2026-05-24 14:25:22 +08:00
OoO
6ac412716a V10.413 protect code review fallback host
All checks were successful
CD Pipeline / deploy (push) Successful in 1m6s
2026-05-24 14:05:59 +08:00
OoO
5ea556d406 V10.410 tune code review ollama timeouts
All checks were successful
CD Pipeline / deploy (push) Successful in 1m4s
2026-05-24 13:42:54 +08:00
OoO
65d38d4632 V10.407 shorten ai runner residency
All checks were successful
CD Pipeline / deploy (push) Successful in 1m34s
2026-05-24 13:32:35 +08:00
OoO
717231167f V10.406 shorten code review ollama keepalive
All checks were successful
CD Pipeline / deploy (push) Successful in 1m6s
2026-05-24 13:24:59 +08:00
OoO
0cea70890a 導入 browse.sh 比價診斷計畫
All checks were successful
CD Pipeline / deploy (push) Successful in 1m21s
2026-05-21 18:40:49 +08:00
OoO
106c1935f4 收緊 111 Ollama fallback 資源上限
Some checks failed
CD Pipeline / deploy (push) Failing after 11m7s
2026-05-21 18:13:50 +08:00
OoO
c016200bf4 硬封鎖 Gemini API 預設出站 2026-05-21 14:45:32 +08:00
OoO
c329d96dff 限制 111 fallback context 大小
All checks were successful
CD Pipeline / deploy (push) Successful in 1m10s
2026-05-21 12:44:33 +08:00
OoO
00a808518e 將 111 Ollama fallback 收斂到輕量模型 2026-05-21 12:39:23 +08:00
OoO
d6ae216c8c 限制 111 Ollama fallback 資源占用
All checks were successful
CD Pipeline / deploy (push) Successful in 1m11s
2026-05-21 12:24:49 +08:00
OoO
a46396ca7f [V10.350] 關閉 Gemini 預設備援出站
All checks were successful
CD Pipeline / deploy (push) Successful in 1m6s
2026-05-20 20:10:21 +08:00
OoO
b636303481 [V10.334] 強化 PChome 比價重評與補抓可觀測性
All checks were successful
CD Pipeline / deploy (push) Successful in 1m5s
2026-05-20 14:45:41 +08:00
OoO
0fc96837f4 [V10.284] 預設關閉 Code Review Hermes LLM scan | code_review_pipeline_service.py
All checks were successful
CD Pipeline / deploy (push) Successful in 1m1s
2026-05-19 22:34:30 +08:00
OoO
840cb0acdb [V10.283] 收斂 Code Review Hermes fast scan prompt | code_review_pipeline_service.py
All checks were successful
CD Pipeline / deploy (push) Successful in 1m2s
2026-05-19 22:30:05 +08:00
OoO
350022f2ea [V10.282] 補齊 Code Review Hermes 本地模型矩陣 | code_review_pipeline_service.py
All checks were successful
CD Pipeline / deploy (push) Successful in 1m1s
2026-05-19 22:26:09 +08:00
OoO
f8222006b8 [V10.281] 強化 Code Review Ollama 本地備援矩陣 | code_review_pipeline_service.py
All checks were successful
CD Pipeline / deploy (push) Successful in 1m3s
2026-05-19 22:15:48 +08:00
OoO
03ab276032 [V10.279] 收斂 Code Review Ollama 路徑並補 Phase80 gate | code_review, market_intel
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-05-19 21:57:44 +08:00
OoO
cb0446e85f 限制 PPT 視覺 QA 投影片抽查
All checks were successful
CD Pipeline / deploy (push) Successful in 1m3s
2026-05-19 09:48:00 +08:00
OoO
abe3be2ffa 調整 PPT 視覺 QA timeout
All checks were successful
CD Pipeline / deploy (push) Successful in 1m2s
2026-05-19 09:30:58 +08:00
OoO
d2d8dbab65 強化 PPT 產線與線上預覽
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-05-18 15:44:11 +08:00
OoO
c021945047 fix: route telegram vision through ollama first
All checks were successful
CD Pipeline / deploy (push) Successful in 1m4s
2026-05-18 14:07:49 +08:00
OoO
d82a1671b6 fix: route openclaw qa through ollama cascade 2026-05-13 21:17:22 +08:00
OoO
2635b22ebc 修正缺貨清單手機表頭溢出
All checks were successful
CD Pipeline / deploy (push) Successful in 56s
2026-05-13 20:16:30 +08:00
OoO
ae1895ff4d 守住 compose 環境變數文件契約 2026-05-13 13:01:26 +08:00
OoO
acef0fa6ff 守住 runtime 環境變數文件契約 2026-05-13 12:59:29 +08:00
OoO
2b2233d385 補齊 OpenClaw 與 DeepSeek 環境範例 2026-05-13 12:57:46 +08:00
OoO
25e0570e80 補齊 AI runtime 環境範例 2026-05-13 12:56:14 +08:00
OoO
b65a319cb8 固化 Ollama 三主機路由紅線
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
2026-05-13 12:09:40 +08:00
OoO
6817f6437e 移除舊 SSH jump 設定殘影
All checks were successful
CD Pipeline / deploy (push) Successful in 56s
2026-05-13 09:25:01 +08:00
OoO
30a173cf69 統一全站暖色視覺與市場情報骨架
All checks were successful
CD Pipeline / deploy (push) Successful in 58s
2026-05-06 20:24:46 +08:00
OoO
943de8466c feat(p7): Anthropic SDK + Claude Opus 4.7 接 Code Review (feature flag OFF)
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Operation Ollama-First v5.0 / Phase 7 Frontier 升級

services/anthropic_service.py (新檔, 226 行)
- AnthropicService 包裝 + ClaudeResponse dataclass
- Ephemeral prompt cache 5 分鐘 TTL(重複 system_prompt 省 90% 成本)
- usage 解析 input/output/cache_creation/cache_read 四欄位
- ANTHROPIC_API_KEY 未設或 SDK 缺失時 is_available()=False 靜默退化

code_review_pipeline_service.py — _openclaw_assess 加 L1 Claude 分支
- CODE_REVIEW_USE_CLAUDE flag (預設 OFF,等 ANTHROPIC_API_KEY 設定後翻 ON)
- 路由:Claude Opus 4.7 (Arena code Elo 1548) → Gemini → ElephantAlpha 三層
- request_id 串鏈不變

ai_call_logger.py COST_TABLE 補 3 個 Claude 模型:
- claude-opus-4-7:    $15/$75 per M tokens (程式碼 #1)
- claude-sonnet-4-6:  $3/$15  per M tokens (agentic 平衡)
- claude-haiku-4-5:   $0.8/$4 per M tokens (輕量快速)

requirements.txt: 加 anthropic>=0.40.0
.env.example: 加 ANTHROPIC_API_KEY / CODE_REVIEW_USE_CLAUDE / CLAUDE_MODEL

52 unit tests 全綠(22 logger + 18 anthropic + 5 routing + 7 security)

啟用步驟(待統帥手動):
  1. .env 加 ANTHROPIC_API_KEY=sk-ant-...
  2. CODE_REVIEW_USE_CLAUDE=true + restart momo-app
  3. 觀察 ai_calls.cache_read_tokens > 0 確認 cache 生效

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 23:31:30 +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
6bce46bbc7 fix(runtime): 強化健康檢查監控韌性
All checks were successful
CD Pipeline / deploy (push) Successful in 2m29s
2026-05-01 14:46:49 +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
OoO
91ad98e621 feat(ai): 強化 ElephantAlpha NIM fallback
All checks were successful
CD Pipeline / deploy (push) Successful in 1m48s
2026-04-30 09:33:39 +08:00
OoO
4d5a995718 chore: 刪除孤兒 AI service 並補齊 env 範例
ADR-017 Phase 3f-5:刪除未被 runtime 引用的 elephant_alpha_decision_router、telegram_ai_integration、watcher_agent;補 .env.example 的 Aider/AutoHeal/NVIDIA/OpenClaw/backup/report/PG sync 等實際讀取變數。
2026-04-29 21:46:24 +08:00
OoO
ffeb28be95 docs: 補齊 .env.example — INITIAL_ADMIN_PASSWORD/BOT_API_TOKEN/SSH_JUMP_* 2026-04-28 14:59:19 +08:00
OoO
8331c15d1b fix(post-3.5c): .env.example 補齊 HERMES_URL + DISABLE_LOGIN
All checks were successful
CD Pipeline / deploy (push) Successful in 1m19s
P1-19:
- 既有 LOGIN_PASSWORD/SECRET_KEY 補上「[必填]」註解
- 新增 DISABLE_LOGIN(auth.py:13 在用,但 .env.example 沒有)
- 新增 Hermes 區塊:HERMES_URL、HERMES_TIMEOUT、EMBEDDING_HOST(註解)
- 統一格式:每條前面加「[必填] / [預設 X]」標註

注意:Elephant Alpha 區塊既有 ELEPHANT_ALPHA_HERMES_URL 是 Elephant 專用,
與本次新增的 HERMES_URL(Hermes Module 2 用)不同變數,分開保留。
2026-04-28 12:15:59 +08:00
ogt
dc6597d36b [V10.4-D] 環境變數修復:POSTGRES_PASSWORD 注入 + fail-fast 守衛
Some checks failed
CD Pipeline / deploy (push) Failing after 1m6s
修復 H7(排程器/Telegram Bot 容器中 POSTGRES_PASSWORD 為空):

- docker-compose.yml: 移除 scheduler/telegram-bot 的 \${POSTGRES_*} environment
  插值行,僅保留 env_file: .env(與 188 主機已上線版本同步)
- config.py: USE_POSTGRESQL=true 時,POSTGRES_PASSWORD 空值立即 raise ValueError,
  避免無聲連線失敗(原本只在執行期出現 auth error)
- .env.example: 新增 GEMINI_API_KEY / GEMINI_MODEL / OPENCLAW_MODEL,
  附 Gemini 2.0 Flash EOL 2026-06-01 警告

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 01:43:43 +08:00
ogt
87e40ebcf9 fix: resolve datetime variable scope error and duplicate alert notifications
- Fix datetime variable scope issue in openclaw_bot_routes.py by removing redundant imports
- Add notification_sent flag to prevent duplicate import failure alerts in scheduler.py
- Add database configuration to .env.example to fix missing POSTGRES_PASSWORD setup
- Create security fix guide for hardcoded database passwords in Kubernetes configs

Resolves:
- Presentation report export function abnormal (datetime NameError)
- Import failure alert messages being sent repeatedly
- Database connection password configuration issues
2026-04-22 14:32:34 +08:00
ogt
0099543c05 fix(security): 全域健檢 — 40 項安全/Bug/品質修復
Some checks failed
CD Pipeline / deploy (push) Failing after 5m18s
🔴 Critical
- auto_heal_service: 補 import re + sqlalchemy.text + 修正 orchestrator 變數名
  + autoheal_playbook→playbooks 表名 + _alert_and_store cooldown 修復
- aider_heal_executor: shell injection 改 shell=False + list 參數
- docker-compose: DISABLE_LOGIN 改 env var + 移除密碼 fallback + POSTGRES_HOST 修正
- app.py: /api/backup /api/run_task 等 6 個管理 API 加 @login_required
- config.py + pg_sync + e2e_test: 移除 wooo_pg_2026 hardcoded 密碼 fallback
- pg_backup.sh: 移除 TELEGRAM_TOKEN= 中間變數,直接用 $TELEGRAM_BOT_TOKEN
- migration 014: trigger_pattern→match_pattern + 補 error_type NOT NULL 欄位

🟡 High
- telegram_bot_service: str(e) 改通用訊息 + session try/finally + 移除 pa:/pr: 舊 callback
- run_scheduler: ElephantAlpha thread 死亡監控 + 自動重啟 + Telegram 告警
  + agent_context 03:30 TTL 定時清理任務
- openclaw_learning_service: build_rag_context 兩路徑加 .limit(200)
- hooks: commit-quality + momo-prod-guard 空 catch 改 stderr+exit(1)
- scripts/code_review: auto_yes 預設改 false
- db_backup_service: PGPASSWORD 透過 env dict 傳遞

📦 Migrations
- 013_autoheal: 修正建表順序 playbooks→incidents(外鍵前向引用)
- 018_add_missing_indexes: heal_logs/incidents 外鍵索引 + cleanup_expired_agent_context()

🟢 Infrastructure
- requirements.txt: 加版本下界 Flask>=2.3 SQLAlchemy>=1.4 等
- cd.yaml: 新增 run_scheduler.py + run_telegram_bot.py 監聽路徑
- .gitignore: insert_playbook_local.py 加入忽略

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 01:12:23 +08:00
ogt
8df8b24043 docs: 新增 ALERT_WEBHOOK_PASSWORD 和 GITLAB_TOKEN 到 .env.example
- 新增 Alert Webhook 認證設定範例
- 新增 GitLab CI/CD API token 設定範例
- 解決啟動時的環境變數警告
2026-04-20 22:45:36 +08:00
ogt
96e19b6b72 security: harden system_routes.py — auth + input validation
All checks were successful
CD Pipeline / deploy (push) Successful in 1m18s
Issues fixed:

1. [CRITICAL] No authentication on destructive routes (CWE-306)
   POST /api/system/cleanup/docker was unauthenticated (system_bp is
   CSRF-exempt, before_request only refreshes session, no login check).
   Any unauthenticated HTTP client could trigger docker system prune.
   Fix: _require_internal_key() checks X-Internal-Key header against
   INTERNAL_API_KEY env var on all 4 routes; fail-secure if key unset.

2. [MEDIUM] Unvalidated numeric inputs in find commands (CWE-20)
   max_size_mb / older_than_hours came from POST body and were
   interpolated into find -size / -mmin args. Negative/huge values
   could cause unexpected behavior.
   Fix: _validate_int() clamps to [1..10000] / [1..8760] with defaults.

3. [LOW] find -mmin arg missing leading '+' (logic bug)
   '-mmin 168' matches FILES EXACTLY 168 min old, not older-than.
   Fix: '-mmin', f'+{older_than_hours * 60}' (+ = older than)

4. [LOW] subprocess(['date', ...]) in health_check replaced
   with Python datetime.now(UTC).isoformat() — no subprocess needed.

INTERNAL_API_KEY added to .env.example with generation instructions.
Generate with: openssl rand -hex 32

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 05:47:04 +08:00