Files
ewoooc/docs/memory/ai_automation_closure_20260429.md
OoO 10bbd55f5b
All checks were successful
CD Pipeline / deploy (push) Successful in 1m13s
補齊 AI Smoke 趨勢管理
2026-04-29 23:54:23 +08:00

4.0 KiB
Raw Blame History

AI 自動化閉環記憶2026-04-29

用途:讓新 Codex session 快速掌握 2026-04-29 這輪「AI 自動化」修復後的實況,不必重讀整串對話與所有 commit。

核心結論

  • AI 自動化控制面已從三 Agent 擴展為四 AgentHermes、NemoTron、OpenClaw、ElephantAlpha。
  • EventRouter 是告警與 L2 安全 action 的入口AI 掛掉時必須降級,不可中斷通知。
  • AutoHeal 是自癒副作用入口;momo-db / momo-postgres 受保護,不可自動 restart / stop / recreate。
  • OpenClaw learning 是 AI 記憶與 embedding queue 的橋接層raw ai_insights 寫入者必須 enqueue embedding 或可回補。
  • ElephantAlpha 只負責 orchestration / HITL / AutoHeal bridge不可繞過 ADR-011、ADR-012、ADR-013。
  • AI 自動化最小 Prometheus 指標已接入 /metrics,來源為 services/ai_automation_metrics.py
  • 線上 smoke dashboard 已接入 /ai_automation_smokeJSON API 為 /api/ai-automation/smoke
  • Smoke API 會保存最近快檢 JSONL 趨勢dashboard 顯示 OK / Warning / Critical 最近分布。
  • Smoke history 已支援 JSONL 匯出、清理與每日摘要;清理只影響 smoke history不碰 DB 或 EventRouter queue。

已落地範圍

  • EventRouter 增加同步 dispatch、AI 失敗降級、Telegram 失敗 file queue、成功後 replay、去重冷卻、靜音檢查、L2 SAFE_ACTIONS 限制。
  • NemoTron 在缺 API key、quota、timeout、network/HTTP error、0 tool call 時 fallback 到 Hermes 規則。
  • Code review pipeline 預設關閉 auto-fix高風險只走 HITL/action_plan內部 webhook token 預設必填。
  • AutoHeal 補 incident / heal log / KM 沉澱DB 不可用時安全降級SSH_CMD 限 read-only allowlist。
  • OpenClaw learning 補 raw insert embedding bridge、stale processing reset、missing embedding backfill、pgvector semantic RAG fallback。
  • Scheduler 重要失敗路徑接入 EventRouter減少裸 exception 漏通知。
  • ElephantAlpha 執行引擎補 sync timeout、HITL reply_markup、未知 step fail fast、code/resource action 走 AutoHeal bridge。
  • L2 agent_actions.pyflag_for_human_reviewroute_to_kmmark_for_relearn 已從 stub 改為可審計 OpenClaw memory 寫入。
  • /metrics 已匯出 EventRouter dispatch、latency、safe action、Telegram replay、AutoHeal action 與 duration 指標。
  • Smoke dashboard read-only 檢查 EventRouter queue、AutoHeal protected resources、NemoTron fallback、OpenClaw embedding queue、ElephantAlpha HITL不做外部網路呼叫。
  • Smoke history 只保存精簡紀錄,不保存完整 details避免長期檔案膨脹與敏感資訊堆積。
  • Export API 回傳 application/x-ndjsonclear API 只刪除 MOMO_AI_AUTOMATION_SMOKE_HISTORY 指向檔案。

驗證紀錄

  • 2026-04-29 AI metrics 批次:26 passed
  • 2026-04-29 AI smoke dashboard 批次:2 passed(單檔 smoke service後續核心組需持續納入。
  • 2026-04-29 AI smoke trend 批次:5 passedsmoke + metrics
  • 2026-04-29 AI smoke management 批次:7 passedsmoke + metrics
  • 2026-04-29 L2 安全記憶批次:24 passed
  • collect-only48 tests collected
  • git diff --check 已通過。

相關 commit

  • 779b27f 修復 P0 告警自癒鏈與測試收集
  • 0875dd8 補強 5.5 自癒安全回看
  • 1c2dc6c 補強 AI 自動化閉環與安全降級
  • f0e044a 補齊自癒稽核與 OpenClaw 記憶閉環
  • 0c2e9bb 串接 AI 洞察向量化與漏通知入口
  • 78eebfb 加入告警去重與洞察向量回補
  • d486598 補強 ElephantAlpha 執行與通知閉環
  • 5b25f55 補齊 EventRouter 失敗通知回放
  • 162a76b 落地 L2 安全記憶動作
  • d58e4d0 同步四 Agent AI 自動化治理紀錄

下次進場先看

  • ADR-018四 AI Agent 自動化控制面。
  • ADR-012Action Ladder 與 L2 SAFE_ACTIONS。
  • ADR-013AutoHeal 安全邊界。
  • docs/AI_INTELLIGENCE_MODULE_SOT.md:目前 AI 架構事實。
  • docs/guides/ai_automation_session_sop.mdAI 自動化 session 執行與收尾 SOP。