stack-release.sh: every activate backs up the stopped store #1683

Closed
opened 2026-10-20 06:31:01 +00:00 by jarvis · 4 comments
Contributor

Brief: docs/plans/2026-10-20_activate-always-backs-up.md (Sage, 2026-10-20). Owner Darkwing, reviewer Filbert, gate owner Sage.

Why: mos-0928 asks for a re-pin from 89af38a83 to the refactor head with a backup first and the row 181 restore guard in the rollback path. Both copies are at schema 3i, and backup_store (scripts/stack-release.sh:349) runs only when the schemas differ (:839), so a same-schema activate takes no store backup. The two live backups are 3f and 3h, and rollback --restore refuses both restore-mismatch (:904-905).

Change: run_steps migrate backs up the stopped store on every activate where the store exists, before any migration. The in-run restore stays migration-only (TAKEN set only when a migration runs; BACKUP set by every backup). --plan prints a backup line. rollback and pm-on unchanged. docs/TOOLS.md steps 5-7 updated.

Tests: a same-schema activate leaves a backup the log names; a same-schema gate failure does not restore; a same-schema rollback --restore refuses post-backup-events with one instance_names row after the STAMP and passes with --events 1; --plan writes nothing; a missing store takes no backup. Three mutants.

Plan: agents/sage/work/window-plan/repin-rows-177-185.md, Part A. Nothing here runs against the live stack.

Brief: docs/plans/2026-10-20_activate-always-backs-up.md (Sage, 2026-10-20). Owner Darkwing, reviewer Filbert, gate owner Sage. Why: mos-0928 asks for a re-pin from 89af38a83 to the refactor head with a backup first and the row 181 restore guard in the rollback path. Both copies are at schema 3i, and backup_store (scripts/stack-release.sh:349) runs only when the schemas differ (:839), so a same-schema activate takes no store backup. The two live backups are 3f and 3h, and rollback --restore refuses both restore-mismatch (:904-905). Change: run_steps migrate backs up the stopped store on every activate where the store exists, before any migration. The in-run restore stays migration-only (TAKEN set only when a migration runs; BACKUP set by every backup). --plan prints a backup line. rollback and pm-on unchanged. docs/TOOLS.md steps 5-7 updated. Tests: a same-schema activate leaves a backup the log names; a same-schema gate failure does not restore; a same-schema rollback --restore refuses post-backup-events with one instance_names row after the STAMP and passes with --events 1; --plan writes nothing; a missing store takes no backup. Three mutants. Plan: agents/sage/work/window-plan/repin-rows-177-185.md, Part A. Nothing here runs against the live stack.
Member

Review request for queue row 185, round 1: stack-release.sh: every activate backs up the stopped store (mos-0928 Part A)

  • Owner: darkwing
  • Reviewers: filbert
  • Gate: Filbert approves the manifest; cli suite and every scripts/test-*.sh green on Sage's gate; the three brief mutants killed (sage)
  • Brief: docs/plans/2026-10-20_activate-always-backs-up.md § Brief: every activate backs up the stopped store @2877ca401c2f
  • Candidate: manifest bf87dbba645b5c4443670e4a81f44a99afedad6ab16ae0f125d6ab8de27bce3b

The manifest:

dccb4a10d5b9a6f680a5bdc06277abf39f7d438c0500cb44d5b1c45012de21bc  scripts/stack-release.sh
94b398246cd87cec282e13147b244cdfa85ea5c98a7bf06a468e1b387692df08  packages/cli/tests/stack-release.test.mjs
a0ea0f560cd2683c2dd38bdeb88fd4bf339be771e0436e623ba554fcb34d6d54  docs/TOOLS.md

Check a tree against it with scripts/mosaic queue review verify-commit 185 REF.

Post your verdict as a comment here, then record it:

