-
-
๐๏ธ
-
- Architecture Boundary Context
+
+
+
+
+
${int(scenario["business_impact"]["revenue_loss_per_hour"] * 0.85):,}
+
Savings/Hour
+
-
- ROI includes value from both OSS advisory analysis and Enterprise autonomous execution.
- This demonstrates the complete ARF value proposition across the architectural boundary.
-
+
+
+
+ ARF Detection: Detected in 45s with 94% confidence.
+ {scenario["metrics"]["affected_users"]:,} users affected.
+
+ """
+
+ # Get visualizations as Plotly figures
+ telemetry_fig = create_simple_telemetry_plot(scenario_name, DEMO_CONFIG["use_true_arf"])
+ impact_fig = create_simple_impact_plot(scenario_name, DEMO_CONFIG["use_true_arf"])
+ timeline_fig = create_timeline_plot(scenario_name, DEMO_CONFIG["use_true_arf"])
+
+ return scenario_card_html, telemetry_fig, impact_fig, timeline_fig
-
-
- Ready to realize these savings?
- Contact sales for Enterprise license โ
+ except Exception as e:
+ logger.error(f"Error updating scenario display: {e}")
+ # Return fallback values
+ error_html = f"""
+
+
Error loading scenario
+
{str(e)}
-
+ """
+ return error_html, create_empty_plot("Error"), create_empty_plot("Error"), create_empty_plot("Error")
+
+# ===========================================
+# ADDITIONAL FIXED FUNCTIONS
+# ===========================================
+
+def get_installation_status() -> Dict[str, Any]:
"""
+ Get installation status - returns JSON/dict
+ FIXED: Returns dict for gr.JSON() component
+ """
+ installation = {
+ "oss_installed": ARF_OSS_AVAILABLE,
+ "enterprise_installed": False, # Enterprise would require separate check
+ "oss_version": "3.3.9" if ARF_OSS_AVAILABLE else "not_installed",
+ "enterprise_version": "not_installed",
+ "execution_allowed": False, # OSS doesn't allow execution
+ "recommendations": [
+ "OSS provides advisory analysis only",
+ "Enterprise required for autonomous execution"
+ ],
+ "badges": {
+ "oss": {
+ "text": "โ
ARF OSS v3.3.9" if ARF_OSS_AVAILABLE else "โ ๏ธ Mock ARF",
+ "color": "#10b981" if ARF_OSS_AVAILABLE else "#f59e0b",
+ "icon": "โ
" if ARF_OSS_AVAILABLE else "โ ๏ธ"
+ },
+ "enterprise": {
+ "text": "๐ Enterprise Required",
+ "color": "#64748b",
+ "icon": "๐"
+ }
+ },
+ "timestamp": datetime.now().isoformat(),
+ "components_available": ["TelemetryCollector", "ReliabilityAnalyzer", "AutoHealingEngine"] if ARF_OSS_AVAILABLE else ["simulated"],
+ "license": "Apache 2.0" if ARF_OSS_AVAILABLE else "demo"
+ }
+ return installation
+
+def get_installation_badges() -> str:
+ """
+ Get installation badges as HTML
+ This is fine as it's used by gr.HTML()
+ """
+ installation = get_installation_status()
+ oss_badge = installation["badges"]["oss"]
+ enterprise_badge = installation["badges"]["enterprise"]
- # Create simple ROI chart
- roi_chart = create_empty_plot("ROI Analysis Chart", True)
-
- return roi_html, roi_chart
+ return f"""
+
+
+ {oss_badge['icon']} {oss_badge['text']}
+
+
+ {enterprise_badge['icon']} {enterprise_badge['text']}
+
+
+ """
# ===========================================
-# CREATE DEMO INTERFACE - FIXED VERSION
+# ROI CALCULATION FUNCTION (Fixed)
# ===========================================
-def create_demo_interface():
- """Create demo interface using modular components with boundary awareness"""
-
- import gradio as gr
-
- # Get components
- components = get_components()
-
- # Get CSS styles
- css_styles = components["get_styles"]()
-
- # Store CSS for later use in launch()
- global _demo_css
- _demo_css = css_styles
-
- # Get boundary badges for the interface
- boundary_badges = BoundaryManager.get_boundary_badges()
-
- # Create interface without css parameter (will be added in launch)
- with gr.Blocks(
- title=f"๐ ARF Investor Demo v3.8.0 - TRUE ARF v3.3.7"
- ) as demo:
-
- # Header
- header_html = components["create_header"]("3.3.7", settings.use_true_arf)
-
- # Status bar with boundary badges
- status_html = components["create_status_bar"]()
+
+def calculate_roi(scenario_name: str, monthly_incidents: int, team_size: int) -> Tuple[Dict[str, Any], go.Figure]:
+ """
+ Calculate ROI - returns dict and Plotly figure
+ FIXED: Returns (dict, Plotly figure) for (gr.JSON(), gr.Plot())
+ """
+ try:
+ # Calculate ROI based on inputs
+ impact_per_incident = {
+ "Cache Miss Storm": 8500,
+ "Database Connection Pool Exhaustion": 4200,
+ "Kubernetes Memory Leak": 5500,
+ "API Rate Limit Storm": 3800,
+ "Network Partition": 12000,
+ "Storage I/O Saturation": 6800
+ }.get(scenario_name, 5000)
+
+ # Calculations
+ annual_impact = impact_per_incident * monthly_incidents * 12
+ potential_savings = int(annual_impact * 0.82) # ARF saves 82%
+ enterprise_cost = 625000 # Annual enterprise license
+ roi_multiplier = round(potential_savings / enterprise_cost, 1)
+ payback_months = round((enterprise_cost / (potential_savings / 12)), 1)
+ annual_roi = int((potential_savings - enterprise_cost) / enterprise_cost * 100)
- # Add boundary badges as a separate element
- boundary_display = gr.HTML(value=boundary_badges, visible=settings.show_boundaries)
+ # ROI results dict
+ roi_results = {
+ "status": "success",
+ "scenario": scenario_name,
+ "inputs": {
+ "monthly_incidents": monthly_incidents,
+ "team_size": team_size,
+ "impact_per_incident": f"${impact_per_incident:,}"
+ },
+ "calculations": {
+ "annual_impact_without_arf": f"${annual_impact:,}",
+ "potential_savings_with_arf": f"${potential_savings:,}",
+ "enterprise_annual_cost": f"${enterprise_cost:,}",
+ "roi_multiplier": f"{roi_multiplier}ร",
+ "payback_months": f"{payback_months}",
+ "annual_roi_percentage": f"{annual_roi}%",
+ "net_annual_savings": f"${potential_savings - enterprise_cost:,}"
+ },
+ "breakdown": {
+ "engineer_cost_savings": f"${team_size * 200000 * 0.3:,}", # 30% engineer time saved
+ "incident_cost_savings": f"${potential_savings - (team_size * 200000 * 0.3):,}",
+ "total_opportunity": f"${potential_savings:,}"
+ },
+ "recommendation": f"ARF Enterprise provides {roi_multiplier}ร ROI with {payback_months}-month payback",
+ "timestamp": datetime.now().isoformat(),
+ "arf_version": "3.3.9"
+ }
- # ============ 5 TABS ============
- with gr.Tabs(elem_classes="tab-nav"):
-
- # TAB 1: Live Incident Demo
- with gr.TabItem("๐ฅ Live Incident Demo", id="tab1"):
- (scenario_dropdown, scenario_card, telemetry_viz, impact_viz,
- workflow_header, detection_agent, recall_agent, decision_agent,
- oss_section, enterprise_section, oss_btn, enterprise_btn,
- approval_toggle, mcp_mode, timeline_viz,
- detection_time, mttr, auto_heal, savings,
- oss_results_display, enterprise_results_display, approval_display, demo_btn) = components["create_tab1_incident_demo"]()
-
- # TAB 2: Business ROI
- with gr.TabItem("๐ฐ Business Impact & ROI", id="tab2"):
- (dashboard_output, roi_scenario_dropdown, monthly_slider, team_slider,
- calculate_btn, roi_output, roi_chart) = components["create_tab2_business_roi"](components["INCIDENT_SCENARIOS"])
-
- # TAB 3: Enterprise Features
- with gr.TabItem("๐ข Enterprise Features", id="tab3"):
- (license_display, validate_btn, trial_btn, upgrade_btn,
- mcp_mode_tab3, mcp_mode_info, features_table, integrations_table) = components["create_tab3_enterprise_features"]()
-
- # TAB 4: Audit Trail
- with gr.TabItem("๐ Audit Trail & History", id="tab4"):
- (refresh_btn, clear_btn, export_btn, execution_table,
- incident_table, export_text) = components["create_tab4_audit_trail"]()
-
- # TAB 5: Learning Engine
- with gr.TabItem("๐ง Learning Engine", id="tab5"):
- (learning_graph, graph_type, show_labels, search_query, search_btn,
- clear_btn_search, search_results, stats_display, patterns_display,
- performance_display) = components["create_tab5_learning_engine"]()
+ # Create ROI visualization
+ categories = ['Without ARF', 'With ARF', 'Net Savings']
+ values = [annual_impact, annual_impact - potential_savings, potential_savings - enterprise_cost]
+ colors = ['#ef4444', '#10b981', '#8b5cf6']
+
+ fig = go.Figure(data=[
+ go.Bar(
+ name='Annual Cost',
+ x=categories,
+ y=values,
+ marker_color=colors,
+ text=[f'${v:,.0f}' for v in values],
+ textposition='auto',
+ )
+ ])
+
+ fig.update_layout(
+ title=dict(
+ text=f"ROI Analysis: {scenario_name}",
+ font=dict(size=18, color='#1e293b')
+ ),
+ xaxis_title="Scenario",
+ yaxis_title="Annual Cost ($)",
+ height=400,
+ plot_bgcolor='white',
+ showlegend=False,
+ margin=dict(l=20, r=20, t=60, b=20)
+ )
- # Footer
- footer_html = components["create_footer"]()
+ # Add ROI multiplier annotation
+ fig.add_annotation(
+ x=2, y=values[2] * 1.1,
+ text=f"ROI: {roi_multiplier}ร",
+ showarrow=False,
+ font=dict(size=14, color="#8b5cf6", weight="bold"),
+ bgcolor="rgba(139, 92, 246, 0.1)",
+ borderpad=4
+ )
- # ============ EVENT HANDLERS ============
+ logger.info(f"โ
ROI calculated for {scenario_name}")
+ return roi_results, fig
- # Update scenario display when dropdown changes
- scenario_dropdown.change(
- fn=update_scenario_display,
- inputs=[scenario_dropdown],
- outputs=[scenario_card, telemetry_viz, impact_viz, timeline_viz]
- )
+ except Exception as e:
+ logger.error(f"Error calculating ROI: {e}")
+ error_results = {
+ "status": "error",
+ "error": str(e),
+ "scenario": scenario_name,
+ "timestamp": datetime.now().isoformat()
+ }
+ return error_results, create_empty_plot("ROI Calculation Error")
+
+# ===========================================
+# MAIN APPLICATION
+# ===========================================
+
+def create_demo_interface():
+ """Create the demo interface with fixed data types"""
+ with gr.Blocks(title="ARF OSS v3.3.9 Demo", theme=gr.themes.Soft()) as demo:
+ gr.Markdown("# ๐ ARF OSS v3.3.9 Demo")
+ gr.Markdown("### Agentic Reliability Framework - OSS Edition")
- # Run OSS Analysis
- oss_btn.click(
- fn=run_true_arf_analysis,
- inputs=[scenario_dropdown],
- outputs=[
- detection_agent, recall_agent, decision_agent,
- oss_results_display, incident_table
- ]
+ # Installation status
+ installation = get_installation_status()
+ gr.Markdown(f"**Status:** {installation['badges']['oss']['text']}")
+
+ # Scenario selection
+ scenario_dropdown = gr.Dropdown(
+ choices=[
+ "Cache Miss Storm",
+ "Database Connection Pool Exhaustion",
+ "Kubernetes Memory Leak",
+ "API Rate Limit Storm",
+ "Network Partition",
+ "Storage I/O Saturation"
+ ],
+ value="Cache Miss Storm",
+ label="Select Scenario"
)
- # Execute Enterprise Healing
- enterprise_btn.click(
- fn=execute_enterprise_healing,
- inputs=[scenario_dropdown, approval_toggle, mcp_mode],
- outputs=[approval_display, enterprise_results_display, execution_table]
- )
+ # Update button
+ update_btn = gr.Button("Update Display", variant="primary")
- # Run Complete Demo with boundary progression
- @AsyncRunner.async_to_sync
- async def run_complete_demo_async(scenario_name):
- """Run a complete demo walkthrough with true ARF and boundary awareness"""
- # Step 1: Update scenario
- update_result = update_scenario_display(scenario_name)
-
- # Step 2: Run true ARF analysis
- oss_result = await run_true_arf_analysis(scenario_name)
-
- # Step 3: Execute Enterprise (simulation) with boundary context
- await asyncio.sleep(1)
-
- scenario = components["INCIDENT_SCENARIOS"].get(scenario_name, {})
- impact = scenario.get("business_impact", {})
- revenue_loss = impact.get("revenue_loss_per_hour", get_scenario_impact(scenario_name))
- savings = int(revenue_loss * 0.85)
+ # Results area
+ with gr.Row():
+ with gr.Column(scale=1):
+ scenario_card = gr.HTML(label="Scenario Details")
- # Get boundary context
- boundaries = BoundaryManager.get_system_boundaries()
+ with gr.Column(scale=2):
+ telemetry_plot = gr.Plot(label="Telemetry")
+ impact_plot = gr.Plot(label="Business Impact")
+ timeline_plot = gr.Plot(label="Timeline Comparison")
+
+ # Analysis controls
+ with gr.Row():
+ analyze_btn = gr.Button("๐ Run OSS Analysis", variant="secondary")
+ execute_btn = gr.Button("โก Execute Enterprise Healing", variant="primary")
+
+ # Results displays
+ with gr.Row():
+ with gr.Column(scale=1):
+ analysis_results = gr.JSON(label="OSS Analysis Results")
- # Get orchestrator for execution simulation
- orchestrator = components["DemoOrchestrator"]()
- execution_result = await orchestrator.execute_healing(scenario_name, "autonomous")
-
- enterprise_results = {
- "demo_mode": "Complete Walkthrough",
- "scenario": scenario_name,
- "arf_version": "3.3.7",
- "true_oss_used": True,
- "enterprise_simulated": True,
- "boundary_progression": [
- f"1. Incident detected - {boundaries['oss']['label']}",
- f"2. OSS analysis completed - {boundaries['oss']['label']}",
- f"3. HealingIntent created - {boundaries['oss']['label']}",
- f"4. Enterprise license validated ({boundaries['enterprise']['label']})",
- f"5. Autonomous execution simulated ({boundaries['enterprise']['label']}+)",
- f"6. Outcome recorded in RAG memory"
+ with gr.Column(scale=1):
+ execution_results = gr.JSON(label="Enterprise Execution Results")
+
+ # ROI Calculator
+ gr.Markdown("## ๐ฐ ROI Calculator")
+ with gr.Row():
+ roi_scenario = gr.Dropdown(
+ choices=[
+ "Cache Miss Storm",
+ "Database Connection Pool Exhaustion",
+ "Kubernetes Memory Leak"
],
- "execution_result": execution_result,
- "outcome": {
- "recovery_time": "12 minutes",
- "manual_comparison": "45 minutes",
- "cost_saved": f"${savings:,}",
- "users_protected": "45,000",
- "learning": "Pattern added to RAG memory"
- },
- "architectural_summary": f"This demonstrates the complete ARF v3.3.7 architecture: {boundaries['oss']['label']} for advisory analysis โ {boundaries['enterprise']['label']} for autonomous execution"
- }
-
- # Create demo completion message with enhanced boundary context
- demo_message = f"""
-
-
-
-
-
-
- โ
Complete Demo: Architecture Validated
-
-
- ARF v3.3.7 โข OSS advises โ Enterprise executes
-
-
-
-
- BOUNDARY VALIDATED
-
-
-
-
-
-
-
-
-
-
- {boundaries['oss']['label']}
-
-
- โข Anomaly detected in 45s
- โข 3 similar incidents recalled
- โข 94% confidence healing plan
- โข Apache 2.0 license validated
-
-
-
-
-
-
-
- {boundaries['enterprise']['label']}
-
-
- โข Autonomous execution simulated
- โข Rollback guarantee: 100%
- โข 12min vs 45min recovery
- โข ${savings:,} saved
-
-
-
-
-
-
-
- ๐๏ธ Architecture Flow
-
-
-
-
-
OSS Advisory
-
Apache 2.0
-
-
-
-
-
-
-
-
Enterprise
-
Commercial
-
-
-
-
-
-
-
-
-
-
Cost Saved
-
${savings:,}
-
-
-
ROI Multiplier
-
5.2ร
-
-
-
-
-
-
-
-
โ
-
-
- Architecture Successfully Validated
-
-
- Clear separation maintained: OSS for advisory intelligence, Enterprise for autonomous execution
-
-
-
-
-
-
-
-
- """
-
- # IMPORTANT FIX: The demo_message should update approval_display, not create a new output
- # Update the enterprise_results_display to include demo completion info
- enterprise_results["demo_completion_message"] = demo_message
-
- # Get updated tables
- incident_table_data = get_audit_manager().get_incident_table()
- execution_table_data = get_audit_manager().get_execution_table()
-
- # Combine all results - FIXED OUTPUT COUNT
- return (
- *update_result, # 4 outputs: scenario_card, telemetry_viz, impact_viz, timeline_viz
- *oss_result[:3], # 3 outputs: detection_agent, recall_agent, decision_agent
- oss_result[3], # 1 output: oss_results_display
- enterprise_results, # 1 output: enterprise_results_display
- demo_message, # 1 output: approval_display
- incident_table_data, # 1 output: incident_table
- execution_table_data # 1 output: execution_table
- ) # TOTAL: 4 + 3 + 1 + 1 + 1 + 1 + 1 = 12 outputs (matches expectations)
-
- # FIXED: demo_btn.click with correct output count
- demo_btn.click(
- fn=run_complete_demo_async,
- inputs=[scenario_dropdown],
- outputs=[
- scenario_card, telemetry_viz, impact_viz, timeline_viz, # 4
- detection_agent, recall_agent, decision_agent, # 3
- oss_results_display, # 1
- enterprise_results_display, # 1
- approval_display, # 1
- incident_table, # 1
- execution_table # 1
- ] # TOTAL: 12 outputs
- )
-
- # ROI Calculation
- calculate_btn.click(
- fn=calculate_roi,
- inputs=[roi_scenario_dropdown, monthly_slider, team_slider],
- outputs=[roi_output, roi_chart]
- )
-
- # Update ROI scenario
- roi_scenario_dropdown.change(
- fn=lambda x: get_components()["EnhancedROICalculator"]().calculate_comprehensive_roi(),
- inputs=[],
- outputs=[roi_output]
- )
-
- # Update ROI chart
- monthly_slider.change(
- fn=lambda x, y: calculate_roi(roi_scenario_dropdown.value, x, y)[1],
- inputs=[monthly_slider, team_slider],
- outputs=[roi_chart]
- )
-
- team_slider.change(
- fn=lambda x, y: calculate_roi(roi_scenario_dropdown.value, x, y)[1],
- inputs=[monthly_slider, team_slider],
- outputs=[roi_chart]
- )
-
- # Audit Trail Functions
- def refresh_audit_trail():
- """Refresh audit trail tables"""
- return (
- get_audit_manager().get_execution_table(),
- get_audit_manager().get_incident_table()
+ value="Cache Miss Storm",
+ label="Scenario"
)
+ monthly_incidents = gr.Slider(1, 50, value=15, label="Monthly Incidents")
+ team_size = gr.Slider(1, 20, value=5, label="Team Size")
- def clear_audit_trail():
- """Clear audit trail"""
- get_audit_manager().clear()
- return [], []
+ roi_btn = gr.Button("Calculate ROI", variant="primary")
- def export_audit_trail():
- """Export audit trail as JSON"""
- audit_data = {
- "executions": get_audit_manager().executions,
- "incidents": get_audit_manager().incidents,
- "boundary_crossings": get_audit_manager().boundary_crossings,
- "export_time": datetime.datetime.now().isoformat(),
- "arf_version": "3.3.7",
- "architecture": "OSS advises โ Enterprise executes"
- }
- return json.dumps(audit_data, indent=2)
+ with gr.Row():
+ roi_output = gr.JSON(label="ROI Results")
+ roi_chart = gr.Plot(label="ROI Visualization")
- refresh_btn.click(
- fn=refresh_audit_trail,
- inputs=[],
- outputs=[execution_table, incident_table]
- )
+ # ===== Event Handlers =====
- clear_btn.click(
- fn=clear_audit_trail,
- inputs=[],
- outputs=[execution_table, incident_table]
+ # Update scenario display
+ update_btn.click(
+ fn=update_scenario_display,
+ inputs=[scenario_dropdown],
+ outputs=[scenario_card, telemetry_plot, impact_plot, timeline_plot]
)
- export_btn.click(
- fn=export_audit_trail,
- inputs=[],
- outputs=[export_text]
+ scenario_dropdown.change(
+ fn=update_scenario_display,
+ inputs=[scenario_dropdown],
+ outputs=[scenario_card, telemetry_plot, impact_plot, timeline_plot]
)
- # Enterprise Features
- def validate_license():
- """Validate enterprise license with boundary context"""
- boundaries = BoundaryManager.get_system_boundaries()
-
- if boundaries["enterprise"]["available"]:
- return {
- "status": "โ
Valid License",
- "license_type": "Enterprise",
- "version": boundaries["enterprise"]["version"],
- "expires": "2025-12-31",
- "capabilities": boundaries["enterprise"]["capabilities"],
- "boundary_context": f"Real {boundaries['enterprise']['label']} detected"
- }
- else:
- return {
- "status": "โ ๏ธ Demo Mode",
- "license_type": "Simulated",
- "version": boundaries["enterprise"]["version"],
- "expires": "Demo only",
- "capabilities": boundaries["enterprise"]["capabilities"],
- "boundary_context": f"Simulating {boundaries['enterprise']['label']} - requires license",
- "contact": "sales@arf.dev"
- }
-
- validate_btn.click(
- fn=validate_license,
- inputs=[],
- outputs=[license_display]
+ # Run OSS analysis
+ analyze_btn.click(
+ fn=run_true_arf_analysis,
+ inputs=[scenario_dropdown],
+ outputs=[analysis_results]
)
- # Initialize with boundary badges
- demo.load(
- fn=lambda: boundary_badges,
- inputs=[],
- outputs=[boundary_display]
+ # Execute enterprise healing
+ execute_btn.click(
+ fn=execute_enterprise_healing,
+ inputs=[scenario_dropdown],
+ outputs=[execution_results]
)
- # Load default scenario
- demo.load(
- fn=lambda: update_scenario_display(settings.default_scenario),
- inputs=[],
- outputs=[scenario_card, telemetry_viz, impact_viz, timeline_viz]
+ # Calculate ROI
+ roi_btn.click(
+ fn=calculate_roi,
+ inputs=[roi_scenario, monthly_incidents, team_size],
+ outputs=[roi_output, roi_chart]
)
- # Load ROI data
+ # Initialize with default scenario
demo.load(
- fn=lambda: calculate_roi(settings.default_scenario, 15, 5),
+ fn=lambda: update_scenario_display("Cache Miss Storm"),
inputs=[],
- outputs=[roi_output, roi_chart]
+ outputs=[scenario_card, telemetry_plot, impact_plot, timeline_plot]
)
-
- logger.info("โ
Demo interface created successfully with boundary awareness")
return demo
-# ===========================================
-# LAUNCH FUNCTION
-# ===========================================
-def launch_demo():
- """Launch the demo application with proper configuration"""
- try:
- logger.info("๐ Starting ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION")
-
- # Check installation
- installation = get_installation_status()
- boundaries = BoundaryManager.get_system_boundaries()
-
- logger.info("=" * 60)
- logger.info("๐๏ธ SYSTEM ARCHITECTURE BOUNDARIES:")
- logger.info(f" OSS: {boundaries['oss']['label']} v{boundaries['oss']['version']}")
- logger.info(f" Enterprise: {boundaries['enterprise']['label']} v{boundaries['enterprise']['version']}")
- logger.info(f" Mode: {boundaries['demo_mode']['architecture']}")
- logger.info("=" * 60)
-
- # Create interface
- demo = create_demo_interface()
-
- # Get CSS styles
- components = get_components()
- css_styles = components["get_styles"]()
-
- # Configure for Hugging Face Spaces
- launch_config = {
- "server_name": "0.0.0.0",
- "server_port": 7860,
- "share": False,
- "favicon_path": None,
- "quiet": False,
- "show_error": True,
- "debug": False,
- "max_threads": 40,
- }
-
- # Add CSS if available
- if css_styles:
- launch_config["css"] = css_styles
-
- logger.info("โ
Launch configuration ready")
-
- return demo, launch_config
-
- except Exception as e:
- logger.error(f"โ Launch failed: {e}", exc_info=True)
-
- # Create minimal fallback interface
- import gradio as gr
-
- with gr.Blocks(title="ARF Demo - Fallback Mode") as fallback_demo:
- gr.HTML(f"""
-
-
๐จ ARF Demo Failed to Start
-
Error: {str(e)}
-
-
Troubleshooting Steps:
-
- - Check logs for detailed error
- - Ensure all dependencies are installed
- - Try: pip install agentic-reliability-framework==3.3.7
- - Restart the application
-
-
-
- """)
-
- return fallback_demo, {"server_name": "0.0.0.0", "server_port": 7860}
+def main():
+ """Main entry point"""
+ logger.info("=" * 60)
+ logger.info("๐ ARF OSS v3.3.9 Demo Application")
+ logger.info(f"โ
ARF OSS Available: {ARF_OSS_AVAILABLE}")
+ logger.info("=" * 60)
+
+ demo = create_demo_interface()
+ demo.launch(
+ server_name="0.0.0.0",
+ server_port=7860,
+ share=False
+ )
-# ===========================================
-# MAIN EXECUTION
-# ===========================================
if __name__ == "__main__":
- try:
- logger.info("๐ ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION")
- logger.info("=" * 60)
- logger.info("Enhanced version with clear boundaries and reliable visualizations")
- logger.info("Fixed to show clear OSS vs Enterprise boundaries with architectural honesty")
- logger.info("=" * 60)
-
- # Launch the demo
- demo, config = launch_demo()
-
- print("\n" + "="*60)
- print("๐ ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION")
- print("๐ Architecture: OSS advises โ Enterprise executes")
- print("๐ Starting on http://localhost:7860")
- print("="*60 + "\n")
-
- # Launch with error handling
- try:
- demo.launch(**config)
- except Exception as launch_error:
- logger.error(f"โ Launch error: {launch_error}")
-
- # Try alternative launch without CSS
- if "css" in config:
- logger.info("โ ๏ธ Retrying without CSS...")
- config.pop("css", None)
- demo.launch(**config)
- else:
- # Last resort: simple launch
- demo.launch(server_name="0.0.0.0", server_port=7860)
-
- except KeyboardInterrupt:
- logger.info("๐ Demo stopped by user")
- except Exception as e:
- logger.error(f"โ Fatal error: {e}", exc_info=True)
- sys.exit(1)
\ No newline at end of file
+ main()
\ No newline at end of file