briefs: canonical wait block drops WAIT_FROM, states fresh log path and exit 3

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Eureka 2026-10-08 15:22:00 +02:00
commit 6ab91ead9c

View file

@ -335,11 +335,12 @@ pid with no match is exit 98. `tools/wait-on.sh pid <pid> [<log>]` is only for a
process with no completion evidence; it prints `GONE (no completion evidence)`
and its exit 0 means "gone", not "succeeded". `tools/wait-on.sh file <path>` is
for an output file written last. The regex is an ERE; an invalid one is exit 3.
Use a fresh log path per job. If a log path is reused (Unity `-logFile`, a
re-run script), record where it ended at launch and pass it, so a stale done
line from the earlier job does not count: `WAIT_FROM=$(wc -c < <log> 2>/dev/null
|| echo 0)` captured before the launch, then `WAIT_FROM=<n> tools/wait-on.sh log
<log> <regex>`. Same contract as the ygg-verify wait: pass a Bash tool `timeout`
Exit 3 means the regex is invalid: fix it, never retry it unchanged.
Every job gets a fresh log path (put the job's own unique name or a timestamp in
it; for Unity, a new `-logFile` path per launch), and a waiter is never pointed
at a log a previous job wrote: a reused log's old done line reads as success at
once, and an offset cannot fix that because truncating writers (`>`, Unity
`-logFile`) rewrite below it. Same contract as the ygg-verify wait: pass a Bash tool `timeout`
of at least 280000 ms, it blocks at most 270 s, exit 0 is done with a bounded
log tail, `RUNNING <n>s` (exit 99) means call it again, exit 98 means the thing
is gone with no completion evidence. Bare `true`, `echo waiting` and `sleep`