-
Notifications
You must be signed in to change notification settings - Fork 1
Add Ralph Wiggum Loop and beads infrastructure #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds loop.sh, PROMPT files, AGENTS.md with beads workflow, beads shellHook in flake.nix, and .gitignore entries for runtime state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e37f64bcba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| plan|build) | ||
| CONFIG[mode]="$1" | ||
| [[ "$1" == "plan" ]] && [[ ${CONFIG[max_iterations]} -eq 0 ]] && CONFIG[max_iterations]=3 | ||
| shift ;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make plan mode default to 3 iterations
When users run ./loop.sh plan without -n, the script still keeps the global default of 500 iterations because the plan-specific override only triggers if max_iterations is already 0. This contradicts both the help text and README examples that say plan mode defaults to 3 iterations, and will make plan runs much longer than intended. This will occur any time plan mode is used without explicitly setting -n or a config override.
Useful? React with 👍 / 👎.
| shellHook = '' | ||
| if ! command -v bd &> /dev/null; then | ||
| echo "Installing beads (bd) for AI agent task tracking..." | ||
| go install github.com/steveyegge/beads/cmd/bd@latest | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure bd is discoverable after go install
The shellHook installs bd with go install but never adds $(go env GOPATH)/bin (or GOBIN) to PATH. On systems where GOPATH/bin is not already on PATH (common in a fresh nix develop), command -v bd will keep failing, causing the install to repeat every shell entry and bd --version to keep failing. This makes the “auto-install” ineffective unless users manually fix their PATH.
Useful? React with 👍 / 👎.
Code Review: PR #87 - Add Ralph Wiggum Loop and beads infrastructureSummaryThis PR adds the Ralph Wiggum autonomous loop system and beads infrastructure to the project. It bootstraps automation tooling for AI-driven development workflows. ✅ Strengths
🔴 Critical Issues1. Security: Dangerously Skip Permissions Flag (HIGH PRIORITY)Location: loop.sh:839, README.md:50 This flag bypasses all permission checks and is extremely risky in an autonomous loop that runs indefinitely. The script could delete important files, make unauthorized API calls, push destructive changes, or execute arbitrary commands without oversight. Recommendation: Remove --dangerously-skip-permissions or add extensive documentation about security implications. Consider implementing a whitelist of safe operations and add a prominent warning in the README. 2. Hardcoded Jujutsu (jj) DependencyLocations: Throughout loop.sh (lines 703-783), PROMPT_build.md:25, PROMPT_review.md:1,6 Issue: The script assumes Jujutsu VCS is available but this project uses Git. No jj installation instructions in README or flake.nix. Functions like vcs_branch(), vcs_commit_short(), vcs_push() will fail. Recommendation: Add Git fallback logic or detect which VCS is in use. Update flake.nix to include jj package if required. Document the requirement prominently or abstract VCS operations to support both Git and Jujutsu. 3. Missing Dependency: codex CLILocation: loop.sh:979, README.md:78-84 Issue: Review functionality requires codex CLI tool but it's not mentioned in dependencies or flake.nix. Will cause fatal errors when review is enabled (default: true). Recommendation: Add codex installation instructions to README. Consider adding to flake.nix if available. Make review feature gracefully degrade if unavailable.
|
Code Review: Ralph Wiggum Loop Infrastructure (PR #87)SummaryThis PR adds the Ralph Wiggum autonomous loop infrastructure - a sophisticated bash-based automation system that orchestrates Claude Code iterations with beads issue tracking and optional AI-powered code review. This is a significant addition (1,703 additions, 0 deletions). Overall Assessment✅ APPROVE with recommendations The code is well-structured and production-grade. However, there are several areas where improvements would enhance security, maintainability, and reliability. Critical Issues (Must Fix Before Merge)1. Command Injection Risk in loop.shSeverity: HIGH | Location: loop.sh:825-830, loop.sh:990-995 The script pipes content to claude and codex commands without validation. Model name from config isn't validated, uses --dangerously-skip-permissions flag, and prompt file path not validated. Recommendation: Add validation for model names (opus|sonnet|haiku) and verify prompt files exist before use. 2. Webhook URL Validation MissingSeverity: MEDIUM | Location: loop.sh:662-683 Webhook URL from config used directly in curl without validation. Could access internal services. Recommendation: Validate URL format and restrict to http/https schemes only. 3. Config Validation IncompleteSeverity: MEDIUM | Location: loop.sh:1506-1516 Config values loaded without type/range validation. No checks for numeric values (max_iterations, delay), valid model names, or boolean normalization. Recommendation: Add validate_config() function to check all config values. 4. PIPESTATUS Race ConditionSeverity: MEDIUM | Location: loop.sh:856-858 Exit code capture from PIPESTATUS may be unreliable due to intermediate commands. Recommendation: Capture PIPESTATUS immediately into an array variable to prevent race conditions. Medium Priority Issues5. Temp File Cleanup (LOW)Some temp files not properly cleaned up (loop.sh:1203-1212, 973). Use trap-based cleanup with TEMP_FILES array. 6. JSON Parsing Performance (LOW)Multiple jq processes spawned in session_list (40 total for 10 sessions). Parse all fields in single jq call using @TSV format. 7. Magic Numbers (LOW)Hardcoded values throughout. Extract to readonly constants with descriptive names. Documentation Issues8. Missing Prerequisites (LOW)Ralph Wiggum section doesn't list required tools: claude CLI + auth, codex CLI (for review), jj (Jujutsu), bd (beads), bc utility. 9. Generic Placeholder Text (LOW)PROMPT_build.md:4 and PROMPT_plan.md:26-27 contain generic placeholders that should be customized for this Astro documentation project. Testing RecommendationsPlease verify:
Positive Aspects ✅
ConclusionThis is a well-crafted, production-grade bash script that brings sophisticated autonomous development capabilities to the project. The code demonstrates advanced bash techniques, proper error handling, and thoughtful UX design. The security concerns are manageable and can be addressed with validation layers. With the recommended fixes, this will be a valuable addition to the development workflow. Recommendation: APPROVE with required changes for security validation ✅ Great work on this implementation! 🚀 Reviewed with Claude Code following project conventions from CLAUDE.md |
Code Review - PR #87: Add Ralph Wiggum Loop and beads infrastructureOverviewThis PR adds the Ralph Wiggum autonomous loop infrastructure to enable AI agents to work continuously on tasks tracked by the beads issue tracker. The changes include a comprehensive bash script, prompt templates, documentation, and Nix environment setup. ✅ Strengths
🔴 Critical Issues1. VCS Commands Assume Jujutsu (not Git)Severity: High The loop.sh script heavily uses
Problem: This repository uses Git, not Jujutsu. All these commands will fail. Evidence from PR description: "Sync with jj (run at session end)" but the repo uses standard git. Recommendation: Either:
2. Hardcoded References to External DependenciesSeverity: Medium loop.sh line 856: References PROMPT_build.md line 12: "Use up to 500 parallel subagents" - this seems unrealistic and could cause resource exhaustion. 3. Review Phase Requires
|
Summary
loop.shandPROMPT_*.mdfiles for Ralph Wiggum autonomous loopAGENTS.md(Issue Tracking, Landing the Plane, Multi-Agent Orchestration, Related Tools)flake.nixwithgopackage and beads auto-install shellHook.gitignoreentries for Ralph/beads runtime stateREADME.mdContext
Bootstrapped from the
aboutrepo viascripts/bootstrap-ralph.shas part of the Ralph Wiggum Loop distribution epic.Test plan
nix developenters shell without errorsbd --versionworks after shell entry./loop.sh --helpshows usagegit status