# `Mobus.Stepwise.IR`
[🔗](https://github.com/fosferon/mobus_stepwise/blob/main/lib/mobus/stepwise/ir.ex#L1)

Normalization helpers for workflow specs compiled into IR.

Normalizes spec shapes to reduce downstream conditionals in the
stepwise engine and pipeline components.

# `t`

```elixir
@type t() :: map()
```

# `normalize`

```elixir
@spec normalize(map()) :: t()
```

Normalizes a raw workflow spec into the internal representation (IR).

Applies the following normalizations:
- Coerces `"stepwise"` string profile to `:stepwise` atom
- Extracts `:initial_state` from atom or string keys
- Ensures `:states` and `:transitions` are maps (converts keyword lists)

This reduces downstream conditionals in engine and pipeline components.

## Parameters

  * `spec` — a raw workflow specification map

## Returns

  * A normalized spec map (IR) with consistent atom keys.

## Examples

    IR.normalize(%{"profile" => "stepwise", "initial_state" => :step_one, "states" => %{}})
    #=> %{profile: :stepwise, initial_state: :step_one, states: %{}, transitions: %{}, ...}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
