Repository navigation
feat(macos): store slices 1b and 2 on the core store models - #4589
Merged
Merged
Conversation
…wrote and deleted (ADR 0060)
…ade probe runs under bash
…the verified mirror
…d read a failed rebuild again
…no wait before them (#4601)
…ead, and rebuild takes over unreadable files (#4617)
…s-core-library-slice-2
…rusted files, on the shared core
… a connection save rebuilds it
…te and tags it again
… with the Swift engine
…ds keep what a trusted read held
…eeps unread favourites and newly held connections
…urite stay in the previous stable's stores
datlechin
marked this pull request as ready for review
November 26, 2026 18:31
datlechin
added a commit
that referenced
this pull request
Nov 26, 2026
datlechin
added a commit
that referenced
this pull request
Nov 26, 2026
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
Mac stores chain, lane M2 (core ADR 0010 slices 1b and 2), on
integ/mac-enginewithmainmerged in (#4590, #4608, #4611, #4617).ConnectionStoreatApplication Support/TablePro/Core/connections.json: every connection field, groups, each connection's group and place, tags, and the favourites with their order.CoreLibraryStorereads it once throughlibrary_contentsand writes it whole throughreplace_library.CoreStoreHost.shared, the one core overTablePro/Corethe sync engine andhistory.dbuse. Its secret store isCoreStoreSecrets: the account's items asKeychainHostSecretskeeps them, and each connection's secrets throughConnectionKeychainSecrets. The Local only ids sit behind a shared lock the library sets on every read and write.ConnectionStorage,GroupStorage,TagStorageandConnectionListPreferences.favoritesOrderkeep their synchronous main-actor API over that one in-memory library.GroupStorage,TagStorageandConnectionListPreferencestake theConnectionStoragethey share instead of a defaults suite.LibraryRecordMappingmapsDatabaseConnection,ConnectionGroupandConnectionTagto the core's records and back:queryTimeoutSecondsgoes toquery_timeout_secs;DatabaseConnection.initreads them.rebuild_libraryrebuilds the file from what the Mac holds when a person saves over an untrusted store, when an untagged core file loses to the verified mirror, and when the core reports a damaged file (document_corrupt,document_missing_version,document_unreadable). A newer build's file is never moved or written over.removing.LegacyLibraryMirror):connections.json(with its tag and backup),com.TablePro.groups,com.TablePro.tagsand the favourites order in the previous stable's formats.connections.jsonexisted, and whether the core is ahead.connections.jsonbeyond what the core's store is trusted for..untrusted-<time>, one an unverified edit ofconnections.jsonreplaces as.replaced-<time>, a damaged one as the core's.corrupt-<seconds>. A save that moves secrets out removes them and the core's pre-upgrade copies.ConnectionKeychainSecretsis theHostSecretsover the Keychain items earlier builds read (database password, SSH password, key passphrase), device-only for Local only connections. It refuses every call until the library has read, since no scope is known before. A connection the core deletes for another device's deletion loses only its device-only items.connections.json's copies of connections the core holds unread, and their places in the favourites order.mainintointeg/mac-engine:SyncHostJournalcalls and feat(macos): saved queries and history on the core stores #4611'sCoreMirrorpushes. The Swift remote-apply paths stay gone with the Swift engine, and so does the saved queries store's stop guard (unlessStopped), which only they used.CoreHistoryDatabaseopens onCoreStoreHost, not a core of its own over the same folder.PublishedSSHRoutegains an init that keeps a stored basis.ConnectionStoreIntegrity.hasKeyandIntegrityStampedFileStore.withdrawTrustare new..claude/rules/data-sync-storage.md: rows for the library, the mirror and its record, the kept copies and the core's tag.apple/scripts/probes/check-library-downgrade.sh: T-DWN with this build and the previous stable's app in one sandbox.Known limits:
LibraryContentsandLibraryWriteRecord.Tests changed on purpose:
Core/beside the legacy file.LibraryWriteRefusal(the immutable flag). The core resets its folder's mode before each write, so a read-only mode no longer refuses it. Affected:ConnectionEditorStoreFixture.makeLibraryReadOnly,ConnectionStorageSyncDeleteTests.failedPersistenceRecordsNoTombstone,MacImportLibraryStoreTests.unwritableLibraryWritesNoKeychainItemandWelcomeViewModelTests.testDeleteKeepsTheConnectionAndReportsWhenPersistenceFails.ConnectionEditorStoreTests.failedSaveForgetsLoadedSecretschanges the record too, because the core writes nothing for a save that leaves the record as it was.CloudLibraryRecordsTestsuses.silentfor the six Safe Mode levels of the base surface.ScopeRecordingKeychainlists its device-only keys.SavedQueryCoreMirrorTestsandFavoriteCoreMirrorTests(from feat(macos): saved queries and history on the core stores #4611) read the host journal instead ofSyncChangeTracker, which integ removed.SavedQueryCoreMirrorTests.policyStopEndsTheApplyandstopWhileTheWriteWaitsgo with the Swift pull apply they tested.CoreLibraryStoreTests.onlyAConnectionSaveVouchesreorders two favourites, so its favourites write writes.Test plan
CoreLibraryStoreTests: first launch, both stores written, the previous stable's edit and deletion taken in, a mirror cut short, an unreadable changed store, a damaged and a newer core file, held entries, trust and vouching, a forged mirror record, repeated ids, secrets moved out, a write over a changed file refused, a connection save over one rebuilding it and keeping a trusted read's values, a save over a newer build's file refused, an empty library trusted, another writer's change read in after a pass and left untrusted, a connection a pull leaves unreadable, an unread favourite after a relaunch.LibraryRecordMappingTests: every stored property ofConnectionCoverageFixturethrough the core, every password source, the query timeout, a tunnel turned off, every Safe Mode level, AI policy and TLS mode, values only the core names, groups and tags.ConnectionKeychainSecretsTests, with no secret call before the library reads.SyncProviderCoordinatorTests.aFinishedPassReadsTheCoresWrites.verify.sh build: PASS.swift test --package-path apple/Packages/TableProFFI: 9 passed.check-library-downgrade.shwith this build's Debug app and TablePro 0.88.0 passed. It covers:connections.jsonwith a tag 0.88 trusts;verify.sh linton every changed Swift file andcheck-banned-words.sh: clean.rebuild_librarymoves aside a newer build's file and one it could not read for the system; the Mac checks before it rebuilds, outside the core's write lock.options, unknown keys or profile sections from the file it replaces.