ralph-claude-code/templates/ralphrc.template
Test User b4b9db6b76 feat(circuit-breaker): add auto-recovery from OPEN state (#160)
The OPEN state was terminal — once triggered, it persisted across
restarts with no automatic recovery. This adds two recovery mechanisms:

1. Cooldown timer (default): OPEN → HALF_OPEN after CB_COOLDOWN_MINUTES
   (default 30). The existing HALF_OPEN logic handles recovery or re-trip.
2. Auto-reset option: CB_AUTO_RESET=true bypasses cooldown, resets to
   CLOSED on startup for fully unattended operation.

Changes:
- Add parse_iso_to_epoch() to lib/date_utils.sh (cross-platform)
- Add cooldown + auto-reset logic to init_circuit_breaker()
- Add opened_at field to state file when entering/staying OPEN
- Add --auto-reset-circuit CLI flag and .ralphrc config vars
- Add 19 tests in test_circuit_breaker_recovery.bats
- Update CLAUDE.md and README.md documentation
2026-02-07 01:33:41 -07:00

102 lines
3.4 KiB
Text

# .ralphrc - Ralph project configuration
# Generated by: ralph enable
# Documentation: https://github.com/frankbria/ralph-claude-code
#
# This file configures Ralph's behavior for this specific project.
# Values here override global Ralph defaults.
# Environment variables override values in this file.
# =============================================================================
# PROJECT IDENTIFICATION
# =============================================================================
# Project name (used in prompts and logging)
PROJECT_NAME="${PROJECT_NAME:-my-project}"
# Project type: javascript, typescript, python, rust, go, unknown
PROJECT_TYPE="${PROJECT_TYPE:-unknown}"
# =============================================================================
# LOOP SETTINGS
# =============================================================================
# Maximum API calls per hour (rate limiting)
MAX_CALLS_PER_HOUR=100
# Timeout for each Claude Code invocation (in minutes)
CLAUDE_TIMEOUT_MINUTES=15
# Output format: json (structured) or text (legacy)
CLAUDE_OUTPUT_FORMAT="json"
# =============================================================================
# TOOL PERMISSIONS
# =============================================================================
# Comma-separated list of allowed tools for Claude
# Common tools: Write, Read, Edit, Grep, Glob
# Bash patterns: Bash(git *), Bash(npm *), Bash(pytest)
ALLOWED_TOOLS="Write,Read,Edit,Bash(git *),Bash(npm *),Bash(pytest)"
# =============================================================================
# SESSION MANAGEMENT
# =============================================================================
# Enable session continuity (maintain context across loops)
SESSION_CONTINUITY=true
# Session expiration time in hours (start fresh after this time)
SESSION_EXPIRY_HOURS=24
# =============================================================================
# TASK SOURCES
# =============================================================================
# Where to import tasks from (comma-separated)
# Options: local, beads, github
TASK_SOURCES="local"
# GitHub label for task filtering (when github is in TASK_SOURCES)
GITHUB_TASK_LABEL="ralph-task"
# Beads filter for task import (when beads is in TASK_SOURCES)
BEADS_FILTER="status:open"
# =============================================================================
# CIRCUIT BREAKER THRESHOLDS
# =============================================================================
# Open circuit after N loops with no file changes
CB_NO_PROGRESS_THRESHOLD=3
# Open circuit after N loops with the same error
CB_SAME_ERROR_THRESHOLD=5
# Open circuit if output declines by more than N percent
CB_OUTPUT_DECLINE_THRESHOLD=70
# Auto-recovery: cooldown before retry (minutes, 0 = immediate)
CB_COOLDOWN_MINUTES=30
# Auto-reset circuit breaker on startup (bypasses cooldown)
# WARNING: Reduces circuit breaker safety for unattended operation
CB_AUTO_RESET=false
# =============================================================================
# ADVANCED SETTINGS
# =============================================================================
# Minimum Claude CLI version required
CLAUDE_MIN_VERSION="2.0.76"
# Enable verbose logging
RALPH_VERBOSE=false
# Custom prompt file (relative to .ralph/)
# PROMPT_FILE="PROMPT.md"
# Custom fix plan file (relative to .ralph/)
# FIX_PLAN_FILE="@fix_plan.md"
# Custom agent file (relative to .ralph/)
# AGENT_FILE="@AGENT.md"