Files
OG T 588b0d745b
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 1m44s
fix(aiops): 修復 sensors=0/0 根因 — MCPToolRegistry 從未在 startup 初始化
三個問題同時修復:

1. main.py: 補上 init_mcp_tool_registry() 呼叫
   - ADR-081 Phase 1 建立了 MCPToolRegistry 但從未在 lifespan startup 被呼叫
   - 導致 PreDecisionInvestigator sensors=0/0,evidence_summary 永遠空白
   - 空白 evidence → Diagnostician 永遠 ABSTAIN

2. signal_producer.py: str(dict) → json.dumps()
   - labels/annotations 用 Python str() 序列化,寫入 Redis 後無法反序列化

3. brain/incident_engine.py: 新增 _parse_dict_field() helper
   - 從 Redis 讀回的 labels/annotations 可能是 JSON 字串
   - isinstance(..., dict) 防禦不足,需先 json.loads()

2026-04-16 ogt + Claude Sonnet 4.6(亞太): 飛輪感官修復

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 15:35:19 +08:00
..

leWOOOgo Brain

AI Reasoning & Decision Engine for AWOOOI 2.0

Overview

leWOOOgo Brain 是 AWOOOI 智能運維平台的 AI 推論核心積木,負責:

  • 決策提案: 分析 Incident 生成修復建議
  • 事件處理: 聚合告警、分析爆炸半徑
  • Skill 載入: 動態載入專業技能模組

Installation

# 在 apps/api 中使用
pip install -e ../../packages/lewooogo-brain

Usage

from lewooogo_brain.interfaces import IProposalEngine
from lewooogo_brain.engines import ProposalEngine

# 使用決策引擎
engine = ProposalEngine(memory=memory_provider)
proposal, message = await engine.generate(incident_id)

Modules

Module Description
interfaces/ ABC 定義
engines/ 推論引擎
skills/ Skill 載入器

ADR Reference