Sync & Offline
Offline-first apps (mobile, desktop, web with Dexie) buffer mutations as LocalMutation envelopes and replay them via the sync-service when the device reconnects. Conflicts surface to the UI as 3-way merge candidates.
Key invariants:
- Bundles are encrypted at rest (
AES-256-GCM,HKDF(tenantKey, devicePubKey, bundleId)). - Vector clocks per aggregate, not per device.
- A local mutation must carry the same
Idempotency-Keyit would have sent online ? server-side dedup is identical to online flow.