From b12016a3f23c2b631cf3d61ce58bf4d73ddd4ad5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 23 Sep 2026 06:19:13 +0200 Subject: [PATCH] Stop the stopgap reporting success for a job that never ran Soul lost a run to CRLF and it still exited 0. The cause: this file's own line endings travel with the heredoc, so the remote bash fails on `set -euo pipefail\r` before `set -e` is in force, limps past the failure and exits clean. A verification runner that can report success without running anything is worse than no runner. Two guards, because one was not enough to notice this for a day. The remote now strips carriage returns before bash sees them, and it prints a verdict sentinel the local side requires; a missing sentinel is treated as failure rather than as silence. A .gitattributes keeps the file LF on disk so the first guard is rarely needed. Co-Authored-By: Claude Opus 5 --- tools/stopgap/.gitattributes | 1 + tools/stopgap/ygg-verify.sh | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tools/stopgap/.gitattributes diff --git a/tools/stopgap/.gitattributes b/tools/stopgap/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/tools/stopgap/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/tools/stopgap/ygg-verify.sh b/tools/stopgap/ygg-verify.sh index 6a64ab6..0d4982e 100644 --- a/tools/stopgap/ygg-verify.sh +++ b/tools/stopgap/ygg-verify.sh @@ -72,7 +72,14 @@ esac # so every argument is quoted here. Without that, `a && b` in the command runs # b on the host. remote_args=$(printf '%q ' "$name" "$sha" "$image" "$cpus" "$mem" "$slots" "${KEEP:-0}" "$cmd") -ssh "${sshopts[@]}" "$host" "bash -s -- $remote_args" <<'REMOTE' +# The heredoc below travels with whatever line endings this file has on disk. +# On Windows that is CRLF, and the remote bash then fails on `set -euo pipefail ` +# BEFORE `set -e` is in force, so the script limps on and can exit 0 — a job that +# never ran, reported as success (seen 2026-09-23). `tr -d` strips the CRs on the +# far side before bash ever sees them. The sentinel below is the second guard: if +# the remote script dies early, no verdict line is printed and the local side +# refuses to report a status it did not receive. +(ssh "${sshopts[@]}" "$host" "tr -d ' ' | bash -s -- $remote_args" <<'REMOTE' set -euo pipefail name=$1 sha=$2 image=$3 cpus=$4 mem=$5 slots=$6 keep=$7 cmd=$8 root=~/eureka-verify @@ -111,5 +118,23 @@ sudo nice -n 10 docker run --rm --cpus="$cpus" --memory="$mem" \ status=$? set -e echo "ygg-verify: exit $status" >&2 +echo "__YGG_VERDICT__ $status" exit $status REMOTE +) | { + # The remote prints __YGG_VERDICT__ as its last line. Strip it from the + # output and exit with it. If it never arrives the remote script died before its + # own exit line, so refuse to report a status that was never produced. + verdict=97 + while IFS= read -r line; do + case "$line" in + "__YGG_VERDICT__ "*) verdict=${line#__YGG_VERDICT__ }; continue ;; + esac + printf '%s\n' "$line" + done + if [ "$verdict" = 97 ]; then + echo "ygg-verify: NO VERDICT from the remote job - treating as failure" >&2 + exit 97 + fi + exit "$verdict" +}