petter2025 commited on
Commit
5b3f47c
Β·
verified Β·
1 Parent(s): f51f76a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +52 -47
app.py CHANGED
@@ -1,7 +1,6 @@
1
- # app.py - Complete fixed version
2
- # πŸš€ ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION
3
- # ENHANCED VERSION WITH CLEAR BOUNDARIES AND RELIABLE VISUALIZATIONS
4
- # Fixed to show clear OSS vs Enterprise boundaries with architectural honesty
5
 
6
  import logging
7
  import sys
@@ -811,40 +810,46 @@ def import_components() -> Dict[str, Any]:
811
  from demo.scenarios import INCIDENT_SCENARIOS
812
  components["INCIDENT_SCENARIOS"] = INCIDENT_SCENARIOS
813
 
814
- # Try to import TrueARF337Orchestrator
815
  try:
816
- from core.true_arf_orchestrator import TrueARF337Orchestrator
817
- components["DemoOrchestrator"] = TrueARF337Orchestrator
818
  except ImportError:
819
- # Fallback to real ARF integration
820
  try:
821
- from core.real_arf_integration import RealARFIntegration
822
- components["DemoOrchestrator"] = RealARFIntegration
 
823
  except ImportError:
824
- # Create a minimal mock orchestrator
825
- class MockOrchestrator:
826
- async def analyze_incident(self, scenario_name, scenario_data):
827
- return {
828
- "status": "mock",
829
- "scenario": scenario_name,
830
- "message": "Mock analysis (no real ARF available)",
831
- "boundary_note": "OSS advisory mode - execution requires Enterprise",
832
- "demo_display": {
833
- "real_arf_version": "mock",
834
- "true_oss_used": False,
835
- "enterprise_simulated": True,
836
- "architectural_boundary": "OSS advises β†’ Enterprise would execute"
 
 
 
 
 
 
837
  }
838
- }
839
- async def execute_healing(self, scenario_name, mode="autonomous"):
840
- return {
841
- "status": "mock",
842
- "scenario": scenario_name,
843
- "message": "Mock execution (no real ARF available)",
844
- "boundary_note": "Simulated Enterprise execution - real execution requires infrastructure",
845
- "enterprise_features_used": ["simulated_execution", "mock_rollback", "demo_mode"]
846
- }
847
- components["DemoOrchestrator"] = MockOrchestrator
848
 
849
  # FIXED: EnhancedROICalculator with proper mock fallback
850
  try:
@@ -1265,7 +1270,7 @@ class AuditTrailManager:
1265
  "incidents": self.incidents,
1266
  "boundary_crossings": self.boundary_crossings,
1267
  "export_time": datetime.datetime.now().isoformat(),
1268
- "version": "3.3.7",
1269
  "architecture": "OSS advises β†’ Enterprise executes"
1270
  }
1271
 
