fix(awooop): show diagnostic ops as non repair
This commit is contained in:
@@ -2753,6 +2753,20 @@ def _safe_int(value: Any) -> int:
|
||||
return 0
|
||||
|
||||
|
||||
def _has_repair_execution_evidence(facts: dict[str, Any]) -> bool:
|
||||
return (
|
||||
_safe_int(facts.get("auto_repair_execution_records")) > 0
|
||||
or _safe_int(facts.get("effective_execution_records")) > 0
|
||||
)
|
||||
|
||||
|
||||
def _has_nonrepair_operation_evidence(facts: dict[str, Any]) -> bool:
|
||||
return (
|
||||
_safe_int(facts.get("automation_operation_records")) > 0
|
||||
and not _has_repair_execution_evidence(facts)
|
||||
)
|
||||
|
||||
|
||||
def _latest_remediation_history_item(
|
||||
history: dict[str, Any] | None,
|
||||
) -> dict[str, Any]:
|
||||
@@ -3509,6 +3523,8 @@ def _build_awooop_status_chain(
|
||||
)
|
||||
auto_repair_records = _safe_int(facts.get("auto_repair_execution_records"))
|
||||
operation_records = _safe_int(facts.get("automation_operation_records"))
|
||||
has_repair_execution = _has_repair_execution_evidence(facts)
|
||||
has_nonrepair_operation = _has_nonrepair_operation_evidence(facts)
|
||||
gateway_total = _safe_int(facts.get("mcp_gateway_total"))
|
||||
km_entries = _safe_int(facts.get("knowledge_entries"))
|
||||
needs_human = bool(truth_status.get("needs_human"))
|
||||
@@ -3516,13 +3532,16 @@ def _build_awooop_status_chain(
|
||||
if verdict == "auto_repaired_verified":
|
||||
repair_state = "auto_repaired_verified"
|
||||
next_step = "monitor_for_regression"
|
||||
elif auto_repair_records > 0 or operation_records > 0:
|
||||
elif has_repair_execution:
|
||||
repair_state = (
|
||||
"executed_pending_verification"
|
||||
if str(verification) == "missing"
|
||||
else "executed"
|
||||
)
|
||||
next_step = "verify_execution_result"
|
||||
elif has_nonrepair_operation:
|
||||
repair_state = "diagnostic_or_audit_recorded"
|
||||
next_step = "manual_review_or_collect_repair_evidence"
|
||||
elif remediation_state == "read_only":
|
||||
repair_state = "read_only_dry_run"
|
||||
next_step = "approve_or_escalate_from_awooop"
|
||||
|
||||
Reference in New Issue
Block a user