constants
constants
¶
Global constants for Marianne.
Centralizes magic numbers used throughout the codebase, making them discoverable, consistent, and easy to modify.
Attributes¶
SHEET_NUM_KEY
module-attribute
¶
Standard key for sheet number in dicts and serialised state.
VALIDATION_PASS_RATE_KEY
module-attribute
¶
Standard key for validation pass rate in checkpoint/job data.
TRUNCATE_STDOUT_TAIL_CHARS
module-attribute
¶
Default truncation limit for stdout/stderr tails in error display and state.
HEALING_CONTEXT_TAIL_CHARS
module-attribute
¶
Maximum stdout/stderr characters captured for self-healing diagnostic context.
RATE_LIMIT_REQUESTS_PER_MINUTE
module-attribute
¶
Maximum requests per minute for API rate limiting.
RATE_LIMIT_REQUESTS_PER_HOUR
module-attribute
¶
Maximum requests per hour for API rate limiting.
RATE_LIMIT_BURST_LIMIT
module-attribute
¶
Maximum burst requests in a short window.
SSE_QUEUE_TIMEOUT_SECONDS
module-attribute
¶
Timeout for SSE event queue reads.
STREAM_CHUNK_SIZE
module-attribute
¶
Default chunk size for stream reads (4 KB).
FILE_HASH_CHUNK_SIZE
module-attribute
¶
Chunk size for file hashing operations (8 KB).
VALIDATION_COMMAND_TIMEOUT_SECONDS
module-attribute
¶
Timeout for user-defined validation commands (1 hour).
VALIDATION_OUTPUT_TRUNCATE_CHARS
module-attribute
¶
Maximum characters for validation command output summaries.
RESET_TIME_MINIMUM_WAIT_SECONDS
module-attribute
¶
Minimum wait time for reset-based rate limit delays (5 minutes).
RESET_TIME_MAXIMUM_WAIT_SECONDS
module-attribute
¶
Maximum wait time for parsed rate limit delays (24 hours).
Safety cap: without this, adversarial or malformed API responses like
'resets in 999999 hours' would schedule timers for years, effectively
blocking the instrument forever with no auto-recovery. 24 hours is the
longest any real API provider rate limit should last. If it's longer,
the operator can re-trigger via mzt clear-rate-limits.
DEFAULT_QUOTA_WAIT_SECONDS
module-attribute
¶
Default wait time when quota exhaustion is detected but no reset time parsed.
DEFAULT_RATE_LIMIT_WAIT_SECONDS
module-attribute
¶
Default wait time for generic rate limit detections.