Skip to content
CAI
Software that uses CAICheck a score

3lvis/SwiftSync

58.6

Adequate · 30 September 2026

9k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Swift library and demo application that provides a robust, offline-first synchronization layer for SwiftData models. It enables bidirectional data sync between local devices and a remote server, handling conflict resolution, pending change queues, and failure inboxes for rejected edits. The implementation includes a backend simulator for deterministic testing and comprehensive tooling for linting, CI, and UI validation.

How it got here

2014 — SwiftSync library introduction and migration

7 changes.

The project introduced the SwiftSync library to provide a modern sync layer for SwiftData applications, replacing the legacy NSManagedObject and AFNetworking infrastructure. This period involved a comprehensive migration from CocoaPods to Swift Package Manager and the removal of outdated Objective-C test suites and dependency files.

2026 — SwiftSync library and demo migration

14 changes.

This period focused on introducing the SwiftSync library for SwiftData model synchronization and migrating the Demo application to use this new framework. The work established robust offline-first capabilities, including a failure inbox for handling rejected changes, and implemented a deterministic SQLite backend to support comprehensive UI and unit testing.

Features

Add pre-commit linting hook

A new pre-commit hook has been added to the repository that automatically runs the project's linting tool on staged files before each commit. This ensures that code formatting and style checks pass locally before changes are pushed, aligning local development with CI requirements. Users can enable the hook by running the provided setup script or configuring Git to use the .githooks directory.

.githooks · high confidence

Added Objective-C exception catcher utility and updated workspace configuration

The SwiftSync module now includes a new ObjCExceptionCatcher component that allows Objective-C code to safely execute blocks and capture NSExceptions as NSError objects, providing structured error details like exception name and reason. Additionally, the workspace configuration has been updated to reference the Demo project and test plan, reflecting the transition from the legacy Demo structure to the new SwiftSync codebase.

SwiftSync.xcworkspace, SwiftSync/Sources/ObjCExceptionCatcher · high confidence

Introduce SwiftSync library for SwiftData model synchronization

This change introduces the SwiftSync library, providing a structured approach to synchronizing SwiftData models with a remote server. It adds a \SyncContainer\ to manage the \ModelContainer\ and coordinate sync operations, along with macros like \@Syncable\ and \@PrimaryKey\ to configure model identity and relationship schemas. The library supports both bulk and single-item sync via \SyncContainer.sync\, handling payload normalization, relationship application, and conflict resolution. It also introduces offline capabilities through \SyncPendingChanges\ to track local inserts, updates, and deletes, and \SyncJSON\ as a \Sendable\ payload carrier to ensure thread safety during asynchronous sync operations.

SwiftSync/Sources/SwiftSync · high confidence

Introduction of oida-based linting and formatting tooling

The repository now uses a custom linter called 'oida' for code quality checks, replacing previous mechanisms. A new \bin/lint\ script manages the oida binary (pinned via \.oida-version\ and checksummed for security), supporting modes for reporting, fixing, and CI checks (\--check\, \--staged\). A companion \bin/staged-swift-files\ script identifies relevant Swift files for staged commits, excluding build artifacts and generated sources. This change establishes a zero-baseline linting policy where any violation fails the check, ensuring consistent code style and formatting across macOS and Linux environments.

bin · high confidence

New CI and local setup scripts for documentation and UI testing

Added three new scripts to the repository: \scripts/check-doc-links.py\ validates internal relative links in Markdown documentation files to prevent dead links; \scripts/run\_ui\_test.sh\ automates the execution of iOS UI tests by managing simulator selection, building the 'Demo' scheme, and handling simulator reboots on failure; and \scripts/setup.sh\ configures the local Git environment to use the \.githooks\ directory for pre-commit hooks.

scripts · high confidence

SwiftSync library introduction with SwiftData sync and offline push

This change introduces SwiftSync, a new sync layer for SwiftData applications that handles JSON-to-SwiftData mapping, relationship syncing, and export to API-ready JSON. The library supports offline push via SwiftData History with last-writer-wins conflict resolution, and provides reactive local reads for SwiftUI and UIKit through @SyncQuery. The repository has been restructured from the previous NSManagedObject-ANDYNetworking project, with new documentation files (AGENTS.md, VOICE.md, LEARNINGS.md) establishing coding standards and documentation contracts. The CI system has been migrated from Travis CI to Swift Package Manager-based testing, and the project now uses oida for Swift code linting with strict zero-baseline enforcement.

(repo-wide) · high confidence

Removals

