Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

castellan doctor

Staged runtime diagnostics: multiplexer, governance, config layers, LLM provider, plugins, evolve archive, latest episode vitals. Verified against DoctorReport::run in crates/castellan-cli/src/doctor_cmd.rs12 stages, always run in this order.

Usage

castellan doctor [--workspace .] [--json]

--json does not change exit behavior — doctor always exits non-zero if any stage’s pass is false. Not every stage can fail: config/preset stages (permissions_preset, plan_verify, model_tiers, mux_default) always report informational detail with pass: true. llm_provider fails when provider = "openrouter" and no API key env is set. memory_sync fails when sync is configured without a token env. Only multiplexer_socket, governance_manifest, live_session, plugin_registry, evolve_archive, and episode_vitals can fail for other reasons.

Stages

Order matches DoctorReport::run in doctor_cmd.rs:

StageCan failChecks
multiplexer_socketyesDefault socket exists / accepts connections
mux_defaultno (informational)Whether mux-by-default is on given socket health + env vars
governance_manifestyescastellan drift-check violations against the verification manifest
permissions_presetno (informational)Active [permissions] preset and tool-override count
plan_verifyno (informational)Guardians-shaped [governance.plan_verify] enabled state
model_tiersno (informational)[models] tier config (default/verify/act/plan — scheduler never uses LLM)
llm_provideryes (openrouter without key)Provider, base_url, key_present (never the value), optional headers, TCP reachability
memory_syncyes (configured, no token)[memory.sync] Turso remote-sync health
live_sessionyesActive live-field session snapshot / idle + instrument corpus note
plugin_registryyesRegistry has at least one plugin, matches plugins.toml
evolve_archiveyes.castellan/topology_archive.json under --workspace is readable
episode_vitalsyesLatest episode under .castellan/episodes has circulation_vitals or wake_stats

Recipes

Local workspace check:

castellan doctor --workspace .

CI-friendly JSON:

castellan doctor --json | jq '.stages[] | select(.pass == false)'

Human table (default):

STAGE                  STATUS DETAIL
------------------------------------------------------------------------
multiplexer_socket      PASS  socket present at /Users/you/.config/castellan/castellan.sock
mux_default             PASS  mux default on (socket_healthy=true); rollback: --no-mux, ...
governance_manifest     PASS  verification manifest OK
...

Failure paths

Stage failingDetail message patternFix
multiplexer_socketsocket missing at ... (run castellan multiplexer ensure)castellan multiplexer ensure
governance_manifestN drift violation(s)castellan drift-check for the full list; fix castellan.toml
llm_providerprovider=openrouter ... key_present=falseexport OPENROUTER_API_KEY=... (never commit the key)
memory_syncconfigured without token envSet the documented Turso token env
plugin_registryempty plugin listCheck plugins.toml; castellan plugin list
evolve_archivearchive missing or invalidRun castellan evolve at least once, or pass --workspace to the right root
episode_vitalsno episode JSON in ...castellan run --goal "..." --plugin gridworld at least once