Files

4.3 KiB

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.