| """ |
| Minimalist, Math-First UI Components for ARF OSS |
| HF Spaces + Gradio compatible |
| """ |
|
|
| import gradio as gr |
| from typing import Dict, Any |
|
|
|
|
| |
| |
| |
| 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;"> |
| <strong>Agentic Reliability Framework</strong><br/> |
| version={version} · mode={mode} · edition=oss |
| </div> |
| <hr/> |
| """ |
| ) |
|
|
|
|
| |
| |
| |
| 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> |
| """ |
| ) |
|
|
|
|
| |
| |
| |
| 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( |
| "execution_state = idle", |
| elem_classes=["mono"], |
| ) |
|
|
| return scenario_dropdown, execution_mode, run_button, metrics |
|
|
|
|
| |
| |
| |
| def create_tab2_business_roi(): |
| with gr.Column(): |
| gr.Markdown("### Impact Estimation") |
|
|
| roi_output = gr.Markdown( |
| """ |
| loss_rate_usd_per_hour = 0 |
| recovery_time_minutes = ∅ |
| expected_savings = ∅ |
| """, |
| elem_classes=["mono"], |
| ) |
|
|
| return roi_output |
|
|
|
|
| |
| |
| |
| 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"], |
| ) |
|
|
|
|
| |
| |
| |
| def create_tab4_audit_trail(): |
| with gr.Column(): |
| gr.Markdown("### Execution Trace") |
|
|
| audit_df = gr.Dataframe( |
| headers=["step", "state", "Δt_ms"], |
| datatype=["str", "str", "number"], |
| row_count=6, |
| ) |
|
|
| return audit_df |
|
|
|
|
| |
| |
| |
| def create_tab5_learning_engine(): |
| with gr.Column(): |
| gr.Markdown("### Learning State") |
|
|
| gr.Markdown( |
| """ |
| vector_memory = enabled |
| feedback_loop = passive |
| online_learning = disabled |
| """, |
| elem_classes=["mono"], |
| ) |
|
|
|
|
| |
| |
| |
| def create_footer() -> gr.HTML: |
| return gr.HTML( |
| """ |
| <hr/> |
| <div style="font-family: monospace; font-size: 12px;"> |
| ARF OSS · Apache-2.0 · 2025 |
| </div> |
| """ |
| ) |
|
|