OG T
|
e7e3fc8e00
|
refactor(api): Phase 22 P2 Protocol 簽名修正 + 缺失方法補齊
E2E Health Check / e2e-health (push) Successful in 16s
- IApprovalRepository.create() 簽名由 ApprovalRequestCreate 改為 dict (與實作一致)
- 補齊 find_by_fingerprint() 和 increment_hit_count() Protocol 方法
2026-03-31 Claude Code (首席架構師 P2 修復)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-31 16:28:37 +08:00 |
|
OG T
|
770586dd85
|
feat(api): Phase 18.3 K8s Executor 整合自動修復
E2E Health Check / e2e-health (push) Successful in 17s
2026-03-31 Claude Code (統帥批准)
新增功能:
- execute_auto_repair() 實際執行 K8s 操作
- restart_deployment: rollout restart
- restart_pod: 刪除 Pod 觸發重建
- clear_cache: 安全清理 Redis 快取
安全機制:
- _check_repair_cooldown(): 防止修復風暴
- 同一資源 5 分鐘內最多修復 3 次
- 超過限制升級為 MEDIUM 風險
- Redis 計數器 + 自動過期
修復閉環完整流程:
執行失敗 → FailureWatcher → AI 分析 → 風險評估
├─ LOW + 冷卻期內 → 自動修復 → 揭露通知
└─ MEDIUM/CRITICAL 或超限 → Telegram 請求授權
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-31 12:10:52 +08:00 |
|
OG T
|
8e2d7c3706
|
feat(api): Phase 18.2 FailureWatcher 失敗自動修復閉環
E2E Health Check / e2e-health (push) Successful in 17s
2026-03-31 Claude Code (統帥批准)
新增:
- IFailureWatcher Protocol (interfaces.py)
- FailureWatcherService 失敗監聽服務
- AI 分析失敗原因 (規則引擎 + LLM 深度分析)
- 風險等級評估 (LOW/MEDIUM/CRITICAL)
- LOW 風險自動修復 (Phase 18.3 實際執行)
- MEDIUM/CRITICAL 推送 Telegram 請求授權
整合:
- executor._write_audit_log() 失敗時觸發 FailureWatcher
- 失敗分類寫入 AuditLog.failure_classification
- 自動修復結果寫入 AuditLog.auto_repair_result
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-31 12:01:56 +08:00 |
|
OG T
|
4c0f15d7b3
|
fix: 修復 3 個 P0 Bug
E2E Health Check / e2e-health (push) Successful in 18s
1. E2E Health: Docker 容器無法訪問內網 IP,改用公網域名
2. metrics_repository: asyncpg 需要 datetime 物件,不能用字串
3. metrics_repository: PostgreSQL 用 date_trunc 而非 strftime
2026-03-31 ogt: 首席架構師審查發現並修復
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-31 11:27:51 +08:00 |
|
OG T
|
13bb1496b0
|
refactor(api): Phase B P1 可靠性強化 (2 項)
E2E Health Check / e2e-health (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
1. send_cicd_progress 重試機制 (指數退避 1,2,4 秒)
2. K8s Repository 封裝 (IK8sRepository + K8sRepository)
首席架構師審查 P1 改進 - 模組化合規
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-30 01:52:59 +08:00 |
|
OG T
|
f5b19cf108
|
feat(learning): 實作 Playbook 信心度調整機制 (ADR-030)
- 新增 _promote_playbook: 高評分提升信心度 +0.1
- 新增 _demote_playbook: 低評分降低信心度 -0.15
- 新增 find_by_source_incident: 按 incident_id 查詢 Playbook
- 新增 adjust_confidence: 信心度調整 + 狀態自動轉換
- 新增 Playbook.failure_rate 屬性
自動狀態轉換:
- ai_confidence >= 0.9 + DRAFT → 自動 APPROVED
- ai_confidence < 0.3 + failure_rate > 50% → 自動 DEPRECATED
測試: 13 案例全部通過
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-29 22:10:49 +08:00 |
|
OG T
|
50c055b547
|
feat(api): Phase D-G P0 修正 - Learning Repository 積木化
新增:
- ILearningRepository Protocol (interfaces.py)
- LearningRepository (Redis 持久化層)
- Learning API 端點 (/api/v1/learning/*)
- LearningService.get_recommended_fix() 方法
- LearningService.get_learning_summary() 方法
修正:
- Service 不直接依賴 Redis Client (透過 Repository)
- 符合 leWOOOgo 積木化原則
- 首席架構師審查: 74/100 → 92/100
更新:
- ADR-030: 新增 Phase D-G P0 修正章節
- Skill 02: v1.9 → v2.0
- Runner 修復: 序列建構解決 _runner_file_commands 衝突
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-29 11:03:51 +08:00 |
|
OG T
|
f1b037bb0c
|
refactor(api): playbook_rag.py 模組化改造 (P1 違規修復)
修復 P1 違規:
- Line 29: Service 直接 import Redis → Repository Pattern
- Line 156: 自建 httpx.AsyncClient → DI 注入
變更:
- 新增 IEmbeddingCacheRepository Protocol (interfaces.py)
- 新增 EmbeddingCacheRepository 實作 (embedding_repository.py)
- PlaybookRAGService 改用 DI 注入 http_client + embedding_cache
- get_playbook_rag_service() 改為 async factory
- PlaybookService 改用 lazy initialization
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-27 10:07:30 +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
|
a470a514e6
|
refactor(api): Phase 17 P0 Router 層違規全部修復
消除 Router 層直接存取 Redis/DB 的違規:
incidents.py (6 處):
- 改用 IncidentService.get_active_incidents()
- 改用 IncidentService.get_from_working_memory()
- 改用 IncidentService.update_outcome()
- 改用 IncidentService.resolve_incident()
- 改用 IncidentService.find_by_proposal_id()
stats.py (8 處):
- 新增 StatsService 封裝快取邏輯
- 移除直接 Redis 存取
audit_logs.py (7 處):
- 新增 AuditLogRepository 封裝 DB 操作
- Router 改用 Repository 層
webhooks.py (2 處):
- 新增 SignalProducerService 封裝 Redis Stream
- 改用 IncidentService.save_to_working_memory()
符合 leWOOOgo 積木化規範:
Router → Service → Repository → DB/Redis
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-26 13:06:47 +08:00 |
|
OG T
|
698687f092
|
feat(api): #7 Playbook 萃取功能 (Phase 7.1-7.4)
實作內容:
- models/playbook.py: Playbook 資料模型 + Request/Response
- repositories/playbook_repository.py: Redis 雙層儲存
- repositories/interfaces.py: IPlaybookRepository Protocol
- services/playbook_service.py: 業務邏輯 (萃取/推薦/核准)
- api/v1/playbooks.py: REST API 端點
API 端點:
- POST /playbooks/extract/{incident_id} - 從成功案例萃取
- POST /playbooks/recommend - 症狀匹配推薦
- POST /playbooks/{id}/approve - 人工核准
- GET/PATCH/DELETE /playbooks/{id} - CRUD
遵循 leWOOOgo 積木化: Router → Service → Repository
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-26 10:54:13 +08:00 |
|
OG T
|
e7f361db50
|
refactor(api): Phase 17 metrics.py Router 層違規修復
移除 Router 層直接 DB 存取,遵循 leWOOOgo 積木化原則:
- 新增 IMetricsRepository Protocol (interfaces.py)
- 新增 MetricsDBRepository 封裝 DB 查詢
- 新增 MetricsService 封裝業務邏輯
- Router 層只做 HTTP 轉發
架構: Router → Service → Repository → PostgreSQL
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-26 10:01:57 +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
|
4b3d98cd0b
|
fix(api): 修復 Repository 層 lint 錯誤
- 移除未使用的 imports
- 修正 import 排序
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-25 22:25:52 +08:00 |
|
OG T
|
75ef8fee0c
|
feat(api): Phase 16 R3.3 Repository 實作 + CI 修復
新增:
- ApprovalDBRepository: Approval CRUD 操作
- IncidentDBRepository: Incident CRUD 操作
- get_approval_repository/get_incident_repository 函數
修復:
- .gitignore 新增 .claude/worktrees/ (防止 CI 失敗)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-25 21:22:02 +08:00 |
|
OG T
|
fe76d0b108
|
feat(api): Phase 16 R3.1-R3.2 Repository 介面定義
新增:
- IApprovalRepository Protocol
- IIncidentRepository Protocol
- ITimelineRepository Protocol
設計: DI 友好的 Protocol 介面,Service 層只依賴抽象
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-25 21:17:51 +08:00 |
|