Mobus.Stepwise.Runtime (mobus_stepwise v0.2.0)

Copy Markdown View Source

Stable accessor helpers for stepwise runtime maps.

Provides deterministic inspection and mutation of runtime state without depending on internal map structure. Orchestrators should prefer these helpers over direct map access.

Meta

The :meta field is an open map for orchestration metadata (session IDs, DAG coordinates, tags, etc.). It survives checkpoint/restore cycles and is passed read-only to capabilities.

runtime = Runtime.put_meta(runtime, :session_id, "sess-123")
Runtime.get_meta(runtime, :session_id)
#=> "sess-123"

Summary

Functions

Returns the :artifacts map from the runtime.

Returns the :context map from the runtime.

Returns the :current_state.

Returns the :execution_id.

Gets a single key from :meta, with optional default.

Shallow-merges a map into :context.

Shallow-merges a map into :meta.

Returns the full :meta map from the runtime.

Puts a single key into :artifacts (normalized via Artifacts.merge/2).

Puts a single key into :context.

Puts a single key into :meta.

Returns the :tenant_id.

Functions

artifacts(runtime)

@spec artifacts(map()) :: map()

Returns the :artifacts map from the runtime.

context(runtime)

@spec context(map()) :: map()

Returns the :context map from the runtime.

current_state(runtime)

@spec current_state(map()) :: atom() | String.t() | nil

Returns the :current_state.

execution_id(runtime)

@spec execution_id(map()) :: String.t() | nil

Returns the :execution_id.

get_meta(runtime, key, default \\ nil)

@spec get_meta(map(), term(), term()) :: term()

Gets a single key from :meta, with optional default.

merge_context(runtime, map)

@spec merge_context(map(), map()) :: map()

Shallow-merges a map into :context.

merge_meta(runtime, map)

@spec merge_meta(map(), map()) :: map()

Shallow-merges a map into :meta.

meta(runtime)

@spec meta(map()) :: map()

Returns the full :meta map from the runtime.

overlay_artifacts(runtime, key, value)

@spec overlay_artifacts(map(), term(), term()) :: map()

Puts a single key into :artifacts (normalized via Artifacts.merge/2).

overlay_context(runtime, key, value)

@spec overlay_context(map(), term(), term()) :: map()

Puts a single key into :context.

put_meta(runtime, key, value)

@spec put_meta(map(), term(), term()) :: map()

Puts a single key into :meta.

tenant_id(runtime)

@spec tenant_id(map()) :: String.t() | nil

Returns the :tenant_id.