From 8f2f5cf163e9db00fff7256919d44cddb9b12cb3 Mon Sep 17 00:00:00 2001 From: krisf Date: Fri, 9 Oct 2026 20:52:45 -0400 Subject: [PATCH] ops: math-fix watcher grep per-run output, not cumulative log (cumulative grep re-matched first queue-busy -> 173-iteration relaunch loop, passes 4-58 no-ops) --- scripts/math-fix-watcher.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/math-fix-watcher.sh b/scripts/math-fix-watcher.sh index b7c748c..a2387e8 100644 --- a/scripts/math-fix-watcher.sh +++ b/scripts/math-fix-watcher.sh @@ -8,9 +8,12 @@ for i in $(seq 1 240); do if pgrep -f "dsh-run" >/dev/null; then sleep 60; continue; fi if ! git diff --quiet || [ -n "$(git status --porcelain --untracked-files=normal | grep -v '^?? ')" ]; then sleep 60; continue; fi echo "[watcher] launching math-fix job (iteration $i)" | tee -a "$LOG" - ~/.local/bin/dsh-run /home/ubuntu/projects/retire-planner "$PROMPT" >> "$LOG" 2>&1 + RUNLOG=$(mktemp /tmp/math-fix-run.XXXXXX) + ~/.local/bin/dsh-run /home/ubuntu/projects/retire-planner "$PROMPT" > "$RUNLOG" 2>&1 rc=$? - if grep -q "DSH_QUEUE_BUSY" "$LOG"; then echo "[watcher] queue busy, retrying" | tee -a "$LOG"; sleep 60; continue; fi + cat "$RUNLOG" >> "$LOG" + if grep -q "DSH_QUEUE_BUSY" "$RUNLOG"; then echo "[watcher] queue busy, retrying" | tee -a "$LOG"; rm -f "$RUNLOG"; sleep 60; continue; fi + rm -f "$RUNLOG" echo "[watcher] math-fix job finished rc=$rc" | tee -a "$LOG" exit $rc done