feat(lanes): wait_distill — block until the next distill batch, no polling

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.
This commit is contained in:
Drew T
2026-08-24 13:02:30 -06:00
parent fc24404452
commit 90fa74ba49
+16
View File
@@ -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\")"