NEW 490e2771d live for mosaic-stack, activation 20261020T075800Z-490e2771d3d0, store 3i. W0-W10 pass;
stops at W9 (assistant idle stop, mos-0948) and S2b/B (old chief end rows in the backup, mos-0950).
99 lines
7.0 KiB
Bash
Executable File
99 lines
7.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Window rows 177-185, W9 (repin-rows-177-185.md draft 4 at 9ddd8a92c, "W9 checks and the turns"), after Mos verifies W5.
|
|
# Every call goes through w.sh into W.txt; every bus call carries --tester. A failed check stops the script.
|
|
# console-check.sh runs from the repo copy agents/sage/work/window-plan/repin-de352dfaf/ after its SCRIPTS.sha256
|
|
# check (the plan's $P holds the same file; Darkwing does not read /mnt/storage/scratch/sage-* dirs).
|
|
# S1 has no threads or message_threads rows, so the human-thread probe has no target: skipped and noted.
|
|
# usage: w9.sh
|
|
set -uo pipefail
|
|
REPO=/mnt/storage/src/mosaic-stack
|
|
WIN=$REPO/agents/darkwing/work/window-rows-177-185
|
|
NEW=490e2771d3d057ab76991e2c7859cd251857e64c
|
|
W5_STAMP="2026-10-20 07:58:00 UTC"
|
|
W5_MS=$(date -d "2026-10-20T07:58:00Z" +%s)000
|
|
PLAN=$REPO/agents/sage/work/window-plan/repin-rows-177-185.md
|
|
PLAN_SHA=b05eb85e357ecb7d1c267c537a3a8c6fef82967368520101ce842d1677e871a1
|
|
TOOL_BLOB=f8051d81cc18aedb7b6f2e743ec0c3f505e0e44b
|
|
CC=$REPO/agents/sage/work/window-plan/repin-de352dfaf/console-check.sh
|
|
CC_SHA=d068fe02da897b700110a162d13d9671fe5994f053c45aff99113fade737094c
|
|
DATA=/home/jwoltje/.mosaic-dev
|
|
SNAP=$WIN/snapshot.mjs
|
|
SNAP_SHA=639fd28a2674aaa03ce824e3394b4052f21cdef7d6fa49bae61a9927ed341e67
|
|
MOSAIC=$HOME/.npm-global/bin/mosaic
|
|
C_NEW=(node "$HOME/.local/share/mosaic-stack/copies/$NEW/packages/cli/src/cli.mjs")
|
|
BZ=(--business mosaic-stack)
|
|
W=$WIN/W.txt
|
|
note() { echo "# $*" >> "$W"; echo "# $*"; }
|
|
stop() { note "STOP: $*"; exit 1; }
|
|
sha() { sha256sum < "$1" | cut -c1-64; }
|
|
step() { local f="$1"; shift; $WIN/w.sh W.txt "$@" > "$WIN/$f"; local rc=$?; cat "$WIN/$f"; return $rc; }
|
|
|
|
note "W9 start $(date -u +%FT%TZ)"
|
|
[ "$(sha $PLAN)" = "$PLAN_SHA" ] || stop "the plan file is not b05eb85e"
|
|
[ "$(git -C $REPO rev-parse HEAD:scripts/stack-release.sh)" = "$TOOL_BLOB" ] || stop "tool blob moved"
|
|
[ "$(sha $CC)" = "$CC_SHA" ] || stop "console-check.sh is not d068fe02 (SCRIPTS.sha256)"
|
|
grep -q "/copies/$NEW/scripts/mosaic" "$MOSAIC" || stop "the wrapper is not pinned to NEW"
|
|
note "plan b05eb85e, tool blob f8051d81cc18, console-check.sh d068fe02, wrapper on NEW: checked"
|
|
|
|
# checks
|
|
step .w9-status.txt "W9 status" scripts/stack-release.sh status mosaic-stack || stop "W9 status exit"
|
|
grep -q "\"copy\":\"$NEW\"" $WIN/.w9-status.txt && grep -q '"pm":true' $WIN/.w9-status.txt && grep -q '"schema":"3i"' $WIN/.w9-status.txt || stop "W9 status: pointer not on NEW, pm true, 3i"
|
|
grep -q 'unit flags: match the pointer' $WIN/.w9-status.txt || stop "W9 status: unit flags"
|
|
step .w9-cc.txt "W9 console-check NEW (repo copy, d068fe02)" bash $CC $NEW || stop "console-check exit"
|
|
grep -qx CONSOLE_PASS $WIN/.w9-cc.txt || stop "console-check not CONSOLE_PASS"
|
|
N=$(journalctl --user -u mosaic-webui.service --since "$W5_STAMP" --no-pager | grep -c 'Proxy: proxy proof off')
|
|
{ echo; echo "## W9 journal since $W5_STAMP: 'Proxy: proxy proof off' count"; echo "$N"; } >> "$W"; note "proxy proof off lines since W5: $N"
|
|
[ "$N" = 1 ] || stop "proxy proof off count is $N, not 1"
|
|
step .w9-launches.txt "W9 launches list" $MOSAIC launches list || stop "launches list"
|
|
step .w9-launches.json "W9 launches list --json" $MOSAIC launches list --json || stop "launches list --json"
|
|
sed -i '$d' $WIN/.w9-launches.json
|
|
CHIEF=$(node -e '
|
|
const l=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8")),since=Number(process.argv[2]);
|
|
const c=l.filter(x=>x.business==="mosaic-stack"&&x.instance==="chief"&&x.live===true);
|
|
if(c.length!==1||!(Date.parse(c[0].startedAt)>=since)){console.error(`running chiefs ${c.length}`);process.exit(1)}
|
|
process.stdout.write(c[0].run)' $WIN/.w9-launches.json "$W5_MS") || stop "launches: not one running chief from this start"
|
|
note "one running chief from this start: run $CHIEF"
|
|
step .w9-agents.txt "W9 agents --tester" $MOSAIC agents "${BZ[@]}" --tester || stop "agents"
|
|
grep -E '(^|[[:space:]])chief[[:space:]].*working' $WIN/.w9-agents.txt && stop "the chief is working"
|
|
|
|
# turns
|
|
step .w9-talk-chief.txt "W9 talk chief --tester" $MOSAIC talk chief "[mos test] re-pin $NEW: reply with one line, no staffing request" "${BZ[@]}" --tester || stop "talk chief"
|
|
PROJ=window-$(date -u +%Y%m%d-%H%M)
|
|
step .w9-project.txt "W9 project create $PROJ --tester" $MOSAIC project create $PROJ "${BZ[@]}" --tester || stop "project create"
|
|
step .w9-thread.txt "W9 thread create $PROJ w9 --tester" $MOSAIC thread create $PROJ w9 "${BZ[@]}" --tester || stop "thread create"
|
|
TID=$(sed -n "s/^created $PROJ\/w9 id \([0-9a-f-]*\) instance .*$/\1/p" $WIN/.w9-thread.txt)
|
|
[ -n "$TID" ] || stop "no thread id"
|
|
note "project $PROJ, thread $TID"
|
|
step .w9-talk-thread.txt "W9 talk --thread --wait 180 --tester" $MOSAIC talk --thread "$TID" "[mos test] reply with one line, then stop" --wait 180 "${BZ[@]}" --tester || stop "talk --thread"
|
|
note "reply received $(date -u +%FT%TZ)"
|
|
step .w9-thread-read.json "W9 thread read --json --tester" $MOSAIC thread read "$TID" --json "${BZ[@]}" --tester || stop "thread read"
|
|
sed -i '$d' $WIN/.w9-thread-read.json
|
|
node -e '
|
|
const t=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8"));
|
|
console.log(`# thread read: ${t.length} messages: ${t.map(m=>`${m.from_role}->${m.to_role} ${m.class}`).join(", ")}`);
|
|
process.exit(t.length===2&&t[0].from_role==="tester"&&t[1].from_role==="assistant"?0:1)' $WIN/.w9-thread-read.json | tee -a "$W" || stop "thread read is not the tester message plus one assistant reply"
|
|
step .w9-threads.txt "W9 threads --tester" $MOSAIC threads "${BZ[@]}" --tester || stop "threads"
|
|
grep -q "$TID\|$PROJ" $WIN/.w9-threads.txt || stop "threads does not list the W9 thread"
|
|
step .w9-names.json "W9 C_NEW names --tester --json" "${C_NEW[@]}" names "${BZ[@]}" --tester --json || stop "names"
|
|
step .w9-usage.json "W9 usage --tester --json" $MOSAIC usage "${BZ[@]}" --tester --json || stop "usage"
|
|
note "human-thread probe: skipped, S1 has 0 threads and 0 message_threads rows, so no human thread exists to read"
|
|
|
|
# the assistant run: wait for it to end (at most 10 minutes after the reply), then S2
|
|
T0=$(date +%s); END=
|
|
while :; do
|
|
$MOSAIC launches list --json > $WIN/.w9-launches-poll.json 2>&1 || stop "launches poll"
|
|
LIVE=$(node -e 'const l=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8"));process.stdout.write(l.filter(x=>x.business==="mosaic-stack"&&x.instance==="assistant"&&x.live===true).map(x=>x.run).join(" "))' $WIN/.w9-launches-poll.json)
|
|
[ -z "$LIVE" ] && { END=$(date -u +%FT%TZ); break; }
|
|
[ $(( $(date +%s) - T0 )) -ge 600 ] && break
|
|
sleep 10
|
|
done
|
|
step .w9-launches-after.txt "W9 launches list after the assistant run" $MOSAIC launches list
|
|
if [ -z "$END" ]; then note "STOP: the assistant run $LIVE is still running 10 minutes after the reply; a stop is Mos's call. S2 waits."; exit 4; fi
|
|
note "assistant run ended by $END (no live assistant in launches list)"
|
|
[ "$(sha $SNAP)" = "$SNAP_SHA" ] || stop "SNAP sha before S2"
|
|
note "SNAP sha256 639fd28a checked before S2"
|
|
step S2.json "S2 snapshot --held" node $SNAP --store "$DATA/bus/bus.sqlite" --held || stop "S2"
|
|
sed -i '$d' $WIN/S2.json
|
|
note "S2.json sha256 $(sha $WIN/S2.json)"
|
|
note "W9 end $(date -u +%FT%TZ)"
|