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

@@ -1010,7 +1010,7 @@ class OpenClawService:
raw_confidence=data.get("confidence"),
forcing_collab=True,
)
data["confidence"] = 0.5 # 低信心分數
data["confidence"] = 0.0 # 🔴 LLM 未返回信心度,設為 0
data["primary_responsibility"] = "COLLAB" # 強制協作處理
# Step 3: 使用 Pydantic 驗證 (會自動正規化 risk_level, data_impact 等)
@@ -1204,7 +1204,7 @@ Trace URL: {signoz_trace_url}
## 🔍 Expert System Initial Diagnosis
- **Matched Rule**: {expert_context.get('initial_diagnosis', 'unknown')}
- **Diagnosis**: {expert_context.get('diagnosis_description', 'N/A')}
- **Confidence**: {expert_context.get('expert_confidence', 0.5):.0%}
- **Confidence**: {expert_context.get('expert_confidence', 0.0):.0%}
- **Requires Human Review**: {'Yes' if expert_context.get('requires_human_review') else 'No'}
- **Suggested Diagnosis Commands**:
{diagnosis_cmds_str}