agentic-loop 3.4.1 → 3.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/package.json +1 -1
- package/ralph/ci.sh +1 -0
- package/ralph/loop.sh +3 -3
- package/ralph/setup.sh +51 -0
- package/ralph/test.sh +12 -4
- package/templates/github/workflows/nightly.yml +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ Ralph reads the PRD and implements each story autonomously. It spawns Claude, ru
|
|
|
24
24
|
- `/vibe-check`, `/review` - On-demand quality and security checks
|
|
25
25
|
- Pre-commit hooks - Block secrets, hardcoded URLs, debug statements
|
|
26
26
|
- Claude Code hooks - Real-time warnings while coding
|
|
27
|
+
- GitHub Actions CI/CD - Fast PR checks + comprehensive nightly tests
|
|
28
|
+
- Test file enforcement - Fails if new code lacks corresponding tests
|
|
27
29
|
|
|
28
30
|
---
|
|
29
31
|
|
package/package.json
CHANGED
package/ralph/ci.sh
CHANGED
package/ralph/loop.sh
CHANGED
|
@@ -325,12 +325,12 @@ run_loop() {
|
|
|
325
325
|
timeout_seconds=$(get_config '.maxSessionSeconds' "$DEFAULT_TIMEOUT_SECONDS")
|
|
326
326
|
|
|
327
327
|
# Run Claude - first story gets fresh session, subsequent continue the session
|
|
328
|
-
local
|
|
328
|
+
local -a claude_args=(-p --dangerously-skip-permissions --verbose)
|
|
329
329
|
if [[ "$session_started" == "true" ]]; then
|
|
330
|
-
|
|
330
|
+
claude_args=(--continue "${claude_args[@]}")
|
|
331
331
|
fi
|
|
332
332
|
|
|
333
|
-
if ! cat "$prompt_file" | run_with_timeout "$timeout_seconds" $
|
|
333
|
+
if ! cat "$prompt_file" | run_with_timeout "$timeout_seconds" claude "${claude_args[@]}"; then
|
|
334
334
|
print_warning "Claude session ended (timeout or error)"
|
|
335
335
|
log_progress "$story" "TIMEOUT" "Claude session ended after ${timeout_seconds}s"
|
|
336
336
|
rm -f "$prompt_file"
|
package/ralph/setup.sh
CHANGED
|
@@ -26,6 +26,7 @@ ralph_setup() {
|
|
|
26
26
|
setup_claude_md
|
|
27
27
|
setup_mcp
|
|
28
28
|
setup_precommit_hooks
|
|
29
|
+
setup_github_ci "$pkg_root"
|
|
29
30
|
|
|
30
31
|
echo ""
|
|
31
32
|
echo " ========================================"
|
|
@@ -463,3 +464,53 @@ EOF
|
|
|
463
464
|
echo " Then run: pre-commit install"
|
|
464
465
|
fi
|
|
465
466
|
}
|
|
467
|
+
|
|
468
|
+
# Set up GitHub Actions CI/CD
|
|
469
|
+
setup_github_ci() {
|
|
470
|
+
local pkg_root="$1"
|
|
471
|
+
local template_dir="$pkg_root/templates/github/workflows"
|
|
472
|
+
|
|
473
|
+
# Skip if not a git repo
|
|
474
|
+
if [[ ! -d ".git" ]]; then
|
|
475
|
+
return 0
|
|
476
|
+
fi
|
|
477
|
+
|
|
478
|
+
# Skip if templates don't exist
|
|
479
|
+
if [[ ! -d "$template_dir" ]]; then
|
|
480
|
+
return 0
|
|
481
|
+
fi
|
|
482
|
+
|
|
483
|
+
# Skip if already set up
|
|
484
|
+
if [[ -f ".github/workflows/pr.yml" ]] && [[ -f ".github/workflows/nightly.yml" ]]; then
|
|
485
|
+
return 0
|
|
486
|
+
fi
|
|
487
|
+
|
|
488
|
+
echo ""
|
|
489
|
+
echo " GitHub Actions CI/CD can be configured:"
|
|
490
|
+
echo " - PR checks: Fast lint/typecheck on pull requests"
|
|
491
|
+
echo " - Nightly: Full test suite + PRD tests at 3am UTC"
|
|
492
|
+
echo ""
|
|
493
|
+
read -r -p " Set up GitHub Actions? [Y/n] " response
|
|
494
|
+
|
|
495
|
+
if [[ "$response" =~ ^[Nn]$ ]]; then
|
|
496
|
+
echo " Skipped GitHub Actions (run 'ralph ci install' later)"
|
|
497
|
+
return 0
|
|
498
|
+
fi
|
|
499
|
+
|
|
500
|
+
echo "Setting up GitHub Actions CI/CD..."
|
|
501
|
+
|
|
502
|
+
# Create workflows directory
|
|
503
|
+
mkdir -p .github/workflows
|
|
504
|
+
|
|
505
|
+
# Install PR workflow
|
|
506
|
+
if [[ ! -f ".github/workflows/pr.yml" ]]; then
|
|
507
|
+
cp "$template_dir/pr.yml" .github/workflows/pr.yml
|
|
508
|
+
echo " Created .github/workflows/pr.yml (fast PR checks)"
|
|
509
|
+
fi
|
|
510
|
+
|
|
511
|
+
# Install nightly workflow
|
|
512
|
+
if [[ ! -f ".github/workflows/nightly.yml" ]]; then
|
|
513
|
+
cp "$template_dir/nightly.yml" .github/workflows/nightly.yml
|
|
514
|
+
echo " Created .github/workflows/nightly.yml (nightly full tests)"
|
|
515
|
+
fi
|
|
516
|
+
}
|
package/ralph/test.sh
CHANGED
|
@@ -14,8 +14,6 @@ ralph_test() {
|
|
|
14
14
|
echo ""
|
|
15
15
|
|
|
16
16
|
local failed=0
|
|
17
|
-
local total=0
|
|
18
|
-
local passed=0
|
|
19
17
|
|
|
20
18
|
case "$mode" in
|
|
21
19
|
all)
|
|
@@ -76,11 +74,18 @@ run_full_test_suite() {
|
|
|
76
74
|
echo "Running: $test_cmd"
|
|
77
75
|
echo ""
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
local log_file
|
|
78
|
+
log_file=$(mktemp)
|
|
79
|
+
|
|
80
|
+
if safe_exec "$test_cmd" "$log_file"; then
|
|
80
81
|
print_success "Unit tests passed"
|
|
82
|
+
rm -f "$log_file"
|
|
81
83
|
return 0
|
|
82
84
|
else
|
|
83
85
|
print_error "Unit tests failed"
|
|
86
|
+
echo ""
|
|
87
|
+
tail -50 "$log_file"
|
|
88
|
+
rm -f "$log_file"
|
|
84
89
|
return 1
|
|
85
90
|
fi
|
|
86
91
|
}
|
|
@@ -131,13 +136,16 @@ run_all_prd_tests() {
|
|
|
131
136
|
|
|
132
137
|
echo -n " $step... "
|
|
133
138
|
|
|
134
|
-
|
|
139
|
+
local step_log
|
|
140
|
+
step_log=$(mktemp)
|
|
141
|
+
if safe_exec "$step" "$step_log"; then
|
|
135
142
|
print_success "passed"
|
|
136
143
|
((passed++))
|
|
137
144
|
else
|
|
138
145
|
print_error "failed"
|
|
139
146
|
((failed++))
|
|
140
147
|
fi
|
|
148
|
+
rm -f "$step_log"
|
|
141
149
|
done <<< "$test_steps"
|
|
142
150
|
|
|
143
151
|
echo ""
|