Commit Graph

56 Commits

Author SHA1 Message Date
OG T
d3a0ed4253 docs(adr): ADR-030 智能自動修復系統完整設計
五階段實施計畫:
- Phase 1: 智能診斷基礎  已完成
- Phase 2: 資料收集強化 (K8s Events + SignOz 深度整合)
- Phase 3: Playbook RAG (向量化 + 語意搜尋)
- Phase 4: 自動執行機制 (信任度 + 風險評估)
- Phase 5: 持續學習迴圈 (反饋 + 信任度調整)

架構相容性分析:
- 介面擴展點定義
- 資料庫 Schema 變更
- 風險評估與回滾計畫

預計時程: 10-15 週

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 21:48:41 +08:00
OG T
309a019cc3 docs: 記錄 Telegram 告警轟炸事故修復
更新:
- ADR-027: 新增緊急事故修復章節
- LOGBOOK: 記錄 2026-03-26 事故時間線
- Skill 02 v1.6: 新增 Telegram 去重機制章節

根因: Phase 6.5 修改 + INC- 前綴重複
修復: Redis 去重 (10 分鐘) + 前綴檢查

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 20:13:07 +08:00
OG T
fb03430469 feat(api): ADR-027 Phase 2 - 簽核/拒絕後自動同步 Incident 狀態
Router 整合點:
- POST /approvals/{id}/sign → on_approval_status_change("approved")
- POST /approvals/{id}/reject → on_approval_status_change("rejected")
- POST /approvals/bulk-approve → 批次同步

變更:
- 移除舊的 resolve_incident_after_approval() 調用
- 改用 IncidentApprovalService.on_approval_status_change()
- 同步失敗不阻斷主流程 (容錯設計)

ADR-027 進度: Phase 1-2  完成

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 19:44:59 +08:00
OG T
dd42e6b75b chore: services export + meetings 文檔格式化
- services/__init__.py: 導出 IncidentApprovalService (ADR-027)
- meetings docs: 格式化更新

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 19:10:48 +08:00
OG T
a9f8ad56c1 chore: 未提交變更整理 (API core + docs + scripts)
API 核心:
- constants.py: 系統常量定義
- unit_of_work.py: Unit of Work 模式
- incident_approval_service.py: Incident-Approval 同步服務

文檔更新:
- LOGBOOK.md: 進度更新
- AWOOOI_AGENTIC_WORKSPACE_ROADMAP.md: 路線圖
- 2026-03-26_llm_testing_evaluation.md: LLM 測試評估
- phase5_telemetry_architecture.md: 遙測架構
- SECRETS_REFERENCE.md: 密鑰參考

配置/腳本:
- Skill 02 v1.x: leWOOOgo 後端更新
- .dependency-cruiser.cjs: 依賴規則
- demo-multisig-flow.sh: 演示腳本

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 19:10:12 +08:00
OG T
2f5986df5c docs: ADR 整理與新增 (021-029)
ADR 編號修正:
- ADR-023 failure-auto-repair → ADR-028
- ADR-025 cicd-ai-integration → ADR-029

新增 ADR:
- ADR-021: Playbook 更新驗證
- ADR-022: Sentry 整合架構
- ADR-027: Incident-Approval 同步
- ADR-028: 失敗自動修復閉環
- ADR-029: CI/CD AI 整合 (原 ADR-025)

更新:
- ADR-018: LLM 測試策略狀態更新

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 19:09:08 +08:00
OG T
c7be68f800 docs: LOGBOOK 更新 Phase 13.2 #84 完成狀態
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 18:56:24 +08:00
OG T
0a9d94d82b feat(k8s): CoreDNS GitOps 架構 (ADR-026)
問題: DNS 配置沒有版本控制,手動修改易遺失

架構:
- k8s/k3s-system/coredns-custom.yaml: HelmChartConfig
- CD workflow: k3s-system 路徑偵測 + 自動 apply
- ADR-026: CoreDNS GitOps 管控架構

DNS 上游:
- 使用 8.8.8.8 + 1.1.1.1
- 禁止 /etc/resolv.conf (systemd-resolved)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 18:43:28 +08:00
OG T
6e3a7fca20 docs: ADR-006 v1.2 Rate Limiter + LOGBOOK 更新
- ADR-006: 新增 Rate Limiter 實作章節 (v1.2)
- LOGBOOK: 記錄 Gemini 切換 + Rate Limiter 上線

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 18:16:45 +08:00
OG T
30145c7d7e docs: ADR-025 CI/CD AI 整合架構 + Skill 07 更新
- ADR-025: 文檔化 Phase 13.1 CI/CD AI 整合架構決策
  - GitHub Webhook 事件驅動流程
  - 風險分級執行決策 (AUTO/TELEGRAM/APPROVAL/BLOCKED)
  - SignOz Log 整合
- Skill 07 v1.3: 新增 Grafana MCP + SignOz query_logs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 15:41:26 +08:00
OG T
14c81f728f docs: 新增 ADR-025 告警鏈路 E2E 驗證 + 更新 Skills
新增:
- ADR-025: 告警鏈路 E2E 驗證架構 (2026-03-26 事故教訓)

更新:
- ADR-011: 新增 DNS 規則最佳實踐 (附錄 B)
- Skill 04: 新增 NetworkPolicy DNS 規則 + CoreDNS 設定
- Skill 05: 新增告警鏈路 Smoke Test 要求
- CLAUDE.md: 新增告警鏈路驗證到任務前必讀

事故根因:
1. URL 路徑錯誤 (webhook vs webhooks)
2. NetworkPolicy DNS 規則標籤不匹配
3. CoreDNS 上游 DNS 依賴 systemd-resolved

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 15:34:12 +08:00
OG T
579da38b8b feat(api): Phase 13 智能路由 + CI/CD 整合 (#74-88)
Phase 13.1 CI/CD Integration:
- #76 workflow_run handler for CI failure diagnosis
- #77 SignOz log query (query_logs, error_logs_summary MCP)
- #78 CIAutoRepairService with risk-based execution decisions

Phase 13.3 Smart Routing:
- #85 Intent Classifier v2.0 (rule engine + LLM fallback)
- #86 Complexity Scorer (9-dimension scoring)
- #87 AI Router v3.0 (routing decision matrix)
- #88 Token Counter (OTEL + Langfuse integration)

New files:
- services/ci_auto_repair.py (risk stratification)
- services/model_registry.py (centralized model config)
- services/token_counter.py (677 lines)
- Skill 08: Model Router Expert
- Skill 09: Strangler Pattern Expert
- ADR-023: Smart Routing Architecture
- ADR-024: API Layer Architecture

Tests:
- phase11-conversational.spec.ts (E2E tests)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 15:32:52 +08:00
OG T
30f045bf28 feat: ADR-019 System Prompt 集中管理 + Nightly LLM Workflow
新增:
- docs/adr/ADR-019-system-prompt-management.md - System Prompt 規範
- apps/api/src/core/prompts.py - 集中管理 System Prompts
- .github/workflows/nightly-llm.yaml - 每夜 LLM 迴歸測試

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 12:27:47 +08:00
OG T
edecf7a053 docs: ADR-020 E2E 驗證框架規範
Phase 18.3 配套決策文檔:
- E2E 驗證腳本架構 (5 步驟標準)
- Safe Label 防護機制
- Daily Health Check 排程規範
- 目標資源驗證要求

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 12:27:36 +08:00
OG T
505ff7a809 docs: LLM 測試評估 + Ollama GPU 問題發現
評估結果:
- Ollama 使用 CPU 推理 (VRAM=0GB)
- 生成速度 0.45 tok/s (正常 10-20x)
- 這是 CI LLM 測試失敗的根因

決策:
- ADR-018 三層框架暫緩整合
- 優先修復 Ollama GPU 問題
- 再實施方案 A (seed 參數)

新增:
- docs/evaluations/2026-03-26_llm_testing_evaluation.md
- feedback_solution_adoption_checklist.md (7問評估清單)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 11:47:49 +08:00
OG T
96c3ddd8c4 feat(api): Phase 18.1 K8s 資源名稱驗證 (ADR-016)
三層防禦架構確保 kubectl 指令有效:
1. Webhook 入口正規化 (webhooks.py)
2. OpenClaw 產生指令前驗證 (openclaw.py)
3. 靜態映射表 + 模糊匹配 (k8s_naming.py, resource_resolver.py)

新增:
- src/utils/k8s_naming.py: RFC 1123 正規化 + 靜態映射
- src/services/resource_resolver.py: MCP K8s Tool 動態驗證
- docs/adr/ADR-016-k8s-resource-naming.md: 契約文檔
- scripts/e2e_tool_call_verification.py: E2E 驗證腳本 v2.0

修改:
- webhooks.py: Phase 18.1.7 入口正規化
- openclaw.py: Phase 18.1.6 產生指令前驗證
- Skill 03 v1.4: 新增 K8s 資源驗證章節

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 11:22:47 +08:00
OG T
fe7fd7a3e0 feat(tests): ADR-018 LLM 測試策略三層架構
問題: LLM 測試因模型波動導致 CI 失敗

解決方案: 三層測試策略
- Tier 1 (CI): Schema 驗證 + Golden Responses
- Tier 2 (Nightly): 屬性測試 + Live LLM
- Tier 3 (Weekly): 語意相似度測試

新增檔案:
- ADR-018-llm-testing-strategy.md
- tests/llm_testing/ 框架
  - schema_validators.py: Pydantic Schema 驗證
  - property_validators.py: kubectl/風險等級驗證
  - golden_responses.py: 預錄回應管理
- tests/test_llm_tier1_schema.py: 35 個 Tier 1 測試

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 11:17:00 +08:00
OG T
281175921c docs: 更新 LOGBOOK - Phase 7.5-7.6 完成
- 新增 Phase 7.5-7.6 進度紀錄
- 更新當前狀態

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 11:09:55 +08:00
OG T
6f99113888 docs: 更新 LOGBOOK - #7 Playbook + ADR 審計 + Phase 13 審查 2026-03-26 10:54:46 +08:00
OG T
8a163609bf docs(adr): 更新 ADR-006/009/015 狀態
ADR-015: 標記為「已實作」 (Phase 16 R1 完成)
ADR-009: 標記為「已實作」 (Phase 9.1-9.5 全部完成)
ADR-006: 新增智能路由整合章節 (Phase 13.3)

首席架構師 ADR 審計 P0/P1 完成

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 10:45:29 +08:00
OG T
0003098c55 docs(adr): ADR-017 LLMOps Observability 三層觀測架構
建立 Phase 15 LLMOps 觀測架構決策文件,記錄:
- 三層觀測架構 (Langfuse + SignOz + Sentry)
- Langfuse 整合與 Deep Linking 實作
- Redis Streams Trace Context 傳遞機制
- 取樣率策略與成本估算

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 10:13:12 +08:00
OG T
24e35fee1b docs(adr): ADR-016 智能路由 (Smart Routing)
新增 Intent + Complexity → Model Selection 架構決策文件,
作為 ADR-006 (AI Fallback) 的補充,實現動態模型選擇。

- IntentClassifier: 關鍵字優先 + LLM 備援
- ComplexityScorer: 規則引擎加權評分
- AIRouter: 整合路由決策

Phase 13.3 #85-87

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 10:13:05 +08:00
OG T
42659a271a docs(adr): ADR-014 Dependency Governance 依賴治理
建立前端依賴治理規範文件,.dependency-cruiser.cjs 已參照此 ADR。

內容包含:
- Layer Model 四層架構定義
- Feature Isolation 規則說明
- CI 整合配置 (pnpm dep-check)
- Severity 分級策略

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 10:12:43 +08:00
OG T
496c569d51 docs: 紅區治理 + 部署文檔更新
- RED_ZONES.md: Tier 3/2 紅區清單
- setup-hooks.sh: Git Hook 安裝腳本
- infrastructure docs: 部署拓撲更新

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 09:55:58 +08:00
OG T
604e38cf07 docs: Phase 14 紅區治理 + Skills 01/03 更新
- CLAUDE.md: 紅區治理章節
- Skills 01/03: 版本更新
- ADR/Architecture: 標準化

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 09:55:47 +08:00
OG T
9ea246c7c2 docs(logbook): Phase 12.4 取消 + 狀態更新
統帥裁定: 現有 Ollama→Gemini→Claude fallback 已足夠

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 09:55:09 +08:00
OG T
60f8d770dd docs: Phase 15 首席架構師審查通過 + Phase 17 技術債規劃
審查結果:
- 架構分層:  通過
- leWOOOgo 5 問:  通過
- 依賴注入:  通過
- 測試: 46/46 通過

Phase 17 技術債 (統帥批准):
- agents.py: Router 直接存取 Redis
- metrics.py: Router 直接存取 DB

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 00:54:40 +08:00
OG T
1ac8965a7a feat(api): Phase 15.1 Langfuse LLMOps 整合 + 模型升級
## 新功能
- Langfuse 自建部署 (192.168.0.110:3100)
- langfuse_client.py - LLM 呼叫追蹤包裝
- OpenClaw 整合 Langfuse trace

## 模型升級 (統帥批准)
- 生產預設: llama3.2:3b → qwen2.5:7b-instruct
- 摘要任務: llama3.2:3b (速度優先)

## 配置更新
- requirements.txt: +langfuse>=2.0.0
- config.py: +LANGFUSE_* 設定
- models.json: 更新 Ollama 模型配置
- K8s: Secret + ConfigMap 更新

## 審查通過
- 模組化檢查 
- 核心測試 31/31 

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-26 00:32:19 +08:00
OG T
2fb011470e refactor(api): Phase 16 R3.4 完整 Repository 層整合
- incident_repository: 新增 get_status(), update_status() 方法
- incidents.py: feedback + debug 端點全面改用 Repository
- 消除所有 Router 層直接 DB 存取 (符合積木化鐵律)
- trust_engine.py: 修復 import 順序 lint 警告
- pre-commit hook: 修正誤判問題 (排除刪除行+註解行)
- LOGBOOK: 更新 Phase 16 完成狀態

驗證結果: 31/31 測試通過

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 23:47:01 +08:00
OG T
0afaea63f8 fix(api): Phase 16 R4 測試修復 - ParsedOperation 向後兼容
問題:
- test_action_parsing.py 導入路徑未更新 (舊: approvals.py)
- ParsedOperation dataclass 不支援 tuple 解包

修復:
- 更新測試導入至 src.services.operation_parser
- 新增 ParsedOperation.__iter__() 支援 tuple 解包

測試: 24/24 passed (100%)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 23:00:03 +08:00
OG T
aefd351e20 docs: 更新 LOGBOOK Phase 16 R4.1 進度
- OperationParser 抽取完成
- approvals.py 瘦身 1097 → 988 行
- Runner diag log 衝突問題記錄

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 21:57:38 +08:00
OG T
ef12228cc7 docs: Phase 16 絞殺者模式啟用 - 48hr 驗證開始
- USE_NEW_ENGINE=true 已在 Production 啟用
- 驗證期: 2026-03-26 16:04 → 2026-03-27 16:04
- 所有組件 healthy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 16:06:32 +08:00
OG T
485cce8c01 docs: 更新 Phase 16 R1.2-R1.3 完成狀態
- LOGBOOK: 記錄絞殺者模式完成 + 架構圖
- 下一步: 部署驗證 → USE_NEW_ENGINE=true → 48hr 監控

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 15:55:48 +08:00
OG T
643946e60c refactor(api): ADR-015 MCP 模組化架構重構
## 重構內容

符合 leWOOOgo 積木化原則:
- 新增 interfaces.py: MCPToolProvider ABC 定義
- 新增 registry.py: Provider 註冊中心 (DI 模式)
- 新增 providers/: K8s, SignOz, Database 具體實作
- 重構 mcp_bridge.py: 透過 ProviderRegistry 委派執行

## 修復 Code Review 問題

- 🔴 移除 _execute_stdio logging 敏感 parameters
- 🔴 修復 conversational-view.tsx i18n 硬編碼

## 新增檔案

- apps/api/src/plugins/mcp/interfaces.py
- apps/api/src/plugins/mcp/registry.py
- apps/api/src/plugins/mcp/providers/__init__.py
- apps/api/src/plugins/mcp/providers/k8s_provider.py
- apps/api/src/plugins/mcp/providers/signoz_provider.py
- apps/api/src/plugins/mcp/providers/database_provider.py
- docs/adr/ADR-015-mcp-modular-architecture.md
- .dependency-cruiser.cjs (Phase 14.2 準備)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 14:31:32 +08:00
OG T
0a1787e934 feat(ci): Phase 12.3 Ollama 自動化測試 (#67-68)
新增:
- CI Ollama Model Test job (連線測試 + 冒煙測試)
- test_model_regression.py (4 個回歸案例 + 準確度報告)
- Skills 03 更新模型選擇規則

Phase 12.1-12.2 完成記錄更新

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 11:26:10 +08:00
OG T
b13b063282 feat(web): Phase 11 對話式 AI UI/UX (#47-59)
Phase 11.1 對話式容器:
- ConversationalView 雙欄佈局 (左側列表 + 右側詳情)
- ApprovalThreadItem 風險等級 + 相對時間顯示
- SSE 即時更新整合

Phase 11.2 批次處理:
- BatchModeSelector 組件 (全部接受/逐一審核/CRITICAL Only)
- POST /api/v1/approvals/bulk-approve API 端點
- CRITICAL + DESTRUCTIVE 安全過濾 (禁止批次核准)

Phase 11.4 鍵盤快捷鍵:
- useKeyboardShortcuts hook (Y/N/方向鍵/Esc)
- Y 鍵長按 2 秒核准 + 頂部進度指示器
- 快捷鍵說明 Modal (Y/N 高亮顯示)

i18n: 100% next-intl 覆蓋

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 10:31:35 +08:00
OG T
749b8bc554 fix(api): 修復時區 import 排序與未使用變數 lint 錯誤
- 修正 import 順序 (standard → third-party → local)
- 修復 datetime/timedelta 未定義錯誤
- 移除未使用的 imports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 09:26:58 +08:00
OG T
2a2dac865a feat(api): 統一使用台北時區 UTC+8 (禁止 UTC)
- 新增 src/utils/timezone.py 時區工具函式
- 修改 11 個後端檔案,全部改用 now_taipei()
- 更新 HARD_RULES.md 加入時區鐵律章節
- 更新 Skills 02/04 加入時區禁令

🔴 HARD RULE: 禁止 datetime.utcnow() / datetime.now(UTC)
 正確做法: from src.utils.timezone import now_taipei

Memory: feedback_timezone_taipei.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 09:08:34 +08:00
OG T
1ab3f15816 fix(api): Lint fixes for sentry_webhook.py 2026-03-25 00:26:24 +08:00
OG T
3b8638b350 feat(api): Add sync-from-approvals endpoint for incident backfill
Fixes existing approvals created before b645981 that lack
corresponding incidents. Ensures "活躍事件" count matches
"待簽核" count.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-25 00:09:44 +08:00
OG T
7bd4cf30e3 fix(i18n): Add missing translations for agent, metrics, and language strategy
New translations:
- agent.state, agent.idle, agent.patrolling, etc.
- metrics.title, metrics.rps, metrics.errorRate, etc.

Updated docs:
- HARD_RULES.md: Added language strategy table
- Skills 01: Added language selection standards
- LOGBOOK.md: Updated progress

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 16:22:44 +08:00
OG T
9bff46a1b0 feat: integrate Sentry + fix CI/CD issues
Sentry Integration (補強 SignOz):
- Add @sentry/nextjs for frontend error tracking + session replay
- Add sentry-sdk[fastapi] for backend error tracking
- Create sentry.client/server/edge.config.ts
- Integrate with next.config.js + instrumentation.ts
- Add Sentry exception capture in FastAPI error handler
- Create deployment scripts for Self-Hosted @ 192.168.0.110

CI/CD Fixes:
- Fix F821 Undefined name 'Field' in incidents.py
- Add NEXT_PUBLIC_API_URL env var to CI build step
- Add build-arg to Docker build verification

E2E Test Improvements:
- Fix strict mode violations in dashboard-acceptance tests
- Add timeout increase for Phase 4 demo tests
- Make tests more resilient to UI variations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 15:19:52 +08:00
OG T
181d62a29e fix(cd): 新增 kubeconfig 驗證步驟 + 修正 PATH
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 13:15:17 +08:00
OG T
8159d22db9 refactor: ClawBot → OpenClaw 全域更名
- 刪除舊版 clawbot.py (已有新版 openclaw.py)
- 更新 models/ai.py 類型定義 (ClawBotAnalysisRequest/Response)
- 更新 api/v1/ai.py import 與註解
- 更新 Discord username
- 更新所有註解與文檔

依據: feedback_openclaw_naming.md (統帥 2026-03-20 正式命名決議)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 12:57:36 +08:00
OG T
ec7e45d538 fix(api): 修復 Incident-Approval 狀態同步 BUG
🔴 P0 核心功能修復:

問題: 審核後頁面重整,Y/n 按鈕重複出現
根因: resolve_incident_after_approval 在 Redis 缺失時靜默跳過

修復:
1. proposal_service.py - 處理 Redis 缺失情況
2. approvals.py - 添加詳細日誌追蹤
3. 設定 resolved_at 時間戳

防禦性增強:
- 日誌記錄 metadata 內容
- 記錄 resolve 成功/失敗狀態
- 警告無 incident_id 的情況

長期規範:
- 新增 feedback_incident_approval_sync.md 記憶
- 更新 HARD_RULES.md API 路徑規範

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 10:39:22 +08:00
OG T
6e644d4fd0 docs: 禁止 Mock 測試規則整合至 HARD_RULES + CLAUDE.md
統帥鐵律 (2026-03-24):
- HARD_RULES.md 新增 No Mock Testing 章節
- CLAUDE.md 新增測試主題引用
- Skill 05 新增禁止 Mock 詳細規範
- LOGBOOK.md 更新當前狀態

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 10:28:46 +08:00
OG T
8542632cff fix(ci): Harbor HTTP registry + Telegram secrets
CD 修復:
- 修復 buildx HTTP vs HTTPS 問題 (insecure registry 設定)
- 移除 UAT 環境 (違反 Memory 鐵律)
- 新增 Production 部署 Telegram 通知
- 修復 deploy-prod.yml 硬編碼 Token (改用 secrets)

docs:
- 新增 guidelines/ 結構化指引目錄
- ARCHITECTURE.md, FRONTEND.md, OPERATIONS.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 23:40:40 +08:00
OG T
00d94ca71c docs: CLAUDE.md 引用 HARD_RULES.md (禁止爆滿)
結構:
- CLAUDE.md: 精簡索引,只放引用連結
- docs/HARD_RULES.md: 詳細規則

這是早就溝通好的做法,不應該忘記。

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 23:32:35 +08:00
OG T
2b1264df05 docs: 完整治理架構 ADR-010/011/012 + CLAUDE.md 鐵律更新
2026-03-23 重大事故修復與治理:

1. ADR-010: Secrets 集中管理 (Bitwarden + Sealed Secrets)
2. ADR-011: NetworkPolicy 變更治理 (偵測 + 告警 + 人工決策)
3. ADR-012: 危險操作治理 (Tier 分級 + CI/CD 攔截 + 審計)
4. UX-001: 告警疲勞解決方案 (時間衰減 + 智慧分組)

CLAUDE.md 更新:
- 新增最高優先級鐵律 (禁止 ClawBot、OpenClaw 核心、禁止危險 API)
- 新增任務開始前必讀 Memory 對照表

事故教訓:
- Telegram Token 連續三次被 logOut 失效
- AWOOOI API 程式碼呼叫 logOut 導致災難
- 已停用 AWOOOI API Telegram,OpenClaw 為唯一 Gateway

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 19:44:56 +08:00
OG T
7478dc0254 feat(phase6-9): Complete modular architecture and Agent Teams
Phase 6.4 - Modular Architecture:
- Add lewooogo-brain adapters for LLM providers
- Add lewooogo-data dual memory (Redis + PostgreSQL)
- Implement consensus engine for multi-agent decisions
- Add incident memory service for historical context

Phase 9 - Agent Teams (Claude Agent SDK):
- Add base agent class with Claude Sonnet 4 integration
- Implement action planner, blast radius, and security agents
- Add agent API endpoints and proposal workflow
- Integrate ADR-009 OpenClaw Agent Teams architecture

DevOps & CI/CD:
- Add GitHub Actions CI/CD workflows (ci.yaml, cd.yaml)
- Add pre-commit hooks and secrets baseline
- Add docker-compose for local development
- Update Kubernetes network policies

Frontend Improvements:
- Add auto-healing error boundary component
- Update i18n messages for agent features
- Enhance dual-state incident card with execution feedback

Documentation:
- Add 7 ADRs covering MCP, design system, architecture decisions
- Update ARCHITECTURE_MEMORY.md with modular design
- Add GLOBAL_RULES.md and SOUL.md for project identity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-23 18:40:36 +08:00