* feat(enable): add ralph-enable wizard for existing projects (v0.11.0) Add interactive wizard and CI version for enabling Ralph in existing projects. New commands: - ralph-enable: Interactive 5-phase wizard for humans - ralph-enable-ci: Non-interactive version with JSON output for CI/automation New library components: - lib/enable_core.sh: Shared logic for idempotency, project detection, templates - lib/wizard_utils.sh: Interactive prompt utilities - lib/task_sources.sh: Task import from beads, GitHub Issues, PRD documents Features: - Auto-detects project type (TypeScript, Python, Rust, Go) - Auto-detects framework (Next.js, FastAPI, Django, Express) - Imports tasks from beads, GitHub Issues, or PRD documents - Generates .ralphrc project configuration file - Idempotent: safe to run multiple times, respects existing files - Exit codes: 0 (success), 1 (error), 2 (already enabled) Updated: - install.sh: Added new commands to global installation - ralph_loop.sh: Loads .ralphrc configuration at startup Tests: 75 new tests (30 enable_core + 23 task_sources + 22 integration) Total: 396 tests passing (100% pass rate) Closes #85, #121, #64, #87, #99 * fix(enable): address code review feedback Fixes from PR #124 review: 1. sed -i portability (ralph_enable.sh:456) - Use portable sed + mv pattern instead of GNU-only sed -i 2. sed regex portability (lib/task_sources.sh) - Replace \s with POSIX [[:space:]] character class - Add sed -E flag for extended regex 3. jq availability check (ralph_enable_ci.sh:177) - Add check for jq when --json flag is used 4. Unused filter parameter (lib/task_sources.sh:44) - Pass filter to bd list --filter command 5. Word-splitting in select_multiple (ralph_enable.sh:322) - Return comma-separated indices instead of space-separated text - Update caller to parse indices correctly 6. Missing || true for check_existing_ralph (ralph_enable.sh:185) - Prevent set -e from exiting on non-zero return 7. select_multiple stdout corruption (lib/wizard_utils.sh) - Redirect interactive output to stderr - Only final result goes to stdout 8. Color variables not exported (lib/wizard_utils.sh:12) - Export WIZARD_* color variables for subshells 9. select_option infinite loop (lib/wizard_utils.sh:179) - Add guard for empty options array * fix(tests): add missing mocks and exports for new enable feature - Add RESPONSE_ANALYSIS_FILE export to test_session_continuity.bats setup - Add mock ralph_enable.sh and ralph_enable_ci.sh to test_installation.bats - Add mock lib files: enable_core.sh, wizard_utils.sh, task_sources.sh, timeout_utils.sh All 396 tests now pass. * fix(config): fix critical issues from PR review 1. .ralphrc Configuration Loading Fix: - Captured env var state BEFORE setting defaults with _env_* variables - load_ralphrc now only restores values explicitly set by environment - .ralphrc settings are now properly applied (not overwritten by defaults) 2. sed Command Injection Fix: - Replaced sed with awk for .ralphrc updates in ralph_enable.sh - awk -v pattern safely handles user input without shell injection risk 3. Shell Injection Fix in safe_create_file(): - Replaced echo with printf '%s\n' for safer content handling - Prevents issues with backslashes, -n, and special characters 4. Specific Error Codes: - Added ENABLE_INVALID_ARGS=3 for argument errors - Added ENABLE_FILE_NOT_FOUND=4 for missing files - Added ENABLE_DEPENDENCY_MISSING=5 for missing deps (e.g., jq) - Added ENABLE_PERMISSION_DENIED=6 for permission errors - Updated ralph_enable.sh and ralph_enable_ci.sh to use specific codes 5. Added tests for .ralphrc loading pattern verification Test count: 398 (up from 396) * fix(enable): make --force flag actually overwrite existing files The --force flag was accepted but safe_create_file() always skipped existing files regardless of ENABLE_FORCE value. Changes: - safe_create_file() now checks ENABLE_FORCE environment variable - When ENABLE_FORCE="true", overwrites existing files instead of skipping - Added proper logging for overwrite operations Added tests: - Verify enable_ralph_in_directory actually changes file contents with --force - Test safe_create_file overwrites when ENABLE_FORCE is true - Test safe_create_file skips when ENABLE_FORCE is false Test count: 400 (up from 398) --------- Co-authored-by: Test User <test@example.com>
95 lines
3.2 KiB
Text
95 lines
3.2 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
|
|
|
|
# =============================================================================
|
|
# 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"
|