Update app.py
Browse files
app.py
CHANGED
|
@@ -22,9 +22,6 @@ import plotly.graph_objects as go
|
|
| 22 |
import plotly.express as px
|
| 23 |
import pandas as pd
|
| 24 |
from plotly.subplots import make_subplots
|
| 25 |
-
import matplotlib.pyplot as plt
|
| 26 |
-
from matplotlib import font_manager
|
| 27 |
-
import seaborn as sns
|
| 28 |
|
| 29 |
# Import OSS components
|
| 30 |
try:
|
|
@@ -42,188 +39,402 @@ except ImportError:
|
|
| 42 |
logger.warning("OSS package not available")
|
| 43 |
|
| 44 |
# ============================================================================
|
| 45 |
-
#
|
| 46 |
# ============================================================================
|
| 47 |
|
| 48 |
-
class
|
| 49 |
-
"""
|
| 50 |
|
| 51 |
def __init__(self):
|
| 52 |
-
|
| 53 |
-
self.
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
-
def
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
"""Record user action with details"""
|
| 81 |
-
if session_id in self.sessions:
|
| 82 |
-
self.sessions[session_id]["actions"].append({
|
| 83 |
-
"timestamp": time.time(),
|
| 84 |
-
"action": action,
|
| 85 |
-
"details": details,
|
| 86 |
-
})
|
| 87 |
-
|
| 88 |
-
# Update global historical trends
|
| 89 |
-
if "revenue_protected" in details:
|
| 90 |
-
self.global_stats["historical_trends"].append({
|
| 91 |
-
"timestamp": time.time(),
|
| 92 |
-
"revenue": details["revenue_protected"],
|
| 93 |
-
"session": session_id[-6:], # Last 6 chars for anonymity
|
| 94 |
-
})
|
| 95 |
-
self.global_stats["total_revenue_protected"] += details["revenue_protected"]
|
| 96 |
-
|
| 97 |
-
self.global_stats["total_executions"] += 1
|
| 98 |
-
|
| 99 |
-
# Update peak performance
|
| 100 |
-
if details.get("revenue_protected", 0) > self.global_stats["peak_performance"]["largest_incident_resolved"]:
|
| 101 |
-
self.global_stats["peak_performance"]["largest_incident_resolved"] = details["revenue_protected"]
|
| 102 |
|
| 103 |
-
def
|
| 104 |
-
"""
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
-
def
|
| 120 |
-
"""Create
|
| 121 |
-
if not self.
|
| 122 |
return go.Figure()
|
| 123 |
|
| 124 |
-
# Prepare data
|
| 125 |
-
|
| 126 |
-
|
|
|
|
| 127 |
|
| 128 |
-
#
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
|
|
|
| 138 |
|
| 139 |
-
#
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
x
|
| 143 |
-
y
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
),
|
| 151 |
-
row=1, col=1
|
| 152 |
-
)
|
| 153 |
|
| 154 |
-
#
|
| 155 |
-
|
| 156 |
-
fig.add_trace(
|
| 157 |
-
go.Scatter(
|
| 158 |
-
x=df['timestamp'],
|
| 159 |
-
y=cumulative_rev,
|
| 160 |
-
mode='lines',
|
| 161 |
-
name='Cumulative Revenue',
|
| 162 |
-
line=dict(color='#2196F3', width=3, dash='dash'),
|
| 163 |
-
fill='tozeroy',
|
| 164 |
-
fillcolor='rgba(33, 150, 243, 0.1)'
|
| 165 |
-
),
|
| 166 |
-
row=1, col=2
|
| 167 |
-
)
|
| 168 |
|
| 169 |
-
#
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
-
#
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
'axis': {'range': [None, max(500000, avg_revenue * 1.5)]},
|
| 192 |
-
'bar': {'color': "#4CAF50"},
|
| 193 |
-
'steps': [
|
| 194 |
-
{'range': [0, 100000], 'color': '#FFEBEE'},
|
| 195 |
-
{'range': [100000, 300000], 'color': '#FFCDD2'},
|
| 196 |
-
{'range': [300000, 500000], 'color': '#EF9A9A'}
|
| 197 |
-
],
|
| 198 |
-
'threshold': {
|
| 199 |
-
'line': {'color': "red", 'width': 4},
|
| 200 |
-
'thickness': 0.75,
|
| 201 |
-
'value': 250000
|
| 202 |
-
}
|
| 203 |
-
}
|
| 204 |
),
|
| 205 |
-
|
| 206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
|
| 208 |
# Update layout
|
| 209 |
fig.update_layout(
|
| 210 |
-
title="
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
|
|
|
| 215 |
)
|
| 216 |
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
|
| 225 |
return fig
|
| 226 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
# ============================================================================
|
| 228 |
# ENHANCED VISUALIZATION ENGINE
|
| 229 |
# ============================================================================
|
|
@@ -375,144 +586,6 @@ class EnhancedVisualizationEngine:
|
|
| 375 |
)
|
| 376 |
|
| 377 |
return fig
|
| 378 |
-
|
| 379 |
-
@staticmethod
|
| 380 |
-
def create_3d_rag_graph(incidents: List[Dict], outcomes: List[Dict], edges: List[Dict]):
|
| 381 |
-
"""Create 3D visualization of RAG graph"""
|
| 382 |
-
|
| 383 |
-
if not incidents:
|
| 384 |
-
return go.Figure()
|
| 385 |
-
|
| 386 |
-
# Prepare 3D coordinates
|
| 387 |
-
np.random.seed(42) # For reproducibility
|
| 388 |
-
|
| 389 |
-
# Incident nodes (red to orange based on severity)
|
| 390 |
-
incident_coords = []
|
| 391 |
-
incident_colors = []
|
| 392 |
-
incident_sizes = []
|
| 393 |
-
incident_labels = []
|
| 394 |
-
|
| 395 |
-
for inc in incidents:
|
| 396 |
-
incident_coords.append([
|
| 397 |
-
np.random.uniform(-1, 0), # x: negative side
|
| 398 |
-
np.random.uniform(-1, 1), # y
|
| 399 |
-
np.random.uniform(0, 1) # z: incidents on bottom layer
|
| 400 |
-
])
|
| 401 |
-
|
| 402 |
-
severity = inc.get("severity", "medium")
|
| 403 |
-
if severity == "critical":
|
| 404 |
-
incident_colors.append("#FF4444") # Bright red
|
| 405 |
-
incident_sizes.append(20)
|
| 406 |
-
elif severity == "high":
|
| 407 |
-
incident_colors.append("#FF9800") # Orange
|
| 408 |
-
incident_sizes.append(15)
|
| 409 |
-
else:
|
| 410 |
-
incident_colors.append("#FFC107") # Amber
|
| 411 |
-
incident_sizes.append(10)
|
| 412 |
-
|
| 413 |
-
incident_labels.append(f"{inc.get('component', 'Unknown')}<br>{severity.upper()}")
|
| 414 |
-
|
| 415 |
-
# Outcome nodes (green gradient based on success)
|
| 416 |
-
outcome_coords = []
|
| 417 |
-
outcome_colors = []
|
| 418 |
-
outcome_sizes = []
|
| 419 |
-
outcome_labels = []
|
| 420 |
-
|
| 421 |
-
for out in outcomes:
|
| 422 |
-
outcome_coords.append([
|
| 423 |
-
np.random.uniform(0, 1), # x: positive side
|
| 424 |
-
np.random.uniform(-1, 1), # y
|
| 425 |
-
np.random.uniform(0, 1) # z
|
| 426 |
-
])
|
| 427 |
-
|
| 428 |
-
if out.get("success", False):
|
| 429 |
-
outcome_colors.append("#4CAF50") # Green
|
| 430 |
-
outcome_sizes.append(12)
|
| 431 |
-
else:
|
| 432 |
-
outcome_colors.append("#F44336") # Red
|
| 433 |
-
outcome_sizes.append(12)
|
| 434 |
-
|
| 435 |
-
outcome_labels.append(f"{out.get('action', 'Unknown')}<br>{'✅' if out.get('success') else '❌'}")
|
| 436 |
-
|
| 437 |
-
# Create figure
|
| 438 |
-
fig = go.Figure()
|
| 439 |
-
|
| 440 |
-
# Add incident nodes
|
| 441 |
-
fig.add_trace(go.Scatter3d(
|
| 442 |
-
x=[c[0] for c in incident_coords],
|
| 443 |
-
y=[c[1] for c in incident_coords],
|
| 444 |
-
z=[c[2] for c in incident_coords],
|
| 445 |
-
mode='markers+text',
|
| 446 |
-
marker=dict(
|
| 447 |
-
size=incident_sizes,
|
| 448 |
-
color=incident_colors,
|
| 449 |
-
symbol='circle',
|
| 450 |
-
line=dict(color='white', width=2)
|
| 451 |
-
),
|
| 452 |
-
text=incident_labels,
|
| 453 |
-
textposition="top center",
|
| 454 |
-
name='Incidents',
|
| 455 |
-
hoverinfo='text',
|
| 456 |
-
))
|
| 457 |
-
|
| 458 |
-
# Add outcome nodes
|
| 459 |
-
fig.add_trace(go.Scatter3d(
|
| 460 |
-
x=[c[0] for c in outcome_coords],
|
| 461 |
-
y=[c[1] for c in outcome_coords],
|
| 462 |
-
z=[c[2] for c in outcome_coords],
|
| 463 |
-
mode='markers+text',
|
| 464 |
-
marker=dict(
|
| 465 |
-
size=outcome_sizes,
|
| 466 |
-
color=outcome_colors,
|
| 467 |
-
symbol='diamond',
|
| 468 |
-
line=dict(color='white', width=1)
|
| 469 |
-
),
|
| 470 |
-
text=outcome_labels,
|
| 471 |
-
textposition="top center",
|
| 472 |
-
name='Outcomes',
|
| 473 |
-
hoverinfo='text',
|
| 474 |
-
))
|
| 475 |
-
|
| 476 |
-
# Add edges (connections)
|
| 477 |
-
edge_x, edge_y, edge_z = [], [], []
|
| 478 |
-
for edge in edges:
|
| 479 |
-
source_idx = int(edge["source"].split("_")[1]) if "_" in edge["source"] else 0
|
| 480 |
-
target_idx = int(edge["target"].split("_")[1]) if "_" in edge["target"] else 0
|
| 481 |
-
|
| 482 |
-
if source_idx < len(incident_coords) and target_idx < len(outcome_coords):
|
| 483 |
-
# Edge from incident to outcome
|
| 484 |
-
edge_x += [incident_coords[source_idx][0], outcome_coords[target_idx][0], None]
|
| 485 |
-
edge_y += [incident_coords[source_idx][1], outcome_coords[target_idx][1], None]
|
| 486 |
-
edge_z += [incident_coords[source_idx][2], outcome_coords[target_idx][2], None]
|
| 487 |
-
|
| 488 |
-
fig.add_trace(go.Scatter3d(
|
| 489 |
-
x=edge_x,
|
| 490 |
-
y=edge_y,
|
| 491 |
-
z=edge_z,
|
| 492 |
-
mode='lines',
|
| 493 |
-
line=dict(color='rgba(100, 100, 100, 0.5)', width=2),
|
| 494 |
-
hoverinfo='none',
|
| 495 |
-
showlegend=False
|
| 496 |
-
))
|
| 497 |
-
|
| 498 |
-
# Update layout
|
| 499 |
-
fig.update_layout(
|
| 500 |
-
title="🧠 3D RAG Knowledge Graph",
|
| 501 |
-
scene=dict(
|
| 502 |
-
xaxis_title="Incidents ← → Outcomes",
|
| 503 |
-
yaxis_title="",
|
| 504 |
-
zaxis_title="Knowledge Depth",
|
| 505 |
-
camera=dict(
|
| 506 |
-
eye=dict(x=1.5, y=1.5, z=1.5)
|
| 507 |
-
),
|
| 508 |
-
aspectmode='manual',
|
| 509 |
-
aspectratio=dict(x=2, y=1, z=1)
|
| 510 |
-
),
|
| 511 |
-
height=600,
|
| 512 |
-
showlegend=True,
|
| 513 |
-
)
|
| 514 |
-
|
| 515 |
-
return fig
|
| 516 |
|
| 517 |
# ============================================================================
|
| 518 |
# EXPORT ENGINE
|
|
@@ -692,21 +765,9 @@ class ExportEngine:
|
|
| 692 |
"""
|
| 693 |
|
| 694 |
return html
|
| 695 |
-
|
| 696 |
-
@staticmethod
|
| 697 |
-
def export_chart_as_image(fig, format: str = "png") -> bytes:
|
| 698 |
-
"""Export Plotly chart as image bytes"""
|
| 699 |
-
try:
|
| 700 |
-
# For Plotly figures
|
| 701 |
-
img_bytes = fig.to_image(format=format, scale=2)
|
| 702 |
-
return img_bytes
|
| 703 |
-
except Exception as e:
|
| 704 |
-
logging.error(f"Failed to export chart: {e}")
|
| 705 |
-
# Return placeholder
|
| 706 |
-
return b""
|
| 707 |
|
| 708 |
# ============================================================================
|
| 709 |
-
#
|
| 710 |
# ============================================================================
|
| 711 |
|
| 712 |
ENTERPRISE_SCENARIOS = {
|
|
@@ -834,60 +895,10 @@ ENTERPRISE_SCENARIOS = {
|
|
| 834 |
"prediction": "Global outage spreading to 5 regions in 12 minutes",
|
| 835 |
"visualization_type": "heatmap",
|
| 836 |
},
|
| 837 |
-
|
| 838 |
-
"🔐 Authentication Service Failure": {
|
| 839 |
-
"description": "OAuth service failing - users cannot login",
|
| 840 |
-
"component": "auth-service",
|
| 841 |
-
"metrics": {
|
| 842 |
-
"latency_ms": 2500,
|
| 843 |
-
"error_rate": 0.85,
|
| 844 |
-
"cpu_util": 0.95,
|
| 845 |
-
"memory_util": 0.99,
|
| 846 |
-
"token_generation_rate": 5,
|
| 847 |
-
"active_sessions": 45000,
|
| 848 |
-
},
|
| 849 |
-
"business_impact": {
|
| 850 |
-
"revenue_at_risk": 1800000,
|
| 851 |
-
"users_impacted": 95000,
|
| 852 |
-
"time_to_resolve": 5.2,
|
| 853 |
-
"auto_heal_possible": True,
|
| 854 |
-
"customer_satisfaction_impact": "Critical",
|
| 855 |
-
"brand_reputation_risk": "High",
|
| 856 |
-
},
|
| 857 |
-
"oss_action": "restart_service",
|
| 858 |
-
"enterprise_action": "circuit_breaker_auto",
|
| 859 |
-
"prediction": "Complete service failure in 4.8 minutes",
|
| 860 |
-
"visualization_type": "radar",
|
| 861 |
-
},
|
| 862 |
-
|
| 863 |
-
"📊 Analytics Pipeline Crash": {
|
| 864 |
-
"description": "Real-time analytics pipeline crashed during reporting",
|
| 865 |
-
"component": "analytics-service",
|
| 866 |
-
"metrics": {
|
| 867 |
-
"latency_ms": 5000,
|
| 868 |
-
"error_rate": 0.95,
|
| 869 |
-
"cpu_util": 0.15,
|
| 870 |
-
"memory_util": 0.99,
|
| 871 |
-
"data_lag_minutes": 45,
|
| 872 |
-
"queue_backlog": 1200000,
|
| 873 |
-
},
|
| 874 |
-
"business_impact": {
|
| 875 |
-
"revenue_at_risk": 750000,
|
| 876 |
-
"users_impacted": 25000,
|
| 877 |
-
"time_to_resolve": 25.0,
|
| 878 |
-
"auto_heal_possible": True,
|
| 879 |
-
"customer_satisfaction_impact": "Medium",
|
| 880 |
-
"brand_reputation_risk": "Medium",
|
| 881 |
-
},
|
| 882 |
-
"oss_action": "restart_pipeline",
|
| 883 |
-
"enterprise_action": "data_recovery_auto",
|
| 884 |
-
"prediction": "Data loss exceeding SLA in 18 minutes",
|
| 885 |
-
"visualization_type": "stream",
|
| 886 |
-
},
|
| 887 |
}
|
| 888 |
|
| 889 |
# ============================================================================
|
| 890 |
-
# MAIN DEMO UI - ENHANCED VERSION
|
| 891 |
# ============================================================================
|
| 892 |
|
| 893 |
def create_enhanced_demo():
|
|
@@ -900,22 +911,9 @@ def create_enhanced_demo():
|
|
| 900 |
live_dashboard = LiveDashboard()
|
| 901 |
viz_engine = EnhancedVisualizationEngine()
|
| 902 |
export_engine = ExportEngine()
|
| 903 |
-
session_manager = DemoSessionManager()
|
| 904 |
enterprise_servers = {}
|
| 905 |
|
| 906 |
-
# Generate session ID for this user
|
| 907 |
-
session_id = f"session_{uuid.uuid4().hex[:16]}"
|
| 908 |
-
session_manager.start_session(session_id)
|
| 909 |
-
|
| 910 |
with gr.Blocks(title="🚀 ARF Ultimate Investor Demo v3.3.7") as demo:
|
| 911 |
-
# Store session data in Gradio state
|
| 912 |
-
session_state = gr.State({
|
| 913 |
-
"session_id": session_id,
|
| 914 |
-
"current_scenario": None,
|
| 915 |
-
"exported_files": [],
|
| 916 |
-
"visualization_cache": {},
|
| 917 |
-
})
|
| 918 |
-
|
| 919 |
gr.Markdown("""
|
| 920 |
# 🚀 Agentic Reliability Framework - Ultimate Investor Demo v3.3.7
|
| 921 |
### **From Cost Center to Profit Engine: 5.2× ROI with Autonomous Reliability**
|
|
@@ -924,213 +922,117 @@ def create_enhanced_demo():
|
|
| 924 |
color: white; padding: 20px; border-radius: 10px; margin: 20px 0;">
|
| 925 |
<div style="display: flex; justify-content: space-between; align-items: center;">
|
| 926 |
<div>
|
| 927 |
-
<h3 style="margin: 0;">🎯
|
| 928 |
<p style="margin: 5px 0;">Experience the full spectrum: <strong>OSS (Free) ↔ Enterprise (Paid)</strong></p>
|
| 929 |
</div>
|
| 930 |
<div style="text-align: right;">
|
| 931 |
-
<p style="margin: 0;">
|
| 932 |
-
<p style="margin: 0;">📊
|
| 933 |
</div>
|
| 934 |
</div>
|
| 935 |
</div>
|
| 936 |
|
| 937 |
-
<script>
|
| 938 |
-
document.getElementById('session-id').textContent = '""" + session_id[-8:] + """';
|
| 939 |
-
</script>
|
| 940 |
-
|
| 941 |
*Watch as ARF transforms reliability from a $2M cost center to a $10M profit engine*
|
| 942 |
""")
|
| 943 |
|
| 944 |
# ================================================================
|
| 945 |
# ENHANCED EXECUTIVE DASHBOARD TAB
|
| 946 |
# ================================================================
|
| 947 |
-
with gr.TabItem("🏢 Executive Dashboard"
|
| 948 |
gr.Markdown("""
|
| 949 |
## 📊 Real-Time Business Impact Dashboard
|
| 950 |
**Live metrics showing ARF's financial impact in enterprise deployments**
|
| 951 |
""")
|
| 952 |
|
| 953 |
with gr.Row():
|
| 954 |
-
with gr.Column(scale=2):
|
| 955 |
-
# Enhanced metrics display with tooltips
|
| 956 |
-
with gr.Row():
|
| 957 |
-
with gr.Column(scale=1):
|
| 958 |
-
revenue_protected = gr.Markdown(
|
| 959 |
-
"### 💰 Revenue Protected\n**$0**",
|
| 960 |
-
elem_id="revenue-protected"
|
| 961 |
-
)
|
| 962 |
-
gr.HTML("""
|
| 963 |
-
<div style="background: #E8F5E9; padding: 10px; border-radius: 5px; margin-top: -15px;">
|
| 964 |
-
<small>💡 <strong>Tooltip:</strong> Total revenue protected from potential outages</small>
|
| 965 |
-
</div>
|
| 966 |
-
""")
|
| 967 |
-
|
| 968 |
-
with gr.Column(scale=1):
|
| 969 |
-
auto_heal_rate = gr.Markdown(
|
| 970 |
-
"### ⚡ Auto-Heal Rate\n**0%**",
|
| 971 |
-
elem_id="auto-heal-rate"
|
| 972 |
-
)
|
| 973 |
-
gr.HTML("""
|
| 974 |
-
<div style="background: #FFF3E0; padding: 10px; border-radius: 5px; margin-top: -15px;">
|
| 975 |
-
<small>💡 <strong>Tooltip:</strong> Percentage of incidents resolved automatically</small>
|
| 976 |
-
</div>
|
| 977 |
-
""")
|
| 978 |
-
|
| 979 |
-
with gr.Row():
|
| 980 |
-
with gr.Column(scale=1):
|
| 981 |
-
mttr_improvement = gr.Markdown(
|
| 982 |
-
"### 🚀 MTTR Improvement\n**94% faster**",
|
| 983 |
-
elem_id="mttr-improvement"
|
| 984 |
-
)
|
| 985 |
-
gr.HTML("""
|
| 986 |
-
<div style="background: #E3F2FD; padding: 10px; border-radius: 5px; margin-top: -15px;">
|
| 987 |
-
<small>💡 <strong>Tooltip:</strong> Mean Time To Recovery improvement vs industry</small>
|
| 988 |
-
</div>
|
| 989 |
-
""")
|
| 990 |
-
|
| 991 |
-
with gr.Column(scale=1):
|
| 992 |
-
engineer_hours = gr.Markdown(
|
| 993 |
-
"### 👷 Engineer Hours Saved\n**0 hours**",
|
| 994 |
-
elem_id="engineer-hours"
|
| 995 |
-
)
|
| 996 |
-
gr.HTML("""
|
| 997 |
-
<div style="background: #F3E5F5; padding: 10px; border-radius: 5px; margin-top: -15px;">
|
| 998 |
-
<small>💡 <strong>Tooltip:</strong> Engineering time saved through automation</small>
|
| 999 |
-
</div>
|
| 1000 |
-
""")
|
| 1001 |
-
|
| 1002 |
with gr.Column(scale=1):
|
| 1003 |
-
#
|
| 1004 |
-
|
| 1005 |
-
###
|
| 1006 |
-
|
| 1007 |
-
|
| 1008 |
-
|
| 1009 |
-
|
| 1010 |
-
<p>📊 **Scenarios Tried:** 0</p>
|
| 1011 |
-
</div>
|
| 1012 |
-
""")
|
| 1013 |
|
| 1014 |
# Real-time streaming metrics
|
| 1015 |
gr.Markdown("### 📈 Real-time System Health Monitor")
|
| 1016 |
real_time_metrics = gr.Plot(
|
| 1017 |
label="",
|
| 1018 |
-
elem_id="real-time-metrics"
|
| 1019 |
)
|
| 1020 |
|
| 1021 |
-
# Enhanced incident feed
|
| 1022 |
-
|
| 1023 |
-
|
| 1024 |
-
|
| 1025 |
-
|
| 1026 |
-
|
| 1027 |
-
|
| 1028 |
-
interactive=False,
|
| 1029 |
-
elem_id="incident-feed"
|
| 1030 |
-
)
|
| 1031 |
-
|
| 1032 |
-
with gr.Column(scale=1):
|
| 1033 |
-
gr.Markdown("### 🔍 Quick Filters")
|
| 1034 |
-
filter_severity = gr.Dropdown(
|
| 1035 |
-
choices=["All", "Critical", "High", "Medium", "Low"],
|
| 1036 |
-
value="All",
|
| 1037 |
-
label="Filter by Severity"
|
| 1038 |
-
)
|
| 1039 |
-
filter_status = gr.Dropdown(
|
| 1040 |
-
choices=["All", "Resolved", "In Progress", "Failed"],
|
| 1041 |
-
value="All",
|
| 1042 |
-
label="Filter by Status"
|
| 1043 |
-
)
|
| 1044 |
|
| 1045 |
-
# Top customers
|
| 1046 |
gr.Markdown("### 🏆 Top Customers Protected")
|
| 1047 |
-
|
| 1048 |
-
|
| 1049 |
-
|
| 1050 |
-
|
| 1051 |
-
|
| 1052 |
-
|
| 1053 |
-
|
| 1054 |
-
|
| 1055 |
-
|
| 1056 |
-
|
| 1057 |
-
|
| 1058 |
-
interactive=False,
|
| 1059 |
-
)
|
| 1060 |
-
|
| 1061 |
-
with gr.Column(scale=1):
|
| 1062 |
-
# Customer ROI visualization
|
| 1063 |
-
gr.Markdown("#### 📊 ROI Distribution")
|
| 1064 |
-
roi_distribution = gr.Plot(
|
| 1065 |
-
label="Customer ROI Distribution"
|
| 1066 |
-
)
|
| 1067 |
|
| 1068 |
# ================================================================
|
| 1069 |
# ENHANCED LIVE WAR ROOM TAB
|
| 1070 |
# ================================================================
|
| 1071 |
-
with gr.TabItem("🔥 Live War Room"
|
| 1072 |
gr.Markdown("""
|
| 1073 |
## 🔥 Multi-Incident War Room
|
| 1074 |
-
**Watch ARF handle
|
| 1075 |
""")
|
| 1076 |
|
| 1077 |
with gr.Row():
|
| 1078 |
with gr.Column(scale=1):
|
| 1079 |
-
# Enhanced scenario selector
|
| 1080 |
scenario_selector = gr.Dropdown(
|
| 1081 |
choices=list(ENTERPRISE_SCENARIOS.keys()),
|
| 1082 |
value="🚨 Black Friday Payment Crisis",
|
| 1083 |
label="🎬 Select Incident Scenario",
|
| 1084 |
info="Choose an enterprise incident scenario",
|
| 1085 |
filterable=True,
|
| 1086 |
-
allow_custom_value=False,
|
| 1087 |
)
|
| 1088 |
|
| 1089 |
-
#
|
| 1090 |
viz_type = gr.Radio(
|
| 1091 |
-
choices=["Radar Chart", "Heatmap", "
|
| 1092 |
value="Radar Chart",
|
| 1093 |
label="📊 Visualization Type",
|
| 1094 |
info="Choose how to visualize the metrics"
|
| 1095 |
)
|
| 1096 |
|
| 1097 |
-
#
|
| 1098 |
metrics_display = gr.JSON(
|
| 1099 |
label="📊 Current Metrics",
|
| 1100 |
value={},
|
| 1101 |
)
|
| 1102 |
|
| 1103 |
-
# Business impact
|
| 1104 |
impact_display = gr.JSON(
|
| 1105 |
label="💰 Business Impact Analysis",
|
| 1106 |
value={},
|
| 1107 |
)
|
| 1108 |
|
| 1109 |
-
# Action buttons
|
| 1110 |
with gr.Row():
|
| 1111 |
-
|
| 1112 |
-
|
| 1113 |
-
"🤖 OSS: Analyze & Recommend",
|
| 1114 |
-
variant="secondary",
|
| 1115 |
-
elem_id="oss-btn"
|
| 1116 |
-
)
|
| 1117 |
-
oss_loading = gr.HTML("", visible=False)
|
| 1118 |
-
|
| 1119 |
-
with gr.Column(scale=1):
|
| 1120 |
-
enterprise_action_btn = gr.Button(
|
| 1121 |
-
"🚀 Enterprise: Execute Healing",
|
| 1122 |
-
variant="primary",
|
| 1123 |
-
elem_id="enterprise-btn"
|
| 1124 |
-
)
|
| 1125 |
-
enterprise_loading = gr.HTML("", visible=False)
|
| 1126 |
|
| 1127 |
-
#
|
| 1128 |
with gr.Accordion("⚙️ Enterprise Configuration", open=False):
|
| 1129 |
license_input = gr.Textbox(
|
| 1130 |
label="🔑 Enterprise License Key",
|
| 1131 |
value="ARF-ENT-DEMO-2024",
|
| 1132 |
-
info="Demo license - real enterprise requires purchase"
|
| 1133 |
-
placeholder="Enter your license key..."
|
| 1134 |
)
|
| 1135 |
|
| 1136 |
execution_mode = gr.Radio(
|
|
@@ -1139,13 +1041,6 @@ def create_enhanced_demo():
|
|
| 1139 |
label="⚙️ Execution Mode",
|
| 1140 |
info="How to execute the healing action"
|
| 1141 |
)
|
| 1142 |
-
|
| 1143 |
-
gr.HTML("""
|
| 1144 |
-
<div style="background: #E3F2FD; padding: 10px; border-radius: 5px; margin-top: 10px;">
|
| 1145 |
-
<small>💡 <strong>Autonomous:</strong> ARF executes automatically</small><br>
|
| 1146 |
-
<small>💡 <strong>Approval:</strong> Requires human approval before execution</small>
|
| 1147 |
-
</div>
|
| 1148 |
-
""")
|
| 1149 |
|
| 1150 |
with gr.Column(scale=2):
|
| 1151 |
# Enhanced results display with tabs
|
|
@@ -1154,7 +1049,6 @@ def create_enhanced_demo():
|
|
| 1154 |
result_display = gr.JSON(
|
| 1155 |
label="",
|
| 1156 |
value={},
|
| 1157 |
-
elem_id="results-json"
|
| 1158 |
)
|
| 1159 |
|
| 1160 |
with gr.TabItem("📈 Performance Analysis"):
|
|
@@ -1167,41 +1061,19 @@ def create_enhanced_demo():
|
|
| 1167 |
label="Incident Severity Heatmap",
|
| 1168 |
)
|
| 1169 |
|
| 1170 |
-
#
|
| 1171 |
-
|
| 1172 |
-
|
| 1173 |
-
|
| 1174 |
-
label="🧠 RAG Graph Memory Visualization",
|
| 1175 |
-
elem_id="rag-graph"
|
| 1176 |
-
)
|
| 1177 |
-
|
| 1178 |
-
with gr.Column(scale=1):
|
| 1179 |
-
# RAG Graph controls
|
| 1180 |
-
gr.Markdown("#### 🎛️ Graph Controls")
|
| 1181 |
-
graph_type = gr.Radio(
|
| 1182 |
-
choices=["2D View", "3D View", "Network View"],
|
| 1183 |
-
value="2D View",
|
| 1184 |
-
label="View Type"
|
| 1185 |
-
)
|
| 1186 |
-
animate_graph = gr.Checkbox(
|
| 1187 |
-
label="🎬 Enable Animation",
|
| 1188 |
-
value=True
|
| 1189 |
-
)
|
| 1190 |
-
refresh_graph = gr.Button(
|
| 1191 |
-
"🔄 Refresh Graph",
|
| 1192 |
-
size="sm"
|
| 1193 |
-
)
|
| 1194 |
|
| 1195 |
# Predictive Timeline
|
| 1196 |
predictive_timeline = gr.Plot(
|
| 1197 |
label="🔮 Predictive Analytics Timeline",
|
| 1198 |
-
elem_id="predictive-timeline"
|
| 1199 |
)
|
| 1200 |
|
| 1201 |
# Function to update scenario with enhanced visualization
|
| 1202 |
-
def update_scenario_enhanced(scenario_name, viz_type
|
| 1203 |
scenario = ENTERPRISE_SCENARIOS.get(scenario_name, {})
|
| 1204 |
-
session_state["current_scenario"] = scenario_name
|
| 1205 |
|
| 1206 |
# Add to RAG graph
|
| 1207 |
incident_id = rag_visualizer.add_incident(
|
|
@@ -1226,18 +1098,9 @@ def create_enhanced_demo():
|
|
| 1226 |
)
|
| 1227 |
elif viz_type == "Heatmap":
|
| 1228 |
viz_fig = viz_engine.create_heatmap_timeline([scenario])
|
| 1229 |
-
elif viz_type == "3D Graph":
|
| 1230 |
-
viz_fig = viz_engine.create_3d_rag_graph(
|
| 1231 |
-
rag_visualizer.incidents,
|
| 1232 |
-
rag_visualizer.outcomes,
|
| 1233 |
-
rag_visualizer.edges
|
| 1234 |
-
)
|
| 1235 |
else: # Stream
|
| 1236 |
viz_fig = viz_engine.create_real_time_metrics_stream()
|
| 1237 |
|
| 1238 |
-
# Store in cache
|
| 1239 |
-
session_state["visualization_cache"][scenario_name] = viz_fig
|
| 1240 |
-
|
| 1241 |
return {
|
| 1242 |
metrics_display: scenario.get("metrics", {}),
|
| 1243 |
impact_display: business_calc.calculate_impact(scenario.get("business_impact", {})),
|
|
@@ -1245,27 +1108,108 @@ def create_enhanced_demo():
|
|
| 1245 |
predictive_timeline: predictive_viz.get_predictive_timeline(),
|
| 1246 |
performance_chart: viz_fig,
|
| 1247 |
incident_heatmap: viz_engine.create_heatmap_timeline([scenario]),
|
| 1248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1249 |
}
|
| 1250 |
|
| 1251 |
# Connect events
|
| 1252 |
scenario_selector.change(
|
| 1253 |
fn=update_scenario_enhanced,
|
| 1254 |
-
inputs=[scenario_selector, viz_type
|
| 1255 |
outputs=[metrics_display, impact_display, rag_graph, predictive_timeline,
|
| 1256 |
-
performance_chart, incident_heatmap,
|
| 1257 |
)
|
| 1258 |
|
| 1259 |
viz_type.change(
|
| 1260 |
-
fn=lambda scenario, viz_type
|
| 1261 |
-
inputs=[scenario_selector, viz_type
|
| 1262 |
-
outputs=[performance_chart,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1263 |
)
|
| 1264 |
|
| 1265 |
# ================================================================
|
| 1266 |
# ENHANCED LEARNING ENGINE TAB
|
| 1267 |
# ================================================================
|
| 1268 |
-
with gr.TabItem("🧠 Learning Engine"
|
| 1269 |
gr.Markdown("""
|
| 1270 |
## 🧠 RAG Graph Learning Engine
|
| 1271 |
**Watch ARF learn from every incident and outcome**
|
|
@@ -1273,96 +1217,31 @@ def create_enhanced_demo():
|
|
| 1273 |
|
| 1274 |
with gr.Row():
|
| 1275 |
with gr.Column(scale=1):
|
| 1276 |
-
#
|
| 1277 |
learning_stats = gr.JSON(
|
| 1278 |
label="📊 Learning Statistics",
|
| 1279 |
value=rag_visualizer.get_stats(),
|
| 1280 |
)
|
| 1281 |
|
| 1282 |
-
#
|
| 1283 |
-
|
| 1284 |
-
simulate_learning_btn = gr.Button(
|
| 1285 |
-
"🎓 Simulate Learning Cycle",
|
| 1286 |
-
variant="primary",
|
| 1287 |
-
elem_id="simulate-learning"
|
| 1288 |
-
)
|
| 1289 |
-
|
| 1290 |
-
learning_rate = gr.Slider(
|
| 1291 |
-
minimum=1,
|
| 1292 |
-
maximum=10,
|
| 1293 |
-
value=3,
|
| 1294 |
-
step=1,
|
| 1295 |
-
label="Learning Cycles",
|
| 1296 |
-
info="Number of incidents to simulate"
|
| 1297 |
-
)
|
| 1298 |
-
|
| 1299 |
-
success_probability = gr.Slider(
|
| 1300 |
-
minimum=0.1,
|
| 1301 |
-
maximum=1.0,
|
| 1302 |
-
value=0.8,
|
| 1303 |
-
step=0.1,
|
| 1304 |
-
label="Success Probability",
|
| 1305 |
-
info="Probability of successful resolution"
|
| 1306 |
-
)
|
| 1307 |
|
| 1308 |
-
# Export
|
| 1309 |
-
|
| 1310 |
-
export_format = gr.Radio(
|
| 1311 |
-
choices=["JSON", "CSV", "Graph Image"],
|
| 1312 |
-
value="JSON",
|
| 1313 |
-
label="Export Format"
|
| 1314 |
-
)
|
| 1315 |
-
|
| 1316 |
-
export_btn = gr.Button(
|
| 1317 |
-
"📤 Export Learned Patterns",
|
| 1318 |
-
variant="secondary"
|
| 1319 |
-
)
|
| 1320 |
-
|
| 1321 |
-
export_status = gr.HTML(
|
| 1322 |
-
"<div style='padding: 10px; background: #E8F5E9; border-radius: 5px;'>"
|
| 1323 |
-
"✅ Ready to export</div>",
|
| 1324 |
-
visible=True
|
| 1325 |
-
)
|
| 1326 |
|
| 1327 |
with gr.Column(scale=2):
|
| 1328 |
-
#
|
| 1329 |
-
|
| 1330 |
-
|
| 1331 |
-
|
| 1332 |
-
label="",
|
| 1333 |
-
)
|
| 1334 |
-
|
| 1335 |
-
with gr.TabItem("🌐 3D Knowledge Graph"):
|
| 1336 |
-
learning_graph_3d = gr.Plot(
|
| 1337 |
-
label="",
|
| 1338 |
-
)
|
| 1339 |
-
|
| 1340 |
-
with gr.TabItem("📊 Learning Progress"):
|
| 1341 |
-
learning_progress = gr.Plot(
|
| 1342 |
-
label="",
|
| 1343 |
-
)
|
| 1344 |
-
|
| 1345 |
-
# Update learning graphs
|
| 1346 |
-
def update_learning_graphs():
|
| 1347 |
-
return {
|
| 1348 |
-
learning_graph_2d: rag_visualizer.get_graph_figure(),
|
| 1349 |
-
learning_graph_3d: viz_engine.create_3d_rag_graph(
|
| 1350 |
-
rag_visualizer.incidents,
|
| 1351 |
-
rag_visualizer.outcomes,
|
| 1352 |
-
rag_visualizer.edges
|
| 1353 |
-
),
|
| 1354 |
-
learning_stats: rag_visualizer.get_stats(),
|
| 1355 |
-
learning_progress: viz_engine.create_real_time_metrics_stream(),
|
| 1356 |
-
}
|
| 1357 |
|
| 1358 |
-
# Simulate
|
| 1359 |
-
def
|
| 1360 |
-
|
| 1361 |
-
|
| 1362 |
-
actions = ["scale_out", "restart_container", "rollback", "circuit_breaker"
|
| 1363 |
-
"failover", "load_balance", "cache_clear", "connection_pool"]
|
| 1364 |
|
| 1365 |
-
for _ in range(
|
| 1366 |
component = random.choice(components)
|
| 1367 |
incident_id = rag_visualizer.add_incident(
|
| 1368 |
component=component,
|
|
@@ -1371,35 +1250,30 @@ def create_enhanced_demo():
|
|
| 1371 |
|
| 1372 |
rag_visualizer.add_outcome(
|
| 1373 |
incident_id=incident_id,
|
| 1374 |
-
success=random.random()
|
| 1375 |
action=random.choice(actions)
|
| 1376 |
)
|
| 1377 |
|
| 1378 |
-
|
| 1379 |
-
|
| 1380 |
-
|
| 1381 |
-
|
| 1382 |
-
{"cycles": cycles, "success_probability": success_prob}
|
| 1383 |
-
)
|
| 1384 |
-
|
| 1385 |
-
return update_learning_graphs()
|
| 1386 |
|
| 1387 |
# Connect events
|
| 1388 |
simulate_learning_btn.click(
|
| 1389 |
-
fn=
|
| 1390 |
-
|
| 1391 |
-
outputs=[learning_graph_2d, learning_graph_3d, learning_stats, learning_progress]
|
| 1392 |
)
|
| 1393 |
|
| 1394 |
-
|
| 1395 |
-
fn=
|
| 1396 |
-
outputs=[
|
| 1397 |
)
|
| 1398 |
|
| 1399 |
# ================================================================
|
| 1400 |
# ENHANCED COMPLIANCE AUDITOR TAB
|
| 1401 |
# ================================================================
|
| 1402 |
-
with gr.TabItem("📝 Compliance Auditor"
|
| 1403 |
gr.Markdown("""
|
| 1404 |
## 📝 Automated Compliance & Audit Trails
|
| 1405 |
**Enterprise-only: Generate SOC2/GDPR/HIPAA compliance reports in seconds**
|
|
@@ -1407,90 +1281,81 @@ def create_enhanced_demo():
|
|
| 1407 |
|
| 1408 |
with gr.Row():
|
| 1409 |
with gr.Column(scale=1):
|
| 1410 |
-
# Compliance
|
| 1411 |
compliance_standard = gr.Dropdown(
|
| 1412 |
choices=["SOC2", "GDPR", "HIPAA", "ISO27001", "PCI-DSS"],
|
| 1413 |
value="SOC2",
|
| 1414 |
label="📋 Compliance Standard",
|
| 1415 |
-
info="Select compliance standard"
|
| 1416 |
)
|
| 1417 |
|
|
|
|
| 1418 |
compliance_license = gr.Textbox(
|
| 1419 |
label="🔑 Enterprise License Required",
|
| 1420 |
value="ARF-ENT-COMPLIANCE",
|
| 1421 |
interactive=True,
|
| 1422 |
-
placeholder="Enter compliance license key..."
|
| 1423 |
)
|
| 1424 |
|
| 1425 |
-
#
|
| 1426 |
-
|
| 1427 |
-
report_format = gr.Radio(
|
| 1428 |
-
choices=["HTML Report", "JSON", "PDF Summary"],
|
| 1429 |
-
value="HTML Report",
|
| 1430 |
-
label="Report Format"
|
| 1431 |
-
)
|
| 1432 |
-
|
| 1433 |
-
include_audit_trail = gr.Checkbox(
|
| 1434 |
-
label="Include Audit Trail",
|
| 1435 |
-
value=True
|
| 1436 |
-
)
|
| 1437 |
-
|
| 1438 |
-
generate_report_btn = gr.Button(
|
| 1439 |
-
"⚡ Generate & Export Report",
|
| 1440 |
-
variant="primary",
|
| 1441 |
-
elem_id="generate-report"
|
| 1442 |
-
)
|
| 1443 |
|
| 1444 |
# Audit trail viewer
|
| 1445 |
-
gr.Markdown("### 📜 Live Audit Trail")
|
| 1446 |
audit_trail = gr.Dataframe(
|
| 1447 |
-
label="",
|
| 1448 |
-
headers=["Time", "Action", "Component", "User", "Status"
|
| 1449 |
value=[],
|
| 1450 |
)
|
| 1451 |
|
| 1452 |
with gr.Column(scale=2):
|
| 1453 |
-
# Report display
|
| 1454 |
-
|
| 1455 |
-
|
| 1456 |
-
|
| 1457 |
-
|
| 1458 |
-
|
| 1459 |
-
|
| 1460 |
-
|
| 1461 |
-
|
| 1462 |
-
|
| 1463 |
-
|
| 1464 |
-
|
| 1465 |
-
|
| 1466 |
-
|
| 1467 |
-
|
| 1468 |
-
|
| 1469 |
-
|
| 1470 |
-
|
| 1471 |
-
|
| 1472 |
-
|
| 1473 |
-
|
| 1474 |
-
|
| 1475 |
-
|
| 1476 |
-
|
| 1477 |
-
|
| 1478 |
-
|
| 1479 |
-
|
| 1480 |
-
|
| 1481 |
-
|
| 1482 |
-
|
| 1483 |
-
|
| 1484 |
-
|
| 1485 |
-
|
| 1486 |
-
|
| 1487 |
-
|
| 1488 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1489 |
|
| 1490 |
# ================================================================
|
| 1491 |
# ENHANCED ROI CALCULATOR TAB
|
| 1492 |
# ================================================================
|
| 1493 |
-
with gr.TabItem("💰 ROI Calculator"
|
| 1494 |
gr.Markdown("""
|
| 1495 |
## 💰 Enterprise ROI Calculator
|
| 1496 |
**Calculate your potential savings with ARF Enterprise**
|
|
@@ -1498,16 +1363,11 @@ def create_enhanced_demo():
|
|
| 1498 |
|
| 1499 |
with gr.Row():
|
| 1500 |
with gr.Column(scale=1):
|
| 1501 |
-
# Inputs
|
| 1502 |
-
gr.Markdown("### 📝 Input Your Business Metrics")
|
| 1503 |
-
|
| 1504 |
monthly_revenue = gr.Number(
|
| 1505 |
value=1000000,
|
| 1506 |
label="Monthly Revenue ($)",
|
| 1507 |
-
info="Your company's monthly revenue"
|
| 1508 |
-
minimum=10000,
|
| 1509 |
-
maximum=1000000000,
|
| 1510 |
-
step=10000
|
| 1511 |
)
|
| 1512 |
|
| 1513 |
monthly_incidents = gr.Slider(
|
|
@@ -1515,8 +1375,7 @@ def create_enhanced_demo():
|
|
| 1515 |
maximum=100,
|
| 1516 |
value=20,
|
| 1517 |
label="Monthly Incidents",
|
| 1518 |
-
info="Reliability incidents per month"
|
| 1519 |
-
step=1
|
| 1520 |
)
|
| 1521 |
|
| 1522 |
team_size = gr.Slider(
|
|
@@ -1524,206 +1383,98 @@ def create_enhanced_demo():
|
|
| 1524 |
maximum=20,
|
| 1525 |
value=3,
|
| 1526 |
label="SRE/DevOps Team Size",
|
| 1527 |
-
info="Engineers handling incidents"
|
| 1528 |
-
step=1
|
| 1529 |
)
|
| 1530 |
|
| 1531 |
-
avg_incident_cost = gr.
|
| 1532 |
-
minimum=100,
|
| 1533 |
-
maximum=10000,
|
| 1534 |
value=1500,
|
| 1535 |
label="Average Incident Cost ($)",
|
| 1536 |
-
info="Revenue loss + engineer time per incident"
|
| 1537 |
-
step=100
|
| 1538 |
-
)
|
| 1539 |
-
|
| 1540 |
-
with gr.Accordion("⚙️ Advanced Settings", open=False):
|
| 1541 |
-
engineer_hourly_rate = gr.Number(
|
| 1542 |
-
value=100,
|
| 1543 |
-
label="Engineer Hourly Rate ($)",
|
| 1544 |
-
info="Average hourly rate of engineers"
|
| 1545 |
-
)
|
| 1546 |
-
|
| 1547 |
-
implementation_timeline = gr.Slider(
|
| 1548 |
-
minimum=1,
|
| 1549 |
-
maximum=12,
|
| 1550 |
-
value=3,
|
| 1551 |
-
label="Implementation Timeline (months)",
|
| 1552 |
-
info="Time to fully implement ARF"
|
| 1553 |
-
)
|
| 1554 |
-
|
| 1555 |
-
calculate_roi_btn = gr.Button(
|
| 1556 |
-
"📈 Calculate ROI",
|
| 1557 |
-
variant="primary",
|
| 1558 |
-
size="lg"
|
| 1559 |
-
)
|
| 1560 |
-
|
| 1561 |
-
with gr.Column(scale=2):
|
| 1562 |
-
# Enhanced results display
|
| 1563 |
-
with gr.Tabs():
|
| 1564 |
-
with gr.TabItem("📊 ROI Results"):
|
| 1565 |
-
roi_results = gr.JSON(
|
| 1566 |
-
label="",
|
| 1567 |
-
value={},
|
| 1568 |
-
)
|
| 1569 |
-
|
| 1570 |
-
with gr.TabItem("📈 Visualization"):
|
| 1571 |
-
roi_chart = gr.Plot(
|
| 1572 |
-
label="",
|
| 1573 |
-
)
|
| 1574 |
-
|
| 1575 |
-
with gr.TabItem("📋 Detailed Breakdown"):
|
| 1576 |
-
roi_breakdown = gr.Dataframe(
|
| 1577 |
-
label="Cost-Benefit Analysis",
|
| 1578 |
-
headers=["Category", "Without ARF", "With ARF", "Savings", "ROI Impact"],
|
| 1579 |
-
value=[],
|
| 1580 |
-
)
|
| 1581 |
-
|
| 1582 |
-
# Export section
|
| 1583 |
-
gr.Markdown("### 📤 Export ROI Analysis")
|
| 1584 |
-
with gr.Row():
|
| 1585 |
-
export_roi_html = gr.Button(
|
| 1586 |
-
"🌐 Export as HTML",
|
| 1587 |
-
variant="secondary"
|
| 1588 |
-
)
|
| 1589 |
-
export_roi_csv = gr.Button(
|
| 1590 |
-
"📊 Export as CSV",
|
| 1591 |
-
variant="secondary"
|
| 1592 |
-
)
|
| 1593 |
-
export_roi_pdf = gr.Button(
|
| 1594 |
-
"📄 Export as PDF",
|
| 1595 |
-
variant="secondary"
|
| 1596 |
-
)
|
| 1597 |
-
|
| 1598 |
-
export_status = gr.HTML(
|
| 1599 |
-
"<div style='padding: 10px; background: #FFF3E0; border-radius: 5px;'>"
|
| 1600 |
-
"📝 Ready for export</div>",
|
| 1601 |
-
visible=True
|
| 1602 |
-
)
|
| 1603 |
-
|
| 1604 |
-
# ================================================================
|
| 1605 |
-
# ENHANCED ANALYTICS & EXPORT TAB
|
| 1606 |
-
# ================================================================
|
| 1607 |
-
with gr.TabItem("📈 Analytics & Export", elem_id="analytics-section"):
|
| 1608 |
-
gr.Markdown("""
|
| 1609 |
-
## 📈 Advanced Analytics & Export Hub
|
| 1610 |
-
**Deep dive into performance metrics and export professional reports**
|
| 1611 |
-
""")
|
| 1612 |
-
|
| 1613 |
-
with gr.Row():
|
| 1614 |
-
with gr.Column(scale=1):
|
| 1615 |
-
# Analytics controls
|
| 1616 |
-
gr.Markdown("### 📊 Analytics Controls")
|
| 1617 |
-
|
| 1618 |
-
analytics_timeframe = gr.Dropdown(
|
| 1619 |
-
choices=["Last Hour", "Today", "Last 7 Days", "Last 30 Days", "All Time"],
|
| 1620 |
-
value="Today",
|
| 1621 |
-
label="Timeframe"
|
| 1622 |
-
)
|
| 1623 |
-
|
| 1624 |
-
analytics_metric = gr.Dropdown(
|
| 1625 |
-
choices=["Revenue Protected", "Incidents Handled", "Auto-Heal Rate",
|
| 1626 |
-
"MTTR Improvement", "ROI", "Compliance Score"],
|
| 1627 |
-
value="Revenue Protected",
|
| 1628 |
-
label="Primary Metric"
|
| 1629 |
)
|
| 1630 |
|
| 1631 |
-
|
| 1632 |
-
"🔄 Refresh Analytics",
|
| 1633 |
-
variant="primary"
|
| 1634 |
-
)
|
| 1635 |
-
|
| 1636 |
-
# Export all data
|
| 1637 |
-
gr.Markdown("### 📤 Bulk Export")
|
| 1638 |
-
with gr.Accordion("Export All Session Data", open=False):
|
| 1639 |
-
export_all_format = gr.Radio(
|
| 1640 |
-
choices=["JSON", "CSV", "HTML Report"],
|
| 1641 |
-
value="JSON",
|
| 1642 |
-
label="Export Format"
|
| 1643 |
-
)
|
| 1644 |
-
|
| 1645 |
-
export_all_btn = gr.Button(
|
| 1646 |
-
"💾 Export All Data",
|
| 1647 |
-
variant="secondary"
|
| 1648 |
-
)
|
| 1649 |
|
| 1650 |
with gr.Column(scale=2):
|
| 1651 |
-
#
|
| 1652 |
-
gr.
|
| 1653 |
-
|
| 1654 |
-
label="",
|
| 1655 |
-
)
|
| 1656 |
-
|
| 1657 |
-
# Session analytics
|
| 1658 |
-
gr.Markdown("### 👤 Session Analytics")
|
| 1659 |
-
session_analytics = gr.JSON(
|
| 1660 |
-
label="",
|
| 1661 |
value={},
|
| 1662 |
)
|
| 1663 |
-
|
| 1664 |
-
# Export hub
|
| 1665 |
-
gr.Markdown("### 🚀 Export Hub", elem_id="export-section")
|
| 1666 |
-
with gr.Row():
|
| 1667 |
-
with gr.Column(scale=1):
|
| 1668 |
-
export_type = gr.Dropdown(
|
| 1669 |
-
choices=["ROI Report", "Compliance Report", "Incident Analysis",
|
| 1670 |
-
"Performance Dashboard", "Executive Summary"],
|
| 1671 |
-
value="ROI Report",
|
| 1672 |
-
label="Report Type"
|
| 1673 |
-
)
|
| 1674 |
|
| 1675 |
-
|
| 1676 |
-
|
| 1677 |
-
|
| 1678 |
-
value=["Include Charts"],
|
| 1679 |
-
label="Customization Options"
|
| 1680 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1681 |
|
| 1682 |
-
|
| 1683 |
-
|
| 1684 |
-
|
| 1685 |
-
|
| 1686 |
-
|
| 1687 |
-
|
| 1688 |
-
|
| 1689 |
-
|
| 1690 |
-
|
| 1691 |
-
|
| 1692 |
-
|
| 1693 |
-
|
| 1694 |
-
|
| 1695 |
-
|
| 1696 |
-
|
| 1697 |
-
|
| 1698 |
-
|
| 1699 |
-
|
| 1700 |
-
|
| 1701 |
-
|
| 1702 |
-
|
| 1703 |
-
|
| 1704 |
-
|
| 1705 |
-
|
| 1706 |
-
|
| 1707 |
-
|
| 1708 |
-
|
| 1709 |
-
|
| 1710 |
-
|
| 1711 |
-
|
| 1712 |
-
|
| 1713 |
-
|
| 1714 |
-
|
| 1715 |
-
|
| 1716 |
-
|
| 1717 |
-
|
| 1718 |
-
|
| 1719 |
-
|
| 1720 |
-
|
| 1721 |
-
|
| 1722 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1723 |
|
| 1724 |
-
#
|
| 1725 |
-
# ENHANCED FOOTER WITH EXPORT LINKS
|
| 1726 |
-
# ================================================================
|
| 1727 |
gr.Markdown("""
|
| 1728 |
---
|
| 1729 |
|
|
@@ -1749,15 +1500,13 @@ def create_enhanced_demo():
|
|
| 1749 |
<p>🌐 <strong>Website:</strong> <a href="https://arf.dev" target="_blank">https://arf.dev</a></p>
|
| 1750 |
<p>📚 <strong>Documentation:</strong> <a href="https://docs.arf.dev" target="_blank">https://docs.arf.dev</a></p>
|
| 1751 |
<p>💻 <strong>GitHub:</strong> <a href="https://github.com/petterjuan/agentic-reliability-framework" target="_blank">petterjuan/agentic-reliability-framework</a></p>
|
| 1752 |
-
<p>📊 <strong>Demo Session ID:</strong> <code>""" + session_id[-8:] + """</code></p>
|
| 1753 |
</div>
|
| 1754 |
</div>
|
| 1755 |
</div>
|
| 1756 |
|
| 1757 |
<div style="text-align: center; padding: 15px; background: #2c3e50; color: white; border-radius: 5px; margin-top: 20px;">
|
| 1758 |
<p style="margin: 0;">🚀 ARF Ultimate Investor Demo v3.3.7 | Enhanced with Professional Analytics & Export Features</p>
|
| 1759 |
-
<p style="margin: 5px 0 0 0; font-size: 12px;">Built with ❤️ using Gradio & Plotly
|
| 1760 |
-
datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + """</p>
|
| 1761 |
</div>
|
| 1762 |
""")
|
| 1763 |
|
|
@@ -1783,7 +1532,6 @@ def main():
|
|
| 1783 |
share=False,
|
| 1784 |
show_error=True,
|
| 1785 |
theme="soft",
|
| 1786 |
-
favicon_path=None,
|
| 1787 |
)
|
| 1788 |
|
| 1789 |
if __name__ == "__main__":
|
|
|
|
| 22 |
import plotly.express as px
|
| 23 |
import pandas as pd
|
| 24 |
from plotly.subplots import make_subplots
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
# Import OSS components
|
| 27 |
try:
|
|
|
|
| 39 |
logger.warning("OSS package not available")
|
| 40 |
|
| 41 |
# ============================================================================
|
| 42 |
+
# BUSINESS IMPACT CALCULATIONS (Based on business.py)
|
| 43 |
# ============================================================================
|
| 44 |
|
| 45 |
+
class BusinessImpactCalculator:
|
| 46 |
+
"""Enterprise-scale business impact calculation"""
|
| 47 |
|
| 48 |
def __init__(self):
|
| 49 |
+
# Enterprise-scale constants
|
| 50 |
+
self.BASE_REVENUE_PER_MINUTE = 5000.0 # $5K/min for enterprise
|
| 51 |
+
self.BASE_USERS = 10000 # 10K active users
|
| 52 |
+
|
| 53 |
+
def calculate_impact(self, scenario: Dict[str, Any]) -> Dict[str, Any]:
|
| 54 |
+
"""Calculate business impact for demo scenarios"""
|
| 55 |
+
revenue_at_risk = scenario.get("revenue_at_risk", 0)
|
| 56 |
+
users_impacted = scenario.get("users_impacted", 0)
|
| 57 |
+
|
| 58 |
+
if revenue_at_risk > 1000000:
|
| 59 |
+
severity = "🚨 CRITICAL"
|
| 60 |
+
impact_color = "#ff4444"
|
| 61 |
+
elif revenue_at_risk > 500000:
|
| 62 |
+
severity = "⚠️ HIGH"
|
| 63 |
+
impact_color = "#ffaa00"
|
| 64 |
+
elif revenue_at_risk > 100000:
|
| 65 |
+
severity = "📈 MEDIUM"
|
| 66 |
+
impact_color = "#ffdd00"
|
| 67 |
+
else:
|
| 68 |
+
severity = "✅ LOW"
|
| 69 |
+
impact_color = "#44ff44"
|
| 70 |
+
|
| 71 |
+
return {
|
| 72 |
+
"revenue_at_risk": f"${revenue_at_risk:,.0f}",
|
| 73 |
+
"users_impacted": f"{users_impacted:,}",
|
| 74 |
+
"severity": severity,
|
| 75 |
+
"impact_color": impact_color,
|
| 76 |
+
"time_to_resolution": f"{scenario.get('time_to_resolve', 2.3):.1f} min",
|
| 77 |
+
"auto_heal_possible": scenario.get("auto_heal_possible", True),
|
| 78 |
}
|
| 79 |
+
|
| 80 |
+
# ============================================================================
|
| 81 |
+
# RAG GRAPH VISUALIZATION (Based on v3_reliability.py)
|
| 82 |
+
# ============================================================================
|
| 83 |
+
|
| 84 |
+
class RAGGraphVisualizer:
|
| 85 |
+
"""Visualize RAG graph memory growth"""
|
| 86 |
|
| 87 |
+
def __init__(self):
|
| 88 |
+
self.incidents = []
|
| 89 |
+
self.outcomes = []
|
| 90 |
+
self.edges = []
|
| 91 |
+
|
| 92 |
+
def add_incident(self, component: str, severity: str):
|
| 93 |
+
"""Add an incident to the graph"""
|
| 94 |
+
incident_id = f"inc_{len(self.incidents)}"
|
| 95 |
+
self.incidents.append({
|
| 96 |
+
"id": incident_id,
|
| 97 |
+
"component": component,
|
| 98 |
+
"severity": severity,
|
| 99 |
+
"timestamp": time.time(),
|
| 100 |
+
})
|
| 101 |
+
return incident_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
+
def add_outcome(self, incident_id: str, success: bool, action: str):
|
| 104 |
+
"""Add an outcome to the graph"""
|
| 105 |
+
outcome_id = f"out_{len(self.outcomes)}"
|
| 106 |
+
self.outcomes.append({
|
| 107 |
+
"id": outcome_id,
|
| 108 |
+
"incident_id": incident_id,
|
| 109 |
+
"success": success,
|
| 110 |
+
"action": action,
|
| 111 |
+
"timestamp": time.time(),
|
| 112 |
+
})
|
| 113 |
+
|
| 114 |
+
# Add edge
|
| 115 |
+
self.edges.append({
|
| 116 |
+
"source": incident_id,
|
| 117 |
+
"target": outcome_id,
|
| 118 |
+
"type": "resolved" if success else "failed",
|
| 119 |
+
})
|
| 120 |
+
return outcome_id
|
| 121 |
|
| 122 |
+
def get_graph_figure(self):
|
| 123 |
+
"""Create Plotly figure of RAG graph"""
|
| 124 |
+
if not self.incidents:
|
| 125 |
return go.Figure()
|
| 126 |
|
| 127 |
+
# Prepare node data
|
| 128 |
+
nodes = []
|
| 129 |
+
node_colors = []
|
| 130 |
+
node_sizes = []
|
| 131 |
|
| 132 |
+
# Add incident nodes
|
| 133 |
+
for inc in self.incidents:
|
| 134 |
+
nodes.append({
|
| 135 |
+
"x": random.random(),
|
| 136 |
+
"y": random.random(),
|
| 137 |
+
"label": f"{inc['component']}\n{inc['severity']}",
|
| 138 |
+
"id": inc["id"],
|
| 139 |
+
"type": "incident",
|
| 140 |
+
})
|
| 141 |
+
node_colors.append("#ff6b6b" if inc["severity"] == "critical" else "#ffa726")
|
| 142 |
+
node_sizes.append(30)
|
| 143 |
|
| 144 |
+
# Add outcome nodes
|
| 145 |
+
for out in self.outcomes:
|
| 146 |
+
nodes.append({
|
| 147 |
+
"x": random.random() + 0.5, # Shift right
|
| 148 |
+
"y": random.random(),
|
| 149 |
+
"label": f"{out['action']}\n{'✅' if out['success'] else '❌'}",
|
| 150 |
+
"id": out["id"],
|
| 151 |
+
"type": "outcome",
|
| 152 |
+
})
|
| 153 |
+
node_colors.append("#4caf50" if out["success"] else "#f44336")
|
| 154 |
+
node_sizes.append(20)
|
|
|
|
|
|
|
|
|
|
| 155 |
|
| 156 |
+
# Create figure
|
| 157 |
+
fig = go.Figure()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
+
# Add edges
|
| 160 |
+
for edge in self.edges:
|
| 161 |
+
source = next((n for n in nodes if n["id"] == edge["source"]), None)
|
| 162 |
+
target = next((n for n in nodes if n["id"] == edge["target"]), None)
|
| 163 |
+
|
| 164 |
+
if source and target:
|
| 165 |
+
fig.add_trace(go.Scatter(
|
| 166 |
+
x=[source["x"], target["x"]],
|
| 167 |
+
y=[source["y"], target["y"]],
|
| 168 |
+
mode="lines",
|
| 169 |
+
line=dict(
|
| 170 |
+
color="#888888",
|
| 171 |
+
width=2,
|
| 172 |
+
dash="dash" if edge["type"] == "failed" else "solid"
|
| 173 |
+
),
|
| 174 |
+
hoverinfo="none",
|
| 175 |
+
showlegend=False,
|
| 176 |
+
))
|
| 177 |
|
| 178 |
+
# Add nodes
|
| 179 |
+
fig.add_trace(go.Scatter(
|
| 180 |
+
x=[n["x"] for n in nodes],
|
| 181 |
+
y=[n["y"] for n in nodes],
|
| 182 |
+
mode="markers+text",
|
| 183 |
+
marker=dict(
|
| 184 |
+
size=node_sizes,
|
| 185 |
+
color=node_colors,
|
| 186 |
+
line=dict(color="white", width=2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
),
|
| 188 |
+
text=[n["label"] for n in nodes],
|
| 189 |
+
textposition="top center",
|
| 190 |
+
hovertext=[f"Type: {n['type']}" for n in nodes],
|
| 191 |
+
hoverinfo="text",
|
| 192 |
+
showlegend=False,
|
| 193 |
+
))
|
| 194 |
|
| 195 |
# Update layout
|
| 196 |
fig.update_layout(
|
| 197 |
+
title="🧠 RAG Graph Memory - Learning from Incidents",
|
| 198 |
+
showlegend=False,
|
| 199 |
+
xaxis=dict(showgrid=False, zeroline=False, showticklabels=False),
|
| 200 |
+
yaxis=dict(showgrid=False, zeroline=False, showticklabels=False),
|
| 201 |
+
plot_bgcolor="white",
|
| 202 |
+
height=500,
|
| 203 |
)
|
| 204 |
|
| 205 |
+
return fig
|
| 206 |
+
|
| 207 |
+
def get_stats(self):
|
| 208 |
+
"""Get graph statistics"""
|
| 209 |
+
successful_outcomes = sum(1 for o in self.outcomes if o["success"])
|
| 210 |
+
|
| 211 |
+
return {
|
| 212 |
+
"incident_nodes": len(self.incidents),
|
| 213 |
+
"outcome_nodes": len(self.outcomes),
|
| 214 |
+
"edges": len(self.edges),
|
| 215 |
+
"success_rate": f"{(successful_outcomes / len(self.outcomes) * 100):.1f}%" if self.outcomes else "0%",
|
| 216 |
+
"patterns_learned": len(self.outcomes) // 3, # Rough estimate
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
# ============================================================================
|
| 220 |
+
# PREDICTIVE ANALYTICS (Based on predictive.py)
|
| 221 |
+
# ============================================================================
|
| 222 |
+
|
| 223 |
+
class PredictiveVisualizer:
|
| 224 |
+
"""Visualize predictive analytics"""
|
| 225 |
+
|
| 226 |
+
def __init__(self):
|
| 227 |
+
self.predictions = []
|
| 228 |
+
|
| 229 |
+
def add_prediction(self, metric: str, current_value: float, predicted_value: float,
|
| 230 |
+
time_to_threshold: Optional[float] = None):
|
| 231 |
+
"""Add a prediction"""
|
| 232 |
+
self.predictions.append({
|
| 233 |
+
"metric": metric,
|
| 234 |
+
"current": current_value,
|
| 235 |
+
"predicted": predicted_value,
|
| 236 |
+
"time_to_threshold": time_to_threshold,
|
| 237 |
+
"timestamp": time.time(),
|
| 238 |
+
"predicted_at": datetime.datetime.now().strftime("%H:%M:%S"),
|
| 239 |
+
})
|
| 240 |
+
|
| 241 |
+
def get_predictive_timeline(self):
|
| 242 |
+
"""Create predictive timeline visualization"""
|
| 243 |
+
if not self.predictions:
|
| 244 |
+
return go.Figure()
|
| 245 |
+
|
| 246 |
+
# Create timeline data
|
| 247 |
+
df = pd.DataFrame(self.predictions[-10:]) # Last 10 predictions
|
| 248 |
+
|
| 249 |
+
fig = go.Figure()
|
| 250 |
+
|
| 251 |
+
# Add current values
|
| 252 |
+
fig.add_trace(go.Scatter(
|
| 253 |
+
x=df["predicted_at"],
|
| 254 |
+
y=df["current"],
|
| 255 |
+
mode="lines+markers",
|
| 256 |
+
name="Current",
|
| 257 |
+
line=dict(color="#4caf50", width=3),
|
| 258 |
+
marker=dict(size=10),
|
| 259 |
+
))
|
| 260 |
+
|
| 261 |
+
# Add predicted values
|
| 262 |
+
fig.add_trace(go.Scatter(
|
| 263 |
+
x=df["predicted_at"],
|
| 264 |
+
y=df["predicted"],
|
| 265 |
+
mode="lines+markers",
|
| 266 |
+
name="Predicted",
|
| 267 |
+
line=dict(color="#ff9800", width=2, dash="dash"),
|
| 268 |
+
marker=dict(size=8),
|
| 269 |
+
))
|
| 270 |
+
|
| 271 |
+
# Add threshold warning if applicable
|
| 272 |
+
for i, row in df.iterrows():
|
| 273 |
+
if row["time_to_threshold"] and row["time_to_threshold"] < 30:
|
| 274 |
+
fig.add_annotation(
|
| 275 |
+
x=row["predicted_at"],
|
| 276 |
+
y=row["predicted"],
|
| 277 |
+
text=f"⚠️ {row['time_to_threshold']:.0f} min",
|
| 278 |
+
showarrow=True,
|
| 279 |
+
arrowhead=2,
|
| 280 |
+
arrowsize=1,
|
| 281 |
+
arrowwidth=2,
|
| 282 |
+
arrowcolor="#ff4444",
|
| 283 |
+
font=dict(color="#ff4444", size=10),
|
| 284 |
+
)
|
| 285 |
+
|
| 286 |
+
# Update layout
|
| 287 |
+
fig.update_layout(
|
| 288 |
+
title="🔮 Predictive Analytics Timeline",
|
| 289 |
+
xaxis_title="Time",
|
| 290 |
+
yaxis_title="Metric Value",
|
| 291 |
+
hovermode="x unified",
|
| 292 |
+
plot_bgcolor="white",
|
| 293 |
+
height=400,
|
| 294 |
+
)
|
| 295 |
|
| 296 |
return fig
|
| 297 |
|
| 298 |
+
# ============================================================================
|
| 299 |
+
# ENTERPRISE MOCK SERVER (Based on enterprise code structure)
|
| 300 |
+
# ============================================================================
|
| 301 |
+
|
| 302 |
+
class MockEnterpriseServer:
|
| 303 |
+
"""Mock enterprise server showing full capabilities"""
|
| 304 |
+
|
| 305 |
+
def __init__(self, license_key: str):
|
| 306 |
+
self.license_key = license_key
|
| 307 |
+
self.license_tier = self._get_license_tier(license_key)
|
| 308 |
+
self.audit_trail = []
|
| 309 |
+
self.learning_engine_active = True
|
| 310 |
+
self.execution_stats = {
|
| 311 |
+
"total_executions": 0,
|
| 312 |
+
"successful_executions": 0,
|
| 313 |
+
"autonomous_executions": 0,
|
| 314 |
+
"approval_workflows": 0,
|
| 315 |
+
"revenue_protected": 0.0,
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
def _get_license_tier(self, license_key: str) -> str:
|
| 319 |
+
"""Determine license tier from key"""
|
| 320 |
+
if "ENTERPRISE" in license_key:
|
| 321 |
+
return "Enterprise"
|
| 322 |
+
elif "PROFESSIONAL" in license_key:
|
| 323 |
+
return "Professional"
|
| 324 |
+
elif "TRIAL" in license_key:
|
| 325 |
+
return "Trial"
|
| 326 |
+
return "Starter"
|
| 327 |
+
|
| 328 |
+
async def execute_healing(self, healing_intent: Dict[str, Any], mode: str = "autonomous") -> Dict[str, Any]:
|
| 329 |
+
"""Mock enterprise execution"""
|
| 330 |
+
execution_id = f"exec_{uuid.uuid4().hex[:16]}"
|
| 331 |
+
start_time = time.time()
|
| 332 |
+
|
| 333 |
+
# Simulate execution time
|
| 334 |
+
await asyncio.sleep(random.uniform(0.5, 2.0))
|
| 335 |
+
|
| 336 |
+
# Determine success based on confidence
|
| 337 |
+
confidence = healing_intent.get("confidence", 0.85)
|
| 338 |
+
success = random.random() < confidence
|
| 339 |
+
|
| 340 |
+
# Calculate simulated impact
|
| 341 |
+
revenue_protected = random.randint(50000, 500000)
|
| 342 |
+
|
| 343 |
+
# Update stats
|
| 344 |
+
self.execution_stats["total_executions"] += 1
|
| 345 |
+
if success:
|
| 346 |
+
self.execution_stats["successful_executions"] += 1
|
| 347 |
+
self.execution_stats["revenue_protected"] += revenue_protected
|
| 348 |
+
|
| 349 |
+
if mode == "autonomous":
|
| 350 |
+
self.execution_stats["autonomous_executions"] += 1
|
| 351 |
+
elif mode == "approval":
|
| 352 |
+
self.execution_stats["approval_workflows"] += 1
|
| 353 |
+
|
| 354 |
+
# Record audit
|
| 355 |
+
audit_entry = {
|
| 356 |
+
"audit_id": f"audit_{uuid.uuid4().hex[:8]}",
|
| 357 |
+
"timestamp": datetime.datetime.now().isoformat(),
|
| 358 |
+
"action": healing_intent["action"],
|
| 359 |
+
"component": healing_intent["component"],
|
| 360 |
+
"mode": mode,
|
| 361 |
+
"success": success,
|
| 362 |
+
"revenue_protected": revenue_protected,
|
| 363 |
+
"execution_time": time.time() - start_time,
|
| 364 |
+
"license_tier": self.license_tier,
|
| 365 |
+
}
|
| 366 |
+
self.audit_trail.append(audit_entry)
|
| 367 |
+
|
| 368 |
+
return {
|
| 369 |
+
"execution_id": execution_id,
|
| 370 |
+
"success": success,
|
| 371 |
+
"message": f"✅ Successfully executed {healing_intent['action']} on {healing_intent['component']}" if success
|
| 372 |
+
else f"⚠️ Execution partially failed for {healing_intent['action']}",
|
| 373 |
+
"revenue_protected": revenue_protected,
|
| 374 |
+
"execution_time": time.time() - start_time,
|
| 375 |
+
"mode": mode,
|
| 376 |
+
"license_tier": self.license_tier,
|
| 377 |
+
"audit_id": audit_entry["audit_id"],
|
| 378 |
+
"learning_recorded": self.learning_engine_active and success,
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
def generate_compliance_report(self, standard: str = "SOC2") -> Dict[str, Any]:
|
| 382 |
+
"""Generate mock compliance report"""
|
| 383 |
+
return {
|
| 384 |
+
"report_id": f"compliance_{uuid.uuid4().hex[:8]}",
|
| 385 |
+
"standard": standard,
|
| 386 |
+
"generated_at": datetime.datetime.now().isoformat(),
|
| 387 |
+
"period": "last_30_days",
|
| 388 |
+
"findings": {
|
| 389 |
+
"audit_trail_complete": True,
|
| 390 |
+
"access_controls_enforced": True,
|
| 391 |
+
"data_encrypted": True,
|
| 392 |
+
"incident_response_documented": True,
|
| 393 |
+
"sla_compliance": "99.95%",
|
| 394 |
+
},
|
| 395 |
+
"summary": f"✅ {standard} compliance requirements fully met",
|
| 396 |
+
"estimated_audit_cost_savings": "$150,000",
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
# ============================================================================
|
| 400 |
+
# LIVE DASHBOARD
|
| 401 |
+
# ============================================================================
|
| 402 |
+
|
| 403 |
+
class LiveDashboard:
|
| 404 |
+
"""Live executive dashboard"""
|
| 405 |
+
|
| 406 |
+
def __init__(self):
|
| 407 |
+
self.total_revenue_protected = 0.0
|
| 408 |
+
self.total_incidents = 0
|
| 409 |
+
self.auto_healed = 0
|
| 410 |
+
self.engineer_hours_saved = 0
|
| 411 |
+
self.start_time = time.time()
|
| 412 |
+
|
| 413 |
+
def add_execution_result(self, revenue_protected: float, auto_healed: bool = True):
|
| 414 |
+
"""Add execution result to dashboard"""
|
| 415 |
+
self.total_revenue_protected += revenue_protected
|
| 416 |
+
self.total_incidents += 1
|
| 417 |
+
if auto_healed:
|
| 418 |
+
self.auto_healed += 1
|
| 419 |
+
self.engineer_hours_saved += 2.5 # 2.5 hours saved per auto-healed incident
|
| 420 |
+
|
| 421 |
+
def get_dashboard_data(self):
|
| 422 |
+
"""Get current dashboard data"""
|
| 423 |
+
uptime_hours = (time.time() - self.start_time) / 3600
|
| 424 |
+
|
| 425 |
+
return {
|
| 426 |
+
"revenue_protected": f"${self.total_revenue_protected:,.0f}",
|
| 427 |
+
"total_incidents": self.total_incidents,
|
| 428 |
+
"auto_healed": self.auto_healed,
|
| 429 |
+
"auto_heal_rate": f"{(self.auto_healed / self.total_incidents * 100):.1f}%" if self.total_incidents > 0 else "0%",
|
| 430 |
+
"engineer_hours_saved": f"{self.engineer_hours_saved:.0f} hours",
|
| 431 |
+
"avg_mttr": "2.3 minutes",
|
| 432 |
+
"industry_mttr": "45 minutes",
|
| 433 |
+
"improvement": "94% faster",
|
| 434 |
+
"uptime": f"{uptime_hours:.1f} hours",
|
| 435 |
+
"roi": "5.2×",
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
# ============================================================================
|
| 439 |
# ENHANCED VISUALIZATION ENGINE
|
| 440 |
# ============================================================================
|
|
|
|
| 586 |
)
|
| 587 |
|
| 588 |
return fig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 589 |
|
| 590 |
# ============================================================================
|
| 591 |
# EXPORT ENGINE
|
|
|
|
| 765 |
"""
|
| 766 |
|
| 767 |
return html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 768 |
|
| 769 |
# ============================================================================
|
| 770 |
+
# DEMO SCENARIOS - ENHANCED
|
| 771 |
# ============================================================================
|
| 772 |
|
| 773 |
ENTERPRISE_SCENARIOS = {
|
|
|
|
| 895 |
"prediction": "Global outage spreading to 5 regions in 12 minutes",
|
| 896 |
"visualization_type": "heatmap",
|
| 897 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 898 |
}
|
| 899 |
|
| 900 |
# ============================================================================
|
| 901 |
+
# MAIN DEMO UI - SIMPLIFIED ENHANCED VERSION
|
| 902 |
# ============================================================================
|
| 903 |
|
| 904 |
def create_enhanced_demo():
|
|
|
|
| 911 |
live_dashboard = LiveDashboard()
|
| 912 |
viz_engine = EnhancedVisualizationEngine()
|
| 913 |
export_engine = ExportEngine()
|
|
|
|
| 914 |
enterprise_servers = {}
|
| 915 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 916 |
with gr.Blocks(title="🚀 ARF Ultimate Investor Demo v3.3.7") as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 917 |
gr.Markdown("""
|
| 918 |
# 🚀 Agentic Reliability Framework - Ultimate Investor Demo v3.3.7
|
| 919 |
### **From Cost Center to Profit Engine: 5.2× ROI with Autonomous Reliability**
|
|
|
|
| 922 |
color: white; padding: 20px; border-radius: 10px; margin: 20px 0;">
|
| 923 |
<div style="display: flex; justify-content: space-between; align-items: center;">
|
| 924 |
<div>
|
| 925 |
+
<h3 style="margin: 0;">🎯 Enhanced Investor Demo</h3>
|
| 926 |
<p style="margin: 5px 0;">Experience the full spectrum: <strong>OSS (Free) ↔ Enterprise (Paid)</strong></p>
|
| 927 |
</div>
|
| 928 |
<div style="text-align: right;">
|
| 929 |
+
<p style="margin: 0;">🚀 <strong>v3.3.7</strong> with enhanced visualizations</p>
|
| 930 |
+
<p style="margin: 0;">📊 Professional analytics & export features</p>
|
| 931 |
</div>
|
| 932 |
</div>
|
| 933 |
</div>
|
| 934 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 935 |
*Watch as ARF transforms reliability from a $2M cost center to a $10M profit engine*
|
| 936 |
""")
|
| 937 |
|
| 938 |
# ================================================================
|
| 939 |
# ENHANCED EXECUTIVE DASHBOARD TAB
|
| 940 |
# ================================================================
|
| 941 |
+
with gr.TabItem("🏢 Executive Dashboard"):
|
| 942 |
gr.Markdown("""
|
| 943 |
## 📊 Real-Time Business Impact Dashboard
|
| 944 |
**Live metrics showing ARF's financial impact in enterprise deployments**
|
| 945 |
""")
|
| 946 |
|
| 947 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 948 |
with gr.Column(scale=1):
|
| 949 |
+
revenue_protected = gr.Markdown("### 💰 Revenue Protected\n**$0**")
|
| 950 |
+
with gr.Column(scale=1):
|
| 951 |
+
auto_heal_rate = gr.Markdown("### ⚡ Auto-Heal Rate\n**0%**")
|
| 952 |
+
with gr.Column(scale=1):
|
| 953 |
+
mttr_improvement = gr.Markdown("### 🚀 MTTR Improvement\n**94% faster**")
|
| 954 |
+
with gr.Column(scale=1):
|
| 955 |
+
engineer_hours = gr.Markdown("### 👷 Engineer Hours Saved\n**0 hours**")
|
|
|
|
|
|
|
|
|
|
| 956 |
|
| 957 |
# Real-time streaming metrics
|
| 958 |
gr.Markdown("### 📈 Real-time System Health Monitor")
|
| 959 |
real_time_metrics = gr.Plot(
|
| 960 |
label="",
|
|
|
|
| 961 |
)
|
| 962 |
|
| 963 |
+
# Enhanced incident feed
|
| 964 |
+
gr.Markdown("### 🔥 Live Incident Feed")
|
| 965 |
+
incident_feed = gr.Dataframe(
|
| 966 |
+
headers=["Time", "Service", "Impact", "Status", "Value Protected"],
|
| 967 |
+
value=[],
|
| 968 |
+
interactive=False,
|
| 969 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 970 |
|
| 971 |
+
# Top customers protected
|
| 972 |
gr.Markdown("### 🏆 Top Customers Protected")
|
| 973 |
+
customers_table = gr.Dataframe(
|
| 974 |
+
headers=["Customer", "Industry", "Revenue Protected", "Uptime", "ROI"],
|
| 975 |
+
value=[
|
| 976 |
+
["FinTech Corp", "Financial Services", "$2.1M", "99.99%", "8.3×"],
|
| 977 |
+
["HealthSys Inc", "Healthcare", "$1.8M", "99.995%", "Priceless"],
|
| 978 |
+
["SaaSPlatform", "SaaS", "$1.5M", "99.98%", "6.8×"],
|
| 979 |
+
["MediaStream", "Media", "$1.2M", "99.97%", "7.1×"],
|
| 980 |
+
["LogisticsPro", "Logistics", "$900K", "99.96%", "6.5×"],
|
| 981 |
+
],
|
| 982 |
+
interactive=False,
|
| 983 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 984 |
|
| 985 |
# ================================================================
|
| 986 |
# ENHANCED LIVE WAR ROOM TAB
|
| 987 |
# ================================================================
|
| 988 |
+
with gr.TabItem("🔥 Live War Room"):
|
| 989 |
gr.Markdown("""
|
| 990 |
## 🔥 Multi-Incident War Room
|
| 991 |
+
**Watch ARF handle 5+ simultaneous incidents across different services**
|
| 992 |
""")
|
| 993 |
|
| 994 |
with gr.Row():
|
| 995 |
with gr.Column(scale=1):
|
| 996 |
+
# Enhanced scenario selector
|
| 997 |
scenario_selector = gr.Dropdown(
|
| 998 |
choices=list(ENTERPRISE_SCENARIOS.keys()),
|
| 999 |
value="🚨 Black Friday Payment Crisis",
|
| 1000 |
label="🎬 Select Incident Scenario",
|
| 1001 |
info="Choose an enterprise incident scenario",
|
| 1002 |
filterable=True,
|
|
|
|
| 1003 |
)
|
| 1004 |
|
| 1005 |
+
# Visualization type selector
|
| 1006 |
viz_type = gr.Radio(
|
| 1007 |
+
choices=["Radar Chart", "Heatmap", "Stream"],
|
| 1008 |
value="Radar Chart",
|
| 1009 |
label="📊 Visualization Type",
|
| 1010 |
info="Choose how to visualize the metrics"
|
| 1011 |
)
|
| 1012 |
|
| 1013 |
+
# Metrics display
|
| 1014 |
metrics_display = gr.JSON(
|
| 1015 |
label="📊 Current Metrics",
|
| 1016 |
value={},
|
| 1017 |
)
|
| 1018 |
|
| 1019 |
+
# Business impact
|
| 1020 |
impact_display = gr.JSON(
|
| 1021 |
label="💰 Business Impact Analysis",
|
| 1022 |
value={},
|
| 1023 |
)
|
| 1024 |
|
| 1025 |
+
# Action buttons
|
| 1026 |
with gr.Row():
|
| 1027 |
+
oss_action_btn = gr.Button("🤖 OSS: Analyze & Recommend", variant="secondary")
|
| 1028 |
+
enterprise_action_btn = gr.Button("🚀 Enterprise: Execute Healing", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1029 |
|
| 1030 |
+
# Enterprise configuration
|
| 1031 |
with gr.Accordion("⚙️ Enterprise Configuration", open=False):
|
| 1032 |
license_input = gr.Textbox(
|
| 1033 |
label="🔑 Enterprise License Key",
|
| 1034 |
value="ARF-ENT-DEMO-2024",
|
| 1035 |
+
info="Demo license - real enterprise requires purchase"
|
|
|
|
| 1036 |
)
|
| 1037 |
|
| 1038 |
execution_mode = gr.Radio(
|
|
|
|
| 1041 |
label="⚙️ Execution Mode",
|
| 1042 |
info="How to execute the healing action"
|
| 1043 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1044 |
|
| 1045 |
with gr.Column(scale=2):
|
| 1046 |
# Enhanced results display with tabs
|
|
|
|
| 1049 |
result_display = gr.JSON(
|
| 1050 |
label="",
|
| 1051 |
value={},
|
|
|
|
| 1052 |
)
|
| 1053 |
|
| 1054 |
with gr.TabItem("📈 Performance Analysis"):
|
|
|
|
| 1061 |
label="Incident Severity Heatmap",
|
| 1062 |
)
|
| 1063 |
|
| 1064 |
+
# RAG Graph visualization
|
| 1065 |
+
rag_graph = gr.Plot(
|
| 1066 |
+
label="🧠 RAG Graph Memory Visualization",
|
| 1067 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1068 |
|
| 1069 |
# Predictive Timeline
|
| 1070 |
predictive_timeline = gr.Plot(
|
| 1071 |
label="🔮 Predictive Analytics Timeline",
|
|
|
|
| 1072 |
)
|
| 1073 |
|
| 1074 |
# Function to update scenario with enhanced visualization
|
| 1075 |
+
def update_scenario_enhanced(scenario_name, viz_type):
|
| 1076 |
scenario = ENTERPRISE_SCENARIOS.get(scenario_name, {})
|
|
|
|
| 1077 |
|
| 1078 |
# Add to RAG graph
|
| 1079 |
incident_id = rag_visualizer.add_incident(
|
|
|
|
| 1098 |
)
|
| 1099 |
elif viz_type == "Heatmap":
|
| 1100 |
viz_fig = viz_engine.create_heatmap_timeline([scenario])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1101 |
else: # Stream
|
| 1102 |
viz_fig = viz_engine.create_real_time_metrics_stream()
|
| 1103 |
|
|
|
|
|
|
|
|
|
|
| 1104 |
return {
|
| 1105 |
metrics_display: scenario.get("metrics", {}),
|
| 1106 |
impact_display: business_calc.calculate_impact(scenario.get("business_impact", {})),
|
|
|
|
| 1108 |
predictive_timeline: predictive_viz.get_predictive_timeline(),
|
| 1109 |
performance_chart: viz_fig,
|
| 1110 |
incident_heatmap: viz_engine.create_heatmap_timeline([scenario]),
|
| 1111 |
+
real_time_metrics: viz_engine.create_real_time_metrics_stream(),
|
| 1112 |
+
}
|
| 1113 |
+
|
| 1114 |
+
# Function for OSS analysis
|
| 1115 |
+
async def oss_analysis(scenario_name):
|
| 1116 |
+
scenario = ENTERPRISE_SCENARIOS.get(scenario_name, {})
|
| 1117 |
+
|
| 1118 |
+
return {
|
| 1119 |
+
result_display: {
|
| 1120 |
+
"status": "OSS_ADVISORY_COMPLETE",
|
| 1121 |
+
"action": scenario.get("oss_action", "unknown"),
|
| 1122 |
+
"component": scenario.get("component", "unknown"),
|
| 1123 |
+
"message": f"✅ OSS analysis recommends {scenario.get('oss_action')} for {scenario.get('component')}",
|
| 1124 |
+
"requires_enterprise": True,
|
| 1125 |
+
"confidence": 0.85,
|
| 1126 |
+
"enterprise_features_required": [
|
| 1127 |
+
"autonomous_execution",
|
| 1128 |
+
"learning_engine",
|
| 1129 |
+
"audit_trails",
|
| 1130 |
+
"compliance_reporting",
|
| 1131 |
+
],
|
| 1132 |
+
"upgrade_url": "https://arf.dev/enterprise",
|
| 1133 |
+
}
|
| 1134 |
+
}
|
| 1135 |
+
|
| 1136 |
+
# Function for Enterprise execution
|
| 1137 |
+
async def enterprise_execution(scenario_name, license_key, mode):
|
| 1138 |
+
scenario = ENTERPRISE_SCENARIOS.get(scenario_name, {})
|
| 1139 |
+
|
| 1140 |
+
# Create or get enterprise server
|
| 1141 |
+
if license_key not in enterprise_servers:
|
| 1142 |
+
enterprise_servers[license_key] = MockEnterpriseServer(license_key)
|
| 1143 |
+
|
| 1144 |
+
server = enterprise_servers[license_key]
|
| 1145 |
+
|
| 1146 |
+
# Create healing intent
|
| 1147 |
+
healing_intent = {
|
| 1148 |
+
"action": scenario.get("enterprise_action", "unknown"),
|
| 1149 |
+
"component": scenario.get("component", "unknown"),
|
| 1150 |
+
"justification": f"Enterprise execution for {scenario_name}",
|
| 1151 |
+
"confidence": 0.92,
|
| 1152 |
+
"parameters": {"scale_factor": 3} if "scale" in scenario.get("enterprise_action", "") else {},
|
| 1153 |
+
}
|
| 1154 |
+
|
| 1155 |
+
# Execute
|
| 1156 |
+
result = await server.execute_healing(healing_intent, mode)
|
| 1157 |
+
|
| 1158 |
+
# Update dashboard
|
| 1159 |
+
live_dashboard.add_execution_result(result["revenue_protected"])
|
| 1160 |
+
|
| 1161 |
+
# Add to RAG graph
|
| 1162 |
+
rag_visualizer.add_outcome(
|
| 1163 |
+
incident_id=f"inc_{len(rag_visualizer.incidents)-1}",
|
| 1164 |
+
success=result["success"],
|
| 1165 |
+
action=healing_intent["action"]
|
| 1166 |
+
)
|
| 1167 |
+
|
| 1168 |
+
# Update dashboard displays
|
| 1169 |
+
dashboard_data = live_dashboard.get_dashboard_data()
|
| 1170 |
+
|
| 1171 |
+
return {
|
| 1172 |
+
result_display: {
|
| 1173 |
+
**result,
|
| 1174 |
+
"rag_stats": rag_visualizer.get_stats(),
|
| 1175 |
+
"dashboard_update": dashboard_data,
|
| 1176 |
+
},
|
| 1177 |
+
rag_graph: rag_visualizer.get_graph_figure(),
|
| 1178 |
+
revenue_protected: f"### 💰 Revenue Protected\n**{dashboard_data['revenue_protected']}**",
|
| 1179 |
+
auto_heal_rate: f"### ⚡ Auto-Heal Rate\n**{dashboard_data['auto_heal_rate']}**",
|
| 1180 |
+
engineer_hours: f"### 👷 Engineer Hours Saved\n**{dashboard_data['engineer_hours_saved']}**",
|
| 1181 |
}
|
| 1182 |
|
| 1183 |
# Connect events
|
| 1184 |
scenario_selector.change(
|
| 1185 |
fn=update_scenario_enhanced,
|
| 1186 |
+
inputs=[scenario_selector, viz_type],
|
| 1187 |
outputs=[metrics_display, impact_display, rag_graph, predictive_timeline,
|
| 1188 |
+
performance_chart, incident_heatmap, real_time_metrics]
|
| 1189 |
)
|
| 1190 |
|
| 1191 |
viz_type.change(
|
| 1192 |
+
fn=lambda scenario, viz_type: update_scenario_enhanced(scenario, viz_type),
|
| 1193 |
+
inputs=[scenario_selector, viz_type],
|
| 1194 |
+
outputs=[performance_chart, incident_heatmap]
|
| 1195 |
+
)
|
| 1196 |
+
|
| 1197 |
+
oss_action_btn.click(
|
| 1198 |
+
fn=oss_analysis,
|
| 1199 |
+
inputs=[scenario_selector],
|
| 1200 |
+
outputs=[result_display]
|
| 1201 |
+
)
|
| 1202 |
+
|
| 1203 |
+
enterprise_action_btn.click(
|
| 1204 |
+
fn=enterprise_execution,
|
| 1205 |
+
inputs=[scenario_selector, license_input, execution_mode],
|
| 1206 |
+
outputs=[result_display, rag_graph, revenue_protected, auto_heal_rate, engineer_hours]
|
| 1207 |
)
|
| 1208 |
|
| 1209 |
# ================================================================
|
| 1210 |
# ENHANCED LEARNING ENGINE TAB
|
| 1211 |
# ================================================================
|
| 1212 |
+
with gr.TabItem("🧠 Learning Engine"):
|
| 1213 |
gr.Markdown("""
|
| 1214 |
## 🧠 RAG Graph Learning Engine
|
| 1215 |
**Watch ARF learn from every incident and outcome**
|
|
|
|
| 1217 |
|
| 1218 |
with gr.Row():
|
| 1219 |
with gr.Column(scale=1):
|
| 1220 |
+
# Learning stats
|
| 1221 |
learning_stats = gr.JSON(
|
| 1222 |
label="📊 Learning Statistics",
|
| 1223 |
value=rag_visualizer.get_stats(),
|
| 1224 |
)
|
| 1225 |
|
| 1226 |
+
# Simulate learning button
|
| 1227 |
+
simulate_learning_btn = gr.Button("🎓 Simulate Learning Cycle", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1228 |
|
| 1229 |
+
# Export knowledge button
|
| 1230 |
+
export_btn = gr.Button("📤 Export Learned Patterns", variant="secondary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1231 |
|
| 1232 |
with gr.Column(scale=2):
|
| 1233 |
+
# RAG Graph visualization
|
| 1234 |
+
learning_graph = gr.Plot(
|
| 1235 |
+
label="🔗 Knowledge Graph Visualization",
|
| 1236 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1237 |
|
| 1238 |
+
# Simulate learning
|
| 1239 |
+
def simulate_learning():
|
| 1240 |
+
# Add random incidents and outcomes
|
| 1241 |
+
components = ["payment-service", "database", "api-service", "cache", "auth-service"]
|
| 1242 |
+
actions = ["scale_out", "restart_container", "rollback", "circuit_breaker"]
|
|
|
|
| 1243 |
|
| 1244 |
+
for _ in range(3):
|
| 1245 |
component = random.choice(components)
|
| 1246 |
incident_id = rag_visualizer.add_incident(
|
| 1247 |
component=component,
|
|
|
|
| 1250 |
|
| 1251 |
rag_visualizer.add_outcome(
|
| 1252 |
incident_id=incident_id,
|
| 1253 |
+
success=random.random() > 0.2, # 80% success rate
|
| 1254 |
action=random.choice(actions)
|
| 1255 |
)
|
| 1256 |
|
| 1257 |
+
return {
|
| 1258 |
+
learning_graph: rag_visualizer.get_graph_figure(),
|
| 1259 |
+
learning_stats: rag_visualizer.get_stats(),
|
| 1260 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1261 |
|
| 1262 |
# Connect events
|
| 1263 |
simulate_learning_btn.click(
|
| 1264 |
+
fn=simulate_learning,
|
| 1265 |
+
outputs=[learning_graph, learning_stats]
|
|
|
|
| 1266 |
)
|
| 1267 |
|
| 1268 |
+
export_btn.click(
|
| 1269 |
+
fn=lambda: {"message": "✅ Knowledge patterns exported to Neo4j for persistent learning"},
|
| 1270 |
+
outputs=[gr.JSON(value={"message": "✅ Knowledge patterns exported"})]
|
| 1271 |
)
|
| 1272 |
|
| 1273 |
# ================================================================
|
| 1274 |
# ENHANCED COMPLIANCE AUDITOR TAB
|
| 1275 |
# ================================================================
|
| 1276 |
+
with gr.TabItem("📝 Compliance Auditor"):
|
| 1277 |
gr.Markdown("""
|
| 1278 |
## 📝 Automated Compliance & Audit Trails
|
| 1279 |
**Enterprise-only: Generate SOC2/GDPR/HIPAA compliance reports in seconds**
|
|
|
|
| 1281 |
|
| 1282 |
with gr.Row():
|
| 1283 |
with gr.Column(scale=1):
|
| 1284 |
+
# Compliance standard selector
|
| 1285 |
compliance_standard = gr.Dropdown(
|
| 1286 |
choices=["SOC2", "GDPR", "HIPAA", "ISO27001", "PCI-DSS"],
|
| 1287 |
value="SOC2",
|
| 1288 |
label="📋 Compliance Standard",
|
|
|
|
| 1289 |
)
|
| 1290 |
|
| 1291 |
+
# License input
|
| 1292 |
compliance_license = gr.Textbox(
|
| 1293 |
label="🔑 Enterprise License Required",
|
| 1294 |
value="ARF-ENT-COMPLIANCE",
|
| 1295 |
interactive=True,
|
|
|
|
| 1296 |
)
|
| 1297 |
|
| 1298 |
+
# Generate report button
|
| 1299 |
+
generate_report_btn = gr.Button("⚡ Generate Compliance Report", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1300 |
|
| 1301 |
# Audit trail viewer
|
|
|
|
| 1302 |
audit_trail = gr.Dataframe(
|
| 1303 |
+
label="📜 Live Audit Trail",
|
| 1304 |
+
headers=["Time", "Action", "Component", "User", "Status"],
|
| 1305 |
value=[],
|
| 1306 |
)
|
| 1307 |
|
| 1308 |
with gr.Column(scale=2):
|
| 1309 |
+
# Report display
|
| 1310 |
+
compliance_report = gr.JSON(
|
| 1311 |
+
label="📄 Compliance Report",
|
| 1312 |
+
value={},
|
| 1313 |
+
)
|
| 1314 |
+
|
| 1315 |
+
# Generate compliance report
|
| 1316 |
+
def generate_compliance_report(standard, license_key):
|
| 1317 |
+
if "ENT" not in license_key:
|
| 1318 |
+
return {
|
| 1319 |
+
compliance_report: {
|
| 1320 |
+
"error": "Enterprise license required",
|
| 1321 |
+
"message": "Compliance features require Enterprise license",
|
| 1322 |
+
"upgrade_url": "https://arf.dev/enterprise",
|
| 1323 |
+
}
|
| 1324 |
+
}
|
| 1325 |
+
|
| 1326 |
+
# Create mock enterprise server
|
| 1327 |
+
if license_key not in enterprise_servers:
|
| 1328 |
+
enterprise_servers[license_key] = MockEnterpriseServer(license_key)
|
| 1329 |
+
|
| 1330 |
+
server = enterprise_servers[license_key]
|
| 1331 |
+
report = server.generate_compliance_report(standard)
|
| 1332 |
+
|
| 1333 |
+
# Update audit trail
|
| 1334 |
+
audit_data = []
|
| 1335 |
+
for entry in server.audit_trail[-10:]: # Last 10 entries
|
| 1336 |
+
audit_data.append([
|
| 1337 |
+
entry["timestamp"][11:19], # Just time
|
| 1338 |
+
entry["action"],
|
| 1339 |
+
entry["component"],
|
| 1340 |
+
"ARF System",
|
| 1341 |
+
"✅" if entry["success"] else "⚠️",
|
| 1342 |
+
])
|
| 1343 |
+
|
| 1344 |
+
return {
|
| 1345 |
+
compliance_report: report,
|
| 1346 |
+
audit_trail: audit_data,
|
| 1347 |
+
}
|
| 1348 |
+
|
| 1349 |
+
generate_report_btn.click(
|
| 1350 |
+
fn=generate_compliance_report,
|
| 1351 |
+
inputs=[compliance_standard, compliance_license],
|
| 1352 |
+
outputs=[compliance_report, audit_trail]
|
| 1353 |
+
)
|
| 1354 |
|
| 1355 |
# ================================================================
|
| 1356 |
# ENHANCED ROI CALCULATOR TAB
|
| 1357 |
# ================================================================
|
| 1358 |
+
with gr.TabItem("💰 ROI Calculator"):
|
| 1359 |
gr.Markdown("""
|
| 1360 |
## 💰 Enterprise ROI Calculator
|
| 1361 |
**Calculate your potential savings with ARF Enterprise**
|
|
|
|
| 1363 |
|
| 1364 |
with gr.Row():
|
| 1365 |
with gr.Column(scale=1):
|
| 1366 |
+
# Inputs
|
|
|
|
|
|
|
| 1367 |
monthly_revenue = gr.Number(
|
| 1368 |
value=1000000,
|
| 1369 |
label="Monthly Revenue ($)",
|
| 1370 |
+
info="Your company's monthly revenue"
|
|
|
|
|
|
|
|
|
|
| 1371 |
)
|
| 1372 |
|
| 1373 |
monthly_incidents = gr.Slider(
|
|
|
|
| 1375 |
maximum=100,
|
| 1376 |
value=20,
|
| 1377 |
label="Monthly Incidents",
|
| 1378 |
+
info="Reliability incidents per month"
|
|
|
|
| 1379 |
)
|
| 1380 |
|
| 1381 |
team_size = gr.Slider(
|
|
|
|
| 1383 |
maximum=20,
|
| 1384 |
value=3,
|
| 1385 |
label="SRE/DevOps Team Size",
|
| 1386 |
+
info="Engineers handling incidents"
|
|
|
|
| 1387 |
)
|
| 1388 |
|
| 1389 |
+
avg_incident_cost = gr.Number(
|
|
|
|
|
|
|
| 1390 |
value=1500,
|
| 1391 |
label="Average Incident Cost ($)",
|
| 1392 |
+
info="Revenue loss + engineer time per incident"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1393 |
)
|
| 1394 |
|
| 1395 |
+
calculate_roi_btn = gr.Button("📈 Calculate ROI", variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1396 |
|
| 1397 |
with gr.Column(scale=2):
|
| 1398 |
+
# Results
|
| 1399 |
+
roi_results = gr.JSON(
|
| 1400 |
+
label="📊 ROI Analysis Results",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1401 |
value={},
|
| 1402 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1403 |
|
| 1404 |
+
# Visualization
|
| 1405 |
+
roi_chart = gr.Plot(
|
| 1406 |
+
label="📈 ROI Visualization",
|
|
|
|
|
|
|
| 1407 |
)
|
| 1408 |
+
|
| 1409 |
+
# Calculate ROI
|
| 1410 |
+
def calculate_roi(revenue, incidents, team_size, incident_cost):
|
| 1411 |
+
# ARF metrics (based on real deployments)
|
| 1412 |
+
auto_heal_rate = 0.817 # 81.7%
|
| 1413 |
+
mttr_reduction = 0.94 # 94% faster
|
| 1414 |
+
engineer_time_savings = 0.85 # 85% less engineer time
|
| 1415 |
|
| 1416 |
+
# Calculations
|
| 1417 |
+
manual_incidents = incidents * (1 - auto_heal_rate)
|
| 1418 |
+
auto_healed = incidents * auto_heal_rate
|
| 1419 |
+
|
| 1420 |
+
# Costs without ARF
|
| 1421 |
+
traditional_cost = incidents * incident_cost
|
| 1422 |
+
engineer_cost = incidents * 2.5 * 100 * team_size # 2.5 hours at $100/hour
|
| 1423 |
+
total_traditional_cost = traditional_cost + engineer_cost
|
| 1424 |
+
|
| 1425 |
+
# Costs with ARF
|
| 1426 |
+
arf_incident_cost = manual_incidents * incident_cost * (1 - mttr_reduction)
|
| 1427 |
+
arf_engineer_cost = manual_incidents * 2.5 * 100 * team_size * engineer_time_savings
|
| 1428 |
+
total_arf_cost = arf_incident_cost + arf_engineer_cost
|
| 1429 |
+
|
| 1430 |
+
# Savings
|
| 1431 |
+
monthly_savings = total_traditional_cost - total_arf_cost
|
| 1432 |
+
annual_savings = monthly_savings * 12
|
| 1433 |
+
implementation_cost = 47500 # $47.5K implementation
|
| 1434 |
+
|
| 1435 |
+
# ROI
|
| 1436 |
+
payback_months = implementation_cost / monthly_savings if monthly_savings > 0 else 999
|
| 1437 |
+
first_year_roi = ((annual_savings - implementation_cost) / implementation_cost) * 100
|
| 1438 |
+
|
| 1439 |
+
# Create chart
|
| 1440 |
+
fig = go.Figure(data=[
|
| 1441 |
+
go.Bar(name='Without ARF', x=['Monthly Cost'], y=[total_traditional_cost], marker_color='#ff4444'),
|
| 1442 |
+
go.Bar(name='With ARF', x=['Monthly Cost'], y=[total_arf_cost], marker_color='#44ff44'),
|
| 1443 |
+
])
|
| 1444 |
+
fig.update_layout(
|
| 1445 |
+
title="Monthly Cost Comparison",
|
| 1446 |
+
yaxis_title="Cost ($)",
|
| 1447 |
+
barmode='group',
|
| 1448 |
+
height=300,
|
| 1449 |
+
)
|
| 1450 |
+
|
| 1451 |
+
return {
|
| 1452 |
+
roi_results: {
|
| 1453 |
+
"monthly_revenue": f"${revenue:,.0f}",
|
| 1454 |
+
"monthly_incidents": incidents,
|
| 1455 |
+
"auto_heal_rate": f"{auto_heal_rate*100:.1f}%",
|
| 1456 |
+
"mttr_improvement": f"{mttr_reduction*100:.0f}%",
|
| 1457 |
+
"monthly_savings": f"${monthly_savings:,.0f}",
|
| 1458 |
+
"annual_savings": f"${annual_savings:,.0f}",
|
| 1459 |
+
"implementation_cost": f"${implementation_cost:,.0f}",
|
| 1460 |
+
"payback_period": f"{payback_months:.1f} months",
|
| 1461 |
+
"first_year_roi": f"{first_year_roi:.1f}%",
|
| 1462 |
+
"key_metrics": {
|
| 1463 |
+
"incidents_auto_healed": f"{auto_healed:.0f}/month",
|
| 1464 |
+
"engineer_hours_saved": f"{(incidents * 2.5 * engineer_time_savings):.0f} hours/month",
|
| 1465 |
+
"revenue_protected": f"${(incidents * incident_cost * auto_heal_rate):,.0f}/month",
|
| 1466 |
+
}
|
| 1467 |
+
},
|
| 1468 |
+
roi_chart: fig,
|
| 1469 |
+
}
|
| 1470 |
+
|
| 1471 |
+
calculate_roi_btn.click(
|
| 1472 |
+
fn=calculate_roi,
|
| 1473 |
+
inputs=[monthly_revenue, monthly_incidents, team_size, avg_incident_cost],
|
| 1474 |
+
outputs=[roi_results, roi_chart]
|
| 1475 |
+
)
|
| 1476 |
|
| 1477 |
+
# Enhanced footer
|
|
|
|
|
|
|
| 1478 |
gr.Markdown("""
|
| 1479 |
---
|
| 1480 |
|
|
|
|
| 1500 |
<p>🌐 <strong>Website:</strong> <a href="https://arf.dev" target="_blank">https://arf.dev</a></p>
|
| 1501 |
<p>📚 <strong>Documentation:</strong> <a href="https://docs.arf.dev" target="_blank">https://docs.arf.dev</a></p>
|
| 1502 |
<p>💻 <strong>GitHub:</strong> <a href="https://github.com/petterjuan/agentic-reliability-framework" target="_blank">petterjuan/agentic-reliability-framework</a></p>
|
|
|
|
| 1503 |
</div>
|
| 1504 |
</div>
|
| 1505 |
</div>
|
| 1506 |
|
| 1507 |
<div style="text-align: center; padding: 15px; background: #2c3e50; color: white; border-radius: 5px; margin-top: 20px;">
|
| 1508 |
<p style="margin: 0;">🚀 ARF Ultimate Investor Demo v3.3.7 | Enhanced with Professional Analytics & Export Features</p>
|
| 1509 |
+
<p style="margin: 5px 0 0 0; font-size: 12px;">Built with ❤️ using Gradio & Plotly</p>
|
|
|
|
| 1510 |
</div>
|
| 1511 |
""")
|
| 1512 |
|
|
|
|
| 1532 |
share=False,
|
| 1533 |
show_error=True,
|
| 1534 |
theme="soft",
|
|
|
|
| 1535 |
)
|
| 1536 |
|
| 1537 |
if __name__ == "__main__":
|