Skip to content

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

SHEET_NUM_KEY = 'sheet_num'

Standard key for sheet number in dicts and serialised state.

VALIDATION_PASS_RATE_KEY module-attribute

VALIDATION_PASS_RATE_KEY = 'validation_pass_rate'

Standard key for validation pass rate in checkpoint/job data.

TRUNCATE_STDOUT_TAIL_CHARS module-attribute

TRUNCATE_STDOUT_TAIL_CHARS = 500

Default truncation limit for stdout/stderr tails in error display and state.

HEALING_CONTEXT_TAIL_CHARS module-attribute

HEALING_CONTEXT_TAIL_CHARS = 10000

Maximum stdout/stderr characters captured for self-healing diagnostic context.

RATE_LIMIT_REQUESTS_PER_MINUTE module-attribute

RATE_LIMIT_REQUESTS_PER_MINUTE = 60

Maximum requests per minute for API rate limiting.

RATE_LIMIT_REQUESTS_PER_HOUR module-attribute

RATE_LIMIT_REQUESTS_PER_HOUR = 1000

Maximum requests per hour for API rate limiting.

RATE_LIMIT_BURST_LIMIT module-attribute

RATE_LIMIT_BURST_LIMIT = 10

Maximum burst requests in a short window.

SSE_QUEUE_TIMEOUT_SECONDS module-attribute

SSE_QUEUE_TIMEOUT_SECONDS = 30.0

Timeout for SSE event queue reads.

STREAM_CHUNK_SIZE module-attribute

STREAM_CHUNK_SIZE = 4096

Default chunk size for stream reads (4 KB).

FILE_HASH_CHUNK_SIZE module-attribute

FILE_HASH_CHUNK_SIZE = 8192

Chunk size for file hashing operations (8 KB).

VALIDATION_COMMAND_TIMEOUT_SECONDS module-attribute

VALIDATION_COMMAND_TIMEOUT_SECONDS = 3600

Timeout for user-defined validation commands (1 hour).

VALIDATION_OUTPUT_TRUNCATE_CHARS module-attribute

VALIDATION_OUTPUT_TRUNCATE_CHARS = 500

Maximum characters for validation command output summaries.

RESET_TIME_MINIMUM_WAIT_SECONDS module-attribute

RESET_TIME_MINIMUM_WAIT_SECONDS = 300.0

Minimum wait time for reset-based rate limit delays (5 minutes).

RESET_TIME_MAXIMUM_WAIT_SECONDS module-attribute

RESET_TIME_MAXIMUM_WAIT_SECONDS = 86400.0

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_QUOTA_WAIT_SECONDS = 3600.0

Default wait time when quota exhaustion is detected but no reset time parsed.

DEFAULT_RATE_LIMIT_WAIT_SECONDS module-attribute

DEFAULT_RATE_LIMIT_WAIT_SECONDS = 3600.0

Default wait time for generic rate limit detections.