@@ -1525,7 +1530,7 @@ async def run_true_arf_analysis(scenario_name: str) -> tuple:
1525
  oss_results_dict = {
1526
  "status": "success",
1527
  "scenario": scenario_name,
1528
- "arf_version": boundaries["oss"]["version"],
1529
  "analysis": {
1530
  "detected": True,
1531
  "confidence": 94,
@@ -1814,11 +1819,11 @@ def create_demo_interface():
1814
 
1815
  # Create interface without css parameter (will be added in launch)
1816
  with gr.Blocks(
1817
- title=f"πŸš€ ARF Investor Demo v3.8.0 - TRUE ARF v3.3.7"
1818
  ) as demo:
1819
 
1820
  # Header
1821
- header_html = components["create_header"]("3.3.7", settings.use_true_arf)
1822
 
1823
  # Status bar with boundary badges
1824
  status_html = components["create_status_bar"]()
@@ -1916,7 +1921,7 @@ def create_demo_interface():
1916
  enterprise_results = {
1917
  "demo_mode": "Complete Walkthrough",
1918
  "scenario": scenario_name,
1919
- "arf_version": "3.3.7",
1920
  "true_oss_used": True,
1921
  "enterprise_simulated": True,
1922
  "boundary_progression": [
@@ -1935,7 +1940,7 @@ def create_demo_interface():
1935
  "users_protected": "45,000",
1936
  "learning": "Pattern added to RAG memory"
1937
  },
1938
- "architectural_summary": f"This demonstrates the complete ARF v3.3.7 architecture: {boundaries['oss']['label']} for advisory analysis β†’ {boundaries['enterprise']['label']} for autonomous execution"
1939
  }
1940
 
1941
  # Create demo completion message with enhanced boundary context
@@ -1952,7 +1957,7 @@ def create_demo_interface():
1952
  βœ… Complete Demo: Architecture Validated
1953
  </h3>
1954
  <p style="margin: 5px 0 0 0; font-size: 13px; color: #64748b;">
1955
- ARF v3.3.7 β€’ OSS advises β†’ Enterprise executes
1956
  </p>
1957
  </div>
1958
  <div style="display: flex; align-items: center; gap: 8px;">
@@ -2156,7 +2161,7 @@ def create_demo_interface():
2156
  "incidents": get_audit_manager().incidents,
2157
  "boundary_crossings": get_audit_manager().boundary_crossings,
2158
  "export_time": datetime.datetime.now().isoformat(),
2159
- "arf_version": "3.3.7",
2160
  "architecture": "OSS advises β†’ Enterprise executes"
2161
  }
2162
  return json.dumps(audit_data, indent=2)
@@ -2241,7 +2246,7 @@ def create_demo_interface():
2241
  def launch_demo():
2242
  """Launch the demo application with proper configuration"""
2243
  try:
2244
- logger.info("πŸš€ Starting ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION")
2245
 
2246
  # Check installation
2247
  installation = get_installation_status()
@@ -2297,7 +2302,7 @@ def launch_demo():
2297
  <ol style="text-align: left; color: #475569;">
2298
  <li>Check logs for detailed error</li>
2299
  <li>Ensure all dependencies are installed</li>
2300
- <li>Try: pip install agentic-reliability-framework==3.3.7</li>
2301
  <li>Restart the application</li>
2302
  </ol>
2303
  </div>
@@ -2311,17 +2316,17 @@ def launch_demo():
2311
  # ===========================================
2312
  if __name__ == "__main__":
2313
  try:
2314
- logger.info("πŸš€ ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION")
2315
  logger.info("=" * 60)
2316
- logger.info("Enhanced version with clear boundaries and reliable visualizations")
2317
- logger.info("Fixed to show clear OSS vs Enterprise boundaries with architectural honesty")
2318
  logger.info("=" * 60)
2319
 
2320
  # Launch the demo
2321
  demo, config = launch_demo()
2322
 
2323
  print("\n" + "="*60)
2324
- print("πŸš€ ARF Ultimate Investor Demo v3.8.0 - ENTERPRISE EDITION")
2325
  print("πŸ“Š Architecture: OSS advises β†’ Enterprise executes")
2326
  print("🌐 Starting on http://localhost:7860")
2327
  print("="*60 + "\n")
 
1
+ # app.py - Complete fixed version with version consistency
2
+ # πŸš€ ARF Ultimate Investor Demo v3.3.9 - ENTERPRISE EDITION
3
+ # Enhanced with clear OSS vs Enterprise boundaries
 
4
 
5
  import logging
6
  import sys
 
810
  from demo.scenarios import INCIDENT_SCENARIOS
811
  components["INCIDENT_SCENARIOS"] = INCIDENT_SCENARIOS
812
 
813
+ # Try to import TrueARFOrchestrator (renamed for version consistency)
814
  try:
815
+ from core.true_arf_orchestrator import TrueARFOrchestrator
816
+ components["DemoOrchestrator"] = TrueARFOrchestrator
817
  except ImportError:
818
+ # Fallback to old name for compatibility during transition
819
  try:
820
+ from core.true_arf_orchestrator import TrueARF337Orchestrator
821
+ components["DemoOrchestrator"] = TrueARF337Orchestrator
822
+ logger.warning("⚠️ Using TrueARF337Orchestrator - rename to TrueARFOrchestrator for version consistency")
823
  except ImportError:
824
+ # Fallback to real ARF integration
825
+ try:
826
+ from core.real_arf_integration import RealARFIntegration
827
+ components["DemoOrchestrator"] = RealARFIntegration
828
+ except ImportError:
829
+ # Create a minimal mock orchestrator
830
+ class MockOrchestrator:
831
+ async def analyze_incident(self, scenario_name, scenario_data):
832
+ return {
833
+ "status": "mock",
834
+ "scenario": scenario_name,
835
+ "message": "Mock analysis (no real ARF available)",
836
+ "boundary_note": "OSS advisory mode - execution requires Enterprise",
837
+ "demo_display": {
838
+ "real_arf_version": "mock",
839
+ "true_oss_used": False,
840
+ "enterprise_simulated": True,
841
+ "architectural_boundary": "OSS advises β†’ Enterprise would execute"
842
+ }
843
  }
844
+ async def execute_healing(self, scenario_name, mode="autonomous"):
845
+ return {
846
+ "status": "mock",
847
+ "scenario": scenario_name,
848
+ "message": "Mock execution (no real ARF available)",
849
+ "boundary_note": "Simulated Enterprise execution - real execution requires infrastructure",
850
+ "enterprise_features_used": ["simulated_execution", "mock_rollback", "demo_mode"]
851
+ }
852
+ components["DemoOrchestrator"] = MockOrchestrator
 
853
 
854
  # FIXED: EnhancedROICalculator with proper mock fallback
855
  try:
 
1270
  "incidents": self.incidents,
1271
  "boundary_crossings": self.boundary_crossings,
1272
  "export_time": datetime.datetime.now().isoformat(),
1273
+ "version": "3.3.9",
1274
  "architecture": "OSS advises β†’ Enterprise executes"
1275
  }
