fix(api): 全面清除假信心分數 - 遵循 feedback_confidence_truthfulness.md

🔴 違規修正: 規則匹配/Expert System 不是 AI 分析,confidence 必須 = 0.0

修正檔案:
- agents/action_planner.py: 0.9 → 0.0
- agents/blast_radius.py: 0.85/0.5/0.9 → 0.0
- agents/security.py: 計算公式 → 0.0
- signoz_webhook.py: 0.7 → 0.0
- auto_approve.py: default 0.5 → 0.0
- ci_auto_repair.py: 整個計算函數 → return 0.0
- error_analyzer_service.py: default 0.5 → 0.0
- intent_classifier.py: 計算公式 → 0.0
- openclaw.py: default 0.5 → 0.0
- resource_resolver.py: 0.8 → 0.0
- k8s_naming.py: 0.9/0.7 → 0.0

只有 LLM 真實分析返回的 confidence 才能 > 0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-29 16:00:46 +08:00
parent b5602e23db
commit 938df7f291
11 changed files with 27 additions and 48 deletions

View File

@@ -389,7 +389,7 @@ class ActionPlannerAgent(BaseAgent[ActionPlan]):
result = ActionPlan(
agent_name=self.AGENT_NAME,
status=AgentStatus.SUCCESS,
confidence=0.9,
confidence=0.0, # 🔴 規則匹配/模板,非 AI 分析
analysis=analysis,
latency_ms=latency_ms,
action_type=template["action_type"],

View File

@@ -270,7 +270,7 @@ class BlastRadiusAgent(BaseAgent[BlastRadiusResult]):
result = BlastRadiusResult(
agent_name=self.AGENT_NAME,
status=AgentStatus.SUCCESS,
confidence=0.85, # 基於依賴圖的信心分數
confidence=0.0, # 🔴 規則/圖譜分析,非 AI
analysis=analysis,
latency_ms=latency_ms,
impact_level=impact_level,
@@ -331,7 +331,7 @@ class BlastRadiusAgent(BaseAgent[BlastRadiusResult]):
affected.append(AffectedService(
name=target_service,
impact_type="direct",
confidence=0.5,
confidence=0.0, # 🔴 規則推斷,非 AI
reason="未知服務,無法確定依賴關係",
))
return affected, 1000, [target_service]
@@ -391,7 +391,8 @@ class BlastRadiusAgent(BaseAgent[BlastRadiusResult]):
chain.append(dep)
impact_type = "indirect" if depth == 0 else "transitive"
confidence = 0.9 - (depth * 0.1)
# 🔴 規則/圖譜推斷,非 AI 分析
confidence = 0.0
affected.append(AffectedService(
name=dep,

View File

@@ -279,8 +279,8 @@ class SecurityAgent(BaseAgent[SecurityResult]):
risk_factors.append("未偵測到明顯風險因素")
max_risk_score = 2.0 # 基礎低風險
# 計算信心分數 (規則匹配越多,信心越高)
confidence = min(0.95, 0.7 + len(risk_factors) * 0.05)
# 🔴 規則匹配,非 AI 分析,信心度設 0
confidence = 0.0
# 生成分析摘要
if max_risk_score >= 8.0: