Skip to content

fix(sync): remove replica vectors after remote tombstones - #5647

Merged
thedotmack merged 4 commits into
thedotmack:mainfrom
Afloat16:afloat/20261110-sync-tombstone-vector-cleanup
Nov 9, 2026
Merged

thedotmack merged 4 commits into
thedotmack:mainfrom
Afloat16:afloat/20261110-sync-tombstone-vector-cleanup

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Remote canonical tombstones delete replica SQLite rows but never delete their Chroma fragments. Backfill only visits existing SQLite rows, so deleted content stays indexed indefinitely and consumes semantic-search candidates. Origin IDs cannot identify replica vector rows.

Change

Capture the replica local row ID inside the tombstone transaction, then schedule the existing best-effort vector cleanup after commit, behind earlier same-row forwards. Extract the local-delete cleanup lane so local API deletes and replicated tombstones share one process-wide serial cleanup path. No new replay or inference work.

Validation

  • Regression tests fail against the unchanged upstream implementation and pass with this correction.
  • The focused native Bun test selection, root and viewer TypeScript checks, and the complete production build pass.
  • Runtime artifacts are generated and compared against a baseline built with the same dependencies; only artifacts changed by this correction are included.
  • Native verification; final branch head: e5346179badbd8534e2983159d7be5684c4f7a44.

@thedotmack
thedotmack merged commit d58a11d into thedotmack:main Nov 9, 2026
13 of 16 checks passed
@thedotmack

Copy link
Copy Markdown
Owner

Merged, thank you @Afloat16! A pulled tombstone now also removes the deleted memory's vectors, so deleted content stops showing up as semantic-search candidates. Sharing one serial cleanup lane with local deletes is a nice consolidation. I merged main and dropped the generated bundles.

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.

2 participants