From 5681438b0fa700450233a9529237a5ae44aad642 Mon Sep 17 00:00:00 2001 From: autonomic-bot Date: Wed, 27 May 2026 16:09:01 +0100 Subject: [PATCH] launch.sh fix: don't let an empty-match grep kill the watchdog (set -e + pipefail) handoff_check's now="$(grep CLAIMED.*awaiting ... )" returned non-zero when a phase's STATUS has no claimed-awaiting lines yet (normal early in a phase); under set -euo pipefail that assignment exited the whole watchdog. Append `|| true` to the now= and cur= command substitutions. Verified: watchdog survives the handoff tick on a freshly-created STATUS-1c.md. Co-Authored-By: Claude Opus 4.7 (1M context) --- cc-ci-plan/launch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cc-ci-plan/launch.sh b/cc-ci-plan/launch.sh index b1f572d..17d5cf0 100755 --- a/cc-ci-plan/launch.sh +++ b/cc-ci-plan/launch.sh @@ -143,7 +143,7 @@ handoff_check() { idx="$(cur_idx)" sf="$BUILDER_DIR/$(phase_status "$idx")"; rf="$ADV_DIR/$(phase_review "$idx")" if [[ -f "$sf" ]]; then - now="$(grep -iE 'CLAIMED.*awaiting' "$sf" 2>/dev/null | grep -oiE 'M[0-9]+(\.[0-9]+)?|[A-Z][0-9]+' | tr '[:lower:]' '[:upper:]' | sort -u)" + now="$(grep -iE 'CLAIMED.*awaiting' "$sf" 2>/dev/null | grep -oiE 'M[0-9]+(\.[0-9]+)?|[A-Z][0-9]+' | tr '[:lower:]' '[:upper:]' | sort -u || true)" if [[ -n "$_wd_baselined" ]]; then added="$(comm -13 <(printf '%s\n' "$_wd_awaiting" | sort -u) <(printf '%s\n' "$now" | sort -u) | grep -vE '^$' || true)" if [[ -n "$added" ]]; then @@ -154,7 +154,7 @@ handoff_check() { _wd_awaiting="$now"; _wd_baselined=1 fi if [[ -f "$rf" ]]; then - cur="$(md5sum "$rf" 2>/dev/null | awk '{print $1}')" + cur="$(md5sum "$rf" 2>/dev/null | awk '{print $1}' || true)" if [[ -n "$cur" && "$cur" != "$_wd_last_review" ]]; then [[ -n "$_wd_last_review" ]] && { log "handoff: $(phase_review "$idx") changed -> pinging Builder"