WardrikDaemon.Doctor (wardrik_daemon v0.1.0-rc.1)

Copy Markdown

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.

Summary

Types

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

Functions

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

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

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

Types

check()

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

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

Functions

counted(count, thing)

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

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

print(checks)

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

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

run(env, opts \\ [])

@spec run(%{required(String.t()) => 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.