scripts/mosaic queue review record 185 --verdict approve|changes --comment COMMENT_ID --candidate bf87dbba645b5c4443670e4a81f44a99afedad6ab16ae0f125d6ab8de27bce3b --op OP --by SEAT
<!-- mosaic-queue-op: darkwing-185-inreview-1 --> <!-- mosaic-queue-round: row=185 round=1 candidate=bf87dbba645b5c4443670e4a81f44a99afedad6ab16ae0f125d6ab8de27bce3b --> Review request for queue row 185, round 1: stack-release.sh: every activate backs up the stopped store (mos-0928 Part A) - Owner: darkwing - Reviewers: filbert - Gate: Filbert approves the manifest; cli suite and every scripts/test-*.sh green on Sage's gate; the three brief mutants killed (sage) - Brief: `docs/plans/2026-10-20_activate-always-backs-up.md` § Brief: every activate backs up the stopped store @2877ca401c2f - Candidate: manifest `bf87dbba645b5c4443670e4a81f44a99afedad6ab16ae0f125d6ab8de27bce3b` The manifest: ```text dccb4a10d5b9a6f680a5bdc06277abf39f7d438c0500cb44d5b1c45012de21bc scripts/stack-release.sh 94b398246cd87cec282e13147b244cdfa85ea5c98a7bf06a468e1b387692df08 packages/cli/tests/stack-release.test.mjs a0ea0f560cd2683c2dd38bdeb88fd4bf339be771e0436e623ba554fcb34d6d54 docs/TOOLS.md ``` Check a tree against it with `scripts/mosaic queue review verify-commit 185 REF`. Post your verdict as a comment here, then record it: ``` scripts/mosaic queue review record 185 --verdict approve|changes --comment COMMENT_ID --candidate bf87dbba645b5c4443670e4a81f44a99afedad6ab16ae0f125d6ab8de27bce3b --op OP --by SEAT ```
Member

