Buckets:

download
raw
4.65 kB
# Copyright (c) 2025-2026 Yutaro Maeda. All rights reserved.
# Licensed under the Apache License 2.0. See LICENSE file for details.
"""FaultRay — pre-deployment infrastructure resilience simulation (research prototype)."""
__version__ = "11.2.0"
def __getattr__(name: str) -> object:
"""Lazy imports for the public API surface.
This ensures ``import faultray`` never fails even when optional
dependencies (e.g. pydantic, networkx) are missing — individual
symbols raise ImportError only when actually accessed.
"""
_import_map = {
# Model layer
"InfraGraph": ("faultray.model.graph", "InfraGraph"),
"Component": ("faultray.model.components", "Component"),
"ComponentType": ("faultray.model.components", "ComponentType"),
"Dependency": ("faultray.model.components", "Dependency"),
"load_yaml": ("faultray.model.loader", "load_yaml"),
# Simulation engines
"SimulationEngine": ("faultray.simulator.engine", "SimulationEngine"),
"SimulationReport": ("faultray.simulator.engine", "SimulationReport"),
"DynamicSimulationEngine": ("faultray.simulator.dynamic_engine", "DynamicSimulationEngine"),
"OpsSimulationEngine": ("faultray.simulator.ops_engine", "OpsSimulationEngine"),
"CascadeEngine": ("faultray.simulator.cascade", "CascadeEngine"),
# Availability models
"compute_three_layer_model": (
"faultray.simulator.availability_model", "compute_three_layer_model",
),
"compute_five_layer_model": (
"faultray.simulator.availability_model", "compute_five_layer_model",
),
# Monte Carlo
"run_monte_carlo": ("faultray.simulator.monte_carlo", "run_monte_carlo"),
# Specialist engines
"CostImpactEngine": ("faultray.simulator.cost_engine", "CostImpactEngine"),
"SecurityResilienceEngine": (
"faultray.simulator.security_engine", "SecurityResilienceEngine",
),
# SLA Validator
"SLAValidatorEngine": (
"faultray.simulator.sla_validator", "SLAValidatorEngine",
),
"SLATarget": (
"faultray.simulator.sla_validator", "SLATarget",
),
# CI/CD Gate
"CIGateGenerator": (
"faultray.ci.github_action", "CIGateGenerator",
),
"CIGateConfig": (
"faultray.ci.github_action", "CIGateConfig",
),
"SARIFExporter": (
"faultray.ci.sarif_exporter", "SARIFExporter",
),
# Agent components
"AgentConfig": ("faultray.model.agent_components", "AgentConfig"),
"LLMEndpointConfig": ("faultray.model.agent_components", "LLMEndpointConfig"),
"ToolServiceConfig": ("faultray.model.agent_components", "ToolServiceConfig"),
"AgentOrchestratorConfig": ("faultray.model.agent_components", "AgentOrchestratorConfig"),
# Agent engines
"AdoptionEngine": ("faultray.simulator.adoption_engine", "AdoptionEngine"),
"AgentMonitorEngine": ("faultray.simulator.agent_monitor", "AgentMonitorEngine"),
"generate_agent_scenarios": ("faultray.simulator.agent_scenarios", "generate_agent_scenarios"),
# SDK entry point
"FaultRay": ("faultray.sdk", "FaultRay"),
# Backward-compatibility alias (old brand name)
"FaultZero": ("faultray.sdk", "FaultZero"),
# SDK agent convenience functions
"assess_agents": ("faultray.sdk", "assess_agents"),
"generate_monitoring_plan": ("faultray.sdk", "generate_monitoring_plan"),
"check_hallucination_risk": ("faultray.sdk", "check_hallucination_risk"),
}
if name in _import_map:
module_path, attr = _import_map[name]
import importlib
mod = importlib.import_module(module_path)
return getattr(mod, attr)
raise AttributeError(f"module 'faultray' has no attribute {name!r}")
__all__ = [
"InfraGraph", "Component", "ComponentType", "Dependency",
"load_yaml",
"SimulationEngine", "SimulationReport",
"DynamicSimulationEngine", "OpsSimulationEngine",
"CascadeEngine",
"compute_three_layer_model", "compute_five_layer_model",
"run_monte_carlo",
"CostImpactEngine", "SecurityResilienceEngine",
"SLAValidatorEngine", "SLATarget",
"CIGateGenerator", "CIGateConfig", "SARIFExporter",
"AgentConfig", "LLMEndpointConfig", "ToolServiceConfig", "AgentOrchestratorConfig",
"AdoptionEngine", "AgentMonitorEngine", "generate_agent_scenarios",
"FaultRay", "FaultZero",
"assess_agents", "generate_monitoring_plan", "check_hallucination_risk",
]

Xet Storage Details

Size:
4.65 kB
·
Xet hash:
2d2eeb8ff0dc4854c9ec49ac35229dc0ac0bfd8fd59b8f652c0744881ee319db

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.