From 7bd3cb46db894a7da332dcbaa6daf5ebbb4f2e15 Mon Sep 17 00:00:00 2001 From: Joshua Pruitt <50942+photuris@users.noreply.github.com> Date: Mon, 30 Nov 2026 20:11:16 -0600 Subject: [PATCH 1/2] Run migrations again when a snapshot restore rolled them back --- bin/omarchy-migrate | 54 ++++++++- default/i18n/en/cli.json | 1 + test/shell.d/migrate-scope-test.sh | 180 ++++++++++++++++++++++++++++- 3 files changed, 231 insertions(+), 4 deletions(-) diff --git a/bin/omarchy-migrate b/bin/omarchy-migrate index 9e36030a6f7a..7a1680d1b17e 100755 --- a/bin/omarchy-migrate +++ b/bin/omarchy-migrate @@ -32,6 +32,38 @@ OMARCHY_PATH="${OMARCHY_PATH:-/usr/share/omarchy}" STATE_DIR="${OMARCHY_MIGRATION_STATE:-$HOME/.local/state/omarchy/migrations}" MIGRATIONS_DIR="$OMARCHY_PATH/migrations" +# Markers live in $HOME, which a snapshot restore leaves alone, while much of +# what migrations change is on the root filesystem and goes back with it. So a +# completed migration also gets a record on the root filesystem, and a receipt +# next to the markers saying that record was written on this machine. A receipt +# whose record is gone means the root filesystem was restored to a point before +# the migration ran, so the migration is pending again. Markers without a +# receipt (older runs, another machine's home) are trusted as before. +RECORDS_DIR="${OMARCHY_MIGRATION_RECORDS:-/var/lib/omarchy/migration-records/$UID}" +machine_id="" +IFS= read -r machine_id 2>/dev/null <"${OMARCHY_MIGRATION_MACHINE_ID:-/etc/machine-id}" || true +[[ $machine_id =~ ^[0-9a-f]{32}$ ]] || machine_id="" +RECEIPTS_DIR="$STATE_DIR-receipts/$machine_id" + +rolled_back() { + [[ -n $machine_id && -f $RECEIPTS_DIR/$1 && ! -f $RECORDS_DIR/$1 ]] +} + +# The records directory is on the root filesystem but owned by the user, so it +# takes root once to create and nothing after that. Only a run that inherited +# the update lock creates it, which is what omarchy update gives it along with +# its authorization, and sudo -n never asks. Any other run records when the +# directory is there and otherwise goes on without, which leaves its markers +# trusted as before. +record_on_root() { + [[ -n $machine_id ]] || return 1 + if [[ ! -d $RECORDS_DIR ]]; then + omarchy-update-lock held 2>/dev/null || return 1 + sudo -n install -d -m 755 -o "$UID" "$RECORDS_DIR" 2>/dev/null || return 1 + fi + touch "$RECORDS_DIR/$1" 2>/dev/null && [[ -f $RECORDS_DIR/$1 ]] +} + migration_entries() { [[ -d $MIGRATIONS_DIR ]] || return 0 @@ -49,7 +81,7 @@ pending_migrations() { while IFS=$'\t' read -r name file marker; do [[ -n $name ]] || continue - if [[ ! -f $marker ]]; then + if [[ ! -f $marker ]] || rolled_back "$name"; then printf '%s\n' "$name" fi done < <(migration_entries) @@ -89,8 +121,17 @@ deferred=0 while IFS=$'\t' read -r name file marker <&3; do [[ -n $name ]] || continue - if [[ ! -f $marker ]]; then - echo -e "\e[32m\n$(omarchy-i18n update.migration "${name%.sh}")\e[0m" + again=0 + if [[ -f $marker ]] && rolled_back "$name"; then + again=1 + fi + + if [[ ! -f $marker ]] || (( again )); then + if (( again )); then + echo -e "\e[32m\n$(omarchy-i18n update.migrationAgain "${name%.sh}")\e[0m" + else + echo -e "\e[32m\n$(omarchy-i18n update.migration "${name%.sh}")\e[0m" + fi status=0 OMARCHY_PATH="$OMARCHY_PATH" bash -euo pipefail "$file" 3<&- || status=$? @@ -106,6 +147,13 @@ while IFS=$'\t' read -r name file marker <&3; do fi mkdir -p "$(dirname "$marker")" + # Receipts are best effort: one that cannot be written only loses the + # rerun after a restore, and must not fail a migration that succeeded. + if record_on_root "$name"; then + { mkdir -p "$RECEIPTS_DIR" && touch "$RECEIPTS_DIR/$name"; } 2>/dev/null || true + elif [[ -n $machine_id ]]; then + rm -f "$RECEIPTS_DIR/$name" 2>/dev/null || true + fi touch "$marker" fi done 3< <(migration_entries) diff --git a/default/i18n/en/cli.json b/default/i18n/en/cli.json index 867f0dabcfbe..6447331c4e1e 100644 --- a/default/i18n/en/cli.json +++ b/default/i18n/en/cli.json @@ -488,6 +488,7 @@ "update.migrationsWaiting": "Waiting for pacman transaction to finish before running Omarchy migrations...", "update.migrationsDeferred": "Pacman transaction is still running; Omarchy migrations will retry on next login.", "update.migration": "Running migration (%1)", + "update.migrationAgain": "Running migration again after a snapshot restore (%1)", "update.migrationDeferred": "Migration %1 is waiting for a package update; it and the migrations after it will run on the next update or login.", "update.orphans": "Orphan system packages", "update.orphansFound": { diff --git a/test/shell.d/migrate-scope-test.sh b/test/shell.d/migrate-scope-test.sh index d46adfe29a63..4b26341f2d69 100644 --- a/test/shell.d/migrate-scope-test.sh +++ b/test/shell.d/migrate-scope-test.sh @@ -16,7 +16,21 @@ cat >"$stub_bin/omarchy-notification-dismiss" <<'SH' #!/bin/bash printf '%s\n' "$1" >>"$TEST_DISMISSALS" SH -chmod +x "$stub_bin/omarchy-notification-dismiss" +cat >"$stub_bin/sudo" <<'SH' +#!/bin/bash +printf '%s\n' "$*" >>"$TEST_SUDO_LOG" +[[ ${TEST_SUDO:-fail} == "create" ]] || exit 1 +mkdir -p "${*: -1}" +SH +cat >"$stub_bin/omarchy-update-lock" <<'SH' +#!/bin/bash +printf '%s\n' "$*" >>"$TEST_LOCK_LOG" +[[ ${1:-} == "held" && ${TEST_UPDATE:-0} == "1" ]] +SH +chmod +x "$stub_bin"/* + +default_machine_id="0123456789abcdef0123456789abcdef" +printf '%s\n' "$default_machine_id" >"$test_tmp/machine-id" cat >"$test_root/migrations/100-first.sh" <<'SH' [[ $OMARCHY_PATH == "$TEST_EXPECTED_OMARCHY_PATH" ]] @@ -29,6 +43,10 @@ SH calls="$test_tmp/calls" dismissals="$test_tmp/dismissals" +sudo_log="$test_tmp/sudo.log" +lock_log="$test_tmp/lock.log" +: >"$sudo_log" +: >"$lock_log" # $1 is HOME, $2 is OMARCHY_PATH; the rest are omarchy-migrate's arguments. run_migrate() { @@ -37,9 +55,15 @@ run_migrate() { HOME="$home" \ OMARCHY_PATH="$root" \ PATH="$stub_bin:$ROOT/bin:$PATH" \ + OMARCHY_MIGRATION_RECORDS="${TEST_RECORDS:-$test_tmp/records}" \ + OMARCHY_MIGRATION_MACHINE_ID="${TEST_MACHINE_ID:-$test_tmp/machine-id}" \ TEST_EXPECTED_OMARCHY_PATH="$root" \ TEST_CALLS="${TEST_CALLS:-$calls}" \ TEST_DISMISSALS="$dismissals" \ + TEST_SUDO_LOG="$sudo_log" \ + TEST_LOCK_LOG="$lock_log" \ + TEST_SUDO="${TEST_SUDO:-fail}" \ + TEST_UPDATE="${TEST_UPDATE:-0}" \ "$ROOT/bin/omarchy-migrate" "$@" } @@ -136,3 +160,157 @@ grep -q '^after-reader$' "$stdin_calls" || -f $stdin_home/.local/state/omarchy/migrations/200-after.sh ]] || fail "migration runner marks both stdin-isolated migrations complete" pass "migration queue uses a private file descriptor instead of migration stdin" + +# 1. Rerun exactly the migrations a root restore rolled back. +rollback_home="$test_tmp/rollback-home" +rollback_records="$test_tmp/rollback-records" +rollback_calls="$test_tmp/rollback-calls" +rollback_receipts="$rollback_home/.local/state/omarchy/migrations-receipts/$default_machine_id" +mkdir -p "$rollback_home" "$rollback_records" + +TEST_CALLS="$rollback_calls" TEST_RECORDS="$rollback_records" \ + run_migrate "$rollback_home" "$test_root" >"$test_tmp/rollback-initial.out" +for name in 100-first.sh 200-second.sh; do + [[ -f $rollback_records/$name ]] || fail "migration runner writes root record for $name" + [[ -f $rollback_receipts/$name ]] || fail "migration runner writes receipt for $name" +done +! grep -q 'update\.migrationAgain' "$test_tmp/rollback-initial.out" || + fail "initial migration run does not announce a restore rerun" + +rm "$rollback_records/200-second.sh" +if ! TEST_RECORDS="$rollback_records" run_migrate "$rollback_home" "$test_root" --pending >"$test_tmp/rollback-pending1.out"; then + fail "migration runner reports a rolled-back migration as pending" +fi +[[ $(cat "$test_tmp/rollback-pending1.out") == "200-second.sh" ]] || + fail "migration runner lists only the rolled-back migration as pending" "$(cat "$test_tmp/rollback-pending1.out")" + +: >"$lock_log" +rollback_snapshot=$(find "$rollback_home" "$rollback_records" -printf '%p %s %T@\n' | sort) +if ! TEST_RECORDS="$rollback_records" run_migrate "$rollback_home" "$test_root" --pending >"$test_tmp/rollback-pending2.out"; then + fail "repeated --pending still reports the rolled-back migration" +fi +[[ $(cat "$test_tmp/rollback-pending2.out") == "200-second.sh" ]] || + fail "repeated --pending still lists only the rolled-back migration" "$(cat "$test_tmp/rollback-pending2.out")" +[[ ! -s $lock_log ]] || fail "--pending never queries omarchy-update-lock" "$(cat "$lock_log")" +[[ $(find "$rollback_home" "$rollback_records" -printf '%p %s %T@\n' | sort) == "$rollback_snapshot" ]] || + fail "--pending creates or modifies no files" + +TEST_CALLS="$rollback_calls" TEST_RECORDS="$rollback_records" \ + run_migrate "$rollback_home" "$test_root" >"$test_tmp/rollback-rerun.out" +[[ $(cat "$rollback_calls") == $'first\nsecond\nsecond' ]] || + fail "migration runner reruns only the rolled-back migration" "$(cat "$rollback_calls")" +(( $(grep -o 'update\.migrationAgain' "$test_tmp/rollback-rerun.out" | wc -l) == 1 )) || + fail "migration runner announces a rolled-back rerun once" "$(cat "$test_tmp/rollback-rerun.out")" +[[ -f $rollback_records/200-second.sh ]] || fail "rerun recreates the missing root record" +if TEST_RECORDS="$rollback_records" run_migrate "$rollback_home" "$test_root" --pending >"$test_tmp/rollback-after.out"; then + fail "no migration stays pending after rerun" "$(cat "$test_tmp/rollback-after.out")" +fi + +rm "$rollback_home/.local/state/omarchy/migrations/100-first.sh" "$rollback_records/100-first.sh" +TEST_CALLS="$rollback_calls" TEST_RECORDS="$rollback_records" \ + run_migrate "$rollback_home" "$test_root" >"$test_tmp/rollback-unmarked.out" +grep -q 'update\.migration' "$test_tmp/rollback-unmarked.out" || + fail "unmarked rolled-back migration uses the normal announcement" "$(cat "$test_tmp/rollback-unmarked.out")" +! grep -q 'update\.migrationAgain' "$test_tmp/rollback-unmarked.out" || + fail "unmarked rolled-back migration is not announced as a restore rerun" "$(cat "$test_tmp/rollback-unmarked.out")" +[[ $(cat "$rollback_calls") == $'first\nsecond\nsecond\nfirst' ]] || + fail "unmarked rolled-back migration runs once" "$(cat "$rollback_calls")" +pass "migration runner reruns exactly the migrations a root restore rolled back" + +# 2. Trust markers that have no receipt. +noreceipt_home="$test_tmp/noreceipt-home" +noreceipt_records="$test_tmp/noreceipt-records" +noreceipt_calls="$test_tmp/noreceipt-calls" +mkdir -p "$noreceipt_home/.local/state/omarchy/migrations" "$noreceipt_records" +touch "$noreceipt_home/.local/state/omarchy/migrations/100-first.sh" \ + "$noreceipt_home/.local/state/omarchy/migrations/200-second.sh" + +if TEST_RECORDS="$noreceipt_records" run_migrate "$noreceipt_home" "$test_root" --pending >"$test_tmp/noreceipt-pending.out"; then + fail "markers without receipts are not pending" "$(cat "$test_tmp/noreceipt-pending.out")" +fi +[[ ! -s $test_tmp/noreceipt-pending.out ]] || + fail "--pending prints nothing for markers without receipts" "$(cat "$test_tmp/noreceipt-pending.out")" +TEST_CALLS="$noreceipt_calls" TEST_RECORDS="$noreceipt_records" \ + run_migrate "$noreceipt_home" "$test_root" >"$test_tmp/noreceipt-run.out" +[[ ! -e $noreceipt_calls ]] || fail "markers without receipts do not rerun" "$(cat "$noreceipt_calls")" +pass "migration runner trusts markers that have no receipt" + +# 3. Ignore receipts written on another machine. +other_machine_home="$test_tmp/other-machine-home" +other_machine_records="$test_tmp/other-machine-records" +other_machine_calls="$test_tmp/other-machine-calls" +other_machine_id="$test_tmp/other-machine-id" +mkdir -p "$other_machine_home" "$other_machine_records" +printf 'fedcba9876543210fedcba9876543210\n' >"$other_machine_id" + +TEST_CALLS="$other_machine_calls" TEST_RECORDS="$other_machine_records" \ + run_migrate "$other_machine_home" "$test_root" >"$test_tmp/other-machine-run.out" +rm -rf "$other_machine_records" + +if TEST_RECORDS="$other_machine_records" TEST_MACHINE_ID="$other_machine_id" \ + run_migrate "$other_machine_home" "$test_root" --pending >"$test_tmp/other-machine-pending.out"; then + fail "receipts from another machine do not trigger pending" "$(cat "$test_tmp/other-machine-pending.out")" +fi +if ! TEST_RECORDS="$other_machine_records" \ + run_migrate "$other_machine_home" "$test_root" --pending >"$test_tmp/same-machine-pending.out"; then + fail "receipts from the same machine trigger pending when records are gone" +fi +[[ $(cat "$test_tmp/same-machine-pending.out") == $'100-first.sh\n200-second.sh' ]] || + fail "same machine lists both receipted migrations as pending" "$(cat "$test_tmp/same-machine-pending.out")" +pass "migration runner ignores receipts written on another machine" + +# 4. Ask sudo for the records directory only inside an update. +sudo_outside_home="$test_tmp/sudo-outside-home" +sudo_outside_records="$test_tmp/sudo-outside-records" +sudo_outside_calls="$test_tmp/sudo-outside-calls" +mkdir -p "$sudo_outside_home" +: >"$sudo_log" + +TEST_CALLS="$sudo_outside_calls" TEST_RECORDS="$sudo_outside_records" TEST_SUDO=create \ + run_migrate "$sudo_outside_home" "$test_root" >"$test_tmp/sudo-outside.out" +[[ ! -s $sudo_log ]] || fail "runner does not call sudo outside an update" "$(cat "$sudo_log")" +[[ ! -e $sudo_outside_records ]] || fail "records directory is not created outside an update" +[[ -f $sudo_outside_home/.local/state/omarchy/migrations/100-first.sh && + -f $sudo_outside_home/.local/state/omarchy/migrations/200-second.sh ]] || + fail "markers are still written outside an update" +[[ ! -e $sudo_outside_home/.local/state/omarchy/migrations-receipts ]] || + fail "receipts directory is not created when records cannot be written outside an update" + +sudo_inside_home="$test_tmp/sudo-inside-home" +sudo_inside_records="$test_tmp/sudo-inside-records" +sudo_inside_calls="$test_tmp/sudo-inside-calls" +sudo_inside_receipts="$sudo_inside_home/.local/state/omarchy/migrations-receipts/$default_machine_id" +mkdir -p "$sudo_inside_home" + +TEST_CALLS="$sudo_inside_calls" TEST_RECORDS="$sudo_inside_records" TEST_SUDO=create TEST_UPDATE=1 \ + run_migrate "$sudo_inside_home" "$test_root" >"$test_tmp/sudo-inside.out" +[[ $(cat "$sudo_log") == "-n install -d -m 755 -o $UID $sudo_inside_records" ]] || + fail "runner calls sudo -n install once for the records directory inside an update" "$(cat "$sudo_log")" +for name in 100-first.sh 200-second.sh; do + [[ -f $sudo_inside_records/$name ]] || fail "root record written for $name inside an update" + [[ -f $sudo_inside_receipts/$name ]] || fail "receipt written for $name inside an update" +done +pass "migration runner asks sudo for the records directory only inside an update" + +# 5. Fall back to plain markers when recording fails. +fallback_home="$test_tmp/fallback-home" +fallback_records="$test_tmp/fallback-records" +fallback_calls="$test_tmp/fallback-calls" +fallback_receipts="$fallback_home/.local/state/omarchy/migrations-receipts/$default_machine_id" +mkdir -p "$fallback_home" "$fallback_records" + +TEST_CALLS="$fallback_calls" TEST_RECORDS="$fallback_records" \ + run_migrate "$fallback_home" "$test_root" >"$test_tmp/fallback-initial.out" +rm -rf "$fallback_records" + +TEST_CALLS="$fallback_calls" TEST_RECORDS="$fallback_records" TEST_UPDATE=1 \ + run_migrate "$fallback_home" "$test_root" >"$test_tmp/fallback-rerun.out" +[[ $(cat "$fallback_calls") == $'first\nsecond\nfirst\nsecond' ]] || + fail "fallback rerun executes both rolled-back migrations" "$(cat "$fallback_calls")" +[[ ! -e $fallback_receipts/100-first.sh && ! -e $fallback_receipts/200-second.sh ]] || + fail "fallback removes stale receipts when recording fails" +[[ ! -e $fallback_records ]] || fail "records directory stays absent when sudo fails" +if TEST_RECORDS="$fallback_records" run_migrate "$fallback_home" "$test_root" --pending >"$test_tmp/fallback-pending.out"; then + fail "fallback leaves nothing pending after clearing stale receipts" "$(cat "$test_tmp/fallback-pending.out")" +fi +pass "migration runner falls back to plain markers when it cannot record" From a6400806e08d4adbb21625c55e29475646334f8d Mon Sep 17 00:00:00 2001 From: Joshua Pruitt <50942+photuris@users.noreply.github.com> Date: Mon, 30 Nov 2026 20:19:05 -0600 Subject: [PATCH 2/2] Document migration records and the rerun after a snapshot restore --- agents/skills/migrations.md | 17 +++++++++++++++++ docs/update-process.md | 4 ++++ manual/47-system-snapshots.md | 4 +++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/agents/skills/migrations.md b/agents/skills/migrations.md index cb1ad128876e..63dbd1a1c8cf 100644 --- a/agents/skills/migrations.md +++ b/agents/skills/migrations.md @@ -31,6 +31,17 @@ prompt themselves. Migrations must be idempotent: if one user already applied a machine-wide repair, the same migration running for another user should detect that and no-op. +The marker is in the home directory, which a snapshot restore of the root filesystem leaves alone, while much of what migrations change goes back with the root. So the runner keeps two more empty files for each migration it completes: + +```text +/var/lib/omarchy/migration-records// (root record, on the root filesystem) +~/.local/state/omarchy/migrations-receipts// (receipt: a root record was written on this machine) +``` + +A migration whose receipt for this machine is there while its root record is gone has been rolled back: the root filesystem was restored to a point before it ran. It is pending again, `omarchy-migrate --pending` lists it, and the next run announces it as running again after a snapshot restore. A marker without a receipt is trusted as before, which covers every marker written before the records existed, the markers seeded from `/etc/skel`, and a home directory carried to another machine or a reinstall. + +The records directory belongs to the user but sits under root-owned directories, so creating it takes root once. The runner creates it only in a process that inherited the update lock, which is what `omarchy update` gives it along with its sudo authorization, and it uses `sudo -n`, so it never asks for a password. Any other run writes records when the directory is there and otherwise completes without them. Records and receipts are best effort: failing to write one never fails a migration, it only means a later restore will not be noticed for that migration. This is one more reason migrations must be idempotent: a rolled-back migration runs a second time against a home directory that already has its changes. + ## When migrations run ### During `omarchy update` @@ -165,6 +176,12 @@ rm ~/.local/state/omarchy/migrations/.sh omarchy-migrate ``` +To accept a rolled-back migration as done without running it again, remove its receipt and leave its marker: + +```bash +rm ~/.local/state/omarchy/migrations-receipts/"$(cat /etc/machine-id)"/.sh +``` + Don't add a test for a migration under `test/`. It runs once per machine and is frozen once it ships, so the test stops guarding anything. If a migration needs logic worth testing, put that logic in a `bin/` command the migration calls and test the command. Tests of `omarchy-migrate`, the login notifier, and `omarchy-upgrade-to-quattro` stay. Omarchy 4.0 is upgraded through `bin/omarchy-upgrade-to-quattro`, not through the diff --git a/docs/update-process.md b/docs/update-process.md index f1fe7b6bebc4..bfbaa098fbd2 100644 --- a/docs/update-process.md +++ b/docs/update-process.md @@ -26,6 +26,8 @@ The design goal is: | `/tmp/omarchy-update.log` | user | Transcript of `omarchy update`, used by `omarchy-update-analyze-logs`. | | `~/.local/state/omarchy/current/` | user | Generated active theme, selected theme name, and current background symlink. | | `~/.local/state/omarchy/migrations/` | user | Per-user migration markers. | +| `~/.local/state/omarchy/migrations-receipts//` | user | Per-user receipts: a root record was written for this migration on this machine. | +| `/var/lib/omarchy/migration-records//` | user | Root records of completed migrations, on the root filesystem so a snapshot restore takes them back. Created with `sudo -n` by a migration run that inherited the update lock. | | `~/.local/state/omarchy/reboot-required` | user | Optional reboot marker checked by `omarchy-update-restart`. | | `~/.local/state/omarchy/restart-*-required` | user | Optional service/app restart markers checked by `omarchy-update-restart`. The shell needs no marker: it is restarted unconditionally after every update. | @@ -57,6 +59,8 @@ privileged work should invoke the appropriate helper or privilege prompt. Migrations must be idempotent; if one user already applied a machine-wide repair, the migration should no-op for other users. +A snapshot restore of the root filesystem leaves those markers in place, so the runner also keeps a root record of each completed migration and a receipt for it in the home directory. A migration whose receipt is there while its root record is gone was rolled back by a restore and runs again; [`migrations.md`](../agents/skills/migrations.md) has the paths and the rules. + When invoked by the update, migrations share its single sudo authorization. The standalone migration runner has its own security changes in the migration-boundary PR; this update change does not establish that standalone boundary. Historical migrations remain strictly ordered. For watchers and diagnostics, `omarchy-migrate --pending` prints pending diff --git a/manual/47-system-snapshots.md b/manual/47-system-snapshots.md index 6565fbee9833..f73297868e88 100644 --- a/manual/47-system-snapshots.md +++ b/manual/47-system-snapshots.md @@ -34,4 +34,6 @@ A restore brings back your root filesystem, but not your `/home`. So it works fo This also means that your `~/.config` directory is kept as-is. So if you're rolling back to an earlier version of a library or application that stores configuration files in a new format, you'll have to sort that out manually. -The same goes for Omarchy's own record of which migrations have already run: it lives in your home directory, so it survives the restore. Migrations that ran after the snapshot was taken stay marked as done, even though the changes they made to the root filesystem have been rolled back, and the next `omarchy update` won't run them again. So if you update again after a restore and something an earlier update had set up is still missing, that's the likely reason. +The same goes for Omarchy's own list of which migrations have already run: it lives in your home directory, so it survives the restore. To notice that, Omarchy also keeps a record on the root filesystem of the migrations run during `omarchy update`, and a note in your home directory that it did. When a restore takes the record away and the note is still there, that migration runs again at the next `omarchy update` or `omarchy-migrate`, and says it is running again after a snapshot restore. + +This does not cover a migration for which Omarchy could not write both the record and the note: one run by an older version of Omarchy, one run by hand before the first update with this feature, or one where the write failed. Those stay marked as done, even though the changes they made to the root filesystem have been rolled back. So if you update again after a restore and something an earlier update had set up is still missing, that's the likely reason.