From 1c1dbd93d6854b93c933a6724d5f5d1d56d05b35 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Sun, 4 Oct 2026 17:52:35 +0000 Subject: [PATCH] Console: a job is done only on the app's closing report; prove-shard.sh takes every block fixture after the first argument The console marked any job with a RESULT line as done, so a running shard job read as finished. Done now means the SUMMARY line carries finished_at or the job's closing 'job : (exit N)' line is present. prove-shard.sh dropped the third fixture argument (block-344-shards4) because it read only $2. Co-Authored-By: Claude Fable 5.1 --- proving/windows-wsl2/prove-shard.sh | 2 +- relay/api/console.mjs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/proving/windows-wsl2/prove-shard.sh b/proving/windows-wsl2/prove-shard.sh index 2be08ef53..16d3ddb3c 100755 --- a/proving/windows-wsl2/prove-shard.sh +++ b/proving/windows-wsl2/prove-shard.sh @@ -7,7 +7,7 @@ set -uo pipefail HERE="$(cd "$(dirname "$0")" && pwd)" SHARD_FIXTURE="${1:-block-338-shard1}" -BLOCK_FIXTURES="${2:-block-341-shards2 block-344-shards4}" +BLOCK_FIXTURES="${*:2}"; BLOCK_FIXTURES="${BLOCK_FIXTURES:-block-341-shards2 block-344-shards4}" # every argument after the first; a quoted list works too export PATH="$HOME/.cargo/bin:$HOME/.sp1/bin:$PATH" CUDA_DIR="$(ls -d /usr/local/cuda-12.* 2>/dev/null | sort -V | tail -1 || true)" [ -n "$CUDA_DIR" ] && export PATH="$CUDA_DIR/bin:$PATH" && export LD_LIBRARY_PATH="$CUDA_DIR/lib64:/usr/lib/wsl/lib:${LD_LIBRARY_PATH:-}" diff --git a/relay/api/console.mjs b/relay/api/console.mjs index 919093f40..d5e4eef5f 100644 --- a/relay/api/console.mjs +++ b/relay/api/console.mjs @@ -220,8 +220,13 @@ async function jobs(sql) { const runs = rows.map(r => { const m = /^job-(.+)-([0-9a-f]{8,32})$/.exec(r.run_id); const lines = r.tail.split('\n').filter(l => l.trim()); - const ex = lastMatch(lines, /\b(?:exit(?:ed)?(?:[ _-]?code)?|EXIT|rc)\s*[=: ]\s*(-?\d+)\b/i); - const done = !!ex || lines.some(l => /^(DONE|FINISHED|RESULT)\b/.test(l)); + // Final only when the app's closing report is in: a SUMMARY line with finished_at set, or its + // "job : done|failed|timeout|aborted (exit N)" line. RESULT lines and a stage's own "exit N" echo are progress. + let summaryJson = null; + for (const l of lines) { const mm = /^SUMMARY\s+(\{.*\})\s*$/.exec(l); if (mm) { try { summaryJson = JSON.parse(mm[1]); } catch {} } } + const finalLine = lastMatch(lines, /^job \S+: (?:done|failed|timeout|aborted) \(exit (-?\d+)\)/); + const done = !!(summaryJson && summaryJson.finished_at) || !!finalLine; + const ex = finalLine || (summaryJson && summaryJson.finished_at ? [null, String(summaryJson.exit)] : null); const sum = lastMatch(lines, /^(?:RESULT|SUMMARY)[:\s](.+)$/i); const machineId = m ? m[2] : r.machine; return { run_id: r.run_id, job_id: m ? m[1] : r.run_id, machine_id: machineId, machine: NAMES[machineId.slice(0, 8)] || r.machine, host: r.machine, at: iso(r.received_at), label: r.label,