Removal of NSManagedObject networking category

The \NSManagedObject+ANDYNetworking\ category, which previously provided class methods to process network changes against Core Data entities (including background context handling and completion blocks), has been removed from the source code.

Source · high confidence

Removal of NSManagedObject+ANDYMapChanges pod

The \NSManagedObject+ANDYMapChanges\ pod has been removed from the demo project. This eliminates the \NSManagedObject\ category that previously provided methods for mapping local Core Data objects against remote change sets, including automatic detection of inserted, updated, and deleted entities based on local and remote keys.

Demo/Pods/NSManagedObject-ANDYMapChanges · high confidence

Removal of legacy Objective-C test suite

The Objective-C test implementation (Tests.m) and its associated Info.plist configuration have been removed from the Demo/DemoTests directory. This cleanup eliminates the previous XCTest-based setup and teardown logic for the Core Data context, indicating a shift away from this specific test infrastructure.

Demo/DemoTests · high confidence

Removed legacy AFNetworking pod files

The Demo/Pods directory no longer includes the source files for the AFNetworking library (specifically AFHTTPRequestOperation, AFHTTPRequestOperationManager, AFHTTPSessionManager, and AFNetworkReachabilityManager). This change removes the vendored third-party code from the repository, likely as part of a cleanup or migration to a different dependency management approach.

Demo/Pods · high confidence

Behavioural changes

Demo app re-architected with SwiftSync and reactive state machines

The demo application has replaced its legacy synchronization layer with SwiftSync, introducing a new runtime initialization via \DemoRuntime\ and a reactive state-management pattern using \ScreenLoadMachine\ and feature-specific view models (e.g., \ProjectsViewMachine\). This change provides users with real-time, reactive UI updates for data loading and synchronization states, while also introducing structured error presentation and offline-first capabilities for tasks and projects.

DemoCore/Sources/DemoCore/Features · high confidence

Demo app rebuilt with SwiftSync and offline failure management

The Demo application has been replaced with a new implementation using the SwiftSync framework, introducing a reactive sync engine and a dedicated offline status bar that displays pending and failed change counts. A new Failures Sheet allows users to view, edit, or discard rejected offline changes, while the UI now supports scenario selection for testing network conditions and includes comprehensive error handling for sync operations.

Demo/Demo · high confidence

Demo app replaces legacy sync with SwiftData-based offline support and failure inbox

The demo application has replaced its previous synchronization layer with a new architecture built on SwiftData and SwiftSync. This change introduces robust offline capabilities, allowing users to create, update, and delete tasks while disconnected; changes are automatically queued and pushed to the server upon reconnection. A key addition is the 'failures inbox,' which surfaces any server-rejected changes (such as conflicts or validation errors) directly in the UI, allowing users to inspect, edit, or discard these failed items. The underlying data models now use \@Syncable\ and \@NotExport\ attributes to manage synchronization scope, and the sync engine handles complex scenarios like preserving deleted item identities for later reconciliation.

DemoCore/Sources/DemoCore/Sync · high confidence

Demo backend now uses a local SQLite simulator with deterministic seed data and offline sync support

The DemoBackend location has been replaced with a new SQLite-based server simulator that provides a consistent, deterministic demo experience. It initializes with fixed, non-random seed data for projects, users, tasks, and items, ensuring the same identity (public\_id) is preserved across fresh installs. The simulator exposes read endpoints for projects, users, and tasks, and supports task state and relationship updates. Crucially, it implements an upload endpoint that handles offline changes using a Last-Writer-Wins strategy, supporting idempotent upserts, tombstoning for deletes, and the ability to revive tombstoned rows if a newer edit arrives. Tests verify that internal database IDs never leak, public IDs are adopted from clients or minted by the server, and stale operations are correctly rejected.

DemoBackend · high confidence

Demo project migrated to modern Xcode scheme and Swift Package structure

The Demo project's build configuration has been updated to use the modern Xcode 15+ scheme format (version 1.7) and project file format (objectVersion 77). This change replaces the legacy manual file references with file-system synchronized groups for the Demo and DemoUITests targets, removes the now-unnecessary workspace container file, and updates the framework dependencies to include SwiftSync, DemoBackend, and DemoCore while removing the old Pods/libPods.a dependency.

Demo/Demo.xcodeproj · high confidence

Syncable macro now generates SyncUpdatableModel conformance with explicit isolation for relationship updates

The @Syncable macro implementation has been updated to generate conformances for the SyncUpdatableModel protocol instead of the legacy Sync protocol. This change introduces explicit actor isolation (isolated (any Actor)?) to the generated applyRelationships methods, ensuring thread-safe execution for Swift 6.3 strict concurrency. Users benefit from safer, isolated updates to model relationships during synchronization, while the macro also enforces stricter validation on property names and identity keys.

SwiftSync/Sources/MacrosImplementation · high confidence

Test coverage

Added UI tests for offline sync and failure handling; Added diagnostics tests for the @Syncable macro; Added test suite for SwiftSync sync engine behavior; Added unit tests for DemoCore sync, offline push, and UI state logic.

Dependencies

Migrate from CocoaPods to Swift Package Manager

The project has replaced its legacy CocoaPods dependency management with Swift Package Manager (SPM). This change introduces new Package.swift manifests for the core SwiftSync library, DemoCore, and DemoBackend, targeting iOS 18 and macOS 15 with Swift 6 language modes. Consequently, the old Podfile, Podfile.lock, and associated local podspecs (including ANDYDataManager, AFNetworking, and various NSManagedObject mappers) have been removed, shifting the build system entirely to SPM.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 64 → 59 (-5.0)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 89 → 87 (-2.2)
  • Architecture 100 → 99 (-1.3)
  • Maturity 62 → 62 (+0.0)
  • Readiness 48 → 37 (-11.6)
  • Security 85 → 92 (+6.7)
  • Domain Modelling 100 → 100 (+0.0)

Resolved (21)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: written for insiders (docs/planning/world-class-roadmap.md)
  • Duplicated block (14 lines × 2) (DemoBackend/Sources/DemoBackend/DemoServerSimulator.swift)
  • Duplicated block (6 lines × 2) (DemoBackend/Sources/DemoBackend/DemoServerSimulator.swift)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Hotspot: DemoCore/Sources/DemoCore/Networking/DemoAPI.swift (DemoCore/Sources/DemoCore/Networking/DemoAPI.swift)
  • Hotspot: SwiftSync/Sources/SwiftSync/SyncDateParser.swift (SwiftSync/Sources/SwiftSync/SyncDateParser.swift)
  • Hotspot: SwiftSync/Sources/SwiftSync/SyncPayload.swift (SwiftSync/Sources/SwiftSync/SyncPayload.swift)
  • TooManyMethods: DemoSyncEngine (DemoCore/Sources/DemoCore/Sync/DemoSyncEngine.swift)
  • …and 1 more

New (43)

  • Coverage not measured — Swift suite
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • Documentation: written for insiders (docs/project/reactive-reads.md)
  • Duplicated block (13 lines × 2) (Demo/Demo/Features/Projects/ProjectView.swift)
  • Duplicated block (13 lines × 2) (DemoBackend/Sources/DemoBackend/DemoServerSimulator.swift)
  • Duplicated block (14 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (14 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (15 lines × 4) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (15–19 lines × 5) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (16 lines × 2) (DemoBackend/Sources/DemoBackend/DemoServerSimulator.swift)
  • Duplicated block (16 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (17 lines × 2) (DemoBackend/Sources/DemoBackend/DemoServerSimulator.swift)
  • Duplicated block (18–20 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (19 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (19 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (20 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (20 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (22 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (28–30 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • Duplicated block (9–10 lines × 2) (SwiftSync/Sources/SwiftSync/ModelContext+Sync.swift)
  • …and 23 more

Changes since last survey

  • 12 commits — 12 feature/other, 0 fixes

By area

  • (root) — 6 commits
  • .github/workflows — 4 commits
  • .github/pull_request_template.md — 1 commit
  • SwiftSync/Sources — 1 commit

Notable commits

  • change: Coverage is not a thing we measure (#684)
  • change: Learnings go in a file apiece, and the PR asks what earned its keep (#677)
  • change: Lint with oida, at zero baseline (#682)
  • change: One line length across every repo (#680)
  • change: The PR template drops Screenshots (#679)
  • change: The checkout is a commit, not a moving tag (#685)
  • change: The doc link check reads markdown, so it reads it on Linux (#687)
  • change: Three keys that only repeat swift-format's defaults (#681)
  • change: VOICE.md says how we write, and the PR template follows tienda's shape (#678)
  • change: ci: build and test on Xcode 27 / Swift 6.4 (#676)
  • change: oida 0.16.1, and the formatter gets its rules back (#683)
  • change: oida 0.17.1, and a scope that reads as written (#686)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

3lvis/SwiftSync was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 1993a39120545097f62eab46aeaa34929c28beb9 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.