Skip to main content

Crate reliary_core

Crate reliary_core 

Source

Structs§

EditRecord
ErrorRecord
FormatConfig
ReadRecord
SessionState

Enums§

OutputFormat

Constants§

MAX_FILE_SIZE
Maximum file size we read into memory (10 MB). Files larger than this are rejected with an error rather than read.

Functions§

atomic_write
Atomic file write: write to temp file, fsync, then rename. Prevents partial-write corruption on crash or power loss. D31: Single handle — write, sync, rename in one file open.
build_state_block
Build a ~150-token state block from session state + memory recall + risk analysis
default_max_entries
default_ttl
evict
Evict entries older than TTL or beyond max_entries count.
hash_content
Hash content for storage key. Returns the full SHA-256 hex digest.
now
open
Open or create the cache database at the given path.
parse_session_file
retrieve
Retrieve original content by hash. Updates accessed_at in one round trip.
safe_open_db
Open a SQLite database with WAL + NORMAL sync for crash recovery. D33: Merged safe_open_db and safe_open_db_query into one function.
safe_read
Read a file with size cap. Returns an error string if the file is missing, unreadable, or larger than MAX_FILE_SIZE.
safe_read_stdin
Read from stdin with a size cap. Reads up to MAX_FILE_SIZE bytes then errors. Prevents OOM on cat huge.log | reliary-agent ....
stats
Stats for the reliary stats command. D29: Combined into single query.
store
Store original content, return hash.