Skip to content

cmux link sync push: a file deleted here but changed on the machine stays a conflict - #28729

Open
teamleaderleo wants to merge 4 commits into
lane/sync-push-keeps-machine-editsfrom
lane/sync-push-keeps-spared-deletes
Open

teamleaderleo wants to merge 4 commits into
lane/sync-push-keeps-machine-editsfrom
lane/sync-push-keeps-spared-deletes

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

HOLD: abandoned with #28675, which it is stacked on. To be closed; do not land.

Stacked on #28675 (base lane/sync-push-keeps-machine-edits; it retargets to feat-cmux-next when that lands).

cmux link sync push: when this Mac deleted a file that the machine changed since the last push, the push leaves the machine's copy in place, as before. It now also keeps the file in the record, so a pull reports the delete here against the edit there as a conflict.

Why

The Codex review of #28675 named this as a follow-up (P1): "A machine-edited file deleted locally is left on the machine but removed from the next manifest... A subsequent pull therefore treats the machine file as new and restores it, silently choosing the machine edit instead of reporting the expected delete-vs-edit conflict." The bug was already on feat-cmux-next; #28675 didn't add it.

What changes

In the delete pass, a file the machine still has but changed since the last push keeps the last push's record entry, and is counted as kept. A file the machine still has as the push left it is deleted, as before. A file missing on both sides drops out of the record, as before. The count uses saturating_add, so the Rust panic ratchet gets no new hit.

Tests

link_sync a_file_deleted_here_but_changed_on_the_machine_stays_a_conflict_after_a_push:

  • after a push, the machine edits notes.txt and this Mac deletes it;
  • a second push leaves the machine's copy (kept: 1);
  • a pull reports notes.txt as a sync_conflict and doesn't bring the file back here.

The test is committed before the fix (4b22f75). The red and green results run on cmux-ci at this head and will be added here.

Observed / Not run

  • Observed: rustfmt is clean with the repo's config.
  • Not run locally: cargo (cmux-tui runs on CI only).

Changelog

Fixed: Bring Back Local reports a file you deleted on this Mac but changed on the Cloud machine as a conflict, instead of bringing the machine's copy back.

Risk: normal. Sync record only; nothing new is deleted.

Agent session: agent session

🤖 Generated with Claude Code

teamleaderleo and others added 4 commits October 31, 2026 01:35
… machine stays a conflict

Red on cf5c99c: the delete pass spares the machine's changed file but drops its record
entry, so a later pull treats it as new and brings it back here with no conflict (Codex
review follow-up on #28675).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-22973a84aab760788504
…s the conflict

The delete pass left a file the machine had changed since the last push, but dropped it
from the next record. A pull then saw it as new on the machine and brought it back here,
quietly choosing the machine's edit over this Mac's delete. The spared file now keeps
the last push's entry (counted as `kept`), and a pull reports the delete against the
edit as a conflict.

Test: link_sync a_file_deleted_here_but_changed_on_the_machine_stays_a_conflict_after_a_push.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-22973a84aab760788504
…it (panic ratchet)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-22973a84aab760788504
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing this one; I own it. It was stacked on #28675, which is closed (the reason is there). The case it covers stays as it is on feat-cmux-next: a file deleted on this Mac that the machine changed is left on the machine but dropped from the record, and a later pull brings it back. Changing that is part of the same sync-semantics question; it's noted on #28675 and with #28111's owner.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — fa0c31bf Deployed Oct 31, 2026 by teamleaderleo via cmux-tui tree preflight #86500
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