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).
80 lines
5.3 KiB
Bash
Executable File
80 lines
5.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Window rows 177-185, W0-W4 (repin-rows-177-185.md draft 4 at 9ddd8a92c, sha256 b05eb85e...71a1; mos-0944 go).
|
|
# Nothing is stopped. Each step goes through w.sh into W.txt; a failed check stops the script.
|
|
# usage: wsteps.sh
|
|
set -uo pipefail
|
|
REPO=/mnt/storage/src/mosaic-stack
|
|
WIN=$REPO/agents/darkwing/work/window-rows-177-185
|
|
OLD=89af38a83afa22a8a4f0d368a0a4030ad15a0efa
|
|
NEW=490e2771d3d057ab76991e2c7859cd251857e64c
|
|
PLAN=$REPO/agents/sage/work/window-plan/repin-rows-177-185.md
|
|
PLAN_SHA=b05eb85e357ecb7d1c267c537a3a8c6fef82967368520101ce842d1677e871a1
|
|
TOOL_BLOB=f8051d81cc18aedb7b6f2e743ec0c3f505e0e44b
|
|
BC=$REPO/agents/sage/work/window-plan/repin-de352dfaf/business-check.mjs
|
|
BC_SHA=eece4d4671e1ce15ba81e1654c641925ac4988b343687b062897392285a8a1a7
|
|
BIZ=$HOME/.config/mosaic-dev/businesses/mosaic-stack.json
|
|
BIZ_SHA=1e49bdf05e62607972958f5b7298cfd600c7825812370e26d7c2a842f2af9b93
|
|
DATA=/home/jwoltje/.mosaic-dev
|
|
SNAP=$WIN/snapshot.mjs
|
|
SNAP_SHA=639fd28a2674aaa03ce824e3394b4052f21cdef7d6fa49bae61a9927ed341e67
|
|
MOSAIC=$HOME/.npm-global/bin/mosaic
|
|
W=$WIN/W.txt
|
|
note() { echo "# $*" >> "$W"; echo "# $*"; }
|
|
stop() { note "STOP: $*"; exit 1; }
|
|
sha() { sha256sum < "$1" | cut -c1-64; }
|
|
|
|
note "W0-W4 start $(date -u +%FT%TZ)"
|
|
[ "$(git -C $REPO show 9ddd8a92c:agents/sage/work/window-plan/repin-rows-177-185.md | sha256sum | cut -c1-64)" = "$PLAN_SHA" ] || stop "plan at 9ddd8a92c is not b05eb85e"
|
|
[ "$(sha $PLAN)" = "$PLAN_SHA" ] || stop "the plan file in REPO is not b05eb85e"
|
|
[ "$(git -C $REPO rev-parse HEAD:scripts/stack-release.sh)" = "$TOOL_BLOB" ] || stop "tool blob moved"
|
|
git -C $REPO diff --quiet $NEW HEAD -- scripts/stack-release.sh scripts/webui-service.sh scripts/bus-service.sh scripts/stack-copy.sh || stop "P5: the four scripts differ from NEW"
|
|
[ -z "$(git -C $REPO status --porcelain -- scripts/stack-release.sh scripts/webui-service.sh scripts/bus-service.sh scripts/stack-copy.sh)" ] || stop "P5: the four scripts are dirty"
|
|
[ "$(sha $BC)" = "$BC_SHA" ] || stop "business-check.mjs sha"
|
|
note "plan b05eb85e, tool blob f8051d81cc18, P5 four scripts at NEW and clean, business-check.mjs eece4d46: checked $(date -u +%FT%TZ)"
|
|
|
|
# W0
|
|
$WIN/w.sh W.txt "W0 stack-copy copy NEW" scripts/stack-copy.sh copy $NEW || stop "W0 copy"
|
|
$WIN/w.sh W.txt "W0 business-check NEW" node $BC $NEW > $WIN/.w0-bc.txt; cat $WIN/.w0-bc.txt
|
|
grep -qx LOAD_OK $WIN/.w0-bc.txt || stop "W0 business-check NEW not LOAD_OK"
|
|
|
|
# W0b
|
|
[ "$(sha $BIZ)" = "$BIZ_SHA" ] || stop "business file sha256 is not P1's 1e49bdf0"
|
|
STAMP=$(date -u +%Y%m%dT%H%M%SZ)
|
|
COPY=$BIZ.pre-window-$STAMP
|
|
[ ! -e "$COPY" ] || stop "$COPY exists"
|
|
cp -p "$BIZ" "$COPY" || stop "W0b cp"
|
|
[ "$(sha "$COPY")" = "$BIZ_SHA" ] || stop "W0b copy sha256"
|
|
echo "W0b $(date -u +%FT%TZ) business file copy $COPY sha256 $(sha "$COPY") (source $BIZ sha256 $(sha "$BIZ"))" >> $WIN/backups.txt
|
|
note "W0b: $COPY, sha256 $(sha "$COPY"), recorded in backups.txt"
|
|
|
|
# W1
|
|
$WIN/w.sh W.txt "W1 agents --tester" $MOSAIC agents --business mosaic-stack --tester > $WIN/.w1-agents.txt || stop "W1 agents"
|
|
grep -E '(^|[[:space:]])chief[[:space:]].*working' $WIN/.w1-agents.txt && stop "W1: the chief is working"
|
|
$WIN/w.sh W.txt "W1 launches list" $MOSAIC launches list || stop "W1 launches list"
|
|
note "W1 start stamp $(date -u +%FT%TZ)"
|
|
[ "$(sha $SNAP)" = "$SNAP_SHA" ] || stop "SNAP sha before S1"
|
|
note "SNAP sha256 639fd28a checked before S1"
|
|
$WIN/w.sh W.txt "S1 snapshot --held" node $SNAP --store "$DATA/bus/bus.sqlite" --held > $WIN/S1.json || stop "S1"
|
|
sed -i '$d' $WIN/S1.json # w.sh prints "# exit N" last; S1.json keeps the snapshot only
|
|
note "S1.json sha256 $(sha $WIN/S1.json)"
|
|
|
|
# W2
|
|
$WIN/w.sh W.txt "W2 status" scripts/stack-release.sh status mosaic-stack || stop "W2 status"
|
|
|
|
# W3
|
|
$WIN/w.sh W.txt "W3 activate NEW --pm --plan" scripts/stack-release.sh activate $NEW mosaic-stack --pm --plan > $WIN/W3-plan.txt || stop "W3 plan exit"
|
|
sed -i '$d' $WIN/W3-plan.txt
|
|
note "W3-plan.txt sha256 $(sha $WIN/W3-plan.txt)"
|
|
|
|
# W4
|
|
$WIN/w.sh W.txt "W4 bus unit (Environment omitted from the transcript)" systemctl --user show [email protected] -p ExecStart -p WorkingDirectory -p DropInPaths || stop "W4 bus"
|
|
$WIN/w.sh W.txt "W4 webui unit" systemctl --user show mosaic-webui.service -p ExecStart -p WorkingDirectory -p DropInPaths || stop "W4 webui"
|
|
BUSL=$(systemctl --user show [email protected] -p ExecStart -p DropInPaths -p WorkingDirectory)
|
|
WEBL=$(systemctl --user show mosaic-webui.service -p ExecStart -p DropInPaths -p WorkingDirectory)
|
|
for u in BUSL WEBL; do v=${!u}; grep -qx 'DropInPaths=' <<< "$v" || stop "W4 $u DropInPaths not empty"; grep '^ExecStart=' <<< "$v" | grep -q "copies/$OLD/" || stop "W4 $u ExecStart does not name the OLD copy"; grep '^ExecStart=' <<< "$v" | grep -q "copies/$NEW" && stop "W4 $u ExecStart names NEW"; grep '^ExecStart=' <<< "$v" | grep -q "[\"'\\\\]" && stop "W4 $u ExecStart has a quote or backslash"; done
|
|
grep '^ExecStart=' <<< "$BUSL" | grep -q -- ' --pm' || stop "W4 bus ExecStart has no --pm"
|
|
note "W4 checks: DropInPaths empty on both, both ExecStart name the OLD copy, bus has --pm, no quote or backslash in either ExecStart"
|
|
ENVL=$(systemctl --user show [email protected] -p Environment)
|
|
note "W4 bus Environment: $(tr ' ' '\n' <<< "${ENVL#Environment=}" | grep -c =) assignments; quote or backslash: $(grep -q "[\"'\\\\]" <<< "$ENVL" && echo FOUND || echo none) (values not recorded)"
|
|
note "W0-W4 end $(date -u +%FT%TZ)"
|