Files
stack/agents/researcher/work/queue-80/r1/phase-b.sh
T
jason.woltjeandClaude Opus 5.5 3182fdf113 researcher: row 80 round 1 packet (#1574)
Stranded delivery list on the bus agents view. Built by Sage's Haiku
subagent (decision 129), rebased onto 57a2ddc5. Phase B, three runs:
the first failed the new test (node:sqlite null-prototype rows, fixed
by mapping to plain objects), the second stopped at cli on a missing
node_modules link, the third passed: 14 node suites, nine scripts,
15/15 mutants killed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 10:19:38 -05:00

78 lines
3.2 KiB
Bash

#!/usr/bin/env bash
# Row 80 Phase B runner, round 2, candidate base 57a2ddc5978b05b780dc0e69fb4e6c2a60ab5877.
# Usage: bash <packet>/phase-b.sh
# Any nonzero step exit stops the run: no later suite, script or mutant runs. The stop is
# recorded in out/phase-b-summary.txt and the run ends PHASE-B-STOPPED. A full pass ends
# PHASE-B-DONE. Output goes to out/ through tee.
set -u
cd / || exit 1
WT=/mnt/storage/src/mosaic-stack/.claude/worktrees/agent-abe72e00ca2bcdf7e
PK=$WT/agents/researcher/work/queue-80/r1
OUT=$PK/out
export DOCKER_HOST=unix:///nonexistent.sock
mkdir -p "$OUT"
SUM=$OUT/phase-b-summary.txt
: > "$SUM"
# finish RC: scan for processes with a cwd in the worktree, write the end marker, exit RC.
finish() {
local left=0 p pid c
for p in /proc/[0-9]*; do
pid=${p#/proc/}
c=$(readlink "$p/cwd" 2>/dev/null) || continue
case "$c" in
"$WT"|"$WT"/*) echo "leftover pid=$pid cwd=$c" >> "$SUM"; left=$((left + 1)) ;;
esac
done
echo "processes with cwd in worktree: $left" >> "$SUM"
if [ "$1" -eq 0 ]; then echo "PHASE-B-DONE" >> "$SUM"; else echo "PHASE-B-STOPPED" >> "$SUM"; fi
exit "$1"
}
# step NAME DIR COMMAND... runs COMMAND in DIR, tees to out/NAME.log, records exit code and TAP totals.
# A nonzero exit records a STOP line and calls finish 1.
step() {
local name=$1 dir=$2
shift 2
( cd "$dir" && "$@" ) 2>&1 | tee "$OUT/$name.log" > /dev/null
local rc=${PIPESTATUS[0]}
echo "$name exit=$rc" >> "$SUM"
grep -E '^# (tests|suites|pass|fail|cancelled|skipped|todo) ' "$OUT/$name.log" | sed 's/^/ /' >> "$SUM"
if [ "$rc" -ne 0 ]; then
echo "STOP: $name exited $rc; later steps and mutants not run" >> "$SUM"
finish 1
fi
}
# Suites, in the order of the packages directory. Each uses its package.json test form.
step bus "$WT/packages/bus" node --test 'tests/*.test.mjs'
step business "$WT/packages/business" node --test tests/
step cli "$WT/packages/cli" node --test 'tests/*.test.mjs'
step control-board "$WT/packages/control-board" node --test tests/
step conversation "$WT/packages/conversation" node --test tests/
step discord "$WT/packages/discord" node --test tests/
step harness "$WT/packages/harness" node --test 'tests/*.test.mjs'
step ledger "$WT/packages/ledger" node --test 'tests/*.test.mjs'
step mosaic "$WT/packages/mosaic" node --test tests/
step queue "$WT/packages/queue" node --test tests/
step runs "$WT/packages/runs" node --test tests/
step seat "$WT/packages/seat" node --test tests/
step tasks "$WT/packages/tasks" node --test 'tests/*.test.mjs'
step webui "$WT/packages/webui" node --test tests/
# The nine scripts/test-*.sh, sequentially, from the worktree root.
for s in "$WT"/scripts/test-*.sh; do
step "script-$(basename "$s" .sh)" "$WT" bash "$s"
done
# The 15 mutants last.
python3 -I "$PK/mutants.py" "$WT" "$PK" 2>&1 | tee "$OUT/mutants-run.log" > /dev/null
rc=${PIPESTATUS[0]}
echo "mutants exit=$rc" >> "$SUM"
if [ "$rc" -ne 0 ]; then
echo "STOP: mutants exited $rc" >> "$SUM"
finish 1
fi
finish 0