# `Imp.Optimizer.Parameter.Set`
[🔗](https://github.com/deepfates/imp/blob/v0.18.1/lib/imp/optimizer/parameter/set.ex#L1)

Immutable parameter state with playbook-style revision lineage.

A committed set increments `revision`, records the prior `hash` as
`parent_hash`, and rehashes the complete canonical data representation. This
gives a compact persistence boundary while each individual change retains its
own `base_digest` optimistic guard.

# `t`

```elixir
@type t() :: %Imp.Optimizer.Parameter.Set{
  hash: String.t(),
  id: String.t(),
  parameters: [Imp.Optimizer.Parameter.t()],
  parent_hash: String.t() | nil,
  revision: non_neg_integer()
}
```

# `apply_changes`

```elixir
@spec apply_changes(t(), [Imp.Optimizer.Parameter.Change.t() | map()]) ::
  {:ok, t()} | {:error, term()}
```

Applies all changes or returns an error without yielding a partial set.

# `diff`

```elixir
@spec diff(t(), t()) :: [Imp.Optimizer.Parameter.Change.t()]
```

Returns the minimal ordered replacement changes from `source` to `target`.

# `dump`

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

Returns a deterministic data-only representation.

# `fetch`

```elixir
@spec fetch(t(), String.t()) :: {:ok, Imp.Optimizer.Parameter.t()} | :error
```

Returns a parameter by stable string ID.

# `load!`

```elixir
@spec load!(map()) :: t()
```

Loads and verifies a persisted parameter set.

# `new`

```elixir
@spec new(String.t(), [Imp.Optimizer.Parameter.t()]) :: t()
```

Builds a root parameter set from unique typed parameters.

---

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