"""
Common Core Constants

定义了 SAGE 框架中使用的常量。
这些常量可以被所有 SAGE 包使用，主要用于 kernel 的任务调度和容错配置。

Layer: L1 (Foundation)
"""

# Default configuration
DEFAULT_CHECKPOINT_INTERVAL = 60  # seconds
DEFAULT_HEALTH_CHECK_INTERVAL = 30  # seconds
DEFAULT_MAX_RESTART_ATTEMPTS = 3
DEFAULT_CLEANUP_TIMEOUT = 5.0  # seconds

# Restart strategies
RESTART_STRATEGY_FIXED = "fixed_delay"
RESTART_STRATEGY_EXPONENTIAL = "exponential_backoff"
RESTART_STRATEGY_FAILURE_RATE = "failure_rate"

# Placement strategies
PLACEMENT_STRATEGY_SIMPLE = "simple"
PLACEMENT_STRATEGY_RESOURCE_AWARE = "resource_aware"
PLACEMENT_STRATEGY_LOAD_BALANCE = "load_balance"

# Scheduling strategies
SCHEDULING_STRATEGY_FIFO = "fifo"
SCHEDULING_STRATEGY_PRIORITY = "priority"
SCHEDULING_STRATEGY_RESOURCE_AWARE = "resource_aware"

__all__ = [
    "DEFAULT_CHECKPOINT_INTERVAL",
    "DEFAULT_HEALTH_CHECK_INTERVAL",
    "DEFAULT_MAX_RESTART_ATTEMPTS",
    "DEFAULT_CLEANUP_TIMEOUT",
    "RESTART_STRATEGY_FIXED",
    "RESTART_STRATEGY_EXPONENTIAL",
    "RESTART_STRATEGY_FAILURE_RATE",
    "PLACEMENT_STRATEGY_SIMPLE",
    "PLACEMENT_STRATEGY_RESOURCE_AWARE",
    "PLACEMENT_STRATEGY_LOAD_BALANCE",
    "SCHEDULING_STRATEGY_FIFO",
    "SCHEDULING_STRATEGY_PRIORITY",
    "SCHEDULING_STRATEGY_RESOURCE_AWARE",
]
