Skip to content

feat(icloud): add private sync engine - #19

Merged
serabi merged 3 commits into
mainfrom
codex/icloud-sync-engine
Jul 14, 2026
Merged

serabi merged 3 commits into
mainfrom
codex/icloud-sync-engine

Conversation

@serabi

@serabi serabi commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add opt-in, local-first iCloud sync for library metadata and reading state
  • persist local changes in a durable outbox and defer child records until their parents arrive
  • add CloudKit codecs, deterministic conflict handling, tombstone reconciliation, and account-change quarantine
  • protect account transitions with explicit keep-or-discard policy and account-bound generations
  • add the private CloudKit container entitlement and sync state persistence

Testing

  • 78 tests passed, 0 failed, 0 skipped on iPad (A16), iOS 26.4 simulator

Manual Apple setup

  • create or select the iCloud.com.piperly.app CloudKit container in the Apple Developer portal
  • enable CloudKit for the app identifier and provisioning profile
  • deploy the record schema to the development environment before device testing
  • promote the validated schema to production before release

Stack


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

serabi and others added 3 commits July 9, 2026 15:32
# Conflicts:
#	Piperly/Services/BookStore.swift
Address the remaining #19 sync-correctness findings from the Opus review.

- Reading progress no longer regresses on an untrusted device clock: a
  same-locator progression decrease is treated as clock skew and the higher
  progression is kept (LibraryConflictResolver + applyRemoteSave route through
  one resolver). A genuine locator change may still lower it.
- Bound the deferred/quarantine/account-transition snapshot buckets and expire
  delete tombstones via SyncSnapshotMaintenance, pruned on every persist.
- Add bounded persistent tombstones so an older cross-device save cannot
  resurrect a recently deleted record after the local delete is sent/cleared.
- Make remote profile-delete replacement idempotent (keyed on "no profiles
  exist") and stop treating a failed replacement enqueue as an unresolved
  deletion, preventing duplicate default profiles on retry.
- Update ADR 0002 reading-state rule to match the non-regression policy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serabi
serabi changed the base branch from codex/stable-book-identity to main July 14, 2026 15:18
@serabi
serabi marked this pull request as ready for review July 14, 2026 15:18
@serabi
serabi merged commit 06e38e7 into main Jul 14, 2026
2 checks passed
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.

1 participant