Skip to main content

Module edge_cases

Module edge_cases 

Source
Expand description

Edge case handlers for V3 Immortal Architecture. Handles storage failures, concurrency, data validation, platform differences, and recovery scenarios. ZERO DATA LOSS. EVER.

Structs§

FileLock
File-based lock for concurrent access control
IndexConsistencyReport
Index consistency report
ProjectIsolation
Per-project isolation for multiple Claude instances
RecoveryMarker
Recovery marker for idempotent crash recovery

Enums§

ContentType
Content type detection for binary vs text
LockError
Lock-related errors
NormalizedContent
Content normalization result
StorageError
Storage-related errors
ValidationError
Validation errors

Constants§

CHUNK_SIZE
Chunk size for large content (1 MB)
MAX_SINGLE_BLOCK_BYTES
Maximum single block size (10 MB)

Functions§

atomic_write
Atomic write: write to temp file then rename
check_disk_space
Check available disk space before writing
detect_content_type
Detect if data is text or binary
find_writable_location
Find a writable location from a list of candidates
merge_preserving_user_sections
Merge content preserving user sections marked with
normalize_content
Normalize content for capture
normalize_path
Normalize a file path for cross-platform consistency
paths_equal
Compare paths with platform-aware normalization
safe_path
Sanitize path for filesystem safety
safe_write_to_claude
Safe write to Claude memory directory (handles locks)
validate_content_size
Validate and potentially chunk large content
validated_timestamp
Validated timestamp: clamp to sane range