wai doctor (toolchain.doctor, also the tool toolchain_doctor of wai mcp)
prints one line per check, each pass, FAIL with its fix, not checked with
the reason, or n/a. With --json, the envelope carries each check's state and
facts, and a result: passed, failed, or passed-with-not-checked. A check that
could not be run is never a pass. It exits 1 when a check failed, as the
exit-code table says, and 0 otherwise.
It looks at this wai's version and path, and at whether wai at a prompt
reaches it: each wai earlier on PATH is asked --version --json, and one
that does not answer as WAI's does, or that hangs, is a finding. One reached
through a relative entry of PATH is named and not run. It finds the relay
and the room service as wai dev finds them, and checks that each is of this
wai's toolchain. It also finds the room client's files and Studio's. Each row
of the quickstart README's port table, compiled in, is checked: free, or
held by what the system will name to this account. On Linux that comes
from /proc, on macOS from lsof, and on Windows from the system's own socket
tables. It finds browsers for Studio and for the harnesses, and starts none.
It reports where wai key keeps keys, and whether the directory and each file
are this account's alone: by mode and owner on Unix, by SID through
win_acl.rs on Windows, with the command that fixes each. A seed is never
opened. On macOS it asks the keychain tool for its search list alone, and
whether the login keychain is unlocked always reads not checked, since
asking can raise a prompt.
Nothing is sent and nothing is written. Each program asked has 3 s and is
then stopped with its process group. Each group of checks runs on its own
thread, and the run ends at 6 s: what has not finished by then reads as not
checked.
wai-relay and wai-room gain --version [--json], naming their own version
and the toolchain they belong to (wai-rs's version in the tree they were
built from), which is what wai doctor reads. build.sh runs both before it
packs them.
doctor joins the closed verb list (catalogue, door check). The catalogue
export and Studio's generated actions are regenerated. tests/cli_doctor.rs
drives the real binary on a made-up machine: its own PATH, home and temp
directory, with wai hard-linked into a bin of its own. It is added to the
conformance workflow's quickstart step, and wai/quickstart/README.md to that
workflow's paths.
Co-Authored-By: Claude Opus 5.5 <[email protected]>