Run diagnostics before a workflow¶
This page is the how-to guide for the pre-flight diagnostic workflow.
It covers every command you can run before a real ralph run to verify
your environment is ready, and what each one proves about your setup.
Goal¶
A failed run that you could have prevented by running one command is a wasted run. Diagnostics exist to catch the preventable failures — missing agents, broken MCP transport, misloaded policy, an unrecoverable capability bundle — before you invest time in a real workflow.
Prerequisites¶
Ralph Workflow installed (
pipx install ralph-workflow)A project directory with
PROMPT.mdwritten or the starter template in placeAt least one supported agent CLI installed on
PATH(see Agent CLI lifecycle)
When to run this¶
Before your first run on a new machine
After changing
pipeline.toml,artifacts.toml,mcp.toml, orralph-workflow.tomlAfter upgrading Ralph Workflow or any agent CLI
When debugging a run that failed earlier than expected
After pulling changes that touched policy or agent configuration
The full pre-flight: ralph --diagnose¶
The single command that runs every check is:
ralph --diagnose
This runs seven checks in order. Each check writes a status panel to the terminal and updates the overall verdict.
# |
Check |
What it proves |
|---|---|---|
1 |
Git repository |
You’re in a git repo and the working tree state is sane for a workflow |
2 |
Configuration |
|
3 |
Agent availability |
Each configured agent CLI is on |
4 |
MCP servers |
Configured MCP upstream servers are reachable and the chosen transport is compatible |
5 |
Workspace files |
|
6 |
Capability state |
The shipped baseline capability bundle is loaded; missing / degraded capabilities are surfaced |
7 |
Pre-flight policy validation |
The full policy bundle passes validation: agent chains, recovery, scope, artifact contracts |
Expected output (success): a green “All checks passed” panel and exit
code 0. Failure mode: a red panel per failing check and a non-zero exit
code.
Targeted pre-flight flags¶
For narrower checks, use one of these instead of --diagnose. They exit
faster and produce a smaller, focused report.
ralph --check-config¶
Loads and validates ralph-workflow.toml, pipeline.toml, artifacts.toml,
and mcp.toml. Exits non-zero if any file fails to parse, fails the loader
precedence rules, or fails schema validation.
Use this when:
You just edited a config file and want to know it parses
You’re upgrading and want to check for deprecated keys
A run failed early with a config-shaped error
ralph --check-mcp¶
Validates only the MCP server configuration: probes each upstream’s
transport, checks reachability, and confirms the chosen transport (stdio /
HTTP / SSE) is compatible with the configured agent. Useful when you’ve
changed mcp.toml and want to isolate MCP failures from agent failures.
ralph --check-policy¶
Loads the bundled policy bundle (or your override) and validates it:
Phase routing and drain graph
Agent chain satisfiability
Recovery policy structure
Artifact requirements contract
Use this when:
You’ve overridden
pipeline.tomlorrecovery.tomlA run failed in a way that looks policy-shaped
ralph --dry-run¶
Runs the pipeline skeleton without invoking any agent CLI: phase routing is exercised, capability probes happen, and a synthetic workflow report is emitted, but no agent commands are spawned. The fastest way to verify routing, prompts, and recovery decisions before paying for a real run.
Use this when:
You want to verify phase routing without spending agent credits
You’re debugging “the wrong agent ran the wrong phase”
You want to see what the run would do
ralph --list-agents¶
Lists every configured agent (built-in + project-local + user-global) and
each one’s availability status: on PATH, version detected, headless mode
supported. Useful when configuring a new agent or confirming a PATH fix.
ralph --list-providers¶
Lists the OpenCode provider configurations visible to the run. Useful when chaining providers or debugging OpenCode-specific transport issues.
ralph --inspect-checkpoint¶
Prints the most recent checkpoint JSON: phase, drain, artifact path, agent name, model, prompts, and verdict. Use this after a failed run to understand what state was reached without re-running the workflow.
Verification signal¶
After running ralph --diagnose, you should see:
Ralph Workflow Diagnostics
─────────────────────────
✓ Git repository
✓ Configuration
✓ Agents (claude, opencode)
✓ MCP servers (3 upstreams reachable)
✓ Workspace files
✓ Capability state (12/12 healthy)
✓ Pre-flight policy validation
All checks passed. Ready for `ralph`.
If any check is red, fix it before running a real workflow. The diagnostic report tells you exactly which check failed and what it expected.
Common failure modes and what they mean¶
Symptom |
Likely cause |
Fix |
|---|---|---|
“Agent |
The agent CLI is not installed or not on PATH |
Install the CLI; ensure |
“MCP upstream |
Network/auth or wrong URL |
Verify the URL, check |
“Capability |
Web search provider missing or out of quota |
Set a provider key in |
“Pre-flight policy validation: chain |
An agent name in the chain is unknown |
Run |
“PROMPT.md is the starter template” |
You haven’t replaced the starter text |
Edit |