Files
stack/agents/sage/work/window-plan/repin-5fa9cc8f2.md

19 KiB

Window A: re-pin to 5fa9cc8f2, rows 129, 164, 125, 162, 155, 154, 156, 165 and 167, bus stays 3h

Sage, 2026-10-19, on Mos's rulings mos-0838 (D1 to D3) and mos-0845 (D1 to D4). It follows repin-8e7ea89a1.md, which passed (mos-0844) and stays the record. Mos runs every window step, with Jason there for his two plug-in patches and his browser check. Sage runs none of the window steps.

  • OLD, live: 8e7ea89a1e86447d26ec335e4b138acfd5130cbc. Bus schema 3h. The pointer state/stack-active.json exists, so this window has no adopt step.

  • NEW: 5fa9cc8f2c66b52408b652b59c3070f7210b44d0, on origin refactor. Bus schema 3h (SCHEMA_VERSION = '3h' in its packages/bus/src/store.mjs). No copy yet; W0 makes it.

  • REPO: the canonical checkout /mnt/storage/src/mosaic-stack. The tool is its scripts/stack-release.sh, blob 4b16e848a6b9905b6a568668367bad6df5f65c7b, the blob P2 rehearsed for 8e7ea89a1. mos-0838 D2: with that blob unchanged, A needs no extra rehearsal. If row 166 or row 382's fix lands first, the blob changes, and this plan waits for a P2-style scratch activate and rollback with the new blob before it goes to Jason.

  • Data root: /home/jwoltje/.mosaic-dev.

  • P=/mnt/storage/scratch/sage-pin-de352dfaf, unchanged, checked against repin-de352dfaf/SCRIPTS.sha256. Only business-check.mjs and console-check.sh are used.

  • Copy CLIs. scripts/mosaic sends names, name, plugins, follow, thread and threads to the seat CLI, which refuses them with exit 4 (F1, P19 378). Those verbs run from the copy's own CLI, the way Jason ran names on 10-19 (mos-0845, rc 0, []):

    COPIES=/home/jwoltje/.local/share/mosaic-stack/copies
    C_OLD="node $COPIES/8e7ea89a1e86447d26ec335e4b138acfd5130cbc/packages/cli/src/cli.mjs"
    C_NEW="node $COPIES/5fa9cc8f2c66b52408b652b59c3070f7210b44d0/packages/cli/src/cli.mjs"
    

    Every other verb goes through mosaic, so the reads also show that the wrapper reaches NEW.

What NEW carries over OLD

git rev-list --count 8e7ea89a1..5fa9cc8f2 is 78. A path-limited log over packages scripts roles adapters contracts tools package.json package-lock.json lists nine code commits:

Row Commit Live effect
129 850484a7d Console Chat view over the bus's project and thread verbs. Creation and Send need --send and the signed-in human. No default project or thread is made.
164 008746b6e The channel plug-in kind, with cli and webui as its modules. Chat refuses until plugins.channel names them (mos-0812). The channel reads plug-ins on each operation, so Jason's set needs no restart.
125 aa625565f Token limits per instance, model, provider and key. mosaic limits. No limit is set by this window.
162 7e7f8e208 stack-release.sh itself. It runs from REPO, so the copy's own file has no live effect.
155 b2f57ca70 The human and the chief configure the assistant. Settings shows it.
154 9353675d1 WYSIWYG Markdown editor in the Console docs view.
156 4f45cadc0 The host starts the landing run once a merge decision is approved. Nothing in the window approves one.
165 9466f3e5e The human adds and changes role instances, from the CLI and the Console. mosaic business instances.
167 5fa9cc8f2 One settings snapshot; names rethrows a refusal instead of printing an empty list.

None of them changes the schema. Row 126 (3i) is Window B.

Two plug-in patches, both Jason's

The live business file has no plugins key, so the bus has no usage source and every turn logs usage-unknown with source @none (F4, P19 381). One example is in the bus journal at 2026-10-19T17:29:00Z: run r8fba7e598156, instance chief, turn 21e204db-8f55-4348-8f13-c10f85e764a2, code baseline-unknown. I read it with journalctl --user -u 'mosaic-bus@mosaic-stack' --since "2026-10-19T17:20:00Z" at 17:32Z. A bare --since 17:23:30 reads as CDT on this host, which is 22:23:30Z, so it finds nothing. With --since "2026-10-19 17:23:30 UTC" the same grep counts 1. My sage-1003 said 17:23Z. That was the smoke time, not the line's; the line is at 17:29:00Z.

  1. Before activate, Jason adds "usage-source": ["transcript"] with OLD's own setter (mos-0845 D3). 8e7ea89a1 knows that kind; it doesn't know channel. The live bus reads usage sources only at start (createUsage loads them once), so the patch takes effect at W5's restart, under NEW. If W5 rolls back, OLD's restart loads the same file, which is why Darkwing's scratch run proves both loads (W-pre below).
  2. After activate, Jason adds "channel": ["cli", "webui"] with NEW's setter.

A patch names only the kinds it changes; the setter keeps the rest. Each one takes the revision from a read made just before it.

Before the window (nothing stopped)

# Who Step
P0 Mos cd $P && grep -E ' (business-check.mjs|console-check.sh)$' $REPO/agents/sage/work/window-plan/repin-de352dfaf/SCRIPTS.sha256 | sha256sum -c: two OK lines.
P1 Mos node $P/business-check.mjs 8e7ea89a1e86447d26ec335e4b138acfd5130cbc: LOAD_OK. After W0, the same for NEW: LOAD_OK, HOLDS chief instance.name yes, HOLDS pm instance.name no. REFUSED stops the window.
P2 Sage console-check.sh $NEW against a stub Console of NEW on a scratch port, as in the 8e7ea89a1 window. CONSOLE_PASS before the window goes to Jason. Done 2026-10-19 17:59:23Z (mos-0849 G1): repin-5fa9cc8f2/p2.out (sha256 ed8f5da1…5995), five PASS lines, CONSOLE_PASS, CALLS [], rc 0, from repin-5fa9cc8f2/p2.sh (509fa685…569b). See the last section.
P3 Darkwing The scratch --plan for 5fa9cc8f2 with blob 4b16e848 (sage-1004), on a scratch business file that already has "plugins": {"usage-source": ["transcript"]}. It proves three things: the scratch --plan output, that the file loads under 5fa9cc8f2, and that it loads under 8e7ea89a1 as a rollback would load it (mos-0845 D3). Done 2026-10-19 (sage-1008 reply): agents/darkwing/work/queue-162/scratch-plan-5fa9cc8f2.txt (sha256 af67b254…, exit 0), scratch-load-check.txt (4f72f5d6…, parts 1 and 2 LOAD_OK under 5fa9cc8f2 and 8e7ea89a1) on scratch-business-A.json (d4c109fa…), made from the committed example file (mos-0847).

The window, Jason present

# Who Step
W0 Mos cd $REPO && scripts/stack-copy.sh copy 5fa9cc8f2c66b52408b652b59c3070f7210b44d0. Note the full id it prints. Then P1 for NEW.
W1 Jason, then Mos PM-idle check. Jason: mosaic agents --business mosaic-stack; chief not working, pm not running. Mos: mosaic launches list. Nobody talks to the chief until W6 passes. Record date -u +%FT%TZ as the start stamp. Baseline reads, kept for W6: $C_OLD names --business mosaic-stack --json and $C_OLD threads --business mosaic-stack --json (both [] on 10-19), and mosaic usage --business mosaic-stack --json saved whole, for its total and byRun (U1, mos-0846).
W2 Jason Usage source, OLD's setter. $C_OLD plugins --business mosaic-stack --json; note revision. Write PATCH as {"revision": <that revision>, "plugins": {"usage-source": ["transcript"]}}, then $C_OLD plugins set --file PATCH --business mosaic-stack. Read again: usage-source is ["transcript"] and no other kind is set. A refusal ends the window with nothing stopped and nothing to undo.
W2b Mos node $P/business-check.mjs 8e7ea89a1e86447d26ec335e4b138acfd5130cbc and the same for NEW, on the patched file. Both LOAD_OK. A REFUSED stops the window; undo W2 as below.
W3 Mos scripts/stack-release.sh activate 5fa9cc8f2c66b52408b652b59c3070f7210b44d0 mosaic-stack --plan. Writes nothing. Its from, to, store schema, target schema, migration and needs lines must match P3's scratch output: from 8e7ea89a1, to 5fa9cc8f2, store schema 3h read from the store the running bus holds, target 3h, no migration step, no --migrate need, 78 commits. The bus, Console and CLI lines carry the pointer's flags; beyond those, only copy paths differ. P3's store line reads 3h (from the pointer; there is no store file), because the scratch root has no store; the live line names the held store, and the value 3h must match. Any other difference stops the window before W5 and goes to Mos.
W4 Mos Drop-ins: systemctl --user show [email protected] -p DropInPaths. The pm.conf drop-in adds --pm only. A drop-in that sets ExecStart or WorkingDirectory makes activate refuse drop-in-override; Mos ends the window.
W5 Mos, on Mos's go, Jason present scripts/stack-release.sh activate 5fa9cc8f2c66b52408b652b59c3070f7210b44d0 mosaic-stack --pm. No --migrate. Exit 0 and a final log line result ok. Record the activation id. Exit 1 means the gate failed and the run rolled back to OLD; exit 2 means the rollback failed too: see Stop conditions.
W5b Jason Channel, NEW's setter. $C_NEW plugins --business mosaic-stack --json; note revision. PATCH {"revision": <that revision>, "plugins": {"channel": ["cli", "webui"]}}, then $C_NEW plugins set --file PATCH --business mosaic-stack. Read again: channel is ["cli", "webui"] and usage-source is still ["transcript"].
W6 Mos The checks below.
W7 Mos, then Jason Smoke and the browser check below.

What W5's gate covers: both units active, a live bus host for this start whose pid is the bus unit's MainPID with boot ok, Console /healthz, stack-copy.sh check on NEW for bus, Console and CLI, and exactly one launched journal line for this start. That line is the chief's: bus start --pm launches launch.by, which is the chief, not pm (F3, P19 380).

W6 checks, where the gate doesn't reach

scripts/stack-release.sh status mosaic-stack                # pointer on 5fa9cc8f2, schema 3h, last line ok
bash $P/console-check.sh $NEW                                # CONSOLE_PASS
$C_NEW plugins --business mosaic-stack --json                # row 164: channel cli,webui; usage-source transcript
$C_NEW names --business mosaic-stack --json                  # row 167: same as W1's read
$C_NEW threads --business mosaic-stack --json                # rows 128/129: [] (F2)
mosaic project list --json                                   # exit 0
mosaic limits --business mosaic-stack --json                 # row 125: exit 0
$C_NEW business instances mosaic-stack --json                # row 165: the file's six instances, nothing added
mosaic usage --business mosaic-stack --json                  # total and byRun equal W1's, field for field
mosaic launches list                                         # one running chief from this start
mosaic agents --business mosaic-stack                        # pm not running

All of these read. None writes to the store. threads takes --business, not --project: the 8e7ea89a1 plan's threads --project stack named a project that exists only in the business file. project list reads the store's projects table, which the business file's projects never enter (F2, P19 379). Its output isn't compared to the business file. names differing from W1 means somebody wrote a name during the window; stop and report.

project list at 5fa9cc8f2 goes through the channel (packages/cli/src/cli.mjs:567, channelCallFor), so it reads correctly only after W5b has set plugins.channel. Run it in W6, never before W5b.

business instances runs from $C_NEW (mos-0851), the same as Jason's checklist. The mosaic form would also reach packages/cli after W5: activate points the wrapper at NEW (stack-release.sh:348, stack-copy.sh wrapper), and 5fa9cc8f2's scripts/mosaic:28-33 sends business instances there before line 38. Before W5 the wrapper runs 8e7ea89a1, whose scripts/mosaic sends every business verb to packages/business, which has no instances verb. $C_NEW doesn't depend on which copy the wrapper runs. Every other mosaic <verb> in this plan (agents, launches, usage, limits, project, talk) is on line 38 at both 8e7ea89a1 and 5fa9cc8f2. Sage checked each route with stand-in CLIs on 2026-10-19.

W7, smoke and the browser check

mosaic talk chief "[mos test] re-pin 5fa9cc8f2: reply with one line, no staffing request" --tester
mosaic usage --business mosaic-stack --json                  # one new byRun entry, this start's chief run: input > 0, output > 0, unknownTurns 0

The usage read is F4's acceptance. mosaic usage --json prints no record list, only total and the groups byRun, byInstance, byModel, byProvider and byAccount (5fa9cc8f2 packages/cli/src/usage.mjs), so the check reads the new byRun entry. A turn counts as known only when the transcript added usage (5fa9cc8f2 packages/bus/src/usage.mjs:34 returns no-new-usage otherwise), so nonzero input and output with unknownTurns 0 prove the transcript source works. Any other result goes to Mos with the journal's usage-unknown code; it doesn't roll the window back by itself.

There is no pm smoke. pm isn't running, and a tester message to it waits for a claim nobody makes (F3). The 8e7ea89a1 window's message 02f0e5d6 is still queued for pm; it stays as it is, and any store edit waits for Jason (mos-0845 D2).

Jason's browser check, signed in at https://mosaic.woltje.com:

  • Chat opens and shows an empty project list (row 129). Nobody creates a project or thread or sends from Chat in the window; that writes to the store and is a separate smoke with its own go.
  • #/docs opens spec/north-star.md in the WYSIWYG editor (row 154).
  • Settings shows the Token limits, Token usage, Assistant and Role instances sections (rows 125, 124, 155, 165).

Nobody presses Save in docs, Assistant, Token limits or Role instances. A docs Save commits to Jason's project repo and sends row 143's review notices.

Not done in the window: mosaic name, any project or thread create, any instance add, any limit set, a pm launch, and row 126's activate (Window B).

Stop conditions

Before W5, any refusal or mismatch ends the window with nothing stopped. W2's patch stays unless Jason undoes it as below.

Undoing W2

$C_OLD plugins --business mosaic-stack --json for the revision, then PATCH {"revision": <that revision>, "plugins": {"usage-source": null}} with $C_OLD plugins set. Jason runs it. The running OLD bus never loaded the source, so nothing restarts. If W5 already ran and rolled back, the restarted OLD bus did load it; the undo then needs a plain unit restart afterwards, Mos's go.

From W5 on:

  • Exit 1: the gate failed and the run rolled back inside itself to OLD. Both stores are 3h, so there is no restore. Report the log line and the failing check to Mos. Nothing is retried.
  • Exit 2, rollback-failed: both units stay stopped. Jason or Mos settles it from the rollback set the message names.
  • W6 or W7 failure after an exit 0: a finding for Mos, who decides between a fix forward and rollback mosaic-stack. Both copies are 3h, so the rollback needs no --restore and loses no rows; usage records from W7 stay in the store. Before any rollback after W5b, the channel undo below comes first. Then run rollback mosaic-stack --plan. console-check.sh FAIL alone is not an automatic rollback.

Before any rollback after W5b (mos-0849 G2)

After W5b the live file names channel, and 8e7ea89a1 refuses a kind it doesn't know. P3's load check shows it: part 5, file B under 8e7ea89a1, is REFUSED unknown kind "channel" (agents/darkwing/work/queue-162/scratch-load-check.txt, sha256 4f72f5d6…). A rollback from that point would start an OLD bus that can't load the file. So, in this order:

  1. Jason, NEW's setter, against the live NEW bus. $C_NEW plugins --business mosaic-stack --json; note revision. PATCH {"revision": <that revision>, "plugins": {"channel": null}}, then $C_NEW plugins set --file PATCH --business mosaic-stack. Read again: channel absent, usage-source still ["transcript"].
  2. Mos, node $P/business-check.mjs 8e7ea89a1e86447d26ec335e4b138acfd5130cbc on that file. LOAD_OK is required. REFUSED stops here, and the rollback doesn't run.
  3. Only then rollback mosaic-stack --plan, then the rollback on Mos's go.

The tool won't catch a skipped step 1. rollback in blob 4b16e848 loads no business file before it stops NEW. do_rollback (stack-release.sh:702-728) reads the pointer (pointer_for_business, :540) and the log (from_log, :128), then precheck (:531): check_target (:208) reads the copy's schema as text only (copy_schema, :184-193), and instance_busy, drop_in_override, read_units and flags_drift read units. run_steps (:654) then captures and stops both units (:656-658). The file's first load under OLD is the OLD bus start (start_both, :684). The gate (:685) would fail, and rollback_in_run (:442) would put NEW's units back and gate NEW: exit 1 with NEW live, or exit 2 with both stopped if that gate fails too. Steps 1 and 2 prevent both.

A rollback before W5b is unaffected. That is W5's own exit 1, where the file has only usage-source, which 8e7ea89a1 knows (P3 part 2, LOAD_OK).

Rollback copies

Keep 8e7ea89a1, 52f35e7a0 and 3190ad762. Don't touch 66ea40580. The script prunes nothing.

What Sage ran for this plan

Read only, 2026-10-19 between 17:30Z and 17:44Z, on 894ce3f37. Nothing live was changed.

  • git rev-list --count 8e7ea89a1..5fa9cc8f2 = 78 and the path-limited log above.
  • git hash-object scripts/stack-release.sh = 4b16e848a6.
  • kinds.mjs at 8e7ea89a1 (usage-source, limit-check, search-source) and at 5fa9cc8f2 (adds channel). plugins.mjs usage at both.
  • usage.mjs at 5fa9cc8f2: createUsage loads sources once per bus start; a begin row per turn holds the baseline. The transcript module returns known with no entries when the root is missing, so a fresh run's first turn still gets a known record.
  • scripts/mosaic:38 at 8e7ea89a1 and 5fa9cc8f2 for F1; thread.mjs and broker.mjs for F2; launcher.mjs and cli.mjs:342-343 for F3.
  • The bus journal for 17:20Z on, read-only, for the usage-unknown line above, with a UTC control.
  • The webui README's Chat section at 5fa9cc8f2.

Added 2026-10-19 for mos-0849, on 6e7c23d7d:

  • P2, 17:59:23Z. stack-copy.sh copy 5fa9cc8f2 --copies a scratch HOME under /mnt/storage/scratch/sage-p2-5fa, never the live copies dir. Then p2.sh, the 8e7ea89a1 window's script with NEW and the scratch dir changed: P0's two OK lines, the pinned stub console-stub.mjs (1ba3c7ef…5b93) on port 37763, and HOME=<scratch> console-check.sh $NEW 37763. Five PASS lines, CONSOLE_PASS, CALLS [], rc 0. Both files are in repin-5fa9cc8f2/. The scratch copy was removed afterward. The live copies dir has no 5fa9cc8f2.
  • scripts/stack-release.sh at blob 4b16e848, every node, business and CLI call on the rollback path, for the G2 finding above.