# `WardrikDaemon.Doctor`

Checks what the daemon reads, running or not. Prints a line for each check:

    $ wardrik doctor
    ok    env            /home/me/.config/wardrik/env sets 3 variables
    ok    config         /home/me/.config/wardrik/config.yaml reads
    ok    storage        keeps everything in Postgres at db.internal:5432/wardrik
    ok    vault          1 key from /home/me/.local/share/wardrik/vault_key, which seals
    ok    mcp github     answers at api.githubcopilot.com:443
    FAIL  mcp notes      runs npx, which isn't on this machine's PATH
    ok    channel slack  takes Slack's events over Socket Mode; posts as @wardrik in Acme; @maria decides
    ok    agents         2 agent files and 1 policy read

It runs in its own VM, so it can't open the store a running daemon holds. A `${NAME}` only the
vault holds is left unchecked; the daemon checks it as it starts. If `config.yaml` doesn't read,
no later check runs.

# `check`

```elixir
@type check() :: {:ok | :warn | :fail, String.t(), String.t()}
```

One check: whether it passed, what it looked at, and what it found.

# `counted`

```elixir
@spec counted(non_neg_integer(), String.t()) :: String.t()
```

Returns `count` of `thing`, as `1 key` or `2 keys`.

# `print`

```elixir
@spec print([check()]) :: non_neg_integer()
```

Prints `checks`, a line each. Returns how many failed.

# `run`

```elixir
@spec run(%{required(String.t()) =&gt; String.t()}, keyword()) :: [check()]
```

Runs every check on the files `env`, the environment, points at.

## Options

  * `:req_options` - merged into each request a channel's check makes.

---

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