-
Notifications
You must be signed in to change notification settings - Fork 964
Improvements based on Sam Keen's recent article #53
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
base: main
Are you sure you want to change the base?
Conversation
Add comprehensive security guide covering: - Mandatory safeguards for autonomous agent runs - Pre-flight security checklist with dangerous env vars - Emergency stop procedures - Docker sandboxing example
Add planning skill with 5 mandatory question rounds to force deep requirements exploration before PRD creation. Includes completion gate that requires all rounds to be completed.
Greptile OverviewGreptile SummaryThis PR significantly improves Ralph's production-readiness by adding comprehensive security, cost tracking, and quality control mechanisms. Key Improvements:
Impact: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ralph.sh
participant Security Check
participant Circuit Breaker
participant AI Agent
participant Quality Gates
participant prd.json
User->>ralph.sh: Start Ralph
ralph.sh->>Security Check: Check environment variables
alt Credentials Detected
Security Check-->>User: Warn about AWS_ACCESS_KEY_ID, DATABASE_URL
User->>Security Check: Confirm or abort
end
Security Check->>ralph.sh: Continue
loop For each iteration (up to MAX_ITERATIONS)
ralph.sh->>prd.json: Get next incomplete story
ralph.sh->>Circuit Breaker: Check story attempts
alt Max attempts reached
Circuit Breaker->>prd.json: Mark story as skipped
Circuit Breaker->>ralph.sh: Skip to next story
else Attempts remaining
Circuit Breaker->>ralph.sh: Increment attempt counter
ralph.sh->>AI Agent: Spawn fresh instance (Amp or Claude)
AI Agent->>AI Agent: Read prd.json, progress.txt
AI Agent->>AI Agent: Implement story
AI Agent->>Quality Gates: Run typecheck, lint, tests
alt Quality gates pass
Quality Gates->>AI Agent: All checks passed
AI Agent->>AI Agent: Commit changes
AI Agent->>prd.json: Mark story passes: true
AI Agent->>AI Agent: Append to progress.txt
AI Agent-->>ralph.sh: Output COMPLETE signal (if all done)
else Quality gates fail
Quality Gates->>AI Agent: Checks failed
AI Agent->>AI Agent: Leave story incomplete
end
ralph.sh->>ralph.sh: Check for COMPLETE signal
alt COMPLETE claimed
ralph.sh->>prd.json: Verify all stories passes: true
alt Verification passes
ralph.sh-->>User: All tasks completed
else Verification fails
ralph.sh->>ralph.sh: Continue iteration
end
end
end
end
|
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.
1 file reviewed, 1 comment
| LAST_STORY=$(cat "$LAST_STORY_FILE" 2>/dev/null || echo "") | ||
| fi | ||
|
|
||
| if [ "$CURRENT_STORY" == "$LAST_STORY" ]; then |
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.
Using == for string comparison in bash. While this works in [[ ]] context, consider using = for better POSIX compatibility if the script needs to run on different shells.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: ralph.sh
Line: 204:204
Comment:
Using `==` for string comparison in bash. While this works in `[[ ]]` context, consider using `=` for better POSIX compatibility if the script needs to run on different shells.
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Link to article by Sam Keen which provides great recommendations: https://alteredcraft.com/p/the-ralph-wiggum-agent-loop-is-really