Runtime resolver that hydrates FactRef structs via a Store adapter.
Maintains a process-local cache to avoid repeated store round-trips. The cache lives in the Worker process memory and is cleared on Worker stop.
Summary
Types
Functions
Creates a new FactResolver backed by the given store tuple.
Batch-loads a list of fact hashes into the resolver's cache.
Hashes already present in the cache are skipped. Returns an updated resolver with the newly loaded values in its cache.
@spec resolve(Runic.Workflow.Fact.t() | Runic.Workflow.FactRef.t(), t()) :: {:ok, Runic.Workflow.Fact.t()} | {:error, term()}
Resolves a Fact or FactRef to a full Fact with its value.
- Full
Factstructs with a value are returned as-is (passthrough). FactRefstructs are resolved by checking the cache first, then falling back to the store'sload_fact/2.
Returns {:ok, %Fact{}} or {:error, reason}.
@spec resolve!(Runic.Workflow.Fact.t() | Runic.Workflow.FactRef.t(), t()) :: Runic.Workflow.Fact.t()
Like resolve/2 but raises on error.