Recursive validation for replicated command safety.
Walks any Elixir term to ensure it contains no anonymous functions, PIDs, ports, or references — values that break deterministic serialization. Also enforces depth and size limits.
Summary
Functions
Validates a Concord key against the configured byte-size limit.
Walks a term recursively, rejecting non-serializable values.
Validates a transaction spec before replicated submission.
Validates a logical value before optional compression.
Functions
@spec validate_key(term()) :: :ok | {:error, :empty_key | :key_too_large | :invalid_key}
Validates a Concord key against the configured byte-size limit.
The default maximum is 4096 bytes and can be changed with
config :concord, kv: [max_key_bytes: bytes].
@spec validate_term(term(), non_neg_integer()) :: :ok | {:error, atom()}
Walks a term recursively, rejecting non-serializable values.
Returns :ok or {:error, reason}.
Validates a transaction spec before replicated submission.
Checks structural correctness, limit compliance, and recursive safety.
Validates a logical value before optional compression.
The configured :max_value_bytes is a local admission cap. It may lower,
but never raise, the immutable version-one protocol maximum. Size is
measured from the logical Erlang term, so compression settings cannot alter
whether the value is admitted.