agentic-loop 3.2.7 → 3.2.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/ralph/loop.sh +80 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-loop",
3
- "version": "3.2.7",
3
+ "version": "3.2.9",
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/loop.sh CHANGED
@@ -251,8 +251,8 @@ run_loop() {
251
251
  last_story="$story"
252
252
  fi
253
253
 
254
- # 2. Session startup checklist (Anthropic best practice)
255
- startup_checklist
254
+ # 2. Session startup checklist (skip on retries)
255
+ [[ $consecutive_failures -gt 1 ]] && startup_checklist "true" || startup_checklist "false"
256
256
 
257
257
  # 3. Build prompt with current story context (including failure context if any)
258
258
  print_info "Preparing prompt for $story..."
@@ -413,7 +413,9 @@ run_loop() {
413
413
  fi
414
414
 
415
415
  log_progress "$story" "COMPLETED"
416
- print_success "Story $story completed!"
416
+
417
+ # Show completion summary
418
+ print_story_complete "$story" "$title"
417
419
 
418
420
  # If running specific story, we're done
419
421
  [[ -n "$specific_story" ]] && return 0
@@ -437,28 +439,43 @@ run_loop() {
437
439
  return 1
438
440
  }
439
441
 
440
- # Display startup checklist (Anthropic best practice)
442
+ # Display startup checklist (only full version on first iteration)
443
+ # Usage: startup_checklist [is_retry]
441
444
  startup_checklist() {
445
+ local is_retry="${1:-false}"
446
+
447
+ # On retries, just show minimal info
448
+ if [[ "$is_retry" == "true" ]]; then
449
+ return 0
450
+ fi
451
+
442
452
  echo "--- Startup Checklist ---"
443
453
  echo "Working directory: $(pwd)"
444
454
  echo ""
445
455
 
446
- echo "Recent progress:"
447
- if [[ -f "$RALPH_DIR/progress.txt" ]]; then
448
- tail -"$MAX_PROGRESS_LINES" "$RALPH_DIR/progress.txt" | sed 's/^/ /'
449
- else
450
- echo " (no progress yet)"
451
- fi
456
+ # Show progress summary instead of full list
457
+ local passed_count total_count
458
+ passed_count=$(jq '[.stories[] | select(.passes==true)] | length' "$RALPH_DIR/prd.json" 2>/dev/null || echo "0")
459
+ total_count=$(jq '[.stories[]] | length' "$RALPH_DIR/prd.json" 2>/dev/null || echo "0")
460
+ echo "Progress: $passed_count/$total_count stories complete"
452
461
  echo ""
453
462
 
454
- echo "Stories:"
455
- jq -r '.stories[] | " \(.id): \(.title) [\(if .passes then "DONE" else "TODO" end)]"' "$RALPH_DIR/prd.json" 2>/dev/null || echo " (none)"
456
- echo ""
463
+ # Only show last few progress entries
464
+ if [[ -f "$RALPH_DIR/progress.txt" ]]; then
465
+ echo "Recent:"
466
+ tail -3 "$RALPH_DIR/progress.txt" | sed 's/^/ /'
467
+ echo ""
468
+ fi
457
469
 
470
+ # Show git status only if there are changes
458
471
  if command -v git &>/dev/null && [[ -d ".git" ]]; then
459
- echo "Git status:"
460
- git status --short | head -"$MAX_GIT_STATUS_LINES" | sed 's/^/ /'
461
- echo ""
472
+ local git_changes
473
+ git_changes=$(git status --short 2>/dev/null | head -5)
474
+ if [[ -n "$git_changes" ]]; then
475
+ echo "Uncommitted:"
476
+ echo "$git_changes" | sed 's/^/ /'
477
+ echo ""
478
+ fi
462
479
  fi
463
480
  }
464
481
 
@@ -651,6 +668,53 @@ build_prompt() {
651
668
  _inject_developer_dna
652
669
  }
653
670
 
671
+ # Print story completion summary
672
+ print_story_complete() {
673
+ local story="$1"
674
+ local title="$2"
675
+
676
+ # Get stats
677
+ local passed_count total_count remaining
678
+ passed_count=$(jq '[.stories[] | select(.passes==true)] | length' "$RALPH_DIR/prd.json" 2>/dev/null || echo "0")
679
+ total_count=$(jq '[.stories[]] | length' "$RALPH_DIR/prd.json" 2>/dev/null || echo "0")
680
+ remaining=$((total_count - passed_count))
681
+
682
+ # Get commit info
683
+ local commit_hash=""
684
+ local files_changed="0"
685
+ if command -v git &>/dev/null && [[ -d ".git" ]]; then
686
+ commit_hash=$(git rev-parse --short HEAD 2>/dev/null || echo "")
687
+ files_changed=$(git diff --name-only HEAD~1 2>/dev/null | wc -l | tr -d ' ')
688
+ fi
689
+
690
+ # Build progress bar
691
+ local bar_filled=$((passed_count * 10 / total_count))
692
+ local bar_empty=$((10 - bar_filled))
693
+ local progress_bar=""
694
+ for ((i=0; i<bar_filled; i++)); do progress_bar+="█"; done
695
+ for ((i=0; i<bar_empty; i++)); do progress_bar+="░"; done
696
+
697
+ # Truncate title if too long
698
+ local display_title="$story: $title"
699
+ [[ ${#display_title} -gt 50 ]] && display_title="${display_title:0:47}..."
700
+
701
+ echo ""
702
+ echo " ┌──────────────────────────────────────────────────────┐"
703
+ echo " │ ✅ STORY COMPLETE │"
704
+ echo " ├──────────────────────────────────────────────────────┤"
705
+ printf " │ %-52s│\n" "$display_title"
706
+ echo " ├──────────────────────────────────────────────────────┤"
707
+ printf " │ Progress: [%s] %d/%d stories │\n" "$progress_bar" "$passed_count" "$total_count"
708
+ [[ -n "$commit_hash" ]] && printf " │ Commit: %-42s│\n" "$commit_hash ($files_changed files)"
709
+ if [[ $remaining -eq 0 ]]; then
710
+ echo " │ Status: All stories complete! │"
711
+ else
712
+ printf " │ Remaining: %-41s│\n" "$remaining stories"
713
+ fi
714
+ echo " └──────────────────────────────────────────────────────┘"
715
+ echo ""
716
+ }
717
+
654
718
  # Print progress summary at end of run
655
719
  print_progress_summary() {
656
720
  local start_time="$1"