A validated, immutable semantic question contract.
Preparation caches the exact wire fragment, retains finite caller-key metadata, and computes a versioned semantic fingerprint. Composition functions rebuild the value through the normal validation path, so ordering and request-relative invariants are never bypassed.
Summary
Functions
Delete one key and revalidate the resulting Prepared value.
Return the versioned deterministic semantic-contract fingerprint.
Return caller keys in execution/wire order.
Right-biased merge preserving duplicate positions from the left.
Replace a question without moving it, or append a new key.
Take selected keys while preserving their source execution order.
Types
@type t() :: %TypeSafeSDK.Prepared{ count: pos_integer(), definitions: map(), encoded: struct(), fingerprint: String.t(), json: binary(), keys: %{required(String.t()) => caller_key()}, ordered_keys: [caller_key()], questions: [{caller_key(), term()}] }
Functions
@spec delete(t(), caller_key()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
Delete one key and revalidate the resulting Prepared value.
Return the versioned deterministic semantic-contract fingerprint.
@spec keys(t()) :: [caller_key()]
Return caller keys in execution/wire order.
@spec merge(t(), t()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
Right-biased merge preserving duplicate positions from the left.
@spec new(t() | map() | list()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
@spec put(t(), caller_key(), term()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
Replace a question without moving it, or append a new key.
@spec take(t(), Enumerable.t()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}
Take selected keys while preserving their source execution order.