Expand description
Automatic startup health checks with auto-fix and migration prompts.
Responsibilities:
- Run lightweight health checks on Ralph startup for key commands.
- Auto-update README.md when embedded template is newer (no prompt).
- Detect and prompt for config migrations (deprecated keys, unknown keys).
- Support –auto-fix flag to auto-approve all migrations without prompting.
- Support –no-sanity-checks flag to skip sanity health checks.
- Support non-interactive mode to skip all prompts (for CI/piped runs).
Not handled here:
- Deep validation (git, runners, queue structure) - that’s
ralph doctor. - GUI app flows.
- Network connectivity checks.
Invariants/assumptions:
- Sanity checks are fast and lightweight.
- README auto-update is automatic (users shouldn’t edit this file manually).
- Config migrations require user confirmation unless –auto-fix is set.
- Unknown config keys prompt for remove/keep/rename action.
- Prompts require both stdin and stdout to be TTYs.
- If non_interactive is true, all prompts are skipped (use –auto-fix to apply changes).
- README sync may also be invoked directly by command routing for agent-facing commands.
Structs§
- Sanity
Issue - A single issue found during sanity checks.
- Sanity
Options - Options for controlling sanity check behavior.
- Sanity
Result - Result of running sanity checks.
Enums§
- Issue
Severity - Severity level for sanity issues.
Functions§
- refresh_
readme_ if_ needed - Refresh
.ralph/README.mdif missing/outdated. - report_
sanity_ results - Report sanity check results to the user.
- run_
sanity_ checks - Run all sanity checks and apply fixes based on options.
- should_
refresh_ readme_ for_ command - Whether a command should refresh
.ralph/README.mdbefore execution. - should_
run_ sanity_ checks - Check if sanity checks should run for a given command.