Shared pure functions for inspecting stepwise workflow specs.
Extracted from StepwiseAdvance, StepwiseProjection, and
FsmBreakpoint to eliminate internal duplication. Used by pipeline
components in the foundation; workflow_stem inherits these via
defdelegate.
All functions are pure (no side effects, no process dependency) so they compose safely in ALF pipeline stages.
Summary
Functions
Returns true when two state identifiers refer to the same state.
Returns the ordered list of step identifiers for a workflow spec.
Returns the ordered list of component modules in the canonical stepwise pipeline.
Functions
Returns true when two state identifiers refer to the same state.
Compares atoms directly, binaries directly, and cross-compares
atom/binary via Atom.to_string/1.
Examples
iex> equivalent_state?(:greeting, :greeting)
true
iex> equivalent_state?(:greeting, "greeting")
true
iex> equivalent_state?(:greeting, :problem_solving)
false
Returns the ordered list of step identifiers for a workflow spec.
Order is derived from:
spec.stepswhen present and non-empty (explicit order)spec.statessorted bystep_number(orstep) ascending, otherwise insertion order
Returns [] when the spec has no steps or states.
Examples
iex> ordered_steps(%{steps: [:a, :b, :c]})
[:a, :b, :c]
@spec pipeline_stage_modules() :: [module()]
Returns the ordered list of component modules in the canonical stepwise pipeline.
Both Mobus.Stepwise.Pipeline.Stepwise and WorkflowStem.Pipelines.Stepwise
derive their @components from this function, guaranteeing a single source
of truth for the pipeline stage order.
Order matters — changing this list changes the pipeline for ALL consumers.