Canonical runtime context passed to Jidoka policy code.
Jidoka.Context is the public, data-only shape for controls and approval
predicates. It keeps application context in data and exposes the current
request, operation, and result metadata without requiring callers to reach
into turn internals.
Summary
Functions
Returns caller-provided application context data.
Fetches an application context value by atom or string key without creating atoms.
Fetches a runtime-only value by atom or string key without creating atoms.
Builds a request context from caller-provided application data.
Builds a request context from caller-provided application data or raises.
Normalizes trusted runtime context input and preserves runtime-only fields.
Returns an application context value by atom or string key without creating atoms.
Returns a runtime-only value by atom or string key without creating atoms.
Builds a runtime context from keyword or map attributes.
Builds a runtime context and raises if the attributes are invalid.
Returns trusted runtime-only context values.
Drops runtime-only values before persisting or projecting context.
Returns the Zoi schema for runtime context data.
Projects caller data into the context map expected by Jido actions.
Types
@type boundary() :: :input | :operation | :output
@type t() :: %Jidoka.Context{ agent_id: nil | nil | binary(), agent_state: nil | nil | any(), arguments: map(), boundary: (:input | :operation) | :output, control: nil | nil | atom(), control_name: nil | nil | binary(), data: map(), idempotency: (((:pure | :idempotent) | :dedupe) | :reconcile) | :unsafe_once, idempotency_key: nil | nil | binary(), input: nil | nil | binary(), loop_index: nil | nil | integer(), metadata: map(), operation: nil | nil | binary(), operation_kind: (((((((((:action | :operation) | :tool) | :ash_resource) | :browser) | :skill) | :mcp) | :catalog) | :workflow) | :subagent) | :handoff, operation_metadata: map(), operation_source: nil | nil | binary(), plan: nil | nil | any(), request: nil | nil | any(), request_id: nil | nil | binary(), request_metadata: map(), result: nil | nil | any(), result_value: nil | nil | any(), runtime: map(), session_id: nil | nil | binary(), spec: nil | nil | any() }
Functions
Returns caller-provided application context data.
Fetches an application context value by atom or string key without creating atoms.
Fetches a runtime-only value by atom or string key without creating atoms.
Builds a request context from caller-provided application data.
Passing an existing Jidoka.Context uses only its public data. Use
from_input/1 when trusted code needs to preserve runtime fields.
Builds a request context from caller-provided application data or raises.
Normalizes trusted runtime context input and preserves runtime-only fields.
Returns an application context value by atom or string key without creating atoms.
Returns a runtime-only value by atom or string key without creating atoms.
Builds a runtime context from keyword or map attributes.
Builds a runtime context and raises if the attributes are invalid.
Returns trusted runtime-only context values.
Drops runtime-only values before persisting or projecting context.
@spec schema() :: Zoi.schema()
Returns the Zoi schema for runtime context data.
Projects caller data into the context map expected by Jido actions.