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
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
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
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
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
163d94a35b
docs(skills): Phase 14.2 CI/CD 架構審查 + dependency-cruiser 整合
...
- Skill 04: Runner 殭屍進程修復 + cancel-in-progress: false
- Skill 05: 新增 SRE QA 內容
- Skill 06: dependency-cruiser 依賴治理 (Layer Model + ADR-014)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 09:53:56 +08:00
OG T
414e59d55f
docs: Phase 15 觀測架構更新 Skills 04/05
...
Skill 04 v1.5:
- 新增 Phase 15 三層觀測架構章節
- Deep Linking URL 格式說明
- Trace Context 傳遞架構圖
Skill 05 v1.3:
- 新增 Phase 15 觀測性測試章節
- 三系統健康檢查腳本
- Trace Context 驗證測試
參考:
- project_phase15_langfuse.md (Phase 15 完整記錄)
- project_phase17_tech_debt.md (技術債規劃)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 00:58:27 +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
20984fd354
feat(api): Phase 16 R1.2 完善 PostgreSQL 整合 + 封存策略
...
lewooogo-brain:
- 新增 IIncidentDbAdapter Protocol (DI 模式)
- load_incident 支援 Episodic Memory 回填
- persist_incident 透過 db_adapter 執行
apps/api:
- 新增 IncidentDbAdapter 實現 (SQLAlchemy 操作封裝)
- 絞殺者模式完整整合 lewooogo-brain + PostgreSQL
Skill 06 v1.4:
- 新增「封存而非刪除」策略 (統帥裁示)
- 封存目錄結構 + ARCHIVE_LOG.md 格式
- 90 天保留期 + 48hr 驗證期
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 15:31:03 +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
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
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
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
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
OG T
182410a995
docs(skills): Add Chinese action parsing lesson to Skill 03
...
Record the 2026-03-23 incident where Y button failed because
LLM generated Chinese action strings that couldn't be parsed
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 14:28:40 +08:00
OG T
8eaf2acb0d
docs(skills): add guardrails and dry-run principles
...
- Skill 03: Add proposal guardrails (forbidden commands, namespace binding)
- Skill 04: Add idempotency and garbage collection awareness
- Skill 05: Add dry-run first principle for destructive operations
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 10:59:20 +08:00
OG T
c4dae39dfa
docs(skills): add 2026-03-23 production incident learnings
...
New sections added:
01-frontend-aesthetics:
- Polling + Operation Race Condition pattern
02-lewooogo-backend-core:
- Worker Redis dedicated connection pool (socket_timeout=None)
- SQLite prohibition decree
- Function rename global search requirement
04-awoooi-devops-commander:
- NetworkPolicy Pod Selector (system label)
- Zombie consumer group cleanup
- PostgreSQL initialization checklist
05-awoooi-sre-qa (updated earlier):
- CrashLoopBackOff diagnosis
- Telegram health check
- Frontend race condition diagnosis
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 10:46:14 +08:00
OG T
d050dd1ecc
docs(skills): add production debugging patterns from 2026-03-23 incidents
...
New sections in 05-awoooi-sre-qa.md:
- Worker CrashLoopBackOff diagnosis procedure
- Telegram alert system health check
- Frontend race condition diagnosis (Polling vs API)
- Import name mismatch detection pattern
Lessons learned from:
- 7+ hour outage due to undetected worker crash
- Approval card flicker due to Zustand polling race condition
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 09:21:13 +08:00
OG T
1c66a05335
feat(qa): add Playwright frontend visual verification script
...
- Create apps/web/scripts/verify-frontend.js (無頭偵察兵)
- Detects Console errors (zero-error policy)
- Verifies DOM content (INC-*, RPS, Latency)
- Takes full-page screenshot for evidence
- Update SRE Skill with mandatory verification step
Constitutional Law 14/15: No curl-only verification allowed!
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 01:19:08 +08:00
OG T
c66b4dfb22
feat(agents): implement 6 core Claude skills for auto-pilot validation
...
Skills created:
- 01-awoooi-frontend-aesthetics.md: Nothing.tech visual standards + i18n
- 02-lewooogo-backend-core.md: FastAPI four iron laws + OTEL
- 03-openclaw-cognitive-expert.md: Incident Engine + Multi-Sig + Redis
- 04-awoooi-devops-commander.md: K3s + Docker + Tier 1-3 authorization
- 05-awoooi-sre-qa.md: Playwright + automated QA (no human testing)
- 06-awoooi-monorepo-master.md: Git + dependencies + LOGBOOK updates
Added skill routing to .awoooi-agent-rules.md Session startup flow.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 00:20:51 +08:00