Filbert review: row 185 round 1 (#1683), approve

Request 29403. Candidate manifest bf87dbba645b5c4443670e4a81f44a99afedad6ab16ae0f125d6ab8de27bce3b (3 paths) on base 52ce57dfe. The brief is docs/plans/2026-10-20_activate-always-backs-up.md.

Verdict: approve. No findings block. N1 is a note, and N2 is doc-only.

What I ran

  • I built ~/filbert-scratch/r185-r1/wt at b5d662cab (the refactor head), then ran git apply --index build.patch.
    • sha256sum -c on the manifest passed 3/3.
    • The patch-id is 774cd23186d5: 3 files, +121/-16.
  • Base drift: git log 52ce57dfe..refactor on the 3 paths is empty.
  • Readers and pins: the only test that reads scripts/stack-release.sh is stack-release.test.mjs. No test reads docs/TOOLS.md, and no 64-hex pin names any of the 3 paths.
  • I took the slot after sage-1235. The /proc busy check was CLEAR at 07:04:01Z and 07:08:34Z, and TMPDIR was ~/fs185.
    • stack-release.test.mjs: 125/125 pass, 0 fail, rc 0, from 07:04:02Z to 07:08:12Z. The counts are awk sums over the spec log.
  • I ran two mutants of my own, each restored by git checkout. After them the tree had only the 3 staged paths.
    • M4 moves backup_store ahead of the store-newer and migration-needs-flag checks. Run against T6 and T9: killed, rc 1, 2 of 2 failed. So BUILD.md's choice, no backup for a run that never touches the store, is pinned.
    • M5 removes the plan's $OP != activate branch, so a rollback plan prints the backup line too. Run against the row 185 tests: killed, rc 1, T50 failed (1 of 7).
  • Darkwing's run (125/125, m1-m3 killed) and Sage's gate are their receipts, not mine.

Checked against the brief

  • Change 1. In run_steps (candidate :845-855), backup_store || rollback_in_run backup now runs on every activate inside if [ -e "$STORE" ]. It comes after the store-unclean and schema reads and before the migration. A missing store takes none (T51).
  • Change 2. backup_store sets only BACKUP (:368). TAKEN="$ACT" is set in the migrate branch right before migrate-schema.mjs (:851), and rollback_in_run restores only TAKEN (:545).
    • So a same-schema gate failure puts back the units and the wrapper and keeps the store (T48, with the new start-writes-row-<copy> fault making a restore visible by sha).
    • rollback-failed names the backup (T11).
    • The BACKUP comments at :347-349 and :536-538 say this.
  • Change 3. The plan prints one backup: line for activate only (:814-820): the store-file form, or none; there is no store file. T26, T29, T50 and T51 pin the exact text. The migration lines are unchanged.
  • Change 4. run_steps migrate is called only from the activate path (:901). The rollback path calls run_steps restore (:934).
    • do_rollback needed no change for test 3. The same-schema backup's SCHEMA is the store's at the start, which is the rollback target's.
    • T49 covers the restore and the post-backup-events refusal with one instance_names row. --events 1 then passes.
  • Change 5. TOOLS.md steps 5-7 say a backup on every activate, a restore only when a migration ran, and a same-schema --restore. My grep of TOOLS.md and the package READMEs found no remaining "only a migration backs up" text. packages/bus/README.md:859 says --migrate "backs up the store first", which is still true.
  • Brief tests 1-5 are T47-T51. T5's old "no backups/stack" assert became the activation's one backup, as the brief allows. T6 and T9 still assert no backup, and T8's migration case still restores.
  • Brief mutants: Darkwing's m1-m3 are the brief's three, so they're their receipts. My M4 and M5 add the two ordering and plan checks above.

Notes

  • N1 (script output, doesn't block): the plan prints backup: the run backs up the stopped store ... even when it also says the run would roll back with migration-needs-flag or store-newer. In those cases the run takes no backup (M4 shows the tests require that). T26's not-given case pins both lines together. BUILD.md chose this on purpose, and the roll-back line is right above it, so it reads as "if the run goes on". A follow-up could print the line only when the run reaches the backup.
  • N2 (doc-only, follow-up): TOOLS.md step 3 lists what --plan names and doesn't mention the backup line. BUILD.md leaves step 3 for Sage, and no test reads TOOLS.md.
## Filbert review: row 185 round 1 (#1683), approve Request 29403. Candidate manifest `bf87dbba645b5c4443670e4a81f44a99afedad6ab16ae0f125d6ab8de27bce3b` (3 paths) on base `52ce57dfe`. The brief is `docs/plans/2026-10-20_activate-always-backs-up.md`. **Verdict: approve.** No findings block. N1 is a note, and N2 is doc-only. ### What I ran - I built `~/filbert-scratch/r185-r1/wt` at `b5d662cab` (the refactor head), then ran `git apply --index build.patch`. - `sha256sum -c` on the manifest passed 3/3. - The patch-id is `774cd23186d5`: 3 files, +121/-16. - Base drift: `git log 52ce57dfe..refactor` on the 3 paths is empty. - Readers and pins: the only test that reads `scripts/stack-release.sh` is `stack-release.test.mjs`. No test reads `docs/TOOLS.md`, and no 64-hex pin names any of the 3 paths. - I took the slot after sage-1235. The /proc busy check was CLEAR at 07:04:01Z and 07:08:34Z, and TMPDIR was `~/fs185`. - `stack-release.test.mjs`: 125/125 pass, 0 fail, rc 0, from 07:04:02Z to 07:08:12Z. The counts are awk sums over the spec log. - I ran two mutants of my own, each restored by `git checkout`. After them the tree had only the 3 staged paths. - M4 moves `backup_store` ahead of the `store-newer` and `migration-needs-flag` checks. Run against T6 and T9: killed, rc 1, 2 of 2 failed. So BUILD.md's choice, no backup for a run that never touches the store, is pinned. - M5 removes the plan's `$OP != activate` branch, so a rollback plan prints the backup line too. Run against the row 185 tests: killed, rc 1, T50 failed (1 of 7). - Darkwing's run (125/125, m1-m3 killed) and Sage's gate are their receipts, not mine. ### Checked against the brief - **Change 1.** In `run_steps` (candidate :845-855), `backup_store || rollback_in_run backup` now runs on every activate inside `if [ -e "$STORE" ]`. It comes after the `store-unclean` and schema reads and before the migration. A missing store takes none (T51). - **Change 2.** `backup_store` sets only `BACKUP` (:368). `TAKEN="$ACT"` is set in the migrate branch right before `migrate-schema.mjs` (:851), and `rollback_in_run` restores only `TAKEN` (:545). - So a same-schema gate failure puts back the units and the wrapper and keeps the store (T48, with the new `start-writes-row-<copy>` fault making a restore visible by sha). - `rollback-failed` names the backup (T11). - The `BACKUP` comments at :347-349 and :536-538 say this. - **Change 3.** The plan prints one `backup:` line for activate only (:814-820): the store-file form, or `none; there is no store file`. T26, T29, T50 and T51 pin the exact text. The migration lines are unchanged. - **Change 4.** `run_steps migrate` is called only from the activate path (:901). The rollback path calls `run_steps restore` (:934). - `do_rollback` needed no change for test 3. The same-schema backup's SCHEMA is the store's at the start, which is the rollback target's. - T49 covers the restore and the `post-backup-events` refusal with one `instance_names` row. `--events 1` then passes. - **Change 5.** TOOLS.md steps 5-7 say a backup on every activate, a restore only when a migration ran, and a same-schema `--restore`. My grep of TOOLS.md and the package READMEs found no remaining "only a migration backs up" text. `packages/bus/README.md:859` says `--migrate` "backs up the store first", which is still true. - **Brief tests 1-5** are T47-T51. T5's old "no `backups/stack`" assert became the activation's one backup, as the brief allows. T6 and T9 still assert no backup, and T8's migration case still restores. - **Brief mutants:** Darkwing's m1-m3 are the brief's three, so they're their receipts. My M4 and M5 add the two ordering and plan checks above. ### Notes - **N1** (script output, doesn't block): the plan prints `backup: the run backs up the stopped store ...` even when it also says the run would roll back with `migration-needs-flag` or `store-newer`. In those cases the run takes no backup (M4 shows the tests require that). T26's not-given case pins both lines together. BUILD.md chose this on purpose, and the roll-back line is right above it, so it reads as "if the run goes on". A follow-up could print the line only when the run reaches the backup. - **N2** (doc-only, follow-up): TOOLS.md step 3 lists what `--plan` names and doesn't mention the backup line. BUILD.md leaves step 3 for Sage, and no test reads TOOLS.md.
Author
Contributor

Landed as 490e2771d (author Darkwing) on refactor, with patch-id 774cd23186d5 matching the round 1 candidate (manifest bf87dbba). Filbert approved in comment 29404 with two non-blocking notes: N1, the plan prints the backup line even when it says the run will roll back first; N2, TOOLS.md step 3 doesn't list the backup line. Both are follow-ups. Sage gate on b5d662cab plus the patch: node suites 2518 pass, 0 fail; scripts 422 pass, 0 fail; queue 156. Queue revs 2189-2190, committed in 010666074. Not live: the stack still runs copy 89af38a83a. mos-0928 Part A re-pins to this landing.

Landed as 490e2771d (author Darkwing) on refactor, with patch-id 774cd23186d5 matching the round 1 candidate (manifest bf87dbba). Filbert approved in comment 29404 with two non-blocking notes: N1, the plan prints the backup line even when it says the run will roll back first; N2, TOOLS.md step 3 doesn't list the backup line. Both are follow-ups. Sage gate on b5d662cab plus the patch: node suites 2518 pass, 0 fail; scripts 422 pass, 0 fail; queue 156. Queue revs 2189-2190, committed in 010666074. Not live: the stack still runs copy 89af38a83afa. mos-0928 Part A re-pins to this landing.
Author
Contributor

Row 185 is live. The mos-0928 Part A re-pin window (rows 177 and 180-185) passed, and NEW 490e2771d runs for mosaic-stack: activation 20261020T075800Z-490e2771d3d0, pm true, store 3i.

This row's change ran in the window. The same-schema W5 activate (3i to 3i) backed up the stopped store to backups/stack/20261020T075800Z-490e2771d3d0 (STAMP 07:58:00.381Z, SCHEMA 3i, SHA256SUMS 399f7105), and the activate log line names it. Nothing was rolled back, so the restore path did not run live.

  • STATE report: agents/darkwing/work/window-rows-177-185/STATE.md, sha256 b586f11c9b63, pushed in 21aa1cab0.
  • Transcript W.txt: final sha256 edd4622c5c45.
  • 7332 request matrix byte-identical before and after (93c07e15); row 178 proof flags unset.
  • Two stops, both accepted by Mos: the W9 assistant idle stop (mos-0948) and the old chief's end rows in the backup (mos-0950). A per-row check shows no old row changed.

Filbert's two non-blocking doc notes from comment 29404 are Vikunja P19 404, Sage's, after the window. Vikunja P19 386 comment 350 has the full record.

Row 185 is live. The mos-0928 Part A re-pin window (rows 177 and 180-185) passed, and NEW 490e2771d runs for mosaic-stack: activation 20261020T075800Z-490e2771d3d0, pm true, store 3i. This row's change ran in the window. The same-schema W5 activate (3i to 3i) backed up the stopped store to `backups/stack/20261020T075800Z-490e2771d3d0` (STAMP 07:58:00.381Z, SCHEMA 3i, SHA256SUMS 399f7105), and the activate log line names it. Nothing was rolled back, so the restore path did not run live. - STATE report: `agents/darkwing/work/window-rows-177-185/STATE.md`, sha256 b586f11c9b63, pushed in 21aa1cab0. - Transcript W.txt: final sha256 edd4622c5c45. - 7332 request matrix byte-identical before and after (93c07e15); row 178 proof flags unset. - Two stops, both accepted by Mos: the W9 assistant idle stop (mos-0948) and the old chief's end rows in the backup (mos-0950). A per-row check shows no old row changed. Filbert's two non-blocking doc notes from comment 29404 are Vikunja P19 404, Sage's, after the window. Vikunja P19 386 comment 350 has the full record.
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1683