Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Add the changelog fragment and upgrade notice for folding moved pages (GST-2584)

garrytan3877b651c78d
diff --git a/behavior-changes.d/moved_pages_fold_gst2584.md b/behavior-changes.d/moved_pages_fold_gst2584.md
new file mode 100644
index 0000000000..55b416f8a0
--- /dev/null
+++ b/behavior-changes.d/moved_pages_fold_gst2584.md
@@ -0,0 +1 @@
+gbrain repair file-drift --held no longer offers a delete or a recreate for a page whose file moved while its deletion was held: it lists the page as moved_to <slug> with the new gbrain repair moved-pages --source <id> --slug <old-slug> fold command, and --prefer file skips it. A file that names the page type gbrain-base 1.0.0 gave its path, equal to the type copy an older gbrain stored in the page's frontmatter, now keeps the type a later schema pack gave the page on import, and the import records the rename as a legacy_type retype stamp; before, the next edit read the old type back into the page.
diff --git a/changelog.d/capy-fold-moved-pages.md b/changelog.d/capy-fold-moved-pages.md
new file mode 100644
index 0000000000..517f4ffd6c
--- /dev/null
+++ b/changelog.d/capy-fold-moved-pages.md
@@ -0,0 +1,9 @@
+### A page left behind when its file moved can be folded into the moved page
+
+**`gbrain repair moved-pages` folds a page whose file moved into the page the moved file imported as (GST-2584).** When a file moved while sync held the old page's deletion (`file_gone`), the new path imported as a fresh page and the old page stayed at its old slug with its links, facts, timeline and saved versions. Neither side of `gbrain repair file-drift` was right for it: `--prefer file` dropped what only the old page held, and `--prefer database` wrote a stale copy of the file back.
+- The new repair pairs the two pages only on proof read from Git. The old path's last committed content must be what one new path took in the commit that deleted it, or the content of that path's first commit, made between the old file's add and its deletion. The old page must still hold exactly that content, so later edits to the moved file don't matter, and a page edited in the database after the move stays held as `both_changed`. A frontmatter `id` alone never pairs two pages, and the file name only explains why nothing matched.
+- The preview lists every page whose file is gone, with a reason when it is kept: several candidates, another old page claiming the same moved page, segmented storage, a difference in who may read the two pages, a database edit after the move, or a history too shallow to read. `--apply --expect <hash> --yes` folds exactly the previewed pairs with destructive consent. Each pair's proof and both pages are re-checked under their page keys, including that the old file is still gone. The fold moves the old page's links, relationship dates, timeline, raw data, attachments, user tags, aliases, facts and saved versions to the moved page, makes the old slug an alias, clears the hold and soft-deletes the old page, which `gbrain restore` brings back within 72 hours. No file is written. A brain without a repository has nothing to fold, and the preview says so.
+- `gbrain repair file-drift --held` now lists such a page as `moved_to <slug>` and prints the fold command instead of a recreate or a delete. The `file_gone` hold says when the page simply has no import record, instead of naming a database edit.
+- A file that still names the type gbrain-base 1.0.0 gave its path, equal to the copy an older gbrain stored, is no longer counted as a database edit when a later pack retyped the page. The import keeps the retyped type and records the rename as a `legacy_type` retype stamp, so later edits keep it too.
+
+<!-- behavior-change: moved_pages_fold_gst2584 -->