Fleet changelogs · dev.ecs0.net
rdmbair15m5-changelog-20260922-0535-feat-20260904-09-cloudkit-default-zone

rdmbair15m5-changelog-20260922-0535-feat-20260904-09-cloudkit-default-zone

Supported legacy default-zone reads in ECSCloudKit, unified process CloudKit entitlement checks, authored migration recipe to RTTySyncV1, and verified 28/28 tests passing across fleet hosts.


Metadata


Summary of Changes

  1. ECSCloudKit Default Zone Architecture (FEAT-20260904-09):

    • Sources/ECSCloudKit/SyncModels.swift:
      • Added SyncZoneID.defaultZone (and alias .default) pointing to CloudKit's internal default zone _defaultZone.
      • Added isDefault: Bool helper property.
      • Added Codable conformance to SyncZoneID.
    • Sources/ECSCloudKit/CloudKitSyncDatabase.swift:
      • Added SyncZoneID.ckRecordZoneID returning CKRecordZone.default().zoneID for isDefault == true and scoped CKRecordZone.ID(zoneName:ownerName:) for custom zones.
      • Updated makeCKRecord(zone:), fetchRecords(names:zone:), save(_:zone:), and deleteRecord(name:zone:) to route through zone.ckRecordZoneID.
      • Updated ensureZone(_:): safe no-op on default zone since CKRecordZone.default() implicitly exists in private CloudKit databases and attempting to save it fails.
      • Updated changes(zone:since:): fails closed with a clear error indicating CKFetchRecordZoneChangesOperation is unsupported on the default zone (enforcing custom zone requirement for incremental sync).
    • Unified Entitlement Probing:
      • Updated CloudSyncEntitlements.processHasCloudKit(containerIdentifier:allowedEnvironments:assumeEntitledWithoutEmbeddedProfile:) to inspect com.apple.developer.icloud-container-environment (defaulting to ["Development", "Production"]). This unifies ECSCloudKit with RTTy's duplicated SecTask entitlement inspection.
  2. In-Memory and Test Support Mocks:

    • Sources/ECSCloudKit/InMemorySyncDatabase.swift:
      • Supported zone.isDefault in ensureZone, fetchRecords, save, and deleteRecord.
      • Throws informative error if changes is requested on the default zone.
    • Sources/ECSCloudKitTestSupport/MockSyncDatabase.swift:
      • Implemented seed(_:zone:) helper to seed records on default zone or custom zones as if pushed from another device.
      • Added default zone handling matching InMemorySyncDatabase.
  3. Unit Test Suite:

    • Created Tests/ECSCloudKitTests/DefaultZoneSupportTests.swift covering:
      • testSyncZoneIDDefaultProperties
      • testMakeCKRecordWithDefaultZoneProducesDefaultZoneID
      • testMakeCKRecordWithCustomZoneProducesCustomZoneID
      • testInMemorySyncDatabaseDefaultZoneReadWrite
      • testInMemorySyncDatabaseDefaultZoneChangesThrowsUnsupported
      • testMockSyncDatabaseDefaultZoneOperations
    • Test execution: 28/28 tests passed (0 failures, 0 skipped) on both rdmbair15m5 and rdmsm4x.
  4. Migration Recipe & Operational Architecture:

    • Authored docs/MIGRATION-RECIPE-DEFAULT-TO-RTTYSYNCV1.md:
      • 4-Phase zero-loss migration protocol:
        1. Phase 1: Dual-Read Window (reads RTTySyncV1 with fallback to defaultZone portable-v1 and latest).
        2. Phase 2: Dual-Write Window (replicates local writes to RTTySyncV1 while updating legacy default zone).
        3. Phase 3: Lockstep Mobile Release & Cutover Gate (all active clients updated, writes switch exclusively to RTTySyncV1).
        4. Phase 4: Irreversible Archive & Legacy Cleanup (requires Rich authorization gate, executes backfill migration and retention tagging).
      • Verified signed-device roundtrip verification standards.
      • Preserves CloudStubGuard and fleet data safety boundaries (no live data mutated during library enhancement).

Verification Evidence


Rollback & Undo