Skip to content

fix(install): add lib/ directory copy for response_analyzer.sh#4

Merged
frankbria merged 1 commit into
frankbria:mainfrom
ikanc:fix/install-lib-directory
Dec 31, 2025
Merged

fix(install): add lib/ directory copy for response_analyzer.sh#4
frankbria merged 1 commit into
frankbria:mainfrom
ikanc:fix/install-lib-directory

Conversation

@ikanc
Copy link
Copy Markdown
Contributor

@ikanc ikanc commented Dec 31, 2025

Summary

  • Add mkdir -p "$RALPH_HOME/lib" to create_install_dirs() to create the lib directory
  • Add cp -r "$SCRIPT_DIR/lib/"* "$RALPH_HOME/lib/" to install_scripts() to copy lib scripts
  • Add chmod +x "$RALPH_HOME/lib/"*.sh to make lib scripts executable

This fixes the issue where ralph_loop.sh fails because response_analyzer.sh and circuit_breaker.sh (required at lines 10-11) are not installed to ~/.ralph/lib/.

Test plan

  • Run ./install.sh on a clean system
  • Verify ~/.ralph/lib/ directory exists
  • Verify response_analyzer.sh and circuit_breaker.sh are present and executable
  • Run ralph --monitor to confirm no sourcing errors

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced installation process by improving library script management and initialization during setup.

✏️ Tip: You can customize this high-level summary in your review settings.

The install.sh was missing the lib/ directory copy, causing ralph_loop.sh
to fail when sourcing response_analyzer.sh and circuit_breaker.sh.

Changes:
- Add mkdir -p "$RALPH_HOME/lib" to create_install_dirs()
- Add cp -r "$SCRIPT_DIR/lib/"* "$RALPH_HOME/lib/" to install_scripts()
- Add chmod +x for lib/*.sh scripts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 31, 2025

Walkthrough

The installation script is updated to create a lib directory in the Ralph home directory and copy library scripts with executable permissions during the installation process.

Changes

Cohort / File(s) Summary
Installation lib directory setup
install.sh
Adds creation of ~/.ralph/lib directory in create_install_dirs(), copies all library scripts from script/lib/*.sh into Ralph home's lib directory, and sets executable permissions on copied scripts via install_scripts().

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related issues

Poem

🐰 A burrow grows with scripts so fine,
Lib directories all align,
Permissions set with exec's might,
Ralph's home is ready, snug and tight!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a lib/ directory copy mechanism during installation, specifically mentioning response_analyzer.sh as a key artifact.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9903f8 and a98a167.

📒 Files selected for processing (1)
  • install.sh
🔇 Additional comments (3)
install.sh (3)

78-79: LGTM! Lib directory creation follows existing pattern.

The addition of the lib directory creation is consistent with how other directories are created (templates on line 77) and properly uses the -p flag to avoid errors if the directory already exists.


148-149: LGTM! Executable permissions for lib scripts.

The chmod operation correctly makes all .sh files in the lib directory executable, which is necessary for the scripts to be sourced by ralph_loop.sh. This follows the same pattern as the other chmod operations above (lines 142-147).

Note: This operation depends on the successful copy of lib scripts on line 91.


91-91: No changes needed — source lib/ directory and files exist.

Verification confirms the lib/ directory exists in the repository root and contains both expected files (circuit_breaker.sh and response_analyzer.sh). The glob pattern at line 91 will expand correctly, and the copy operation will succeed. The code is correct as written.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@iosys-hub
Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@frankbria frankbria merged commit e370c1e into frankbria:main Dec 31, 2025
2 checks passed
frankbria pushed a commit that referenced this pull request Dec 31, 2025
Updated both documentation files to reflect recent enhancements and fixes:

CLAUDE.md Changes:
- Added comprehensive Core Architecture section detailing main scripts and lib/ components
- Documented lib/circuit_breaker.sh and lib/response_analyzer.sh modular architecture
- Added detailed Exit Conditions and Thresholds section with circuit breaker thresholds
- Documented advanced two-stage error detection process to eliminate false positives
- Documented multi-line error matching for accurate stuck loop detection
- Added Recent Improvements section highlighting v0.9.0 circuit breaker enhancements
- Updated Global Installation section to include lib/ directory and ralph-import command
- Test coverage details: 13 error detection + 9 stuck loop tests

README.md Changes:
- Updated "What's Working Now" section with circuit breaker enhancements
- Added "Recent Improvements" section highlighting v0.9.0 updates
- Updated test count from 75 to 97 tests (75 core + 13 error detection + 9 stuck loop)
- Enhanced circuit breaker description with two-stage filtering details
- Added circuit breaker thresholds to Exit Thresholds section
- Updated test commands to include error detection and stuck loop test scripts
- Updated current test status with specialized test file counts

Key improvements documented:
- Multi-line error matching fix for detect_stuck_loop function
- JSON field false positive elimination (e.g., "is_error": false)
- Two-stage error filtering for accurate error detection
- Installation fix for lib/ directory components
- 22 new tests added for circuit breaker functionality

These updates ensure documentation accurately reflects the current state of the
codebase following PR #6 (circuit-breaker false positives fix) and PR #4
(installation lib/ directory fix).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants