# SCRATCH ROOT, NOT LIVE. Window B rehearsal (repin-ca15d73e9.md P3, mos-0838 D2, sage-1004/1006/1008),
# run by darkwing from 2026-10-19T22:14:55Z. Rerun for sage-1070 (mos-0867 R2) on the landed tool.
# Tool: /home/jwoltje/darkwing-scratch/r1070/repo, a git clone --shared of the canonical checkout at 4b738e2da93c451eab916faf00e3acb2cda405d5;
# scripts/stack-release.sh blob ed5b41d4677ee2bd85860e120c48387d440f9446 (row 166 landed as 4b738e2da; the 4b16e848 run is scratch-activate-ca15d73e9.txt).
# Root: /home/jwoltje/darkwing-scratch/r1070/rootB. Config /home/jwoltje/darkwing-scratch/r1070/rootB/cfg/config.json, data root /home/jwoltje/darkwing-scratch/r1070/rootB/data, units in /home/jwoltje/darkwing-scratch/r1070/rootB/xcfg/systemd/user.
# Business file: scratch-business-B.json (sha256 c0f83db22ab27729bcf6e555aa4e6c4ef5df56f3e7ca2ff9f891b28b59da994b):
#   the committed example with Window A's plug-ins, usage-source transcript and channel cli,webui.
# Seeded by seed.sh at 5fa9cc8f2c66b52408b652b59c3070f7210b44d0 and 3h: the copy's real bus host started on stand-in units, then adopt.
# Stand-ins (/home/jwoltje/darkwing-scratch/r1070/b): systemctl runs the copy's real 'scripts/mosaic bus start mosaic-stack' WITHOUT --pm.
#   The PM launch is EMULATED: no claude runs. A waiting runner process, one sessions.json entry and one
#   'launched chief' journal line stand in for it. The Console is a /healthz stand-in on 127.0.0.1:47391.
#   journalctl and systemd-analyze are the stack-release test's. claude is a fixture that prints a version.
# Credential files are fake placeholders; both base URLs in the file are 127.0.0.1:9.
# Before: pointer {"copy":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","business":"mosaic-stack","pm":true,"claude":"/home/jwoltje/darkwing-scratch/r1070/b/claude","console":["--port","47391","--business","mosaic-stack"],"schema":"3h","activation":"20261019T221450Z-5fa9cc8f2c66","at":"2026-10-19T22:14:50Z"}
# Before: store schema 3h

