From a09957c068c049a28ff7798ae87190856fac0a0e Mon Sep 17 00:00:00 2001 From: frankbria Date: Wed, 27 Aug 2025 16:09:56 -0700 Subject: [PATCH] Add debug logging for @fix_plan.md completion check - Add logging to show total_items and completed_items counts - Add final debug statement to confirm function completion - This will help identify if the fix_plan completion check is the culprit --- ralph_loop.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ralph_loop.sh b/ralph_loop.sh index 16534dd..1904c42 100755 --- a/ralph_loop.sh +++ b/ralph_loop.sh @@ -272,13 +272,18 @@ should_exit_gracefully() { local total_items=$(grep -c "^- \[" "@fix_plan.md" 2>/dev/null || echo "0") local completed_items=$(grep -c "^- \[x\]" "@fix_plan.md" 2>/dev/null || echo "0") + log_status "INFO" "DEBUG: @fix_plan.md check - total_items:$total_items, completed_items:$completed_items" >&2 + if [[ $total_items -gt 0 ]] && [[ $completed_items -eq $total_items ]]; then - log_status "WARN" "Exit condition: All fix_plan.md items completed ($completed_items/$total_items)" + log_status "WARN" "Exit condition: All fix_plan.md items completed ($completed_items/$total_items)" >&2 echo "plan_complete" return 0 fi + else + log_status "INFO" "DEBUG: @fix_plan.md file not found" >&2 fi + log_status "INFO" "DEBUG: No exit conditions met, continuing loop" >&2 return 1 # Don't exit }