Repository navigation
fix(vault): a restore settles the reconcile record against the restored bare tables (T13324) - #1982
Merged
Merged
Conversation
… restored bare tables The record of carried bare tables (_exodus_recovery_bare_accounts) is local-only, so a vault pull replaced it with this machine's (usually none) while the twins came from the reconciled device, and the pulled store was refused as a strand. Carry now leaves it out (SNAPSHOT_STATE_TABLES) and, once the bare tables are this machine's, keeps per bare table the record (the snapshot's, else this machine's) that still matches by row count and key digest, dropping one neither matches. It never syncs; bundles already carry it whole. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjjTKbQXyCFdkLBSeuyKLt
…ands' into feat/T13324-carry-bare-accounts
…e-accounts # Conflicts: # packages/core/src/cloud/__tests__/nexus-vault.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task: T13324 (epic T12323). Stacked on #1980 (T13309). It gets no CI until it is retargeted to main once #1980 merges.
Problem
The store records which bare tables a reconcile carried in
_exodus_recovery_bare_accounts(T13320). That table is local-only, and so are the bare legacy tables themselves (tasks,sessions, ...).On a vault pull,
carryMachineStatereplaced the record with this machine's copy, usually none, while the twins came from the reconciled device. A second device pulling a store whose carried twin rows were later deleted was therefore refused as a strand (E_SYNC_LEGACY_ONLY_STORE).Change
SNAPSHOT_STATE_TABLES(table-classification.ts): a new list of local-only tables that record facts about other rows in the same file. Carry skips them, the same way it skips schema-state tables.settleRestoredBareAccounts(sync/flags.ts) runs at the end of carry, after the bare tables have become this machine's. For each bare table it keeps the first record that still matches that table by row count and key digest, checking the snapshot's record first and then this machine's from before the restore. A record that neither side matches is dropped, so those rows are judged again.A correction to the task premise
The task text says the bare tables "travel in the bundle". They do, but they are classified local-only, so carry replaces them with this machine's on a pull and empties them on a new machine. That is why the record is settled against the bare tables as restored, not just kept as the snapshot had it.
Tests
vault-manifest.test.ts:SNAPSHOT_STATE_TABLESentry is local-only and not in the manifest.nexus-vault.test.ts(fake server, two devices):match, and enablessync.capturewithout being refused.enableSyncPush/joinStream) only exists in feat(sync): a restored store joins a journaled stream; two-device sync end to end (T13312) #1967, which is still open. The test enables sync withsetSyncFlag, which is where the strand refusal lives. A JOIN assertion follows once feat(sync): a restored store joins a journaled stream; two-device sync end to end (T13312) #1967 lands.Verification (head 468c2f2)
pnpm run typecheckand build: clean.--base origin/main): OK.🤖 Generated with Claude Code
https://claude.ai/code/session_01VjjTKbQXyCFdkLBSeuyKLt