1276
 
 
1530
  oss_results_dict = {
1531
  "status": "success",
1532
  "scenario": scenario_name,
1533
+ "arf_version": "3.3.9",
1534
  "analysis": {
1535
  "detected": True,
1536
  "confidence": 94,
 
1819
 
1820
  # Create interface without css parameter (will be added in launch)
1821
  with gr.Blocks(
1822
+ title=f"πŸš€ ARF Investor Demo v3.3.9 - TRUE ARF OSS Integration"
1823
  ) as demo:
1824
 
1825
  # Header
1826
+ header_html = components["create_header"]("3.3.9", settings.use_true_arf)
1827
 
1828
  # Status bar with boundary badges
1829
  status_html = components["create_status_bar"]()
 
1921
  enterprise_results = {
1922
  "demo_mode": "Complete Walkthrough",
1923
  "scenario": scenario_name,
1924
+ "arf_version": "3.3.9",
1925
  "true_oss_used": True,
1926
  "enterprise_simulated": True,
1927
  "boundary_progression": [
 
1940
  "users_protected": "45,000",
1941
  "learning": "Pattern added to RAG memory"
1942
  },
1943
+ "architectural_summary": f"This demonstrates the complete ARF v3.3.9 architecture: {boundaries['oss']['label']} for advisory analysis β†’ {boundaries['enterprise']['label']} for autonomous execution"
1944
  }
1945
 
1946
  # Create demo completion message with enhanced boundary context
 
1957
  βœ… Complete Demo: Architecture Validated
1958
  </h3>
1959
  <p style="margin: 5px 0 0 0; font-size: 13px; color: #64748b;">
1960
+ ARF v3.3.9 β€’ OSS advises β†’ Enterprise executes
1961
  </p>
1962
  </div>
1963
  <div style="display: flex; align-items: center; gap: 8px;">
 
2161
  "incidents": get_audit_manager().incidents,
2162
  "boundary_crossings": get_audit_manager().boundary_crossings,
2163
  "export_time": datetime.datetime.now().isoformat(),
2164
+ "arf_version": "3.3.9",
2165
  "architecture": "OSS advises β†’ Enterprise executes"
2166
  }
2167
  return json.dumps(audit_data, indent=2)
 
2246
  def launch_demo():
2247
  """Launch the demo application with proper configuration"""
2248
  try:
2249
+ logger.info("πŸš€ Starting ARF Ultimate Investor Demo v3.3.9 - ENTERPRISE EDITION")
2250
 
2251
  # Check installation
2252
  installation = get_installation_status()
 
2302
  <ol style="text-align: left; color: #475569;">
2303
  <li>Check logs for detailed error</li>
2304
  <li>Ensure all dependencies are installed</li>
2305
+ <li>Try: pip install agentic-reliability-framework==3.3.9</li>
2306
  <li>Restart the application</li>
2307
  </ol>
2308
  </div>
 
2316
  # ===========================================
2317
  if __name__ == "__main__":
2318
  try:
2319
+ logger.info("πŸš€ ARF Ultimate Investor Demo v3.3.9 - ENTERPRISE EDITION")
2320
  logger.info("=" * 60)
2321
+ logger.info("Enhanced with clear OSS vs Enterprise boundaries")
2322
+ logger.info(f"True ARF OSS v3.3.9 integration with simulated Enterprise execution")
2323
  logger.info("=" * 60)
2324
 
2325
  # Launch the demo
2326
  demo, config = launch_demo()
2327
 
2328
  print("\n" + "="*60)
2329
+ print("πŸš€ ARF Ultimate Investor Demo v3.3.9 - ENTERPRISE EDITION")
2330
  print("πŸ“Š Architecture: OSS advises β†’ Enterprise executes")
2331
  print("🌐 Starting on http://localhost:7860")
2332
  print("="*60 + "\n")