Ralph Run Reconcile (Codex)
Overview
Run a structured reconcile phase after ralph run to detect and fix post-run gaps. Prioritize deterministic checks before edits, then apply bounded fixes with clear verification.
Load references/reconcile-checks.md before starting analysis.
Operating Modes
Use one mode per request:
report(default): findings and action plan only.execute-safe: apply low-risk actions automatically.execute-approved: apply only explicitly approved medium/high actions.
Workflow
1) Capture Run Context
Collect:
git rev-parse --abbrev-ref HEAD
git rev-parse HEAD
git status --short
date -u +"%Y-%m-%dT%H:%M:%SZ"
Treat existing user changes as immutable unless asked otherwise.
2) Gather Evidence (Read-Only First)
Run:
rg --files .ralph 2>/dev/null || true
test -f .ralph/stories.txt && sed -n '1,220p' .ralph/stories.txt || true
test -f .ralph/state.json && jq '.completed_stories, .merged_stories, .retry_counts' .ralph/state.json || true
git for-each-ref --format='%(refname:short)' refs/heads/ralph/story-* || true
ralph status || true
ralph reconcile || true
test -f progress.txt && tail -n 120 progress.txt || true
If available, inspect .ralph/logs/ and ralph-run-terminal-logs/ for failure signatures.
3) Produce Findings Matrix
Use the checklist in references/reconcile-checks.md.
Output columns:
IDSeverityArtifactProblemActionExec Mode(safe,approved,manual)
Sort by severity, then by user impact.
4) Build Recovery Plan
Create an ordered plan with rollback notes:
- low-risk deterministic fixes
- medium-risk targeted fixes
- high-risk/manual interventions
Include exact commands and expected post-condition for each step.
5) Execute in Bounded Scope
In execute modes, apply:
ralph reconcile --applywhen orphaned branches are clean-merge candidates.- minimal state/spec alignment edits only when evidence is unambiguous.
- minimal reruns for unresolved failed stories.
Respect strict boundaries:
- avoid destructive git commands unless user explicitly requests.
- avoid reverting unrelated local changes.
- stop when encountering conflicts or ambiguous evidence.
6) Verify and Close
Always finish with:
- post-execution
ralph reconcileresult - status of validation commands from
.ralph/config.json - unresolved findings and owner
- explicit next command for the user
Output Contract
Deliver:
Status summary(1 line)Findings matrix(severity sorted)Actions executed(command list)Verification resultsRemaining queue
Cross-Model Safeguard
When requested, generate a Claude Code challenge prompt that asks Claude to dispute the findings matrix and highlight disagreements before any high-risk execution.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.