File size: 3,370 Bytes
bbe2211
ebdbbf6
1d377e2
ebdbbf6
 
 
1d377e2
 
 
bbe2211
d203412
d6a094c
1d377e2
d6a094c
 
 
1d377e2
d6a094c
1d377e2
 
 
d6a094c
1d377e2
 
 
 
d6a094c
ebdbbf6
d6a094c
 
d203412
 
ebdbbf6
1d377e2
ebdbbf6
1d377e2
 
 
d6a094c
1d377e2
ebdbbf6
1d377e2
d6a094c
 
 
adb7e74
d203412
d6a094c
1d377e2
d6a094c
1d377e2
 
 
ebdbbf6
1d377e2
 
 
 
 
 
ebdbbf6
 
1d377e2
ebdbbf6
 
 
 
 
1d377e2
ebdbbf6
1d377e2
 
 
 
ebdbbf6
1d377e2
d203412
cc6b2b9
d6a094c
1d377e2
d6a094c
ebdbbf6
 
1d377e2
d203412
1d377e2
ebdbbf6
1d377e2
 
 
ebdbbf6
 
 
d203412
1d377e2
d6a094c
 
 
1d377e2
d6a094c
 
ebdbbf6
1d377e2
d6a094c
ebdbbf6
 
1d377e2
 
 
d6a094c
1d377e2
ebdbbf6
 
 
d6a094c
 
 
 
 
 
ebdbbf6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
"""
Minimalist, Math-First UI Components for ARF OSS
Contract-compatible with app.py

Principles:
- Deterministic layout
- Low entropy
- Systems-first semantics
- OSS honesty
"""

import gradio as gr
from typing import Dict, Any


# ============================================================
# HEADER (SIGNATURE FIXED)
# ============================================================
def create_header(version: str, mock_mode: bool) -> gr.HTML:
    mode = "mock" if mock_mode else "live"

    return gr.HTML(
        f"""
        <div style="font-family: monospace; line-height: 1.4;">
            <strong>Agentic Reliability Framework</strong><br/>
            version={version} · mode={mode} · build=oss
        </div>
        <hr/>
        """
    )


# ============================================================
# STATUS BAR (SIGNATURE FIXED)
# ============================================================
def create_status_bar(system_online: bool = True) -> gr.HTML:
    status = "ONLINE" if system_online else "OFFLINE"

    return gr.HTML(
        f"""
        <div style="font-family: monospace; font-size: 13px;">
            system={status} | agent_core=active | audit=enabled
        </div>
        """
    )


# ============================================================
# TAB 1 — INCIDENT DEMO
# ============================================================
def create_tab1_incident_demo(
    scenarios: Dict[str, Any]
):
    with gr.Column():
        gr.Markdown("### Incident Input", elem_classes=["mono"])

        scenario_dropdown = gr.Dropdown(
            label="Scenario",
            choices=list(scenarios.keys()),
            value=list(scenarios.keys())[0],
        )

        execution_mode = gr.Radio(
            label="Execution Mode",
            choices=["advisory", "approval", "autonomous"],
            value="advisory",
        )

        run_button = gr.Button("Run Analysis", variant="primary")

        metrics = gr.Markdown(
            "No execution yet.",
            elem_classes=["mono"],
        )

    return scenario_dropdown, execution_mode, run_button, metrics


# ============================================================
# TAB 2 — BUSINESS ROI
# ============================================================
def create_tab2_business_roi():
    with gr.Column():
        gr.Markdown("### Impact Estimation (Model Output)")

        roi_output = gr.Markdown(
            """
            loss_rate_usd_per_hour = 0  
            recovery_time_minutes = ∅  
            confidence_interval = ∅
            """,
            elem_classes=["mono"],
        )

    return roi_output


# ============================================================
# TAB 3 — ENTERPRISE FEATURES
# ============================================================
def create_tab3_enterprise_features():
    with gr.Column():
        gr.Markdown("### Enterprise Capabilities")

        gr.Markdown(
            """
            autonomous_execution = false  
            policy_engine = locked  
            sla_enforcement = locked  

            status = OSS_LIMITED
            """,
            elem_classes=["mono"],
        )


# ============================================================
# TAB 4 — AUDIT TRAIL
# ============================================================
def create_tab4_audit_trail():
    with gr.Column():