constants
Centralized constants for snakesee.
This module consolidates configuration constants and magic numbers used across multiple modules to ensure consistency and make tuning easier.
Configuration is organized into two modules:
- This module (constants.py): Runtime configuration
- RefreshRateConfig: TUI refresh rates
- CacheConfig: Caching behavior and TTLs
-
FileSizeLimits: Security limits for file parsing
-
snakesee.state.config: Estimation-specific configuration
- EstimationConfig: Time estimation parameters
- VarianceMultipliers: Variance settings per estimation method
- ConfidenceWeights: Confidence calculation weights
- ConfidenceThresholds: Decision thresholds
- TimeConstants: Time-related constants
Note: This module defines STALE_WORKFLOW_THRESHOLD_SECONDS (1800.0 seconds / 30 minutes), which is imported by state.config.TimeConstants.stale_workflow_threshold to ensure a single source of truth.
For estimation-specific configuration, see :class:snakesee.state.config.EstimationConfig.
Classes¶
CacheConfig
dataclass
¶
Configuration for caching behavior.
Attributes:
| Name | Type | Description |
|---|---|---|
default_tool_progress_ttl |
float
|
Default TTL for tool progress cache in seconds. |
adaptive_ttl_multiplier |
float
|
Multiplier for adaptive cache TTL based on refresh rate. |
max_cache_ttl |
float
|
Maximum cache TTL in seconds (cap for adaptive calculation). |
exists_cache_ttl |
float
|
TTL for filesystem existence check cache in seconds. |
Source code in snakesee/constants.py
FileSizeLimits
dataclass
¶
Security limits for file sizes.
Attributes:
| Name | Type | Description |
|---|---|---|
max_metadata_file_size |
int
|
Maximum size in bytes for metadata files (10 MB). |
max_events_line_length |
int
|
Maximum line length in bytes for events file (1 MB). |
Source code in snakesee/constants.py
RefreshRateConfig
dataclass
¶
Configuration for TUI refresh rate.
Attributes:
| Name | Type | Description |
|---|---|---|
min_rate |
float
|
Minimum refresh rate in seconds (fastest). |
max_rate |
float
|
Maximum refresh rate in seconds (slowest). |
default_rate |
float
|
Default refresh rate in seconds. |