# `Pixir.VirtualDiffApply`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/virtual_diff_apply.ex#L1)

Planner and staged applier for ADR 0029 `virtual_diff` artifacts.

The module performs workspace-confined BEAM file I/O only. `plan/3` is effect-free;
`apply/3` mutates only when every selected file is applicable and authorized. Apply
is all-or-nothing through precondition checks and staging; rename/delete commit
failures have a narrow residual window, and the result reports recovery.

# `apply`

```elixir
@spec apply(map(), String.t(), keyword()) :: {:ok, map()} | {:error, map()}
```

Apply a `virtual_diff` artifact after complete planning and staging.

# `plan`

```elixir
@spec plan(map(), String.t(), keyword()) :: {:ok, map()} | {:error, map()}
```

Build an effect-free apply plan for a `virtual_diff` artifact.

---

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