fix(alerts): 補齊處置結果與人工通知契約
Some checks failed
CD Pipeline / tests (push) Failing after 45s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Code Review / ai-code-review (push) Successful in 12s

This commit is contained in:
Your Name
2026-05-31 15:41:09 +08:00
parent 03f2abf576
commit 3d8b395032
14 changed files with 888 additions and 75 deletions

View File

@@ -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": {