Repository navigation
feat(core): sync crate contracts, FFI sync surface and fakes - #4572
Merged
Merged
Conversation
datlechin
enabled auto-merge (squash)
November 25, 2026 20:20
datlechin
disabled auto-merge
November 25, 2026 20:30
…, legacy unreadable sets
…es (ADR 0064), stricter fakes, Swift 5 mode for the FFI module
datlechin
enabled auto-merge (squash)
November 26, 2026 01:59
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.
Summary
tablepro-sync(core/crates/sync): the contracts the engine, transport and key lanes build against, insrc/api/:TransportandServiceTransport: pull a page, push a batch with one outcome per change, the scopes body, Sign Out's key-device revoke, stop reports, the device row removal, 0051's rejected codes and whole-request refusals, and the DPoP key each call is signed with.CloudKitTransport: 0054's callback, with its records, outcomes and failures.StateStore,StateTxnandStateFiles: a typed row for every 0054 table, sync and key, behind one commit, the primary key encoding the digests order by, and what opening the file found.HostDeviceStore: device keys, account keys, a proposed reset's keys, the state MAC key and the anchor, each item with its class.RecordAdapterandHostSettings.AccountFlows,ApprovalFlows,DeviceFlows,ResetFlows,TeamFlows,RestoreFlows,StopFlows, togetherKeyFlows), andKeyHooksto stop, lock and report.SyncControl: status, passes, providers and moves, approvals, conflicts, held records, the history window.KeyVersionRow.stopped_cause(catch_up,restart_heldorrestore_wait) afterstate; two causes keep the stricter, personal and history rows stop only ascatch_up;clear_stoptakes the event and refuses one the cause does not allow;enddrops the cause.pending_basestable, a held team restart withheld_restartandaccept_restartbound to the compared IK, and its notice.storeskeeps one row per store file (0060).Roster::ofdecides only with theCaughtUpof a pull of that team.LegacyMetadata::for_account(another account imports only dirty keys and standing), category and password switches, a host journal call,RecordAdapterper scope,HeldReason::AwaitingDeviceApproval, pass reasons for the journal, key flows andCKAccountChanged.Rostercarries the scopes body's stop reports intoTeamKeys.stopped.sync.unimplemented.tablepro-sync-testing(core/crates/sync/testing), dev-only fakes, each with tests of its ADR behavior: an in-memory/v2/syncserver, a CloudKit, a device store, a state store and the key flows.LegacyMirror: the Swift engine's metadata (token, dirty and tombstone keys with their dates, deferred deletions, the three unreadable-copy sets, standing,SyncRecordCache), read at launch for the import and written after each pass while the previous stable runs it.core/crates/ffi/src/sync/):Core::open_sync,SyncService,SyncListener, every key-flow call, theCloudKitTransportforeign trait (uniffi::export(with_foreign)), and theHostSettings,HostDeviceStoreandHostLegacyMirrorcallbacks, bridged to the engine's traits. C# bindings regenerated.ErrorInfo.sync: a sync refusal's step-up challenge,Retry-After, rejected change code or lock cause.apple/Packages/TableProFFI: the generated module compiles in Swift 5 mode, since UniFFI 0.31's Swift for an async foreign trait fails Swift 6 (Swift 6 strict concurrency: async foreign-trait codegen emits #SendingClosureRisksDataRace hard error (0.31.2) mozilla/uniffi-rs#2929, fixed in 0.32, which uniffi-bindgen-cs does not support yet). The apps stay in Swift 6.ARCHITECTURE.md, Bindings: the device store's values cross the FFI as plain bytes, listed with the other plain buffers.core/ARCHITECTURE.md,core/AGENTS.mdandcore.yml: the sync crates' rows, graph edges, platform seams, bindings and packages;tablepro-recordsjoins the core.yml check.detect-changed-paths.sh: the Apple suites skip the sync fakes, the key vectors with their script and fuzz targets, and the records' fixtures; the package suites skip the keys' fuzz project.test_the_mac_app_runs_on_the_shortcut_presets_it_bundlesbecomestest_the_apple_apps_run_on_the_shortcut_presets_the_core_they_link_bundlesand expectsiostrue: the iOS app links the core since feat(ios): sign in to a TablePro account through the shared core #4492, and the old expectation fails on main.Test plan
verify.sh --platform windows --jobs 4 core tablepro-syncandcore tablepro-sync-testing: 17 and 88 tests, the fakes' ADR behavior included.verify.sh --platform windows --jobs 4 core:tablepro-ffi, 383 tests, with the CloudKit, device store and legacy mirror bridges and the unfilled-call error.cargo clippy -p tablepro-ffi -p tablepro-sync -p tablepro-sync-testing --tests: clean.verify.sh --platform windows bindings: PASS on the committed C#;build: the interop compiles against it.python3 -m unittest test_detect_changed_pathsinscripts/ci: the new suite cases and the updated shortcut presets case pass.cargo clippy --target aarch64-apple-darwin -p tablepro-ffi --testswith-D warnings: clean.