Update app.py
Browse files
app.py
CHANGED
|
@@ -481,23 +481,23 @@ class EnhancedReliabilityEngine:
|
|
| 481 |
# Traditional detection (for compatibility)
|
| 482 |
is_anomaly = anomaly_detector.detect_anomaly(event)
|
| 483 |
|
| 484 |
-
# Enhanced severity classification using agent confidence
|
| 485 |
-
agent_confidence = 0.0
|
| 486 |
-
if
|
| 487 |
-
|
| 488 |
-
else:
|
| 489 |
-
|
| 490 |
-
|
| 491 |
|
| 492 |
-
# Set severity based on confidence
|
| 493 |
-
if agent_confidence > 0.8:
|
| 494 |
-
|
| 495 |
-
elif agent_confidence > 0.6:
|
| 496 |
-
|
| 497 |
-
elif agent_confidence > 0.4:
|
| 498 |
-
|
| 499 |
-
else:
|
| 500 |
-
|
| 501 |
|
| 502 |
# Policy evaluation
|
| 503 |
healing_actions = policy_engine.evaluate_policies(event)
|
|
|
|
| 481 |
# Traditional detection (for compatibility)
|
| 482 |
is_anomaly = anomaly_detector.detect_anomaly(event)
|
| 483 |
|
| 484 |
+
# Enhanced severity classification using agent confidence
|
| 485 |
+
agent_confidence = 0.0
|
| 486 |
+
if agent_analysis and 'incident_summary' in agent_analysis:
|
| 487 |
+
agent_confidence = agent_analysis.get('incident_summary', {}).get('anomaly_confidence', 0)
|
| 488 |
+
else:
|
| 489 |
+
# Fallback to basic anomaly detection confidence
|
| 490 |
+
agent_confidence = 0.8 if is_anomaly else 0.1
|
| 491 |
|
| 492 |
+
# Set severity based on confidence
|
| 493 |
+
if agent_confidence > 0.8:
|
| 494 |
+
event.severity = EventSeverity.CRITICAL
|
| 495 |
+
elif agent_confidence > 0.6:
|
| 496 |
+
event.severity = EventSeverity.HIGH
|
| 497 |
+
elif agent_confidence > 0.4:
|
| 498 |
+
event.severity = EventSeverity.MEDIUM
|
| 499 |
+
else:
|
| 500 |
+
event.severity = EventSeverity.LOW
|
| 501 |
|
| 502 |
# Policy evaluation
|
| 503 |
healing_actions = policy_engine.evaluate_policies(event)
|