# `Imp.Playbook`
[🔗](https://github.com/deepfates/imp/blob/v0.18.1/lib/imp/playbook.ex#L1)

Provider-independent, immutable instructions with transactional evolution.

A delta is evaluated against a private candidate and committed only if every
operation and final policy bound succeeds. Content equality is exact after
`Imp.Playbook.Entry.normalize/1`; no semantic or fuzzy deduplication occurs.

# `error`

```elixir
@type error() :: {:error, term()}
```

# `t`

```elixir
@type t() :: %Imp.Playbook{
  entries: [Imp.Playbook.Entry.t()],
  hash: String.t(),
  id: String.t(),
  parent_hash: String.t() | nil,
  policy: Imp.Playbook.Policy.t(),
  revision: non_neg_integer(),
  tombstones: [Imp.Playbook.Tombstone.t()]
}
```

# `apply_delta`

```elixir
@spec apply_delta(t(), Imp.Playbook.Delta.t() | [Imp.Playbook.Delta.operation()]) ::
  {:ok, t()} | error()
```

Applies all operations or returns an error without a partially updated playbook.

# `dump`

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

Returns a deterministic data-only representation.

# `fetch`

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

Returns an entry by ID, regardless of its active status.

# `load!`

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

Loads and validates a data-only playbook representation.

# `new`

```elixir
@spec new(keyword()) :: t()
```

Creates an empty playbook with a stable ID and canonical root hash.

# `render`

```elixir
@spec render(t()) :: String.t()
```

Renders active entries in stable playbook order.

# `serialize`

```elixir
@spec serialize(t()) :: String.t()
```

Serializes a playbook as canonical JSON with lexicographically sorted keys.

---

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