# `Rho.Tools.DynTool`
[🔗](https://github.com/GenericJam/rho/blob/v0.1.0/lib/rho/tools/dyn_tool.ex#L1)

What the `dyn_*` Core tools share: the agent edits its Dyn layer's
staging copy and proposes it (`Rho.Dyn`). There is deliberately
no tool to activate or revert: those need the human's approval (the screen lock).

The tools act on the app's Keeper, or on `ctx[:dyn]` (a Keeper name; the
selftests use their own Keeper on a temp dir, `with_selftest_keeper/1`).

# `error`

```elixir
@spec error(term(), String.t() | nil) :: {:error, String.t()}
```

A tool error for `Rho.Dyn`'s staging errors.

# `expect`

```elixir
@spec expect(term(), (term() -&gt; boolean())) :: :ok | {:error, term()}
```

`:ok` if `result` matches, else `{:error, result}` (for selftests).

# `keeper`

```elixir
@spec keeper(map()) :: atom()
```

The Keeper the tools act on.

# `path_schema`

```elixir
@spec path_schema() :: map()
```

The `path` argument's JSON Schema.

# `staging_line`

```elixir
@spec staging_line(atom()) :: String.t()
```

Does staging differ from the current generation's sources?

# `with_selftest_keeper`

```elixir
@spec with_selftest_keeper((map() -&gt; result)) :: result when result: term()
```

Runs `fun.(ctx)` against a fresh Keeper on a temp dir (no generation, Core
approval refusing everything), for the tools' selftests.

---

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