Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 165bb0c512
ℹ️ 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".
165bb0c to
ba0d0af
Compare
6656ec2 to
0937b17
Compare
ba0d0af to
c960418
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c960418bdf
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f77702c7c
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a45b9528a2
ℹ️ 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".
| if (plan.keep) { | ||
| keepMoveCopy(target.db, plan); | ||
| return 0; |
There was a problem hiding this comment.
Restore live snapshots that match an old-side reassignment clock
If a receiver applies a reassign_scope old-side operation and then receives the boundary copy through a snapshot, both have the same clock because recordScopeReassignment() assigns one clock to both sides. The planner therefore returns keep, and this branch moves the inactive source tombstone into the boundary without restoring its content or active state. The snapshot baseline advances, and subsequent equal-clock arrivals keep the tombstone, leaving the memory unreadable. The fresh evidence beyond the earlier incremental finding is that applyMoveSnapshotItem() still unconditionally takes this branch; the exception added to keepInboundMove() does not cover either snapshot application path. Handle the matching reassignment tombstone before treating the live snapshot as a replay.
Useful? React with 👍 / 👎.

Description
Devices record coordinator Project moves for boundaries they can access, even when they have no local Project mapping. Snapshots and incremental updates can then reconcile the same memory across the old scope and the Project boundary using the stored origin and full clock.
With
sync_boundary_migration=on, a device advertises support to the coordinator, remaps its Projects, and moves the memories it authored. It syncs a private SQLite backup to disk before moving any rows.codemem sync migration statusreports the backup path and size and how many rows still carry the old scope.This prevents duplicate copies when a snapshot or incremental update arrives before or after the device learns about a move. Memories with IDs that were already ambiguous can stay duplicated.
codemem sync duplicateslists them. See the Project move trust model.Type of Change
Testing
852 tests passed in 21 isolated files, including device moves, snapshots and replication, membership proof, backup durability, and migration status.
Four new cases reproduced duplicate growth before the fix. They now match ordinary sync when two copies already exist.
pnpm run tscandpnpm --silent lint:delta -- --base 6656ec22passed.Relevant checks pass locally
Added/updated tests for changes
Manually verified changes work as expected
Checklist