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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-loop",
3
- "version": "3.4.1",
3
+ "version": "3.4.3",
4
4
  "description": "Autonomous AI coding loop - PRD-driven development with Claude Code",
5
5
  "author": "Allie Jones <allie@allthrive.ai>",
6
6
  "license": "MIT",
package/ralph/ci.sh CHANGED
@@ -19,6 +19,7 @@ ralph_ci() {
19
19
  echo "Commands:"
20
20
  echo " install - Install GitHub Actions workflows"
21
21
  echo " status - Check CI status"
22
+ return 1
22
23
  ;;
23
24
  esac
24
25
  }
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 claude_cmd="claude -p --dangerously-skip-permissions --verbose"
328
+ local -a claude_args=(-p --dangerously-skip-permissions --verbose)
329
329
  if [[ "$session_started" == "true" ]]; then
330
- claude_cmd="claude --continue -p --dangerously-skip-permissions --verbose"
330
+ claude_args=(--continue "${claude_args[@]}")
331
331
  fi
332
332
 
333
- if ! cat "$prompt_file" | run_with_timeout "$timeout_seconds" $claude_cmd; then
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
- if eval "$test_cmd"; then
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
- if eval "$step" >/dev/null 2>&1; then
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 ""
@@ -79,7 +79,7 @@ jobs:
79
79
 
80
80
  # PRD testSteps (if ralph is set up)
81
81
  - name: Install ralph
82
- run: npm install -g thrivekit 2>/dev/null || true
82
+ run: npm install -g agentic-loop 2>/dev/null || true
83
83
 
84
84
  - name: Run PRD tests
85
85
  if: hashFiles('.ralph/prd.json') != ''