From 90fa74ba4973cd88eccf638941e0d636620be78e Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:02:30 -0600 Subject: [PATCH] =?UTF-8?q?feat(lanes):=20wait=5Fdistill=20=E2=80=94=20blo?= =?UTF-8?q?ck=20until=20the=20next=20distill=20batch,=20no=20polling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The harness re-invokes the main loop when a background command exits, so a blocking wait IS the self-reminder; a sleep-then-tail poll loop would just burn tokens for the same information. --- tools/lanes/wait_distill.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tools/lanes/wait_distill.sh diff --git a/tools/lanes/wait_distill.sh b/tools/lanes/wait_distill.sh new file mode 100644 index 000000000..78a07142b --- /dev/null +++ b/tools/lanes/wait_distill.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Blocks until the distill lane raises the NEXT batch, then exits — the harness re-invokes the main +# loop on completion, so this is a self-reminder without polling (no sleep-then-tail loops). +set -u +cd /home/musashi/bfm-decomp +DEADLINE=$(( $(date +%s) + 10800 )) # 3h, then report back regardless +while [ -z "$(ls .run/distill_ready/*.json 2>/dev/null)" ]; do + [ "$(date +%s)" -ge "$DEADLINE" ] && { echo "[wait_distill] 3h with no new batch — lane may be idle"; exit 0; } + [ -e .run/ox_campaign.stop ] && { echo "[wait_distill] campaign stopped"; exit 0; } + sleep 60 +done +echo "[wait_distill] BATCH READY: $(ls .run/distill_ready/*.json)" +.venv/bin/python -c " +import json,glob +for p in glob.glob('.run/distill_ready/*.json'): + d=json.load(open(p)); print(f\" waves {' '.join(d['waves'])} · {d['novel']} novel candidates\")"