"""Shared constants for mnemograph."""

# Time constants (in seconds)
SECONDS_PER_MINUTE = 60
SECONDS_PER_HOUR = 3600
SECONDS_PER_DAY = 86400
SECONDS_PER_WEEK = 604800
SECONDS_PER_MONTH = 2592000  # 30 days
SECONDS_PER_YEAR = 31536000  # 365 days

# Decay constants
LN_2 = 0.693147  # ln(2) for half-life calculations
DEFAULT_HALF_LIFE_DAYS = 30.0

# Embedding constants
DEFAULT_EMBEDDING_DIMENSION = 384

# Retrieval limits
DEFAULT_RECENT_LIMIT = 5
DEFAULT_SHALLOW_ENTITIES = 5
DEFAULT_MEDIUM_MAX_NODES = 30
DEFAULT_DEEP_SEEDS = 10
DEFAULT_GOTCHA_LIMIT = 10

# Type filter multiplier for vector search
TYPE_FILTER_OVERFETCH_MULTIPLIER = 5

# Weight coefficients
WEIGHT_RECENCY_COEFF = 0.4
WEIGHT_CO_ACCESS_COEFF = 0.3
WEIGHT_EXPLICIT_COEFF = 0.3

# Co-access leaky integrator parameters
CO_ACCESS_HALF_LIFE_DAYS = 30.0
CO_ACCESS_SIGMOID_MIDPOINT = 5.0
CO_ACCESS_SIGMOID_STEEPNESS = 0.8

# Query limits
DEFAULT_QUERY_LIMIT = 10
DEFAULT_SUGGESTION_LIMIT = 5
DEFAULT_VECTOR_SEARCH_LIMIT = 20

# Token budgets for tiered retrieval
SHALLOW_CONTEXT_TOKENS = 500
MEDIUM_CONTEXT_TOKENS = 2000
DEEP_CONTEXT_TOKENS = 5000

# Similarity and weight thresholds
DEFAULT_SIMILARITY_THRESHOLD = 0.7
DUPLICATE_DETECTION_THRESHOLD = 0.8
DUPLICATE_AUTO_BLOCK_THRESHOLD = 0.8
WEAK_RELATION_THRESHOLD = 0.2
PRUNING_CANDIDATE_THRESHOLD = 0.1
SUGGEST_RELATION_CONFIDENCE_THRESHOLD = 0.4

# Health check limits
OVERLOADED_ENTITY_OBSERVATION_LIMIT = 15
HEALTH_REPORT_ITEM_LIMIT = 10
MAX_OBSERVATION_TOKENS = 2000

# Suggestion confidence scores
CO_OCCURRENCE_CONFIDENCE = 0.7
SHARED_RELATION_CONFIDENCE = 0.65

# Similarity calculation
AFFIX_MATCH_BONUS = 0.2
