#!/usr/bin/env bash # loop-sms-watch.sh — bridge watcher: tail the alpha loop log and SMS # Charles on milestones via ping-charles.sh (queues until SMTP wired). # Superseded by the harness native [notify] notifier (ticket 522) once built. set -uo pipefail LOG="$HOME/.coordinate/logs/loop-alpha.log" PING="$HOME/.coordinate/scripts/ping-charles.sh" tail -n 0 -F "$LOG" 2>/dev/null | while read -r line; do case "$line" in *"loop: dispatch"*) id=$(echo "$line" | grep -o 'dispatch [0-9]*' | grep -o '[0-9]*') "$PING" "loop dispatched #$id" info >/dev/null 2>&1 || true ;; *"noted REPORT"*) id=$(echo "$line" | grep -o 'REPORT on #[0-9]*' | grep -o '[0-9]*$') "$PING" "turn COMPLETE #$id — check redmine" ok >/dev/null 2>&1 || true ;; *"status"*) "$PING" "status transition: $line" info >/dev/null 2>&1 || true ;; *FAIL*|*error*|*quota wall*|*deferred*) "$PING" "loop issue: $line" warn >/dev/null 2>&1 || true ;; esac done