Skip to content

🤖 fix: restore settings backups from the legacy mux/ managed path - #3958

Merged
ibetitsmike merged 5 commits into
mainfrom
mike/backup-legacy-mux-path
Aug 25, 2026
Merged

🤖 fix: restore settings backups from the legacy mux/ managed path#3958
ibetitsmike merged 5 commits into
mainfrom
mike/backup-legacy-mux-path

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Settings backups pushed before the product rename live under the legacy mux/ managed path, so a fresh Xum install pointed at the same repository failed with No Xum backup found in 'xum/' on this branch. The backup cache now selects one effective managed path per prepare: the configured spelling, or its legacy mux spelling when only that tree carries a backup manifest. Reads and writes follow the selection, so pre-rename backups restore correctly and pushes update them in place instead of forking a second xum/ copy.

Background

The Backup settings default managed path moved mux/xum/ across the rename, but the backup cache only ever materialized (sparse checkout), validated, and read the configured directory. Rename compatibility is centralized in src/common/compat/legacyMux.ts, so the alias lives there rather than as a scattered fallback.

Implementation

  • legacyMux.ts: listBackupManagedPathSpellings() returns the configured spelling first, then the legacy spelling produced by replacing whole xum path segments with mux (substrings like xum-settings are untouched).
  • gitRepo.ts: before checkout, resolveEffectiveManagedPath probes the fetched commit for <spelling>/manifest.json with a bounded, non-recursive ls-tree that requires the entry to be a blob (a directory spelled like the manifest is rejected). Only the selected tree is validated, sparse-checked-out, staged, and diffed — junk under the unselected spelling can never block or bloat the backup in use.
  • The selection is exposed as PreparedBackupRepository.managedPath; BackupService addresses every payload operation (export, preview, validate, restore) to it. The payload store itself stays single-path.
  • The missing-backup error now names the legacy spelling that was also considered.

Validation

New tests:

  • adapters: select + restore a mux/-era backup via xum/ config; push updates mux/ in place (no xum/ fork); configured xum/ wins when both spellings hold backups; canonical junk (gitlink + directory manifest.json) doesn't block selecting a valid legacy backup.
  • service unit: every payload call follows the prepared repository's managed path, not the configured settings path.
  • service integration: full push(mux-era) → restore(xum settings) → re-push round trip against a real bare repo.

Pre-existing local failures unrelated to this change (case-insensitive APFS + a SIGTERM-flaky 200-commit transfer test) fail identically on the base commit.

Risks

Low-moderate: the managed-path selection sits in the cache-materialization path all backup operations share. If selection ever picked the wrong spelling, pushes would write to that spelling — mitigated by the blob-manifest probe, configured-path precedence, and the in-place-push/no-fork tests. Behavior for repositories without any legacy spelling is unchanged (selection short-circuits to the configured path).


Generated with xum • Model: coder:anthropic-wif/claude-fable-5 • Thinking: xhigh

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba2419e356

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/gitRepo.ts Outdated
@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eab04e86ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/gitRepo.ts Outdated
Comment thread src/node/services/backup/gitRepo.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f810f54e77

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/gitRepo.ts Outdated
@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d55ae1498

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/gitRepo.ts
Comment thread src/node/services/backup/gitRepo.ts Outdated
@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

Round summary: the probe read is now capped at the per-file payload limit (streaming kill, no re-fetch on over-limit). The "fall back on deep payload corruption" suggestion is resolved as by-design — a parseable Xum manifest under the configured path is the user's current backup, and silently restoring the stale pre-rename snapshot would mask corruption; the actionable INVALID_BACKUP error is the intended contract.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 06b9943f1f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike
ibetitsmike added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit a39cdd9 Aug 25, 2026
19 of 20 checks passed
@ibetitsmike
ibetitsmike deleted the mike/backup-legacy-mux-path branch August 25, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant