Skip to content

Fix CI, lock throttle state, and keep checkpointID through splits - #9

Merged
ryanashcraft merged 5 commits into
mainfrom
claude/repository-improvements-c980c2
Nov 11, 2026
Merged

ryanashcraft merged 5 commits into
mainfrom
claude/repository-improvements-c980c2

Conversation

@ryanashcraft

@ryanashcraft ryanashcraft commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

What changed

Four small, independent commits salvaged from the unmerged async-surfaces branch. None of that branch's async API (streams, perform, WorkWaiters) is included.

  • Swift 6 tools, v5 language mode. Package.swift moves to tools 6.0, keeps both targets in Swift 5 language mode, and turns on StrictConcurrency warnings for the library target.
  • Throttle lock. rateLimitController, throttleDuration, and nextOperationDeadline in CloudKitOperationHandler are written from CloudKit completion callbacks and read when queueing an operation. They are now guarded by one lock and made private.
  • checkpointID survives a size split. ModifyOperation.split only attached the checkpoint to the last delete chunk, so an oversized operation with no deletions lost it. The checkpoint now rides the final chunk regardless. Two tests added.
  • CI. Drops swift-actions/setup-swift@v1 and runs on macos-26, so the build uses the runner's default Xcode. The first attempt pinned macos-15 and failed: ErrorMiddleware references CKError.Code.participantAlreadyInvited, which only exists in the macOS 26 SDK and later.

Why

  • CI on main has failed at the Build step on every recorded run since April 2026.
  • The throttle state is an unsynchronized cross-thread read/write.
  • A dropped checkpointID means a caller waiting on that checkpoint never sees it complete.

Notes for review

  • Two commits are partial picks. The throttle commit keeps only the throttle lock from its source: the source also locked accumulators for modifyRecordsResultBlock and the old fetch code, which main has since replaced (deprecated modify completion block restored, fetch accumulation moved into FetchOperationResponseBuilder). All conflicts were resolved to main's side, so modify and fetch error handling are unchanged. The CI commit leaves out its source's README section on the async API.
  • New warnings are expected. The build now reports 14 strict-concurrency warnings plus the existing deliberate deprecation warning. They are the burn-down list for Swift 6 language mode, not regressions.
  • Minimum toolchain. The manifest now needs Swift 6 tools. Separately, main already needs the macOS 26 SDK (Xcode 26) to compile because of that CKError case, even though the manifest does not say so.

Verification

  • Clean build with Xcode's toolchain.
  • 30 tests pass; a Thread Sanitizer run of the suite is clean.
  • The CI change is unverified until this PR's workflow runs.

🤖 Generated with Claude Code

ryanashcraft and others added 5 commits November 10, 2026 20:58
rateLimitController, throttleDuration, and nextOperationDeadline are
written from CloudKit completion callbacks on arbitrary threads and read
by queueOperation on the caller's thread. Guard all three with one lock
and make them private so nothing reads them unguarded.

This is the throttle half of 8371389 from async-surfaces. That commit
also locked per-operation accumulators for modifyRecordsResultBlock and
the pre-builder fetch code; main has since restored the deprecated
modify completion block (0ba54f7) and moved fetch accumulation into
FetchOperationResponseBuilder (4d00787), so those hunks are dropped and
main's side is kept unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…letions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit b140693)
swift-actions/setup-swift@v1 installs a Swift 5.x toolchain that cannot
build the tools 6.0 manifest; the macos-15 image's default Xcode
toolchain ships Swift 6.x.

This is the CI half of 9ee58d0 from async-surfaces. That commit's README
section documented the async streams and perform APIs, which are not
being carried over, so it is left out.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The build failed on macos-15 with "type 'CKError.Code' has no member
'participantAlreadyInvited'". That case was added in the macOS 26 SDK,
and ErrorMiddleware has listed it since 4d00787, so the package no
longer compiles with Xcode 16. macos-26 defaults to Xcode 26.6, which
ships that SDK.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@ryanashcraft
ryanashcraft merged commit dbed0f5 into main Nov 11, 2026
1 check 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