## 0. the units the W4 checks read (stand-in systemctl show) and the unit dir
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> bash -c for u in mosaic-bus@mosaic-stack.service mosaic-webui.service; do systemctl --user show "$u" -p LoadState -p ExecStart -p Environment -p DropInPaths; done; systemd-analyze --user unit-paths; ls -la "$XDG_CONFIG_HOME/systemd/user")
LoadState=loaded
ExecStart={ path=/home/jwoltje/darkwing-scratch/r1070/copies/5fa9cc8f2c66b52408b652b59c3070f7210b44d0/scripts/mosaic ; argv[]=/home/jwoltje/darkwing-scratch/r1070/copies/5fa9cc8f2c66b52408b652b59c3070f7210b44d0/scripts/mosaic bus start mosaic-stack --pm ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
Environment=PATH=/usr/local/bin:/usr/bin:/bin MOSAIC_CLAUDE_BIN=/home/jwoltje/darkwing-scratch/r1070/b/claude
DropInPaths=
LoadState=loaded
ExecStart={ path=/usr/bin/node ; argv[]=/usr/bin/node /home/jwoltje/darkwing-scratch/r1070/copies/5fa9cc8f2c66b52408b652b59c3070f7210b44d0/packages/webui/src/cli.mjs serve --checkout /home/jwoltje/darkwing-scratch/r1070/repo --port 47391 --business mosaic-stack ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
Environment=PATH=/usr/local/bin:/usr/bin:/bin
DropInPaths=
/home/jwoltje/darkwing-scratch/r1070/rootB/xcfg/systemd/user
total 16
drwxr-xr-x 2 jwoltje jwoltje 4096 Oct 19 17:14 .
drwxr-xr-x 3 jwoltje jwoltje 4096 Oct 19 17:14 ..
-rw-r--r-- 1 jwoltje jwoltje 2227 Oct 19 17:14 mosaic-bus@.service
-rw-r--r-- 1 jwoltje jwoltje 2157 Oct 19 17:14 mosaic-webui.service
# exit 0

## 1. activate --plan
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> scripts/stack-release.sh activate ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00 mosaic-stack --plan --copies /home/jwoltje/darkwing-scratch/r1070/copies --bin /home/jwoltje/darkwing-scratch/r1070/rootB/bin)
plan: activate for mosaic-stack
from: 5fa9cc8f2c66b52408b652b59c3070f7210b44d0
to: ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00
store schema: 3h (read from the store the running bus holds)
target schema: 3i
migration: 3h to 3i, after a backup of the stopped store
migration steps: 3h to 3i
needs: --migrate (not given; the run would roll back with migration-needs-flag)
needs: Jason present for this run (decision 96 condition 2)
commits: the run adds 8 (newest first, at most 200):
  ca15d73e9 limits: a daily token quota for the account the stack uses, and bus schema 3h to 3i (row 126, #1620)
  54319f552 sessions: Filbert row 126 r2 review, approve
  4c385db45 sessions: Dewey row 126 round 4 build and review rounds 1-2
  2124cfa76 queue: row 126 Filbert r1 approve, brief re-pin for 3h to 3i, row 7 week note, round 2 in-review (sage)
  e264db51b plans: row 126 brief names the 3h to 3i step and the account guard (#1620)
  1df04f52f sessions: Filbert row 126 r1 review, approve
  9e2b26866 queue: row 167 Filbert approve and done, row 126 round 1 in-review (sage)
  640a1ee97 sessions: Sage row 167 landing and row 126 3i ruling
bus: scripts/bus-service.sh install --copy ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00 --copies /home/jwoltje/darkwing-scratch/r1070/copies --pm --claude /home/jwoltje/darkwing-scratch/r1070/b/claude
Console: scripts/webui-service.sh install --copy ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00 --copies /home/jwoltje/darkwing-scratch/r1070/copies --port 47391 --business mosaic-stack
CLI: scripts/stack-copy.sh wrapper ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00 --copies /home/jwoltje/darkwing-scratch/r1070/copies --bin /home/jwoltje/darkwing-scratch/r1070/rootB/bin
# exit 0
# --plan runs check_target and plan only (stack-release.sh:717 activate, :727 rollback; precheck at :718 and :728). The row 166 drop-in scan and unit reads
#   (drop_in_override, read_units with the unquoted check) run in precheck, so in steps 2 and 6, and read_units in status.

## 2. activate --pm --migrate
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> scripts/stack-release.sh activate ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00 mosaic-stack --pm --migrate --copies /home/jwoltje/darkwing-scratch/r1070/copies --bin /home/jwoltje/darkwing-scratch/r1070/rootB/bin)
stack-release: captured the rollback set: /home/jwoltje/darkwing-scratch/r1070/rootB/data/state/stack-rollback/20261019T221455Z-ca15d73e9fdc
stack-release: stopped both units
stack-release: stopped store schema: 3h
stack-release: backup: /home/jwoltje/darkwing-scratch/r1070/rootB/data/backups/stack/20261019T221455Z-ca15d73e9fdc
stack-release: migrated the store to 3i
stack-release: installed ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00
stack-release: gate passed on ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00
stack-release: activate ok: ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00 is live for mosaic-stack
# exit 0
# activation log, last line: {"at":"2026-10-19T22:14:56Z","op":"activate","from":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","to":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","backup":"20261019T221455Z-ca15d73e9fdc","activation":"20261019T221455Z-ca15d73e9fdc","result":"ok"}
# activation id: 20261019T221455Z-ca15d73e9fdc; backup: 20261019T221455Z-ca15d73e9fdc
# backup dir: /home/jwoltje/darkwing-scratch/r1070/rootB/data/backups/stack/20261019T221455Z-ca15d73e9fdc
# backup STAMP: 2026-10-19T22:14:55.866Z; SCHEMA: 3h; DATA_ROOT: /home/jwoltje/darkwing-scratch/r1070/rootB/data
# backup files: ./bus/bus.sqlite ./DATA_ROOT ./LISTING.txt ./MODES.txt ./ROLLBACK_SET ./SCHEMA ./SHA256SUMS ./SOURCE.sha256 ./STAMP 

## 2a. backup check (sha256sum -c from the backup's bus/)
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> bash -c cd '/home/jwoltje/darkwing-scratch/r1070/rootB/data/backups/stack/20261019T221455Z-ca15d73e9fdc/bus' && sha256sum -c ../SHA256SUMS)
bus.sqlite: OK
# exit 0
# SOURCE.sha256 matches SHA256SUMS: yes

## 3. status after activate
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> scripts/stack-release.sh status mosaic-stack --copies /home/jwoltje/darkwing-scratch/r1070/copies --bin /home/jwoltje/darkwing-scratch/r1070/rootB/bin)
pointer: /home/jwoltje/darkwing-scratch/r1070/rootB/data/state/stack-active.json
  {"copy":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","business":"mosaic-stack","pm":true,"claude":"/home/jwoltje/darkwing-scratch/r1070/b/claude","console":["--port","47391","--business","mosaic-stack"],"schema":"3i","activation":"20261019T221455Z-ca15d73e9fdc","at":"2026-10-19T22:14:56Z"}
log (last five lines):
  {"at":"2026-10-19T22:14:50Z","op":"adopt","from":null,"to":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","backup":null,"activation":"20261019T221450Z-5fa9cc8f2c66","result":"ok"}
  {"at":"2026-10-19T22:14:55Z","op":"activate","from":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","to":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","backup":null,"activation":"20261019T221455Z-ca15d73e9fdc","result":"started"}
  {"at":"2026-10-19T22:14:56Z","op":"activate","from":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","to":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","backup":"20261019T221455Z-ca15d73e9fdc","activation":"20261019T221455Z-ca15d73e9fdc","result":"ok"}
check:
  bus: /home/jwoltje/darkwing-scratch/r1070/copies/ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00
  Console: /home/jwoltje/darkwing-scratch/r1070/copies/ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00
  CLI: /home/jwoltje/darkwing-scratch/r1070/copies/ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00
  result: pass
bus status:
  host: mosaic-stack, pid 1754257, running, since 2026-10-19T22:14:56.261Z, notifier off
  socket: present
  writer.lock: pid 1754295
  boot: organization file loaded at 2026-10-19T22:14:56.261Z
unit flags: match the pointer
drift: 100 commit(s) on refactor since the pointer's copy
# exit 0
# store schema after activate (read-only, held by the bus): 3i

## 4. launches list after activate (the NEW copy's CLI)
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> /home/jwoltje/darkwing-scratch/r1070/copies/ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00/scripts/mosaic launches list --json)
[
  {
    "run": "remul1754340",
    "business": "mosaic-stack",
    "instance": "chief",
    "harness": "claude-code",
    "model": "emulated",
    "launchedBy": "standin-pm-emulation",
    "runnerPid": 1754340,
    "runnerStartTime": "54928658",
    "startedAt": "2026-10-19T22:14:56.364Z",
    "live": true
  }
]
# exit 0
# mos-0838 D3 counts, read-only from the scratch store the bus holds, rows with at > the backup STAMP:
#   events after 2026-10-19T22:14:55.866Z: 0 (total 0)
#   usage_records after 2026-10-19T22:14:55.866Z: 0 (total 0)
#   instance_names after 2026-10-19T22:14:55.866Z: 0 (total 0)

## 5. rollback --restore --plan
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> scripts/stack-release.sh rollback mosaic-stack --restore 20261019T221455Z-ca15d73e9fdc --plan --copies /home/jwoltje/darkwing-scratch/r1070/copies --bin /home/jwoltje/darkwing-scratch/r1070/rootB/bin)
plan: rollback for mosaic-stack
from: ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00
to: 5fa9cc8f2c66b52408b652b59c3070f7210b44d0
store schema: 3i (read from the store the running bus holds)
target schema: 3h
restore: the store must go back to 3h; needs --restore 20261019T221455Z-ca15d73e9fdc
commits: the run takes away 8 (newest first, at most 200):
  ca15d73e9 limits: a daily token quota for the account the stack uses, and bus schema 3h to 3i (row 126, #1620)
  54319f552 sessions: Filbert row 126 r2 review, approve
  4c385db45 sessions: Dewey row 126 round 4 build and review rounds 1-2
  2124cfa76 queue: row 126 Filbert r1 approve, brief re-pin for 3h to 3i, row 7 week note, round 2 in-review (sage)
  e264db51b plans: row 126 brief names the 3h to 3i step and the account guard (#1620)
  1df04f52f sessions: Filbert row 126 r1 review, approve
  9e2b26866 queue: row 167 Filbert approve and done, row 126 round 1 in-review (sage)
  640a1ee97 sessions: Sage row 167 landing and row 126 3i ruling
bus: scripts/bus-service.sh install --copy 5fa9cc8f2c66b52408b652b59c3070f7210b44d0 --copies /home/jwoltje/darkwing-scratch/r1070/copies --pm --claude /home/jwoltje/darkwing-scratch/r1070/b/claude
Console: scripts/webui-service.sh install --copy 5fa9cc8f2c66b52408b652b59c3070f7210b44d0 --copies /home/jwoltje/darkwing-scratch/r1070/copies --port 47391 --business mosaic-stack
CLI: scripts/stack-copy.sh wrapper 5fa9cc8f2c66b52408b652b59c3070f7210b44d0 --copies /home/jwoltje/darkwing-scratch/r1070/copies --bin /home/jwoltje/darkwing-scratch/r1070/rootB/bin
# exit 0

## 6. rollback --restore
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> scripts/stack-release.sh rollback mosaic-stack --restore 20261019T221455Z-ca15d73e9fdc --copies /home/jwoltje/darkwing-scratch/r1070/copies --bin /home/jwoltje/darkwing-scratch/r1070/rootB/bin)
restore: /home/jwoltje/darkwing-scratch/r1070/rootB/data/backups/stack/20261019T221455Z-ca15d73e9fdc; the store now in place moves to /home/jwoltje/darkwing-scratch/r1070/rootB/data/bus.post-attempt-20261019T221457Z and is kept; 0 event(s) were written after the backup
stack-release: captured the rollback set: /home/jwoltje/darkwing-scratch/r1070/rootB/data/state/stack-rollback/20261019T221457Z-5fa9cc8f2c66
stack-release: stopped both units
stack-release: stopped store schema: 3i
stack-release: restored /home/jwoltje/darkwing-scratch/r1070/rootB/data/backups/stack/20261019T221455Z-ca15d73e9fdc; the store from before the restore is at /home/jwoltje/darkwing-scratch/r1070/rootB/data/bus.post-attempt-20261019T221457Z
stack-release: installed 5fa9cc8f2c66b52408b652b59c3070f7210b44d0
stack-release: gate passed on 5fa9cc8f2c66b52408b652b59c3070f7210b44d0
stack-release: rollback ok: 5fa9cc8f2c66b52408b652b59c3070f7210b44d0 is live for mosaic-stack
# exit 0
# activation log, last line: {"at":"2026-10-19T22:14:59Z","op":"rollback","from":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","to":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","backup":"20261019T221455Z-ca15d73e9fdc","activation":"20261019T221457Z-5fa9cc8f2c66","result":"ok"}

## 7. status after rollback
# command: (cd /home/jwoltje/darkwing-scratch/r1070/repo && <scratch env> scripts/stack-release.sh status mosaic-stack --copies /home/jwoltje/darkwing-scratch/r1070/copies --bin /home/jwoltje/darkwing-scratch/r1070/rootB/bin)
pointer: /home/jwoltje/darkwing-scratch/r1070/rootB/data/state/stack-active.json
  {"copy":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","business":"mosaic-stack","pm":true,"claude":"/home/jwoltje/darkwing-scratch/r1070/b/claude","console":["--port","47391","--business","mosaic-stack"],"schema":"3h","activation":"20261019T221457Z-5fa9cc8f2c66","at":"2026-10-19T22:14:59Z"}
log (last five lines):
  {"at":"2026-10-19T22:14:50Z","op":"adopt","from":null,"to":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","backup":null,"activation":"20261019T221450Z-5fa9cc8f2c66","result":"ok"}
  {"at":"2026-10-19T22:14:55Z","op":"activate","from":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","to":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","backup":null,"activation":"20261019T221455Z-ca15d73e9fdc","result":"started"}
  {"at":"2026-10-19T22:14:56Z","op":"activate","from":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","to":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","backup":"20261019T221455Z-ca15d73e9fdc","activation":"20261019T221455Z-ca15d73e9fdc","result":"ok"}
  {"at":"2026-10-19T22:14:57Z","op":"rollback","from":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","to":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","backup":"20261019T221455Z-ca15d73e9fdc","activation":"20261019T221457Z-5fa9cc8f2c66","result":"started"}
  {"at":"2026-10-19T22:14:59Z","op":"rollback","from":"ca15d73e9fdcdcf66a10f86cdedeb2d6a08f2b00","to":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","backup":"20261019T221455Z-ca15d73e9fdc","activation":"20261019T221457Z-5fa9cc8f2c66","result":"ok"}
check:
  bus: /home/jwoltje/darkwing-scratch/r1070/copies/5fa9cc8f2c66b52408b652b59c3070f7210b44d0
  Console: /home/jwoltje/darkwing-scratch/r1070/copies/5fa9cc8f2c66b52408b652b59c3070f7210b44d0
  CLI: /home/jwoltje/darkwing-scratch/r1070/copies/5fa9cc8f2c66b52408b652b59c3070f7210b44d0
  result: pass
bus status:
  host: mosaic-stack, pid 1755247, running, since 2026-10-19T22:14:58.528Z, notifier off
  socket: present
  writer.lock: pid 1755276
  boot: organization file loaded at 2026-10-19T22:14:58.527Z
unit flags: match the pointer
drift: 108 commit(s) on refactor since the pointer's copy
# exit 0
# store schema after rollback: 3h
# pointer: {"copy":"5fa9cc8f2c66b52408b652b59c3070f7210b44d0","business":"mosaic-stack","pm":true,"claude":"/home/jwoltje/darkwing-scratch/r1070/b/claude","console":["--port","47391","--business","mosaic-stack"],"schema":"3h","activation":"20261019T221457Z-5fa9cc8f2c66","at":"2026-10-19T22:14:59Z"}
# data root bus dirs: backups/stack/20261019T221455Z-ca15d73e9fdc bus bus-host bus.post-attempt-20261019T221457Z 
