OG T
8724ed7dcf
fix(mcp): P1 修復 - DI 一致性 + 測試補充 + 配置優化
...
首席架構師審查 P1 修復清單:
P1-1 RAG Provider DI 模式一致性:
- 支援 rag_service 參數注入
- 新增 close() 方法
- TYPE_CHECKING 延遲導入
P1-3 RAG 測試補充:
- test_rag_provider.py (9 tests)
- DI 注入/Lazy Load/Tool Schema/驗證/Close
P1-4 Grafana Config 快取優化:
- URL/Key 首次查詢後快取
- 減少重複 settings 存取
P1-5 Embedding 維度配置化:
- MODEL_DIMENSIONS 字典 (qwen/llama/nomic)
- default_dimension 參數
- 支援更多模型
測試: 9/9 PASSED
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-29 16:23:30 +08:00
OG T
f1117a3e79
chore: trigger CD build for RAGProvider
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 18:44:30 +08:00
OG T
539f14bcd5
feat(api): Phase 13.2 #84 RAG Provider + Gemini 優先切換
...
1. 新增 RAGProvider MCP Tool Provider
- search_runbook: 語義搜尋維運手冊
- index_documents: 索引文檔
- get_index_stats: 取得索引統計
2. 更新 AI_FALLBACK_ORDER 為 Gemini 優先
- 臨時措施:Ollama CPU 推論緩慢導致 mock_fallback
- 預計 2026-03-27 切回 Ollama
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 18:21:24 +08:00
OG T
30153496d1
fix(api): 修復全部 lint 錯誤 (ruff --fix)
...
- Import sorting (I001)
- Unused imports (F401)
- f-string without placeholders (F541)
- Loop variable unused (B007)
- zip() strict parameter (B905)
- Exception chaining (B904)
- collections.abc imports (UP035)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 16:06:20 +08:00
OG T
e58da5c534
feat(api): Phase 13.2 #83 Grafana MCP Tool
...
New MCP provider for Grafana dashboard integration:
- list_dashboards: List available dashboards with filtering
- get_dashboard: Get dashboard details by UID
- get_panel_data: Query panel data via Grafana Query API
- generate_dashboard_url: Generate shareable dashboard URLs
Security:
- API key authentication (Bearer token)
- Dashboard UID validation (alphanumeric + dash/underscore)
- Read-only operations only
- 30s request timeout
Config:
- GRAFANA_URL (default: http://192.168.0.188:3000 )
- GRAFANA_API_KEY
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-26 15:36:17 +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
cdbd6f0fa6
fix(api): 修復 MCP providers lint 錯誤
...
- interfaces.py: 修正 import 排序
- signoz_provider.py: 移除未使用變數
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 14:44: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
7a8f869104
feat(api): Phase 13.2 #81 PostgreSQL MCP Tool 整合
...
整合 Approval/Incident/Timeline 查詢到 MCP Bridge:
- list_approvals: 列出授權請求 (可依狀態篩選)
- get_approval: 取得單一授權詳情
- list_incidents: 列出 Incident (可依狀態篩選)
- list_timeline: 列出最近時間軸事件
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 12:46:52 +08:00
OG T
23b753dbec
feat(api): Phase 13.2 #79 SignOz MCP Tool 整合
...
整合真實 SignOzClient 到 MCP Bridge:
- gold_metrics: RPS + Error Rate + P99 Latency
- trace_url: 動態 Trace URL 生成
- system_metrics: CPU/Disk 系統指標
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 12:44:46 +08:00
OG T
d31160f4e1
feat(api): Phase 13.2 #80 Kubernetes MCP Tool real implementation
...
- Integrate real ActionExecutor instead of mock responses
- kubectl_get: Execute real kubectl get with JSON output
- kubectl_delete: Dry-run validation + actual pod deletion
- kubectl_scale: Real kubectl scale command
- kubectl_restart: Deployment rollout restart with validation
- Database query placeholder for #81
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-25 12:30:13 +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
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
6f049877fc
fix(lint): ruff auto-fix + lewooogo-core src 加入 git
...
- Python: ruff --fix 修復 280 個 lint 錯誤
- lewooogo-core: src/ 目錄未追蹤,導致 CI eslint 失敗
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-03-23 23:51:37 +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
196d269b92
feat: add all application source code
...
- apps/api: FastAPI backend with Dockerfile
- apps/web: Next.js frontend with Dockerfile
- apps/sensor: Signal collection agent
- packages: shared packages
Co-Authored-By: Claude <noreply@anthropic.com >
2026-03-22 18:57:44 +08:00