fix(alerts): 補齊處置結果與人工通知契約
This commit is contained in:
@@ -57,6 +57,7 @@ from src.services.ollama_failover_manager import (
|
||||
get_ollama_failover_manager,
|
||||
)
|
||||
from src.services.ollama_health_monitor import HealthReport, HealthStatus
|
||||
from src.services.operator_outcome import build_operator_outcome
|
||||
from src.services.run_state_machine import transition
|
||||
|
||||
logger = structlog.get_logger(__name__)
|
||||
@@ -3581,6 +3582,20 @@ def _build_awooop_status_chain(
|
||||
]
|
||||
if fetch_error:
|
||||
blockers.append("truth_chain_fetch_failed")
|
||||
outcome = {}
|
||||
if isinstance(quality.get("operator_outcome"), dict):
|
||||
outcome = dict(quality["operator_outcome"])
|
||||
else:
|
||||
outcome = build_operator_outcome(
|
||||
truth_status=truth_status,
|
||||
automation_quality=quality,
|
||||
remediation_state=remediation_state,
|
||||
fetch_error=fetch_error,
|
||||
source_id=source_id,
|
||||
)
|
||||
if outcome:
|
||||
needs_human = bool(needs_human or outcome.get("needs_human"))
|
||||
next_step = str(outcome.get("next_action") or next_step)
|
||||
|
||||
return {
|
||||
"schema_version": "awooop_status_chain_v1",
|
||||
@@ -3594,6 +3609,7 @@ def _build_awooop_status_chain(
|
||||
"verification": str(verification),
|
||||
"needs_human": needs_human,
|
||||
"next_step": next_step,
|
||||
"operator_outcome": outcome,
|
||||
"blockers": blockers[:8],
|
||||
"fetch_error": fetch_error,
|
||||
"evidence": {
|
||||
|
||||
Reference in New Issue
Block a user