The Swift Package Index logo.Swift Package Index

Build Information

Failed to build CodexKit, reference main (f7fa39), with Swift 6.4 for iOS using Xcode 27.0 on 26 Sep 2026 22:49:59 UTC.

Build Command

env DEVELOPER_DIR=/Applications/Xcode-27.0.0-Release.Candidate.app xcrun xcodebuild -IDEClonedSourcePackagesDirPathOverride=$PWD/.dependencies -skipMacroValidation -skipPackagePluginValidation -derivedDataPath $PWD/.derivedData build -scheme CodexKit-Package -destination generic/platform=iOS

Build Log

    :
550 |     }
551 |
552 |     private func cancel() {
    |                  `- note: add '@available' attribute to enclosing instance method
553 |         let continuation = state.withLock { state -> CheckedContinuation<Bool, Never>? in
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
554 |             switch state {
555 |             case .idle:
SwiftCompile normal arm64 Compiling\ InterruptRaceResolver.swift,\ JSONRPC.swift,\ JSONRPCEnvelopeCodec.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/InterruptRaceResolver.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPC.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift (in target 'CodexAppServerKit' from project 'CodexKit')
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/InterruptRaceResolver.swift:5:27: error: 'Duration' is only available in iOS 16.0 or newer
 2 |
 3 | package struct InterruptRaceResolver: Sendable {
 4 |     package enum Decision: Sendable {
   |                  `- note: add '@available' attribute to enclosing enum
 5 |         case retry(after: Duration)
   |                           `- error: 'Duration' is only available in iOS 16.0 or newer
 6 |         case redirect(to: CodexTurnID)
 7 |         case fail
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/InterruptRaceResolver.swift:12:47: error: 'Duration' is only available in iOS 16.0 or newer
 1 | import Foundation
 2 |
 3 | package struct InterruptRaceResolver: Sendable {
   |                `- note: add '@available' attribute to enclosing struct
 4 |     package enum Decision: Sendable {
 5 |         case retry(after: Duration)
   :
10 |     private static let noActiveTurnMessage = "no active turn to interrupt"
11 |     private static let activationRetryLimit = 5
12 |     private static let activationRetryDelay = Duration.milliseconds(50)
   |                        |                      `- error: 'Duration' is only available in iOS 16.0 or newer
   |                        `- note: add '@available' attribute to enclosing static property
13 |
14 |     private let expectedTurnID: CodexTurnID?
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/InterruptRaceResolver.swift:12:56: error: 'milliseconds' is only available in iOS 16.0 or newer
 1 | import Foundation
 2 |
 3 | package struct InterruptRaceResolver: Sendable {
   |                `- note: add '@available' attribute to enclosing struct
 4 |     package enum Decision: Sendable {
 5 |         case retry(after: Duration)
   :
10 |     private static let noActiveTurnMessage = "no active turn to interrupt"
11 |     private static let activationRetryLimit = 5
12 |     private static let activationRetryDelay = Duration.milliseconds(50)
   |                        |                               `- error: 'milliseconds' is only available in iOS 16.0 or newer
   |                        `- note: add '@available' attribute to enclosing static property
13 |
14 |     private let expectedTurnID: CodexTurnID?
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift:180:25: error: 'Mutex' is only available in iOS 18.0 or newer
172 | }
173 |
174 | package final class JSONRPCResponseWaiter: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
175 |     private enum State {
176 |         case pending(CheckedContinuation<Result<Data, JSONRPC.Error>, Never>?)
    :
178 |     }
179 |
180 |     private let state = Mutex<State>(.pending(nil))
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
181 |
182 |     package init() {}
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift:180:36: error: 'init(_:)' is only available in iOS 18.0 or newer
172 | }
173 |
174 | package final class JSONRPCResponseWaiter: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
175 |     private enum State {
176 |         case pending(CheckedContinuation<Result<Data, JSONRPC.Error>, Never>?)
    :
178 |     }
179 |
180 |     private let state = Mutex<State>(.pending(nil))
    |                                    `- error: 'init(_:)' is only available in iOS 18.0 or newer
181 |
182 |     package init() {}
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift:186:34: error: 'withLock' is only available in iOS 18.0 or newer
172 | }
173 |
174 | package final class JSONRPCResponseWaiter: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
175 |     private enum State {
176 |         case pending(CheckedContinuation<Result<Data, JSONRPC.Error>, Never>?)
    :
182 |     package init() {}
183 |
184 |     package func wait() async throws -> Data {
    |                  `- note: add '@available' attribute to enclosing instance method
185 |         let result = await withCheckedContinuation { continuation in
186 |             let resolved = state.withLock {
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
187 |                 state -> Result<Data, JSONRPC.Error>? in
188 |                 switch state {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift:207:32: error: 'withLock' is only available in iOS 18.0 or newer
172 | }
173 |
174 | package final class JSONRPCResponseWaiter: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
175 |     private enum State {
176 |         case pending(CheckedContinuation<Result<Data, JSONRPC.Error>, Never>?)
    :
204 |
205 |     @discardableResult
206 |     package func resolve(_ result: Result<Data, JSONRPC.Error>) -> Bool {
    |                  `- note: add '@available' attribute to enclosing instance method
207 |         let resolution = state.withLock {
    |                                |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                `- note: add 'if #available' version check
208 |             state -> (Bool, CheckedContinuation<Result<Data, JSONRPC.Error>, Never>?) in
209 |             switch state {
Failed frontend command:
/Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AccountEventHub.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerConnection.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerNotificationDecoder.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerRequests.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServerNotificationRouter.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServerRequest.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServerRequestCodec.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexDomainTypes.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexItemReducer.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexThreadOperations.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexTurnSequences.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexTurnSnapshotReducer.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionTerminationArbiter.swift -primary-file /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/InterruptRaceResolver.swift -primary-file /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPC.swift -primary-file /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCInboundFrameMailbox.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/LoginRegistry.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/RequestSerializer.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ServerRequestRegistry.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayStore.swift -supplementary-output-file-map /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/supplementaryOutputs-7 -target arm64-apple-ios15.0 -disable-cross-import-overlay-search -swift-module-cross-import Darwin /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/Darwin.swiftcrossimport/xlocale.swiftoverlay -load-resolved-plugin /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/swift/host/plugins/libFoundationMacros.dylib\#/Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server\#FoundationMacros -load-resolved-plugin /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/swift/host/plugins/libObservationMacros.dylib\#/Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server\#ObservationMacros -load-resolved-plugin /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/swift/host/plugins/libSwiftMacros.dylib\#/Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server\#SwiftMacros -disable-implicit-swift-modules -Xcc -fno-implicit-modules -Xcc -fno-implicit-module-maps -explicit-swift-module-map-file /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/CodexAppServerKit-dependencies-1.json -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS27.0.sdk -I /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Products/Debug-iphoneos -Isystem /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib -F /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Products/Debug-iphoneos -F /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS27.0.sdk/Developer/Library/Frameworks -module-cache-path /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/SwiftExplicitPrecompiledModules -no-color-diagnostics -Xcc -fno-color-diagnostics -enable-testing -g -debug-info-format\=dwarf -dwarf-version\=4 -profile-generate -profile-coverage-mapping -swift-version 6 -Onone -D SWIFT_PACKAGE -D DEBUG -D SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE -D Xcode -serialize-debugging-options -enable-experimental-feature DebugDescriptionMacro -empty-abi-descriptor -validate-clang-modules-once -clang-build-session-file /Users/admin/builder/spi-builder-workspace/.derivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode -enable-anonymous-context-mangled-names -file-compilation-dir /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode -Xcc -D_LIBCPP_HARDENING_MODE\=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -ivfsstatcache -Xcc /Users/admin/builder/spi-builder-workspace/.derivedData/SDKStatCaches.noindex/iphoneos27.0-24A430-e829b21a6f8c9b70876ba0858053c04440ceaa042ed91876912b2eeea4e3aa14.sdkstatcache -Xcc -fmodules-prune-interval\=86400 -Xcc -fmodules-prune-after\=345600 -Xcc -I/Users/admin/builder/spi-builder-workspace/.derivedData/Build/Products/Debug-iphoneos/include -Xcc -I/Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/DerivedSources-normal/arm64 -Xcc -I/Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/DerivedSources/arm64 -Xcc -I/Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG\=1 -no-auto-bridging-header-chaining -module-name CodexAppServerKit -package-name spi_builder_workspace -const-gather-protocols-file /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/CodexAppServerKit_const_extract_protocols.json -disable-clang-spi -clang-target arm64-apple-ios27.0 -target-sdk-version 27.0 -target-sdk-name iphoneos27.0 -in-process-plugin-server-path /Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -parse-as-library -o /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/InterruptRaceResolver.o -o /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/JSONRPC.o -o /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/JSONRPCEnvelopeCodec.o -debug-module-path /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/CodexAppServerKit.swiftmodule -index-unit-output-path /CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/InterruptRaceResolver.o -index-unit-output-path /CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/JSONRPC.o -index-unit-output-path /CodexKit.build/Debug-iphoneos/CodexAppServerKit-t.build/Objects-normal/arm64/JSONRPCEnvelopeCodec.o -index-store-path /Users/admin/builder/spi-builder-workspace/.derivedData/Index.noindex/DataStore -index-system-modules
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/InterruptRaceResolver.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile InterruptRaceResolver.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPC.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile JSONRPC.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile JSONRPCEnvelopeCodec.swift
SwiftEmitModule normal arm64 Emitting\ module\ for\ CodexAppServerKit (in target 'CodexAppServerKit' from project 'CodexKit')
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AccountEventHub.swift:295:25: error: 'Mutex' is only available in iOS 18.0 or newer
287 | }
288 |
289 | private final class AccountEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
290 |     private struct State {
291 |         var channels: [UUID: AccountEventSubscriberChannel] = [:]
    :
293 |     }
294 |
295 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
296 |
297 |     var isFinished: Bool {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AccountEventHub.swift:295:25: error: 'init(_:)' is only available in iOS 18.0 or newer
287 | }
288 |
289 | private final class AccountEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
290 |     private struct State {
291 |         var channels: [UUID: AccountEventSubscriberChannel] = [:]
    :
293 |     }
294 |
295 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
296 |
297 |     var isFinished: Bool {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AccountEventHub.swift:122:25: error: 'Mutex' is only available in iOS 18.0 or newer
 98 | }
 99 |
100 | private final class AccountEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
101 |     private enum Terminal {
102 |         case open
    :
120 |     }
121 |
122 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
123 |
124 |     func yield(_ event: CodexAccountEvent) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AccountEventHub.swift:122:25: error: 'init(_:)' is only available in iOS 18.0 or newer
 98 | }
 99 |
100 | private final class AccountEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
101 |     private enum Terminal {
102 |         case open
    :
120 |     }
121 |
122 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
123 |
124 |     func yield(_ event: CodexAccountEvent) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AccountEventHub.swift:262:25: error: 'Mutex' is only available in iOS 18.0 or newer
255 | }
256 |
257 | private final class AccountEventSubscriptionCancellation: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
258 |     private struct State {
259 |         var isCancelled = false
260 |     }
261 |
262 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
263 |     private let id: UUID
264 |     private let registry: AccountEventSubscriptionRegistry
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AccountEventHub.swift:262:25: error: 'init(_:)' is only available in iOS 18.0 or newer
255 | }
256 |
257 | private final class AccountEventSubscriptionCancellation: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
258 |     private struct State {
259 |         var isCancelled = false
260 |     }
261 |
262 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
263 |     private let id: UUID
264 |     private let registry: AccountEventSubscriptionRegistry
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:22:46: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 20 |
 21 |     private static let appServerOverloadedErrorCode = -32001
 22 |     private static let overloadRetryDelays: [Duration] = [
    |                        |                     `- error: 'Duration' is only available in iOS 16.0 or newer
    |                        `- note: add '@available' attribute to enclosing static property
 23 |         .milliseconds(100),
 24 |         .milliseconds(250),
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:23:10: error: 'milliseconds' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 20 |
 21 |     private static let appServerOverloadedErrorCode = -32001
 22 |     private static let overloadRetryDelays: [Duration] = [
    |                        `- note: add '@available' attribute to enclosing static property
 23 |         .milliseconds(100),
    |          `- error: 'milliseconds' is only available in iOS 16.0 or newer
 24 |         .milliseconds(250),
 25 |         .milliseconds(500),
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:24:10: error: 'milliseconds' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 20 |
 21 |     private static let appServerOverloadedErrorCode = -32001
 22 |     private static let overloadRetryDelays: [Duration] = [
    |                        `- note: add '@available' attribute to enclosing static property
 23 |         .milliseconds(100),
 24 |         .milliseconds(250),
    |          `- error: 'milliseconds' is only available in iOS 16.0 or newer
 25 |         .milliseconds(500),
 26 |     ]
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:25:10: error: 'milliseconds' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 20 |
 21 |     private static let appServerOverloadedErrorCode = -32001
 22 |     private static let overloadRetryDelays: [Duration] = [
    |                        `- note: add '@available' attribute to enclosing static property
 23 |         .milliseconds(100),
 24 |         .milliseconds(250),
 25 |         .milliseconds(500),
    |          `- error: 'milliseconds' is only available in iOS 16.0 or newer
 26 |     ]
 27 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:30:56: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 28 |     private let transport: any JSONRPC.Transport
 29 |     package nonisolated let connectionEventHub: ConnectionEventHub
 30 |     private let overloadRetryDelay: @Sendable (Int) -> Duration?
    |                                                        `- error: 'Duration' is only available in iOS 16.0 or newer
 31 |     private let retrySleep: @Sendable (Duration) async throws -> Void
 32 |     private let deadlines: CodexAppServer.Configuration.Deadlines
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:31:40: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 29 |     package nonisolated let connectionEventHub: ConnectionEventHub
 30 |     private let overloadRetryDelay: @Sendable (Int) -> Duration?
 31 |     private let retrySleep: @Sendable (Duration) async throws -> Void
    |                                        `- error: 'Duration' is only available in iOS 16.0 or newer
 32 |     private let deadlines: CodexAppServer.Configuration.Deadlines
 33 |     private let deadlineClock: CodexDeadlineClock
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:46:58: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 39 |     private var initializationState = InitializationState.idle
 40 |
 41 |     package init(
    |             `- note: add '@available' attribute to enclosing initializer
 42 |         transport: any JSONRPC.Transport,
 43 |         deadlines: CodexAppServer.Configuration.Deadlines = .init(),
 44 |         deadlineClock: CodexDeadlineClock = .continuous,
 45 |         connectionCloseAction: ConnectionCloseAction,
 46 |         overloadRetryDelay: @escaping @Sendable (Int) -> Duration? = AppServerClient
    |                                                          `- error: 'Duration' is only available in iOS 16.0 or newer
 47 |             .defaultOverloadRetryDelay,
 48 |         retrySleep: @escaping @Sendable (Duration) async throws -> Void = {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:48:42: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 39 |     private var initializationState = InitializationState.idle
 40 |
 41 |     package init(
    |             `- note: add '@available' attribute to enclosing initializer
 42 |         transport: any JSONRPC.Transport,
 43 |         deadlines: CodexAppServer.Configuration.Deadlines = .init(),
    :
 46 |         overloadRetryDelay: @escaping @Sendable (Int) -> Duration? = AppServerClient
 47 |             .defaultOverloadRetryDelay,
 48 |         retrySleep: @escaping @Sendable (Duration) async throws -> Void = {
    |                                          `- error: 'Duration' is only available in iOS 16.0 or newer
 49 |             try await Task.sleep(for: $0)
 50 |         }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:49:28: error: 'sleep(for:tolerance:clock:)' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 39 |     private var initializationState = InitializationState.idle
 40 |
 41 |     package init(
    |             `- note: add '@available' attribute to enclosing initializer
 42 |         transport: any JSONRPC.Transport,
 43 |         deadlines: CodexAppServer.Configuration.Deadlines = .init(),
    :
 47 |             .defaultOverloadRetryDelay,
 48 |         retrySleep: @escaping @Sendable (Duration) async throws -> Void = {
 49 |             try await Task.sleep(for: $0)
    |                            |- error: 'sleep(for:tolerance:clock:)' is only available in iOS 16.0 or newer
    |                            `- note: add 'if #available' version check
 50 |         }
 51 |     ) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:101:52: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 99 |     }
100 |
101 |     package func sleepForInterruptRace(_ duration: Duration) async throws {
    |                  |                                 `- error: 'Duration' is only available in iOS 16.0 or newer
    |                  `- note: add '@available' attribute to enclosing instance method
102 |         try await deadlineClock.sleep(duration)
103 |     }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:182:19: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
177 |     }
178 |
179 |     private func send<Request: AppServerAPI.Request>(
    |                  `- note: add '@available' attribute to enclosing instance method
180 |         _ request: Request,
181 |         purpose: CodexRequestPurpose,
182 |         deadline: Duration?,
    |                   `- error: 'Duration' is only available in iOS 16.0 or newer
183 |         afterResponse: @escaping @Sendable (Request.Response) async throws -> Void
184 |     ) async throws -> Request.Response {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:202:19: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
194 |     }
195 |
196 |     package func send<Params: Encodable & Sendable, Response: Decodable & Sendable>(
    |                  `- note: add '@available' attribute to enclosing instance method
197 |         method: String,
198 |         params: Params,
    :
200 |         scope: AppServerAPI.RequestScope? = nil,
201 |         purpose: CodexRequestPurpose? = nil,
202 |         deadline: Duration? = nil,
    |                   `- error: 'Duration' is only available in iOS 16.0 or newer
203 |         reconcileResponse: @escaping @Sendable (Response) async throws -> Void = { _ in },
204 |         afterResponse: @escaping @Sendable (Response) async throws -> Void = { _ in },
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:526:19: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
522 |         )
523 |     }
524 |     package func runTurnWithDeadline<Output: Sendable>(
    |                  `- note: add '@available' attribute to enclosing instance method
525 |         turnID: CodexTurnID,
526 |         duration: Duration,
    |                   `- error: 'Duration' is only available in iOS 16.0 or newer
527 |         operation: @escaping @Sendable () async throws -> Output
528 |     ) async throws -> Output {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:545:21: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
542 |     }
543 |
544 |     private func runWithDeadline<Output: Sendable>(
    |                  `- note: add '@available' attribute to enclosing instance method
545 |         _ deadline: Duration,
    |                     `- error: 'Duration' is only available in iOS 16.0 or newer
546 |         operation: @escaping @Sendable () async throws -> Output
547 |     ) async throws -> Output {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:568:21: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
565 |     }
566 |
567 |     private func runRequestWithDeadline<Output: Sendable>(
    |                  `- note: add '@available' attribute to enclosing instance method
568 |         _ deadline: Duration,
    |                     `- error: 'Duration' is only available in iOS 16.0 or newer
569 |         operationState: RequestOperationState,
570 |         operation: @escaping @Sendable () async throws -> Output
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:612:18: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
609 |     }
610 |
611 |     private func waitForRetryDelay(
    |                  `- note: add '@available' attribute to enclosing instance method
612 |         _ delay: Duration,
    |                  `- error: 'Duration' is only available in iOS 16.0 or newer
613 |         operationState: RequestOperationState
614 |     ) async throws {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:655:89: error: 'Duration' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
653 |     }
654 |
655 |     private nonisolated static func defaultOverloadRetryDelay(for retryAttempt: Int) -> Duration? {
    |                                     |                                                   `- error: 'Duration' is only available in iOS 16.0 or newer
    |                                     `- note: add '@available' attribute to enclosing static method
656 |         guard retryAttempt < overloadRetryDelays.count else {
657 |             return nil
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:573:25: error: 'Mutex' is only available in iOS 18.0 or newer
 564 | }
 565 |
 566 | private final class AppServerOneBitReadSignal: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 567 |     private struct State {
 568 |         var hasPendingReadiness = false
     :
 571 |     }
 572 |
 573 |     private let state = Mutex(State())
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
 574 |
 575 |     func next() async -> AppServerReadEvent {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:573:25: error: 'init(_:)' is only available in iOS 18.0 or newer
 564 | }
 565 |
 566 | private final class AppServerOneBitReadSignal: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 567 |     private struct State {
 568 |         var hasPendingReadiness = false
     :
 571 |     }
 572 |
 573 |     private let state = Mutex(State())
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
 574 |
 575 |     func next() async -> AppServerReadEvent {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:646:25: error: 'Mutex' is only available in iOS 18.0 or newer
 637 | }
 638 |
 639 | private final class AppServerReadEventWaiter: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 640 |     private enum State {
 641 |         case pending(CheckedContinuation<AppServerReadEvent, Never>?)
     :
 644 |
 645 |     let id = UUID()
 646 |     private let state = Mutex<State>(.pending(nil))
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
 647 |
 648 |     func wait() async -> AppServerReadEvent {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:646:36: error: 'init(_:)' is only available in iOS 18.0 or newer
 637 | }
 638 |
 639 | private final class AppServerReadEventWaiter: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 640 |     private enum State {
 641 |         case pending(CheckedContinuation<AppServerReadEvent, Never>?)
     :
 644 |
 645 |     let id = UUID()
 646 |     private let state = Mutex<State>(.pending(nil))
     |                                    `- error: 'init(_:)' is only available in iOS 18.0 or newer
 647 |
 648 |     func wait() async -> AppServerReadEvent {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:864:25: error: 'Mutex' is only available in iOS 18.0 or newer
 856 | }
 857 |
 858 | private final class AppServerCancellationCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 859 |     private enum State {
 860 |         case pending([CheckedContinuation<Void, Never>])
     :
 862 |     }
 863 |
 864 |     private let state = Mutex<State>(.pending([]))
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
 865 |
 866 |     func wait() async {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:864:36: error: 'init(_:)' is only available in iOS 18.0 or newer
 856 | }
 857 |
 858 | private final class AppServerCancellationCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 859 |     private enum State {
 860 |         case pending([CheckedContinuation<Void, Never>])
     :
 862 |     }
 863 |
 864 |     private let state = Mutex<State>(.pending([]))
     |                                    `- error: 'init(_:)' is only available in iOS 18.0 or newer
 865 |
 866 |     func wait() async {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:695:24: error: 'Mutex' is only available in iOS 18.0 or newer
 686 | }
 687 |
 688 | private final class AppServerPipeReadEventSource: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 689 |     private struct State {
 690 |         var source: DispatchSourceRead?
     :
 693 |     private let signal = AppServerOneBitReadSignal()
 694 |     private let cancellationCompletion = AppServerCancellationCompletion()
 695 |     private let state: Mutex<State>
     |                        `- error: 'Mutex' is only available in iOS 18.0 or newer
 696 |
 697 |     init(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:761:25: error: 'Mutex' is only available in iOS 18.0 or newer
 750 | }
 751 |
 752 | private final class AppServerStdoutReadMetrics: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 753 |     private struct State {
 754 |         var successfulReadCount = 0
     :
 759 |     }
 760 |
 761 |     private let state = Mutex(State())
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
 762 |
 763 |     func beginChunk(byteCount: Int) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:761:25: error: 'init(_:)' is only available in iOS 18.0 or newer
 750 | }
 751 |
 752 | private final class AppServerStdoutReadMetrics: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 753 |     private struct State {
 754 |         var successfulReadCount = 0
     :
 759 |     }
 760 |
 761 |     private let state = Mutex(State())
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
 762 |
 763 |     func beginChunk(byteCount: Int) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:814:24: error: 'Mutex' is only available in iOS 18.0 or newer
 805 | }
 806 |
 807 | private final class AppServerProcessExitEventSource: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 808 |     private struct State {
 809 |         var source: DispatchSourceProcess?
     :
 812 |     private let signal = AppServerOneBitReadSignal()
 813 |     private let cancellationCompletion = AppServerCancellationCompletion()
 814 |     private let state: Mutex<State>
     |                        `- error: 'Mutex' is only available in iOS 18.0 or newer
 815 |
 816 |     init(processIdentifier: pid_t) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:906:24: error: 'Mutex' is only available in iOS 18.0 or newer
 898 | }
 899 |
 900 | package final class AppServerJSONRPCWriter: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 901 |     private struct State {
 902 |         var fileHandle: FileHandle?
     :
 904 |     }
 905 |
 906 |     private let state: Mutex<State>
     |                        `- error: 'Mutex' is only available in iOS 18.0 or newer
 907 |
 908 |     package init(fileHandle: FileHandle) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:1121:29: error: 'Mutex' is only available in iOS 18.0 or newer
1110 | }
1111 |
1112 | private final class AppServerSpawnedProcess: @unchecked Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1113 |     let processIdentifier: pid_t
1114 |
     :
1119 |         var reapSystemCallCount = 0
1120 |     }
1121 |     private let exitState = Mutex(ExitState())
     |                             `- error: 'Mutex' is only available in iOS 18.0 or newer
1122 |
1123 |     private init(processIdentifier: pid_t) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:1121:29: error: 'init(_:)' is only available in iOS 18.0 or newer
1110 | }
1111 |
1112 | private final class AppServerSpawnedProcess: @unchecked Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1113 |     let processIdentifier: pid_t
1114 |
     :
1119 |         var reapSystemCallCount = 0
1120 |     }
1121 |     private let exitState = Mutex(ExitState())
     |                             `- error: 'init(_:)' is only available in iOS 18.0 or newer
1122 |
1123 |     private init(processIdentifier: pid_t) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:1213:24: error: 'Duration' is only available in iOS 16.0 or newer
1110 | }
1111 |
1112 | private final class AppServerSpawnedProcess: @unchecked Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1113 |     let processIdentifier: pid_t
1114 |
     :
1209 |     }
1210 |
1211 |     func waitForExit(
     |          `- note: add '@available' attribute to enclosing instance method
1212 |         terminationToken: ProcessTerminationToken,
1213 |         graceDuration: Duration = .seconds(2)
     |                        `- error: 'Duration' is only available in iOS 16.0 or newer
1214 |     ) async -> JSONRPC.ProcessExitObservation {
1215 |         let exitSource = AppServerProcessExitEventSource(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:1213:36: error: 'seconds' is only available in iOS 16.0 or newer
1110 | }
1111 |
1112 | private final class AppServerSpawnedProcess: @unchecked Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1113 |     let processIdentifier: pid_t
1114 |
     :
1209 |     }
1210 |
1211 |     func waitForExit(
     |          `- note: add '@available' attribute to enclosing instance method
1212 |         terminationToken: ProcessTerminationToken,
1213 |         graceDuration: Duration = .seconds(2)
     |                                    `- error: 'seconds' is only available in iOS 16.0 or newer
1214 |     ) async -> JSONRPC.ProcessExitObservation {
1215 |         let exitSource = AppServerProcessExitEventSource(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:1393:24: error: 'Duration' is only available in iOS 16.0 or newer
1110 | }
1111 |
1112 | private final class AppServerSpawnedProcess: @unchecked Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1113 |     let processIdentifier: pid_t
1114 |
     :
1389 |     }
1390 |
1391 |     private static func waitForExitDuringGrace(
     |                         `- note: add '@available' attribute to enclosing static method
1392 |         exitSource: AppServerProcessExitEventSource,
1393 |         graceDuration: Duration
     |                        `- error: 'Duration' is only available in iOS 16.0 or newer
1394 |     ) async -> Bool {
1395 |         await withTaskGroup(of: WaitEvent.self) { group in
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:1422:24: error: 'Duration' is only available in iOS 16.0 or newer
1110 | }
1111 |
1112 | private final class AppServerSpawnedProcess: @unchecked Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1113 |     let processIdentifier: pid_t
1114 |
     :
1417 |     }
1418 |
1419 |     private static func ensureExitAfterWaitFailure(
     |                         `- note: add '@available' attribute to enclosing static method
1420 |         exitSource: AppServerProcessExitEventSource,
1421 |         terminationToken: ProcessTerminationToken,
1422 |         graceDuration: Duration
     |                        `- error: 'Duration' is only available in iOS 16.0 or newer
1423 |     ) async {
1424 |         if terminationToken.didRequestKill == false {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:1590:25: error: 'Mutex' is only available in iOS 18.0 or newer
1581 | }
1582 |
1583 | package final class ProcessTerminationToken: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1584 |     private struct State {
1585 |         var didRequestTermination = false
     :
1588 |
1589 |     private let processGroupID: pid_t?
1590 |     private let state = Mutex(State())
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
1591 |     private let terminationRequestSignal = AppServerOneBitReadSignal()
1592 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerProcessTransport.swift:1590:25: error: 'init(_:)' is only available in iOS 18.0 or newer
1581 | }
1582 |
1583 | package final class ProcessTerminationToken: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1584 |     private struct State {
1585 |         var didRequestTermination = false
     :
1588 |
1589 |     private let processGroupID: pid_t?
1590 |     private let state = Mutex(State())
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
1591 |     private let terminationRequestSignal = AppServerOneBitReadSignal()
1592 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:13:35: error: 'Duration' is only available in iOS 16.0 or newer
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
  12 |         public struct Deadlines: Equatable, Sendable {
     |                       `- note: add '@available' attribute to enclosing struct
  13 |             public var handshake: Duration?
     |                                   `- error: 'Duration' is only available in iOS 16.0 or newer
  14 |             public var request: Duration?
  15 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:14:33: error: 'Duration' is only available in iOS 16.0 or newer
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
  12 |         public struct Deadlines: Equatable, Sendable {
     |                       `- note: add '@available' attribute to enclosing struct
  13 |             public var handshake: Duration?
  14 |             public var request: Duration?
     |                                 `- error: 'Duration' is only available in iOS 16.0 or newer
  15 |
  16 |             public init(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:17:28: error: 'Duration' is only available in iOS 16.0 or newer
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
  12 |         public struct Deadlines: Equatable, Sendable {
     |                       `- note: add '@available' attribute to enclosing struct
  13 |             public var handshake: Duration?
  14 |             public var request: Duration?
  15 |
  16 |             public init(
     |                    `- note: add '@available' attribute to enclosing initializer
  17 |                 handshake: Duration? = nil,
     |                            `- error: 'Duration' is only available in iOS 16.0 or newer
  18 |                 request: Duration? = nil
  19 |             ) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:18:26: error: 'Duration' is only available in iOS 16.0 or newer
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
  12 |         public struct Deadlines: Equatable, Sendable {
     |                       `- note: add '@available' attribute to enclosing struct
  13 |             public var handshake: Duration?
  14 |             public var request: Duration?
  15 |
  16 |             public init(
     |                    `- note: add '@available' attribute to enclosing initializer
  17 |                 handshake: Duration? = nil,
  18 |                 request: Duration? = nil
     |                          `- error: 'Duration' is only available in iOS 16.0 or newer
  19 |             ) {
  20 |                 self.handshake = handshake
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:73:72: error: 'homeDirectoryForCurrentUser' is unavailable in iOS
  71 |             public static func defaultCodexHomeURL(
  72 |                 environment: [String: String] = ProcessInfo.processInfo.environment,
  73 |                 homeDirectoryForCurrentUser: URL = FileManager.default.homeDirectoryForCurrentUser,
     |                                                                        `- error: 'homeDirectoryForCurrentUser' is unavailable in iOS
  74 |                 applicationSupportDirectory: URL? = FileManager.default.urls(
  75 |                     for: .applicationSupportDirectory,
/Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS27.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:1004:35: note: 'homeDirectoryForCurrentUser' has been explicitly marked unavailable here
1002 |
1003 | /// The home directory for the current user.
1004 | @property (readonly, copy) NSURL *homeDirectoryForCurrentUser API_AVAILABLE(macosx(10.12)) API_UNAVAILABLE(ios, watchos, tvos);
     |                                   `- note: 'homeDirectoryForCurrentUser' has been explicitly marked unavailable here
1005 | /// The temporary directory for the current user.
1006 | @property (readonly, copy) NSURL *temporaryDirectory API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:1016:34: error: 'Duration' is only available in iOS 16.0 or newer
   7 | /// JSON-RPC handshake, and routes server notifications to thread, turn, and
   8 | /// login domain objects.
   9 | public actor CodexAppServer {
     |              `- note: add '@available' attribute to enclosing actor
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
     :
1013 |     /// - Returns: A login handle containing the browser authentication URL.
1014 |     /// - Throws: A transport, JSON-RPC, or app-server login error.
1015 |     public func loginChatGPT(
     |                 `- note: add '@available' attribute to enclosing instance method
1016 |         accountReadinessTimeout: Duration? = nil
     |                                  `- error: 'Duration' is only available in iOS 16.0 or newer
1017 |     ) async throws -> CodexLoginHandle {
1018 |         let state = try await loginRegistry.reserve(
SwiftCompile normal arm64 (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode

SwiftCompile normal arm64 Compiling\ ReviewRestartCoordinator.swift,\ ServerRequestRegistry.swift,\ ThreadEventHub.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ServerRequestRegistry.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift (in target 'CodexAppServerKit' from project 'CodexKit')
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:20:30: error: 'Mutex' is only available in iOS 18.0 or newer
  17 | }
  18 |
  19 | package final class ReviewRestartIdentityAccumulator: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  20 |     private let identities = Mutex<[CodexReviewIdentity]>([])
     |                              `- error: 'Mutex' is only available in iOS 18.0 or newer
  21 |
  22 |     package init() {}
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:20:57: error: 'init(_:)' is only available in iOS 18.0 or newer
  17 | }
  18 |
  19 | package final class ReviewRestartIdentityAccumulator: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  20 |     private let identities = Mutex<[CodexReviewIdentity]>([])
     |                                                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
  21 |
  22 |     package init() {}
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:941:36: error: 'Mutex' is only available in iOS 18.0 or newer
 933 | }
 934 |
 935 | package final class RestartCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 936 |     fileprivate let id: UUID
 937 |     fileprivate let invalidation: InvalidationSignal
     :
 939 |     private let resultCell: SharedResultCell<RestartExecutionOutcome>
 940 |     fileprivate let cleanupLateSession: @Sendable (CodexReviewSession) async throws -> Void
 941 |     private let storedSettlement = Mutex<RestartSettlement?>(nil)
     |                                    `- error: 'Mutex' is only available in iOS 18.0 or newer
 942 |
 943 |     fileprivate init(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:941:60: error: 'init(_:)' is only available in iOS 18.0 or newer
 933 | }
 934 |
 935 | package final class RestartCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 936 |     fileprivate let id: UUID
 937 |     fileprivate let invalidation: InvalidationSignal
     :
 939 |     private let resultCell: SharedResultCell<RestartExecutionOutcome>
 940 |     fileprivate let cleanupLateSession: @Sendable (CodexReviewSession) async throws -> Void
 941 |     private let storedSettlement = Mutex<RestartSettlement?>(nil)
     |                                                            `- error: 'init(_:)' is only available in iOS 18.0 or newer
 942 |
 943 |     fileprivate init(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:989:32: error: 'Mutex' is only available in iOS 18.0 or newer
 983 | }
 984 |
 985 | package final class InvalidationCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 986 |     fileprivate let id: UUID
 987 |     fileprivate let task: Task<[CodexReviewIdentity], Never>
 988 |     fileprivate let restartCompletion: RestartCompletion?
 989 |     private let storedResult = Mutex<[CodexReviewIdentity]?>(nil)
     |                                `- error: 'Mutex' is only available in iOS 18.0 or newer
 990 |
 991 |     fileprivate init(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:989:60: error: 'init(_:)' is only available in iOS 18.0 or newer
 983 | }
 984 |
 985 | package final class InvalidationCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 986 |     fileprivate let id: UUID
 987 |     fileprivate let task: Task<[CodexReviewIdentity], Never>
 988 |     fileprivate let restartCompletion: RestartCompletion?
 989 |     private let storedResult = Mutex<[CodexReviewIdentity]?>(nil)
     |                                                            `- error: 'init(_:)' is only available in iOS 18.0 or newer
 990 |
 991 |     fileprivate init(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1020:25: error: 'Mutex' is only available in iOS 18.0 or newer
1012 | }
1013 |
1014 | private final class InvalidationSignal: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1015 |     private struct State: Sendable {
1016 |         var isRequested = false
     :
1018 |     }
1019 |
1020 |     private let state = Mutex(State())
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
1021 |
1022 |     var isRequested: Bool {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1020:25: error: 'init(_:)' is only available in iOS 18.0 or newer
1012 | }
1013 |
1014 | private final class InvalidationSignal: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1015 |     private struct State: Sendable {
1016 |         var isRequested = false
     :
1018 |     }
1019 |
1020 |     private let state = Mutex(State())
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
1021 |
1022 |     var isRequested: Bool {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1072:25: error: 'Mutex' is only available in iOS 18.0 or newer
1056 | }
1057 |
1058 | private final class SharedResultCell<Value: Sendable>: Sendable {
     |                     `- note: add '@available' attribute to enclosing generic class
1059 |     private struct WaiterCountObserver: Sendable {
1060 |         var minimumCount: Int
     :
1070 |     }
1071 |
1072 |     private let state = Mutex(State())
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
1073 |
1074 |     func wait() async throws -> Value {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1072:25: error: 'init(_:)' is only available in iOS 18.0 or newer
1056 | }
1057 |
1058 | private final class SharedResultCell<Value: Sendable>: Sendable {
     |                     `- note: add '@available' attribute to enclosing generic class
1059 |     private struct WaiterCountObserver: Sendable {
1060 |         var minimumCount: Int
     :
1070 |     }
1071 |
1072 |     private let state = Mutex(State())
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
1073 |
1074 |     func wait() async throws -> Value {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:25:20: error: 'withLock' is only available in iOS 18.0 or newer
  17 | }
  18 |
  19 | package final class ReviewRestartIdentityAccumulator: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  20 |     private let identities = Mutex<[CodexReviewIdentity]>([])
  21 |
  22 |     package init() {}
  23 |
  24 |     package func record(_ identity: CodexReviewIdentity) {
     |                  `- note: add '@available' attribute to enclosing instance method
  25 |         identities.withLock { identities in
     |                    |- error: 'withLock' is only available in iOS 18.0 or newer
     |                    `- note: add 'if #available' version check
  26 |             if identities.contains(where: {
  27 |                 sameReviewLifecycleIdentity($0, identity)
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:35:20: error: 'withLock' is only available in iOS 18.0 or newer
  17 | }
  18 |
  19 | package final class ReviewRestartIdentityAccumulator: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  20 |     private let identities = Mutex<[CodexReviewIdentity]>([])
  21 |
     :
  32 |     }
  33 |
  34 |     fileprivate func snapshot() -> [CodexReviewIdentity] {
     |                      `- note: add '@available' attribute to enclosing instance method
  35 |         identities.withLock { $0 }
     |                    |- error: 'withLock' is only available in iOS 18.0 or newer
     |                    `- note: add 'if #available' version check
  36 |     }
  37 | }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:966:26: error: 'withLock' is only available in iOS 18.0 or newer
 933 | }
 934 |
 935 | package final class RestartCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 936 |     fileprivate let id: UUID
 937 |     fileprivate let invalidation: InvalidationSignal
     :
 963 |     }
 964 |
 965 |     fileprivate var settlement: RestartSettlement? {
     |                     `- note: add '@available' attribute to enclosing property
 966 |         storedSettlement.withLock { $0 }
     |                          |- error: 'withLock' is only available in iOS 18.0 or newer
     |                          `- note: add 'if #available' version check
 967 |     }
 968 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:970:26: error: 'withLock' is only available in iOS 18.0 or newer
 933 | }
 934 |
 935 | package final class RestartCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 936 |     fileprivate let id: UUID
 937 |     fileprivate let invalidation: InvalidationSignal
     :
 967 |     }
 968 |
 969 |     fileprivate func setSettlement(_ settlement: RestartSettlement) {
     |                      `- note: add '@available' attribute to enclosing instance method
 970 |         storedSettlement.withLock { stored in
     |                          |- error: 'withLock' is only available in iOS 18.0 or newer
     |                          `- note: add 'if #available' version check
 971 |             precondition(stored == nil, "A shared restart completion must settle exactly once.")
 972 |             stored = settlement
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:977:26: error: 'withLock' is only available in iOS 18.0 or newer
 933 | }
 934 |
 935 | package final class RestartCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 936 |     fileprivate let id: UUID
 937 |     fileprivate let invalidation: InvalidationSignal
     :
 974 |     }
 975 |
 976 |     fileprivate func setSettlementIfUnset(_ settlement: RestartSettlement) {
     |                      `- note: add '@available' attribute to enclosing instance method
 977 |         storedSettlement.withLock { stored in
     |                          |- error: 'withLock' is only available in iOS 18.0 or newer
     |                          `- note: add 'if #available' version check
 978 |             if stored == nil {
 979 |                 stored = settlement
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1002:22: error: 'withLock' is only available in iOS 18.0 or newer
 983 | }
 984 |
 985 | package final class InvalidationCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 986 |     fileprivate let id: UUID
 987 |     fileprivate let task: Task<[CodexReviewIdentity], Never>
     :
 999 |     }
1000 |
1001 |     fileprivate var result: [CodexReviewIdentity]? {
     |                     `- note: add '@available' attribute to enclosing property
1002 |         storedResult.withLock { $0 }
     |                      |- error: 'withLock' is only available in iOS 18.0 or newer
     |                      `- note: add 'if #available' version check
1003 |     }
1004 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1006:22: error: 'withLock' is only available in iOS 18.0 or newer
 983 | }
 984 |
 985 | package final class InvalidationCompletion: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 986 |     fileprivate let id: UUID
 987 |     fileprivate let task: Task<[CodexReviewIdentity], Never>
     :
1003 |     }
1004 |
1005 |     fileprivate func setResultIfUnset(_ result: [CodexReviewIdentity]) {
     |                      `- note: add '@available' attribute to enclosing instance method
1006 |         storedResult.withLock { stored in
     |                      |- error: 'withLock' is only available in iOS 18.0 or newer
     |                      `- note: add 'if #available' version check
1007 |             if stored == nil {
1008 |                 stored = result
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1023:15: error: 'withLock' is only available in iOS 18.0 or newer
1012 | }
1013 |
1014 | private final class InvalidationSignal: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1015 |     private struct State: Sendable {
1016 |         var isRequested = false
     :
1020 |     private let state = Mutex(State())
1021 |
1022 |     var isRequested: Bool {
     |         `- note: add '@available' attribute to enclosing property
1023 |         state.withLock { $0.isRequested }
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
1024 |     }
1025 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1027:31: error: 'withLock' is only available in iOS 18.0 or newer
1012 | }
1013 |
1014 | private final class InvalidationSignal: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1015 |     private struct State: Sendable {
1016 |         var isRequested = false
     :
1024 |     }
1025 |
1026 |     func request() {
     |          `- note: add '@available' attribute to enclosing instance method
1027 |         let observers = state.withLock { state in
     |                               |- error: 'withLock' is only available in iOS 18.0 or newer
     |                               `- note: add 'if #available' version check
1028 |             state.isRequested = true
1029 |             let observers = state.observers
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1039:32: error: 'withLock' is only available in iOS 18.0 or newer
1012 | }
1013 |
1014 | private final class InvalidationSignal: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1015 |     private struct State: Sendable {
1016 |         var isRequested = false
     :
1036 |     }
1037 |
1038 |     func waitUntilRequested() async {
     |          `- note: add '@available' attribute to enclosing instance method
1039 |         let shouldWait = state.withLock { $0.isRequested == false }
     |                                |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                `- note: add 'if #available' version check
1040 |         guard shouldWait else {
1041 |             return
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1044:38: error: 'withLock' is only available in iOS 18.0 or newer
1012 | }
1013 |
1014 | private final class InvalidationSignal: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1015 |     private struct State: Sendable {
1016 |         var isRequested = false
     :
1036 |     }
1037 |
1038 |     func waitUntilRequested() async {
     |          `- note: add '@available' attribute to enclosing instance method
1039 |         let shouldWait = state.withLock { $0.isRequested == false }
1040 |         guard shouldWait else {
     :
1042 |         }
1043 |         await withCheckedContinuation { continuation in
1044 |             let shouldResume = state.withLock { state in
     |                                      |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                      `- note: add 'if #available' version check
1045 |                 if state.isRequested {
1046 |                     return true
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1079:42: error: 'withLock' is only available in iOS 18.0 or newer
1056 | }
1057 |
1058 | private final class SharedResultCell<Value: Sendable>: Sendable {
     |                     `- note: add '@available' attribute to enclosing generic class
1059 |     private struct WaiterCountObserver: Sendable {
1060 |         var minimumCount: Int
     :
1072 |     private let state = Mutex(State())
1073 |
1074 |     func wait() async throws -> Value {
     |          `- note: add '@available' attribute to enclosing instance method
1075 |         try Task.checkCancellation()
1076 |         let waiterID = UUID()
1077 |         let result = await withTaskCancellationHandler {
1078 |             await withCheckedContinuation { continuation in
1079 |                 let registration = state.withLock {
     |                                          |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                          `- note: add 'if #available' version check
1080 |                     state -> (
1081 |                         Result<Value, CancellationError>?,
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1107:32: error: 'withLock' is only available in iOS 18.0 or newer
1056 | }
1057 |
1058 | private final class SharedResultCell<Value: Sendable>: Sendable {
     |                     `- note: add '@available' attribute to enclosing generic class
1059 |     private struct WaiterCountObserver: Sendable {
1060 |         var minimumCount: Int
     :
1072 |     private let state = Mutex(State())
1073 |
1074 |     func wait() async throws -> Value {
     |          `- note: add '@available' attribute to enclosing instance method
1075 |         try Task.checkCancellation()
1076 |         let waiterID = UUID()
     :
1105 |             }
1106 |         } onCancel: {
1107 |             let waiter = state.withLock { state in
     |                                |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                `- note: add 'if #available' version check
1108 |                 state.waiters.removeValue(forKey: waiterID)
1109 |             }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1117:32: error: 'withLock' is only available in iOS 18.0 or newer
1056 | }
1057 |
1058 | private final class SharedResultCell<Value: Sendable>: Sendable {
     |                     `- note: add '@available' attribute to enclosing generic class
1059 |     private struct WaiterCountObserver: Sendable {
1060 |         var minimumCount: Int
     :
1113 |     }
1114 |
1115 |     func waitForWaiterCount(atLeast minimumCount: Int) async {
     |          `- note: add '@available' attribute to enclosing instance method
1116 |         precondition(minimumCount > 0)
1117 |         let shouldWait = state.withLock { state in
     |                                |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                `- note: add 'if #available' version check
1118 |             state.result == nil && state.waiters.count < minimumCount
1119 |         }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1124:38: error: 'withLock' is only available in iOS 18.0 or newer
1056 | }
1057 |
1058 | private final class SharedResultCell<Value: Sendable>: Sendable {
     |                     `- note: add '@available' attribute to enclosing generic class
1059 |     private struct WaiterCountObserver: Sendable {
1060 |         var minimumCount: Int
     :
1113 |     }
1114 |
1115 |     func waitForWaiterCount(atLeast minimumCount: Int) async {
     |          `- note: add '@available' attribute to enclosing instance method
1116 |         precondition(minimumCount > 0)
1117 |         let shouldWait = state.withLock { state in
     :
1122 |         }
1123 |         await withCheckedContinuation { continuation in
1124 |             let shouldResume = state.withLock { state in
     |                                      |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                      `- note: add 'if #available' version check
1125 |                 if state.result != nil || state.waiters.count >= minimumCount {
1126 |                     return true
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift:1141:29: error: 'withLock' is only available in iOS 18.0 or newer
1056 | }
1057 |
1058 | private final class SharedResultCell<Value: Sendable>: Sendable {
     |                     `- note: add '@available' attribute to enclosing generic class
1059 |     private struct WaiterCountObserver: Sendable {
1060 |         var minimumCount: Int
     :
1138 |     }
1139 |
1140 |     func resolve(_ result: Value) {
     |          `- note: add '@available' attribute to enclosing instance method
1141 |         let waiters = state.withLock { state in
     |                             |- error: 'withLock' is only available in iOS 18.0 or newer
     |                             `- note: add 'if #available' version check
1142 |             precondition(state.result == nil, "A shared result must resolve exactly once.")
1143 |             state.result = result
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:99:25: error: 'Mutex' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
  97 |     }
  98 |
  99 |     private let state = Mutex(State())
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
 100 |     // `removeSubscriber` and deinit cancellation must never acquire `delivery`: channel
 101 |     // completion can wait on a task-status lock while its cancellation handler removes here.
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:99:25: error: 'init(_:)' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
  97 |     }
  98 |
  99 |     private let state = Mutex(State())
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
 100 |     // `removeSubscriber` and deinit cancellation must never acquire `delivery`: channel
 101 |     // completion can wait on a task-status lock while its cancellation handler removes here.
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:102:28: error: 'Mutex' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 100 |     // `removeSubscriber` and deinit cancellation must never acquire `delivery`: channel
 101 |     // completion can wait on a task-status lock while its cancellation handler removes here.
 102 |     private let delivery = Mutex(())
     |                            `- error: 'Mutex' is only available in iOS 18.0 or newer
 103 |
 104 |     package init() {}
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:102:28: error: 'init(_:)' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 100 |     // `removeSubscriber` and deinit cancellation must never acquire `delivery`: channel
 101 |     // completion can wait on a task-status lock while its cancellation handler removes here.
 102 |     private let delivery = Mutex(())
     |                            `- error: 'init(_:)' is only available in iOS 18.0 or newer
 103 |
 104 |     package init() {}
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:831:25: error: 'Mutex' is only available in iOS 18.0 or newer
 819 | }
 820 |
 821 | private final class ThreadEventGenerationCheckpointIdentity: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 822 |     enum Phase: Equatable, Sendable {
 823 |         case inactive
     :
 829 |
 830 |     let id = UUID()
 831 |     private let state = Mutex(Phase.inactive)
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
 832 |
 833 |     var phase: Phase {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:831:25: error: 'init(_:)' is only available in iOS 18.0 or newer
 819 | }
 820 |
 821 | private final class ThreadEventGenerationCheckpointIdentity: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 822 |     enum Phase: Equatable, Sendable {
 823 |         case inactive
     :
 829 |
 830 |     let id = UUID()
 831 |     private let state = Mutex(Phase.inactive)
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
 832 |
 833 |     var phase: Phase {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:1311:25: error: 'Mutex' is only available in iOS 18.0 or newer
1288 | }
1289 |
1290 | private final class ThreadEventSubscriberChannel: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1291 |     private enum Phase: Sendable {
1292 |         case open
     :
1309 |
1310 |     private static let incrementalCapacity = 256
1311 |     private let state = Mutex(State())
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
1312 |
1313 |     @discardableResult
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:1311:25: error: 'init(_:)' is only available in iOS 18.0 or newer
1288 | }
1289 |
1290 | private final class ThreadEventSubscriberChannel: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1291 |     private enum Phase: Sendable {
1292 |         case open
     :
1309 |
1310 |     private static let incrementalCapacity = 256
1311 |     private let state = Mutex(State())
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
1312 |
1313 |     @discardableResult
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:1616:25: error: 'Mutex' is only available in iOS 18.0 or newer
1613 | }
1614 |
1615 | private final class ThreadEventSubscriptionCancellation: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1616 |     private let state = Mutex(false)
     |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
1617 |     private let id: UUID
1618 |     private let threadID: CodexThreadID
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:1616:25: error: 'init(_:)' is only available in iOS 18.0 or newer
1613 | }
1614 |
1615 | private final class ThreadEventSubscriptionCancellation: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1616 |     private let state = Mutex(false)
     |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
1617 |     private let id: UUID
1618 |     private let threadID: CodexThreadID
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:107:30: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 105 |
 106 |     deinit {
 107 |         let channels = state.withLock { state in
     |                              |- error: 'withLock' is only available in iOS 18.0 or newer
     |                              `- note: add 'if #available' version check
 108 |             let channels = state.threads.values.flatMap { $0.subscribers.values }
 109 |             state.threads.removeAll(keepingCapacity: false)
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:123:19: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 116 |     }
 117 |
 118 |     package func registerCheckpoint(
     |                  `- note: add '@available' attribute to enclosing instance method
 119 |         for threadID: CodexThreadID,
 120 |         operation: ThreadEventGenerationOperation = .standard
 121 |     ) throws -> ThreadEventGenerationCheckpoint {
 122 |         let identity = ThreadEventGenerationCheckpointIdentity()
 123 |         try state.withLock { state in
     |                   |- error: 'withLock' is only available in iOS 18.0 or newer
     |                   `- note: add 'if #available' version check
 124 |             if case .failed(let error) = state.phase {
 125 |                 throw error
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:138:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 135 |     }
 136 |
 137 |     package func turnStartDisposition(for threadID: CodexThreadID) -> ThreadEventTurnStartDisposition {
     |                  `- note: add '@available' attribute to enclosing instance method
 138 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 139 |             if let checkpointID = state.threads[threadID]?.activeCheckpointID,
 140 |                let checkpoint = state.checkpoints[checkpointID] {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:151:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 148 |     }
 149 |
 150 |     package func activate(_ checkpoint: ThreadEventGenerationCheckpoint) {
     |                  `- note: add '@available' attribute to enclosing instance method
 151 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 152 |             guard var record = state.checkpoints[checkpoint.identity.id] else {
 153 |                 switch checkpoint.identity.phase {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:192:19: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 186 |     }
 187 |
 188 |     package func seed(
     |                  `- note: add '@available' attribute to enclosing instance method
 189 |         _ snapshot: CodexTurnSnapshot,
 190 |         at checkpoint: ThreadEventGenerationCheckpoint
 191 |     ) throws {
 192 |         try state.withLock { state in
     |                   |- error: 'withLock' is only available in iOS 18.0 or newer
     |                   `- note: add 'if #available' version check
 193 |             guard var record = state.checkpoints[checkpoint.identity.id] else {
 194 |                 if checkpoint.identity.phase == .connectionTerminated {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:215:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 209 |     }
 210 |
 211 |     package func seedProvisionalResumeSnapshot(
     |                  `- note: add '@available' attribute to enclosing instance method
 212 |         _ snapshot: CodexTurnSnapshot,
 213 |         at checkpoint: ThreadEventGenerationCheckpoint
 214 |     ) {
 215 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 216 |             guard var record = state.checkpoints[checkpoint.identity.id] else {
 217 |                 if checkpoint.identity.phase == .connectionTerminated {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:240:19: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 232 |     }
 233 |
 234 |     package func resolveReviewStart(
     |                  `- note: add '@available' attribute to enclosing instance method
 235 |         _ checkpoint: ThreadEventGenerationCheckpoint,
 236 |         eventThreadID: CodexThreadID,
     :
 238 |     ) throws {
 239 |         var publication: ThreadEventPublication?
 240 |         try state.withLock { state in
     |                   |- error: 'withLock' is only available in iOS 18.0 or newer
     |                   `- note: add 'if #available' version check
 241 |             guard let record = state.checkpoints[checkpoint.identity.id] else {
 242 |                 preconditionFailure("Only an active review checkpoint can resolve a response.")
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:314:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 311 |     }
 312 |
 313 |     package func reject(_ checkpoint: ThreadEventGenerationCheckpoint) {
     |                  `- note: add '@available' attribute to enclosing instance method
 314 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 315 |             guard var record = state.checkpoints[checkpoint.identity.id] else {
 316 |                 switch checkpoint.identity.phase {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:361:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 354 |     }
 355 |
 356 |     private func commit(
     |                  `- note: add '@available' attribute to enclosing instance method
 357 |         _ checkpoint: ThreadEventGenerationCheckpoint,
 358 |         beforeDelivery: @escaping @Sendable () -> Void
 359 |     ) {
 360 |         var publication: ThreadEventPublication?
 361 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 362 |             guard let record = state.checkpoints[checkpoint.identity.id] else {
 363 |                 switch checkpoint.identity.phase {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:403:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 400 |     }
 401 |
 402 |     package func discard(_ checkpoint: ThreadEventGenerationCheckpoint) {
     |                  `- note: add '@available' attribute to enclosing instance method
 403 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 404 |             guard let record = state.checkpoints[checkpoint.identity.id] else {
 405 |                 precondition(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:426:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 422 |     }
 423 |
 424 |     package func resetGeneration(for threadID: CodexThreadID) {
     |                  `- note: add '@available' attribute to enclosing instance method
 425 |         var publication: ThreadEventPublication?
 426 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 427 |             guard case .open = state.phase else {
 428 |                 return
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:454:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 447 |     }
 448 |
 449 |     package func beginGeneration(
     |                  `- note: add '@available' attribute to enclosing instance method
 450 |         for threadID: CodexThreadID,
 451 |         including turnID: CodexTurnID
 452 |     ) {
 453 |         var publication: ThreadEventPublication?
 454 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 455 |             guard case .open = state.phase else {
 456 |                 return
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:503:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 496 |     }
 497 |
 498 |     package func seedCurrentTurnSnapshot(
     |                  `- note: add '@available' attribute to enclosing instance method
 499 |         _ snapshot: CodexTurnSnapshot,
 500 |         for threadID: CodexThreadID
 501 |     ) {
 502 |         var publication: ThreadEventPublication?
 503 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 504 |             guard case .open = state.phase else {
 505 |                 return
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:576:18: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 561 |     }
 562 |
 563 |     private func events(
     |                  `- note: add '@available' attribute to enclosing instance method
 564 |         for threadID: CodexThreadID,
 565 |         beforePublication: @escaping @Sendable () -> Void
     :
 574 |         )
 575 |         beforePublication()
 576 |         delivery.withLock { _ in
     |                  |- error: 'withLock' is only available in iOS 18.0 or newer
     |                  `- note: add 'if #available' version check
 577 |             let publication = state.withLock { state -> ThreadEventInitialPublication in
 578 |                 switch state.phase {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:577:37: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 561 |     }
 562 |
 563 |     private func events(
     |                  `- note: add '@available' attribute to enclosing instance method
 564 |         for threadID: CodexThreadID,
 565 |         beforePublication: @escaping @Sendable () -> Void
     :
 575 |         beforePublication()
 576 |         delivery.withLock { _ in
 577 |             let publication = state.withLock { state -> ThreadEventInitialPublication in
     |                                     |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                     `- note: add 'if #available' version check
 578 |                 switch state.phase {
 579 |                 case .failed(let error):
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:609:37: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 603 |
 604 |     @discardableResult
 605 |     package func route(
     |                  `- note: add '@available' attribute to enclosing instance method
 606 |         _ event: CodexThreadEvent,
 607 |         for threadID: CodexThreadID
 608 |     ) throws -> Int {
 609 |         let publication = try state.withLock { state -> ThreadEventPublication? in
     |                                     |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                     `- note: add 'if #available' version check
 610 |             if case .failed(let error) = state.phase {
 611 |                 throw error
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:696:30: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 693 |     }
 694 |
 695 |     package func finish(throwing error: CodexAppServerError) {
     |                  `- note: add '@available' attribute to enclosing instance method
 696 |         let channels = state.withLock { state -> [ThreadEventSubscriberChannel] in
     |                              |- error: 'withLock' is only available in iOS 18.0 or newer
     |                              `- note: add 'if #available' version check
 697 |             switch state.phase {
 698 |             case .open:
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:712:18: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 693 |     }
 694 |
 695 |     package func finish(throwing error: CodexAppServerError) {
     |                  `- note: add '@available' attribute to enclosing instance method
 696 |         let channels = state.withLock { state -> [ThreadEventSubscriberChannel] in
 697 |             switch state.phase {
     :
 710 |             return channels
 711 |         }
 712 |         delivery.withLock { _ in
     |                  |- error: 'withLock' is only available in iOS 18.0 or newer
     |                  `- note: add 'if #available' version check
 713 |             for channel in channels {
 714 |                 channel.fail(error)
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:720:30: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 717 |     }
 718 |
 719 |     package func snapshotForTesting(threadID: CodexThreadID) -> Snapshot {
     |                  `- note: add '@available' attribute to enclosing instance method
 720 |         let captured = state.withLock { state -> (
     |                              |- error: 'withLock' is only available in iOS 18.0 or newer
     |                              `- note: add 'if #available' version check
 721 |             snapshot: Snapshot,
 722 |             subscribers: [ThreadEventSubscriberChannel]
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:759:15: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 756 |     }
 757 |
 758 |     fileprivate func removeSubscriber(_ id: UUID, threadID: CodexThreadID) {
     |                      `- note: add '@available' attribute to enclosing instance method
 759 |         state.withLock { state in
     |               |- error: 'withLock' is only available in iOS 18.0 or newer
     |               `- note: add 'if #available' version check
 760 |             guard var thread = state.threads[threadID] else {
 761 |                 return
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:777:25: error: 'withLock' is only available in iOS 18.0 or newer
  57 | }
  58 |
  59 | package final class ThreadEventHub: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
  60 |     package struct Snapshot: Equatable, Sendable {
  61 |         package var subscriberCount: Int
     :
 771 |     }
 772 |
 773 |     private func deliver(_ publication: ThreadEventPublication?) -> Int {
     |                  `- note: add '@available' attribute to enclosing instance method
 774 |         guard let publication else {
 775 |             return 0
 776 |         }
 777 |         return delivery.withLock { _ in
     |                         |- error: 'withLock' is only available in iOS 18.0 or newer
     |                         `- note: add 'if #available' version check
 778 |             publication.deliver()
 779 |         }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:834:21: error: 'withLock' is only available in iOS 18.0 or newer
 819 | }
 820 |
 821 | private final class ThreadEventGenerationCheckpointIdentity: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 822 |     enum Phase: Equatable, Sendable {
 823 |         case inactive
     :
 831 |     private let state = Mutex(Phase.inactive)
 832 |
 833 |     var phase: Phase {
     |         `- note: add '@available' attribute to enclosing property
 834 |         get { state.withLock { $0 } }
     |                     |- error: 'withLock' is only available in iOS 18.0 or newer
     |                     `- note: add 'if #available' version check
 835 |         set { state.withLock { $0 = newValue } }
 836 |     }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:835:21: error: 'withLock' is only available in iOS 18.0 or newer
 819 | }
 820 |
 821 | private final class ThreadEventGenerationCheckpointIdentity: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
 822 |     enum Phase: Equatable, Sendable {
 823 |         case inactive
     :
 831 |     private let state = Mutex(Phase.inactive)
 832 |
 833 |     var phase: Phase {
     |         `- note: add '@available' attribute to enclosing property
 834 |         get { state.withLock { $0 } }
 835 |         set { state.withLock { $0 = newValue } }
     |                     |- error: 'withLock' is only available in iOS 18.0 or newer
     |                     `- note: add 'if #available' version check
 836 |     }
 837 | }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:1319:28: error: 'withLock' is only available in iOS 18.0 or newer
1288 | }
1289 |
1290 | private final class ThreadEventSubscriberChannel: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1291 |     private enum Phase: Sendable {
1292 |         case open
     :
1312 |
1313 |     @discardableResult
1314 |     func yield(
     |          `- note: add '@available' attribute to enclosing instance method
1315 |         _ event: CodexThreadEvent,
1316 |         compactEvents: [CodexThreadEvent],
1317 |         revision: UInt64
1318 |     ) -> Int {
1319 |         let result = state.withLock { state -> (ThreadEventWaiterDelivery?, Int) in
     |                            |- error: 'withLock' is only available in iOS 18.0 or newer
     |                            `- note: add 'if #available' version check
1320 |             let hasRevisionGap = state.lastPublicationRevision.map {
1321 |                 revision > ($0 &+ 1)
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:1391:30: error: 'withLock' is only available in iOS 18.0 or newer
1288 | }
1289 |
1290 | private final class ThreadEventSubscriberChannel: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1291 |     private enum Phase: Sendable {
1292 |         case open
     :
1384 |     }
1385 |
1386 |     func supersede(
     |          `- note: add '@available' attribute to enclosing instance method
1387 |         with events: [CodexThreadEvent],
1388 |         revision: UInt64,
1389 |         resetsGeneration: Bool
1390 |     ) {
1391 |         let delivery = state.withLock { state -> ThreadEventWaiterDelivery? in
     |                              |- error: 'withLock' is only available in iOS 18.0 or newer
     |                              `- note: add 'if #available' version check
1392 |             guard case .open = state.phase, accept(revision, state: &state) else {
1393 |                 return nil
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift:1413:30: error: 'withLock' is only available in iOS 18.0 or newer
1288 | }
1289 |
1290 | private final class ThreadEventSubscriberChannel: Sendable {
     |                     `- note: add '@available' attribute to enclosing class
1291 |     private enum Phase: Sendable {
1292 |         case open
     :
1410 |     }
1411 |
1412 |     func finish(with events: [CodexThreadEvent], revision: UInt64) {
     |          `- note: add '@available' attribute to enclosing instance method
1413 |         let delivery = state.withLock { state -> ThreadEventWaiterDelivery? in
     |                              |- error: 'withLock' is only available in iOS 18.0 or newer
     |                              `- note: add 'if #available' version check
1414 |             switch state.phase {
1415 |             case .open:
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ReviewRestartCoordinator.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile ReviewRestartCoordinator.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ServerRequestRegistry.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile ServerRequestRegistry.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ThreadEventHub.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile ThreadEventHub.swift
SwiftCompile normal arm64 Compiling\ TurnReplayCore.swift,\ TurnReplayStore.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayStore.swift (in target 'CodexAppServerKit' from project 'CodexKit')
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:40:28: error: 'Mutex' is only available in iOS 18.0 or newer
 37 | }
 38 |
 39 | private final class TurnReplayPendingWritePhase: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 40 |     private let accepted = Mutex(false)
    |                            `- error: 'Mutex' is only available in iOS 18.0 or newer
 41 |
 42 |     var isWriteAccepted: Bool {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:40:28: error: 'init(_:)' is only available in iOS 18.0 or newer
 37 | }
 38 |
 39 | private final class TurnReplayPendingWritePhase: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 40 |     private let accepted = Mutex(false)
    |                            `- error: 'init(_:)' is only available in iOS 18.0 or newer
 41 |
 42 |     var isWriteAccepted: Bool {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:751:25: error: 'Mutex' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
749 |     }
750 |
751 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
752 |     // `remove` and `cancelAll` must never acquire `delivery`: channel completion can wait on a
753 |     // subscriber task-status lock while that lock runs its cancellation handler back into remove.
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:751:25: error: 'init(_:)' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
749 |     }
750 |
751 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
752 |     // `remove` and `cancelAll` must never acquire `delivery`: channel completion can wait on a
753 |     // subscriber task-status lock while that lock runs its cancellation handler back into remove.
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:754:28: error: 'Mutex' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
752 |     // `remove` and `cancelAll` must never acquire `delivery`: channel completion can wait on a
753 |     // subscriber task-status lock while that lock runs its cancellation handler back into remove.
754 |     private let delivery = Mutex(())
    |                            `- error: 'Mutex' is only available in iOS 18.0 or newer
755 |
756 |     func makeSubscription(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:754:28: error: 'init(_:)' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
752 |     // `remove` and `cancelAll` must never acquire `delivery`: channel completion can wait on a
753 |     // subscriber task-status lock while that lock runs its cancellation handler back into remove.
754 |     private let delivery = Mutex(())
    |                            `- error: 'init(_:)' is only available in iOS 18.0 or newer
755 |
756 |     func makeSubscription(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:390:25: error: 'Mutex' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
388 |
389 |     private static let incrementalCapacity = 256
390 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
391 |
392 |     func yield(_ event: CodexTurnEvent, accumulatedSnapshot: CodexTurnSnapshot) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:390:25: error: 'init(_:)' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
388 |
389 |     private static let incrementalCapacity = 256
390 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
391 |
392 |     func yield(_ event: CodexTurnEvent, accumulatedSnapshot: CodexTurnSnapshot) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:560:25: error: 'Mutex' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
558 |     }
559 |
560 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
561 |
562 |     func yield(_ progress: CodexReviewProgress) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:560:25: error: 'init(_:)' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
558 |     }
559 |
560 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
561 |
562 |     func yield(_ progress: CodexReviewProgress) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:707:25: error: 'Mutex' is only available in iOS 18.0 or newer
700 | }
701 |
702 | private final class TurnReplaySubscriptionCancellation<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
703 |     private struct State {
704 |         var isCancelled = false
705 |     }
706 |
707 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
708 |     private let id: UUID
709 |     private let registry: TurnReplaySubscriptionRegistry<Channel>
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:707:25: error: 'init(_:)' is only available in iOS 18.0 or newer
700 | }
701 |
702 | private final class TurnReplaySubscriptionCancellation<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
703 |     private struct State {
704 |         var isCancelled = false
705 |     }
706 |
707 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
708 |     private let id: UUID
709 |     private let registry: TurnReplaySubscriptionRegistry<Channel>
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:43:18: error: 'withLock' is only available in iOS 18.0 or newer
 37 | }
 38 |
 39 | private final class TurnReplayPendingWritePhase: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 40 |     private let accepted = Mutex(false)
 41 |
 42 |     var isWriteAccepted: Bool {
    |         `- note: add '@available' attribute to enclosing property
 43 |         accepted.withLock { $0 }
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
 44 |     }
 45 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:47:18: error: 'withLock' is only available in iOS 18.0 or newer
 37 | }
 38 |
 39 | private final class TurnReplayPendingWritePhase: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 40 |     private let accepted = Mutex(false)
 41 |
    :
 44 |     }
 45 |
 46 |     func acceptWrite() {
    |          `- note: add '@available' attribute to enclosing instance method
 47 |         accepted.withLock { accepted in
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
 48 |             precondition(
 49 |                 accepted == false,
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:57:18: error: 'withLock' is only available in iOS 18.0 or newer
 37 | }
 38 |
 39 | private final class TurnReplayPendingWritePhase: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 40 |     private let accepted = Mutex(false)
 41 |
    :
 54 |     }
 55 |
 56 |     func rejectAcceptedWrite() {
    |          `- note: add '@available' attribute to enclosing instance method
 57 |         accepted.withLock { accepted in
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
 58 |             precondition(
 59 |                 accepted,
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:393:28: error: 'withLock' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
390 |     private let state = Mutex(State())
391 |
392 |     func yield(_ event: CodexTurnEvent, accumulatedSnapshot: CodexTurnSnapshot) {
    |          `- note: add '@available' attribute to enclosing instance method
393 |         let waiter = state.withLock { state -> CheckedContinuation<CodexTurnEvent?, Error>? in
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
394 |             guard case .open = state.phase else {
395 |                 return nil
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:419:28: error: 'withLock' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
416 |     }
417 |
418 |     func finish(with compactSnapshot: CompactTurnSnapshot) {
    |          `- note: add '@available' attribute to enclosing instance method
419 |         let waiter = state.withLock { state -> CheckedContinuation<CodexTurnEvent?, Error>? in
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
420 |             switch state.phase {
421 |             case .open:
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:444:28: error: 'withLock' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
441 |     }
442 |
443 |     func finish(throwing error: CodexAppServerError) {
    |          `- note: add '@available' attribute to enclosing instance method
444 |         let waiter = state.withLock { state -> CheckedContinuation<CodexTurnEvent?, Error>? in
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
445 |             switch state.phase {
446 |             case .open:
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:471:39: error: 'withLock' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
462 |     }
463 |
464 |     func next(
    |          `- note: add '@available' attribute to enclosing instance method
465 |         cancellation: TurnReplaySubscriptionCancellation<TurnReplayEventSubscriberChannel>
466 |     ) async throws -> CodexTurnEvent? {
    :
469 |         return try await withTaskCancellationHandler {
470 |             try await withCheckedThrowingContinuation { continuation in
471 |                 let immediate = state.withLock { state -> Result<CodexTurnEvent?, Error>? in
    |                                       |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                       `- note: add 'if #available' version check
472 |                     if state.pending.isEmpty == false {
473 |                         let event = state.pending.removeFirst()
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:504:28: error: 'withLock' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
501 |     }
502 |
503 |     func cancel() {
    |          `- note: add '@available' attribute to enclosing instance method
504 |         let waiter = state.withLock { state -> CheckedContinuation<CodexTurnEvent?, Error>? in
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
505 |             guard case .cancelled = state.phase else {
506 |                 if case .finished = state.phase {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:521:15: error: 'withLock' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
518 |     }
519 |
520 |     func overflowCountForTesting() -> Int {
    |          `- note: add '@available' attribute to enclosing instance method
521 |         state.withLock { $0.overflowCount }
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
522 |     }
523 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:525:15: error: 'withLock' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
522 |     }
523 |
524 |     private func tryBeginNext() -> Bool {
    |                  `- note: add '@available' attribute to enclosing instance method
525 |         state.withLock { state in
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
526 |             guard state.nextIsActive == false else {
527 |                 return false
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:535:15: error: 'withLock' is only available in iOS 18.0 or newer
368 | }
369 |
370 | private final class TurnReplayEventSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
371 |     typealias Element = CodexTurnEvent
372 |
    :
532 |     }
533 |
534 |     private func endNext() {
    |                  `- note: add '@available' attribute to enclosing instance method
535 |         state.withLock { state in
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
536 |             precondition(state.nextIsActive)
537 |             state.nextIsActive = false
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:563:28: error: 'withLock' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
560 |     private let state = Mutex(State())
561 |
562 |     func yield(_ progress: CodexReviewProgress) {
    |          `- note: add '@available' attribute to enclosing instance method
563 |         let waiter = state.withLock { state -> CheckedContinuation<CodexReviewProgress?, Error>? in
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
564 |             guard case .open = state.phase else {
565 |                 return nil
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:578:28: error: 'withLock' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
575 |     }
576 |
577 |     func finish(with outcome: CodexTurnOutcome) {
    |          `- note: add '@available' attribute to enclosing instance method
578 |         let waiter = state.withLock { state -> CheckedContinuation<CodexReviewProgress?, Error>? in
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
579 |             switch state.phase {
580 |             case .open:
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:606:28: error: 'withLock' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
603 |     }
604 |
605 |     func finish(throwing error: CodexAppServerError) {
    |          `- note: add '@available' attribute to enclosing instance method
606 |         let waiter = state.withLock { state -> CheckedContinuation<CodexReviewProgress?, Error>? in
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
607 |             switch state.phase {
608 |             case .open:
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:636:39: error: 'withLock' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
624 |     }
625 |
626 |     func next(
    |          `- note: add '@available' attribute to enclosing instance method
627 |         cancellation: TurnReplaySubscriptionCancellation<TurnReplayProgressSubscriberChannel>
628 |     ) async throws -> CodexReviewProgress? {
    :
634 |         return try await withTaskCancellationHandler {
635 |             try await withCheckedThrowingContinuation { continuation in
636 |                 let immediate = state.withLock { state -> Result<CodexReviewProgress?, Error>? in
    |                                       |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                       `- note: add 'if #available' version check
637 |                     if let progress = state.newestProgress {
638 |                         state.newestProgress = nil
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:666:28: error: 'withLock' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
663 |     }
664 |
665 |     func cancel() {
    |          `- note: add '@available' attribute to enclosing instance method
666 |         let waiter = state.withLock { state -> CheckedContinuation<CodexReviewProgress?, Error>? in
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
667 |             guard case .cancelled = state.phase else {
668 |                 if case .finished = state.phase {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:685:15: error: 'withLock' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
682 |     func overflowCountForTesting() -> Int { 0 }
683 |
684 |     private func tryBeginNext() -> Bool {
    |                  `- note: add '@available' attribute to enclosing instance method
685 |         state.withLock { state in
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
686 |             guard state.nextIsActive == false else {
687 |                 return false
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:695:15: error: 'withLock' is only available in iOS 18.0 or newer
540 | }
541 |
542 | private final class TurnReplayProgressSubscriberChannel: TurnReplaySubscriberChannel {
    |                     `- note: add '@available' attribute to enclosing class
543 |     typealias Element = CodexReviewProgress
544 |
    :
692 |     }
693 |
694 |     private func endNext() {
    |                  `- note: add '@available' attribute to enclosing instance method
695 |         state.withLock { state in
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
696 |             precondition(state.nextIsActive)
697 |             state.nextIsActive = false
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:717:34: error: 'withLock' is only available in iOS 18.0 or newer
700 | }
701 |
702 | private final class TurnReplaySubscriptionCancellation<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
703 |     private struct State {
704 |         var isCancelled = false
    :
714 |     }
715 |
716 |     func cancel() {
    |          `- note: add '@available' attribute to enclosing instance method
717 |         let shouldRemove = state.withLock { state in
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
718 |             guard state.isCancelled == false else {
719 |                 return false
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:763:18: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
754 |     private let delivery = Mutex(())
755 |
756 |     func makeSubscription(
    |          `- note: add '@available' attribute to enclosing instance method
757 |         makeChannel: () -> Channel,
758 |         prepareForPublication: (Channel) -> Void = { _ in }
    :
761 |         let channel = makeChannel()
762 |         let cancellation = TurnReplaySubscriptionCancellation(id: id, registry: self)
763 |         delivery.withLock { _ in
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
764 |             precondition(
765 |                 state.withLock { $0.isFinished == false },
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:765:23: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
754 |     private let delivery = Mutex(())
755 |
756 |     func makeSubscription(
    |          `- note: add '@available' attribute to enclosing instance method
757 |         makeChannel: () -> Channel,
758 |         prepareForPublication: (Channel) -> Void = { _ in }
    :
763 |         delivery.withLock { _ in
764 |             precondition(
765 |                 state.withLock { $0.isFinished == false },
    |                       |- error: 'withLock' is only available in iOS 18.0 or newer
    |                       `- note: add 'if #available' version check
766 |                 "Late replay must come from handle state."
767 |             )
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:769:19: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
754 |     private let delivery = Mutex(())
755 |
756 |     func makeSubscription(
    |          `- note: add '@available' attribute to enclosing instance method
757 |         makeChannel: () -> Channel,
758 |         prepareForPublication: (Channel) -> Void = { _ in }
    :
767 |             )
768 |             prepareForPublication(channel)
769 |             state.withLock { state in
    |                   |- error: 'withLock' is only available in iOS 18.0 or newer
    |                   `- note: add 'if #available' version check
770 |                 precondition(
771 |                     state.isFinished == false,
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:784:18: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
779 |
780 |     @discardableResult
781 |     func yield(
    |          `- note: add '@available' attribute to enclosing instance method
782 |         _ body: (Channel) -> Void
783 |     ) -> Int {
784 |         delivery.withLock { _ in
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
785 |             let channels = state.withLock { state -> [Channel] in
786 |                 guard state.isFinished == false else {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:785:34: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
779 |
780 |     @discardableResult
781 |     func yield(
    |          `- note: add '@available' attribute to enclosing instance method
782 |         _ body: (Channel) -> Void
783 |     ) -> Int {
784 |         delivery.withLock { _ in
785 |             let channels = state.withLock { state -> [Channel] in
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
786 |                 guard state.isFinished == false else {
787 |                     return []
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:802:29: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
799 |     }
800 |
801 |     func remove(_ id: UUID) {
    |          `- note: add '@available' attribute to enclosing instance method
802 |         let channel = state.withLock { $0.channels.removeValue(forKey: id) }
    |                             |- error: 'withLock' is only available in iOS 18.0 or newer
    |                             `- note: add 'if #available' version check
803 |         channel?.cancel()
804 |     }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:809:18: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
804 |     }
805 |
806 |     func finish(
    |          `- note: add '@available' attribute to enclosing instance method
807 |         _ body: (Channel) -> Void
808 |     ) {
809 |         delivery.withLock { _ in
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
810 |             let channels = state.withLock { state -> [Channel] in
811 |                 guard state.isFinished == false else {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:810:34: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
804 |     }
805 |
806 |     func finish(
    |          `- note: add '@available' attribute to enclosing instance method
807 |         _ body: (Channel) -> Void
808 |     ) {
809 |         delivery.withLock { _ in
810 |             let channels = state.withLock { state -> [Channel] in
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
811 |                 guard state.isFinished == false else {
812 |                     return []
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift:826:30: error: 'withLock' is only available in iOS 18.0 or newer
732 | }
733 |
734 | private final class TurnReplaySubscriptionRegistry<Channel: TurnReplaySubscriberChannel>: Sendable {
    |                     `- note: add '@available' attribute to enclosing generic class
735 |     private struct State {
736 |         var channels: [UUID: Channel] = [:]
    :
823 |     }
824 |
825 |     func cancelAll() {
    |          `- note: add '@available' attribute to enclosing instance method
826 |         let channels = state.withLock { state -> [Channel] in
    |                              |- error: 'withLock' is only available in iOS 18.0 or newer
    |                              `- note: add 'if #available' version check
827 |             let channels = Array(state.channels.values)
828 |             state.channels.removeAll(keepingCapacity: false)
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayCore.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile TurnReplayCore.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/TurnReplayStore.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile TurnReplayStore.swift
SwiftCompile normal arm64 Compiling\ ConnectionEventHub.swift,\ ConnectionSupervisor.swift,\ ConnectionTerminationArbiter.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionTerminationArbiter.swift (in target 'CodexAppServerKit' from project 'CodexKit')
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:31:23: error: 'Duration' is only available in iOS 16.0 or newer
 25 |
 26 | /// A scheduled retry after an app-server overload response.
 27 | public struct CodexRetryDiagnostic: Equatable, Sendable {
    |               `- note: add '@available' attribute to enclosing struct
 28 |     public let requestID: Int
 29 |     public let method: String
 30 |     public let attempt: Int
 31 |     public let delay: Duration
    |                       `- error: 'Duration' is only available in iOS 16.0 or newer
 32 |     public let serverError: CodexServerError
 33 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:38:16: error: 'Duration' is only available in iOS 16.0 or newer
 25 |
 26 | /// A scheduled retry after an app-server overload response.
 27 | public struct CodexRetryDiagnostic: Equatable, Sendable {
    |               `- note: add '@available' attribute to enclosing struct
 28 |     public let requestID: Int
 29 |     public let method: String
    :
 32 |     public let serverError: CodexServerError
 33 |
 34 |     package init(
    |             `- note: add '@available' attribute to enclosing initializer
 35 |         requestID: Int,
 36 |         method: String,
 37 |         attempt: Int,
 38 |         delay: Duration,
    |                `- error: 'Duration' is only available in iOS 16.0 or newer
 39 |         serverError: CodexServerError
 40 |     ) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:489:25: error: 'Mutex' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
487 |     }
488 |
489 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
490 |     // `remove` and `cancelAll` must never acquire `delivery`: channel completion can wait on a
491 |     // subscriber task-status lock while that lock runs its cancellation handler back into remove.
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:489:25: error: 'init(_:)' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
487 |     }
488 |
489 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
490 |     // `remove` and `cancelAll` must never acquire `delivery`: channel completion can wait on a
491 |     // subscriber task-status lock while that lock runs its cancellation handler back into remove.
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:492:28: error: 'Mutex' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
490 |     // `remove` and `cancelAll` must never acquire `delivery`: channel completion can wait on a
491 |     // subscriber task-status lock while that lock runs its cancellation handler back into remove.
492 |     private let delivery = Mutex(())
    |                            `- error: 'Mutex' is only available in iOS 18.0 or newer
493 |
494 |     func makeEvents() -> CodexConnectionEvents {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:492:28: error: 'init(_:)' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
490 |     // `remove` and `cancelAll` must never acquire `delivery`: channel completion can wait on a
491 |     // subscriber task-status lock while that lock runs its cancellation handler back into remove.
492 |     private let delivery = Mutex(())
    |                            `- error: 'init(_:)' is only available in iOS 18.0 or newer
493 |
494 |     func makeEvents() -> CodexConnectionEvents {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:295:25: error: 'Mutex' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
293 |
294 |     private static let diagnosticCapacity = 32
295 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
296 |
297 |     func yield(_ event: CodexConnectionEvent) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:295:25: error: 'init(_:)' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
293 |
294 |     private static let diagnosticCapacity = 32
295 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
296 |
297 |     func yield(_ event: CodexConnectionEvent) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:456:25: error: 'Mutex' is only available in iOS 18.0 or newer
449 | }
450 |
451 | private final class ConnectionEventSubscriptionCancellation: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
452 |     private struct State {
453 |         var isCancelled = false
454 |     }
455 |
456 |     private let state = Mutex(State())
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
457 |     private let id: UUID
458 |     private let registry: ConnectionEventSubscriptionRegistry
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:456:25: error: 'init(_:)' is only available in iOS 18.0 or newer
449 | }
450 |
451 | private final class ConnectionEventSubscriptionCancellation: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
452 |     private struct State {
453 |         var isCancelled = false
454 |     }
455 |
456 |     private let state = Mutex(State())
    |                         `- error: 'init(_:)' is only available in iOS 18.0 or newer
457 |     private let id: UUID
458 |     private let registry: ConnectionEventSubscriptionRegistry
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:298:28: error: 'withLock' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
295 |     private let state = Mutex(State())
296 |
297 |     func yield(_ event: CodexConnectionEvent) {
    |          `- note: add '@available' attribute to enclosing instance method
298 |         let waiter = state.withLock { state -> CheckedContinuation<
    |                            |- error: 'withLock' is only available in iOS 18.0 or newer
    |                            `- note: add 'if #available' version check
299 |             CodexConnectionEvent?, Never
300 |         >? in
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:318:32: error: 'withLock' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
315 |     }
316 |
317 |     func finish(with termination: CodexConnectionTermination) {
    |          `- note: add '@available' attribute to enclosing instance method
318 |         let completion = state.withLock { state -> (
    |                                |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                `- note: add 'if #available' version check
319 |             CheckedContinuation<CodexConnectionEvent?, Never>?,
320 |             [CheckedContinuation<Void, Never>]
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:348:32: error: 'withLock' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
345 |     }
346 |
347 |     func cancel() {
    |          `- note: add '@available' attribute to enclosing instance method
348 |         let completion = state.withLock { state -> (
    |                                |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                `- note: add 'if #available' version check
349 |             CheckedContinuation<CodexConnectionEvent?, Never>?,
350 |             [CheckedContinuation<Void, Never>]
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:382:42: error: 'withLock' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
370 |     }
371 |
372 |     func next(
    |          `- note: add '@available' attribute to enclosing instance method
373 |         cancellation: ConnectionEventSubscriptionCancellation
374 |     ) async -> CodexConnectionEvent? {
    :
380 |         return await withTaskCancellationHandler {
381 |             await withCheckedContinuation { continuation in
382 |                 let registration = state.withLock { state -> (
    |                                          |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                          `- note: add 'if #available' version check
383 |                     CodexConnectionEvent??,
384 |                     [CheckedContinuation<Void, Never>]
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:416:15: error: 'withLock' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
413 |     }
414 |
415 |     func tryBeginNext() -> Bool {
    |          `- note: add '@available' attribute to enclosing instance method
416 |         state.withLock { state in
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
417 |             guard state.nextIsActive == false else {
418 |                 return false
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:426:15: error: 'withLock' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
423 |     }
424 |
425 |     func endNext() {
    |          `- note: add '@available' attribute to enclosing instance method
426 |         state.withLock { state in
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
427 |             precondition(state.nextIsActive, "A next() call must own the channel before ending.")
428 |             state.nextIsActive = false
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:434:54: error: 'withLock' is only available in iOS 18.0 or newer
276 | }
277 |
278 | private final class ConnectionEventSubscriberChannel: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
279 |     private enum Phase {
280 |         case open
    :
430 |     }
431 |
432 |     func waitUntilNextSuspendsForTesting() async {
    |          `- note: add '@available' attribute to enclosing instance method
433 |         await withCheckedContinuation { continuation in
434 |             let isAlreadySuspendedOrFinished = state.withLock { state in
    |                                                      |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                                      `- note: add 'if #available' version check
435 |                 if state.waiter != nil {
436 |                     return true
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:466:34: error: 'withLock' is only available in iOS 18.0 or newer
449 | }
450 |
451 | private final class ConnectionEventSubscriptionCancellation: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
452 |     private struct State {
453 |         var isCancelled = false
    :
463 |     }
464 |
465 |     func cancel() {
    |          `- note: add '@available' attribute to enclosing instance method
466 |         let shouldRemove = state.withLock { state in
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
467 |             guard state.isCancelled == false else {
468 |                 return false
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:498:18: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
492 |     private let delivery = Mutex(())
493 |
494 |     func makeEvents() -> CodexConnectionEvents {
    |          `- note: add '@available' attribute to enclosing instance method
495 |         let id = UUID()
496 |         let channel = ConnectionEventSubscriberChannel()
497 |         let cancellation = ConnectionEventSubscriptionCancellation(id: id, registry: self)
498 |         delivery.withLock { _ in
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
499 |             let terminal = state.withLock { state -> CodexConnectionTermination? in
500 |                 guard let terminal = state.terminal else {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:499:34: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
492 |     private let delivery = Mutex(())
493 |
494 |     func makeEvents() -> CodexConnectionEvents {
    |          `- note: add '@available' attribute to enclosing instance method
495 |         let id = UUID()
496 |         let channel = ConnectionEventSubscriberChannel()
497 |         let cancellation = ConnectionEventSubscriptionCancellation(id: id, registry: self)
498 |         delivery.withLock { _ in
499 |             let terminal = state.withLock { state -> CodexConnectionTermination? in
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
500 |                 guard let terminal = state.terminal else {
501 |                     state.channels[id] = channel
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:514:18: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
511 |     }
512 |
513 |     func yield(_ event: CodexConnectionEvent) {
    |          `- note: add '@available' attribute to enclosing instance method
514 |         delivery.withLock { _ in
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
515 |             let channels = state.withLock { state -> [ConnectionEventSubscriberChannel] in
516 |                 guard state.terminal == nil else {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:515:34: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
511 |     }
512 |
513 |     func yield(_ event: CodexConnectionEvent) {
    |          `- note: add '@available' attribute to enclosing instance method
514 |         delivery.withLock { _ in
515 |             let channels = state.withLock { state -> [ConnectionEventSubscriberChannel] in
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
516 |                 guard state.terminal == nil else {
517 |                     return []
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:528:29: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
525 |     }
526 |
527 |     func remove(_ id: UUID) {
    |          `- note: add '@available' attribute to enclosing instance method
528 |         let channel = state.withLock { $0.channels.removeValue(forKey: id) }
    |                             |- error: 'withLock' is only available in iOS 18.0 or newer
    |                             `- note: add 'if #available' version check
529 |         channel?.cancel()
530 |     }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:533:18: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
530 |     }
531 |
532 |     func finish(with termination: CodexConnectionTermination) {
    |          `- note: add '@available' attribute to enclosing instance method
533 |         delivery.withLock { _ in
    |                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                  `- note: add 'if #available' version check
534 |             let channels = state.withLock { state -> [ConnectionEventSubscriberChannel] in
535 |                 if let existing = state.terminal {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:534:34: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
530 |     }
531 |
532 |     func finish(with termination: CodexConnectionTermination) {
    |          `- note: add '@available' attribute to enclosing instance method
533 |         delivery.withLock { _ in
534 |             let channels = state.withLock { state -> [ConnectionEventSubscriberChannel] in
    |                                  |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                  `- note: add 'if #available' version check
535 |                 if let existing = state.terminal {
536 |                     precondition(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:554:30: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
551 |     }
552 |
553 |     func cancelAll() {
    |          `- note: add '@available' attribute to enclosing instance method
554 |         let channels = state.withLock { state -> [ConnectionEventSubscriberChannel] in
    |                              |- error: 'withLock' is only available in iOS 18.0 or newer
    |                              `- note: add 'if #available' version check
555 |             let channels = Array(state.channels.values)
556 |             state.channels.removeAll(keepingCapacity: false)
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift:565:15: error: 'withLock' is only available in iOS 18.0 or newer
481 | }
482 |
483 | private final class ConnectionEventSubscriptionRegistry: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
484 |     private struct State {
485 |         var channels: [UUID: ConnectionEventSubscriberChannel] = [:]
    :
562 |     }
563 |
564 |     func snapshot() -> ConnectionEventHub.Snapshot {
    |          `- note: add '@available' attribute to enclosing instance method
565 |         state.withLock { state in
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
566 |             .init(subscriberCount: state.channels.count, terminal: state.terminal)
567 |         }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:16:25: error: 'Mutex' is only available in iOS 18.0 or newer
  8 | )
  9 |
 10 | package final class ConnectionCloseAction: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 11 |     private enum Request: Sendable {
 12 |         case close
    :
 14 |     }
 15 |
 16 |     private let action: Mutex<(@Sendable (Request) async -> Void)?>
    |                         `- error: 'Mutex' is only available in iOS 18.0 or newer
 17 |
 18 |     package init(action: (@Sendable () async -> Void)? = nil) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:300:24: error: 'Mutex' is only available in iOS 18.0 or newer
292 | }
293 |
294 | package final class AppServerConnectionLease: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
295 |     private struct State {
296 |         var supervisor: ConnectionSupervisor
    :
298 |     }
299 |
300 |     private let state: Mutex<State>
    |                        `- error: 'Mutex' is only available in iOS 18.0 or newer
301 |
302 |     package init(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:25:23: error: 'Mutex' is only available in iOS 18.0 or newer
  8 | )
  9 |
 10 | package final class ConnectionCloseAction: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 11 |     private enum Request: Sendable {
 12 |         case close
    :
 16 |     private let action: Mutex<(@Sendable (Request) async -> Void)?>
 17 |
 18 |     package init(action: (@Sendable () async -> Void)? = nil) {
    |             `- note: add '@available' attribute to enclosing initializer
 19 |         let wrappedAction: (@Sendable (Request) async -> Void)?
 20 |         if let action {
    :
 23 |             wrappedAction = nil
 24 |         }
 25 |         self.action = Mutex(wrappedAction)
    |                       |- error: 'Mutex' is only available in iOS 18.0 or newer
    |                       `- note: add 'if #available' version check
 26 |     }
 27 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:25:23: error: 'init(_:)' is only available in iOS 18.0 or newer
  8 | )
  9 |
 10 | package final class ConnectionCloseAction: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 11 |     private enum Request: Sendable {
 12 |         case close
    :
 16 |     private let action: Mutex<(@Sendable (Request) async -> Void)?>
 17 |
 18 |     package init(action: (@Sendable () async -> Void)? = nil) {
    |             `- note: add '@available' attribute to enclosing initializer
 19 |         let wrappedAction: (@Sendable (Request) async -> Void)?
 20 |         if let action {
    :
 23 |             wrappedAction = nil
 24 |         }
 25 |         self.action = Mutex(wrappedAction)
    |                       |- error: 'init(_:)' is only available in iOS 18.0 or newer
    |                       `- note: add 'if #available' version check
 26 |     }
 27 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:29:16: error: 'withLock' is only available in iOS 18.0 or newer
  8 | )
  9 |
 10 | package final class ConnectionCloseAction: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 11 |     private enum Request: Sendable {
 12 |         case close
    :
 26 |     }
 27 |
 28 |     package func bind(to supervisor: ConnectionSupervisor) {
    |                  `- note: add '@available' attribute to enclosing instance method
 29 |         action.withLock { action in
    |                |- error: 'withLock' is only available in iOS 18.0 or newer
    |                `- note: add 'if #available' version check
 30 |             precondition(action == nil, "Connection close action may be bound exactly once.")
 31 |             action = { [weak supervisor] request in
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:48:35: error: 'withLock' is only available in iOS 18.0 or newer
  8 | )
  9 |
 10 | package final class ConnectionCloseAction: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 11 |     private enum Request: Sendable {
 12 |         case close
    :
 45 |     }
 46 |
 47 |     package func closeConnection() async {
    |                  `- note: add '@available' attribute to enclosing instance method
 48 |         guard let action = action.withLock({ $0 }) else {
    |                                   |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                   `- note: add 'if #available' version check
 49 |             preconditionFailure("Connection close action is not bound.")
 50 |         }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:55:35: error: 'withLock' is only available in iOS 18.0 or newer
  8 | )
  9 |
 10 | package final class ConnectionCloseAction: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
 11 |     private enum Request: Sendable {
 12 |         case close
    :
 52 |     }
 53 |
 54 |     package func failConnection(with failure: CodexTransportFailure) async {
    |                  `- note: add '@available' attribute to enclosing instance method
 55 |         guard let action = action.withLock({ $0 }) else {
    |                                   |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                   `- note: add 'if #available' version check
 56 |             preconditionFailure("Connection close action is not bound.")
 57 |         }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:306:22: error: 'Mutex' is only available in iOS 18.0 or newer
292 | }
293 |
294 | package final class AppServerConnectionLease: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
295 |     private struct State {
296 |         var supervisor: ConnectionSupervisor
    :
300 |     private let state: Mutex<State>
301 |
302 |     package init(
    |             `- note: add '@available' attribute to enclosing initializer
303 |         supervisor: ConnectionSupervisor,
304 |         processTerminationToken: ProcessTerminationToken
305 |     ) {
306 |         self.state = Mutex(.init(
    |                      |- error: 'Mutex' is only available in iOS 18.0 or newer
    |                      `- note: add 'if #available' version check
307 |             supervisor: supervisor,
308 |             processTerminationToken: processTerminationToken
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:306:22: error: 'init(_:)' is only available in iOS 18.0 or newer
292 | }
293 |
294 | package final class AppServerConnectionLease: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
295 |     private struct State {
296 |         var supervisor: ConnectionSupervisor
    :
300 |     private let state: Mutex<State>
301 |
302 |     package init(
    |             `- note: add '@available' attribute to enclosing initializer
303 |         supervisor: ConnectionSupervisor,
304 |         processTerminationToken: ProcessTerminationToken
305 |     ) {
306 |         self.state = Mutex(.init(
    |                      |- error: 'init(_:)' is only available in iOS 18.0 or newer
    |                      `- note: add 'if #available' version check
307 |             supervisor: supervisor,
308 |             processTerminationToken: processTerminationToken
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:313:15: error: 'withLock' is only available in iOS 18.0 or newer
292 | }
293 |
294 | package final class AppServerConnectionLease: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
295 |     private struct State {
296 |         var supervisor: ConnectionSupervisor
    :
311 |
312 |     deinit {
313 |         state.withLock { state in
    |               |- error: 'withLock' is only available in iOS 18.0 or newer
    |               `- note: add 'if #available' version check
314 |             state.processTerminationToken.terminateOnce()
315 |         }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift:319:32: error: 'withLock' is only available in iOS 18.0 or newer
292 | }
293 |
294 | package final class AppServerConnectionLease: Sendable {
    |                     `- note: add '@available' attribute to enclosing class
295 |     private struct State {
296 |         var supervisor: ConnectionSupervisor
    :
316 |     }
317 |
318 |     package func closeConnection() async {
    |                  `- note: add '@available' attribute to enclosing instance method
319 |         let supervisor = state.withLock { $0.supervisor }
    |                                |- error: 'withLock' is only available in iOS 18.0 or newer
    |                                `- note: add 'if #available' version check
320 |         await supervisor.closeConnection()
321 |     }
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionEventHub.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile ConnectionEventHub.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionSupervisor.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile ConnectionSupervisor.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/ConnectionTerminationArbiter.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile ConnectionTerminationArbiter.swift
SwiftCompile normal arm64 Compiling\ CodexAppServer.swift,\ CodexAppServerNotificationRouter.swift,\ CodexAppServerRequest.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServerNotificationRouter.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServerRequest.swift (in target 'CodexAppServerKit' from project 'CodexKit')
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:13:35: error: 'Duration' is only available in iOS 16.0 or newer
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
  12 |         public struct Deadlines: Equatable, Sendable {
     |                       `- note: add '@available' attribute to enclosing struct
  13 |             public var handshake: Duration?
     |                                   `- error: 'Duration' is only available in iOS 16.0 or newer
  14 |             public var request: Duration?
  15 |
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:14:33: error: 'Duration' is only available in iOS 16.0 or newer
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
  12 |         public struct Deadlines: Equatable, Sendable {
     |                       `- note: add '@available' attribute to enclosing struct
  13 |             public var handshake: Duration?
  14 |             public var request: Duration?
     |                                 `- error: 'Duration' is only available in iOS 16.0 or newer
  15 |
  16 |             public init(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:17:28: error: 'Duration' is only available in iOS 16.0 or newer
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
  12 |         public struct Deadlines: Equatable, Sendable {
     |                       `- note: add '@available' attribute to enclosing struct
  13 |             public var handshake: Duration?
  14 |             public var request: Duration?
  15 |
  16 |             public init(
     |                    `- note: add '@available' attribute to enclosing initializer
  17 |                 handshake: Duration? = nil,
     |                            `- error: 'Duration' is only available in iOS 16.0 or newer
  18 |                 request: Duration? = nil
  19 |             ) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:18:26: error: 'Duration' is only available in iOS 16.0 or newer
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
  12 |         public struct Deadlines: Equatable, Sendable {
     |                       `- note: add '@available' attribute to enclosing struct
  13 |             public var handshake: Duration?
  14 |             public var request: Duration?
  15 |
  16 |             public init(
     |                    `- note: add '@available' attribute to enclosing initializer
  17 |                 handshake: Duration? = nil,
  18 |                 request: Duration? = nil
     |                          `- error: 'Duration' is only available in iOS 16.0 or newer
  19 |             ) {
  20 |                 self.handshake = handshake
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:73:72: error: 'homeDirectoryForCurrentUser' is unavailable in iOS
  71 |             public static func defaultCodexHomeURL(
  72 |                 environment: [String: String] = ProcessInfo.processInfo.environment,
  73 |                 homeDirectoryForCurrentUser: URL = FileManager.default.homeDirectoryForCurrentUser,
     |                                                                        `- error: 'homeDirectoryForCurrentUser' is unavailable in iOS
  74 |                 applicationSupportDirectory: URL? = FileManager.default.urls(
  75 |                     for: .applicationSupportDirectory,
/Applications/Xcode-27.0.0-Release.Candidate.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS27.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:1004:35: note: 'homeDirectoryForCurrentUser' has been explicitly marked unavailable here
1002 |
1003 | /// The home directory for the current user.
1004 | @property (readonly, copy) NSURL *homeDirectoryForCurrentUser API_AVAILABLE(macosx(10.12)) API_UNAVAILABLE(ios, watchos, tvos);
     |                                   `- note: 'homeDirectoryForCurrentUser' has been explicitly marked unavailable here
1005 | /// The temporary directory for the current user.
1006 | @property (readonly, copy) NSURL *temporaryDirectory API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:1016:34: error: 'Duration' is only available in iOS 16.0 or newer
   7 | /// JSON-RPC handshake, and routes server notifications to thread, turn, and
   8 | /// login domain objects.
   9 | public actor CodexAppServer {
     |              `- note: add '@available' attribute to enclosing actor
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
     :
1013 |     /// - Returns: A login handle containing the browser authentication URL.
1014 |     /// - Throws: A transport, JSON-RPC, or app-server login error.
1015 |     public func loginChatGPT(
     |                 `- note: add '@available' attribute to enclosing instance method
1016 |         accountReadinessTimeout: Duration? = nil
     |                                  `- error: 'Duration' is only available in iOS 16.0 or newer
1017 |     ) async throws -> CodexLoginHandle {
1018 |         let state = try await loginRegistry.reserve(
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/AppServerClient.swift:49:28: error: 'sleep(for:tolerance:clock:)' is only available in iOS 16.0 or newer
  4 | private let logger = Logger(subsystem: "CodexAppServerKit", category: "app-server-client")
  5 |
  6 | package actor AppServerClient {
    |               `- note: add '@available' attribute to enclosing actor
  7 |     private struct InitializationContract: Equatable {
  8 |         var clientName: String
    :
 39 |     private var initializationState = InitializationState.idle
 40 |
 41 |     package init(
    |             `- note: add '@available' attribute to enclosing initializer
 42 |         transport: any JSONRPC.Transport,
 43 |         deadlines: CodexAppServer.Configuration.Deadlines = .init(),
    :
 47 |             .defaultOverloadRetryDelay,
 48 |         retrySleep: @escaping @Sendable (Duration) async throws -> Void = {
 49 |             try await Task.sleep(for: $0)
    |                            |- error: 'sleep(for:tolerance:clock:)' is only available in iOS 16.0 or newer
    |                            `- note: add 'if #available' version check
 50 |         }
 51 |     ) {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:1075:46: error: 'Mutex' is only available in iOS 18.0 or newer
   7 | /// JSON-RPC handshake, and routes server notifications to thread, turn, and
   8 | /// login domain objects.
   9 | public actor CodexAppServer {
     |              `- note: add '@available' attribute to enclosing actor
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
     :
1070 |     /// - Parameter apiKey: A nonempty API key without leading or trailing whitespace.
1071 |     /// - Throws: An input, transport, JSON-RPC, or app-server authentication error.
1072 |     public func login(apiKey: String) async throws {
     |                 `- note: add '@available' attribute to enclosing instance method
1073 |         try Self.validate(apiKey: apiKey)
1074 |
1075 |         let acceptedWriteHasUnknownOutcome = Mutex(false)
     |                                              |- error: 'Mutex' is only available in iOS 18.0 or newer
     |                                              `- note: add 'if #available' version check
1076 |         let response: AppServerAPI.Account.Login.Response
1077 |         do {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:1075:46: error: 'init(_:)' is only available in iOS 18.0 or newer
   7 | /// JSON-RPC handshake, and routes server notifications to thread, turn, and
   8 | /// login domain objects.
   9 | public actor CodexAppServer {
     |              `- note: add '@available' attribute to enclosing actor
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
     :
1070 |     /// - Parameter apiKey: A nonempty API key without leading or trailing whitespace.
1071 |     /// - Throws: An input, transport, JSON-RPC, or app-server authentication error.
1072 |     public func login(apiKey: String) async throws {
     |                 `- note: add '@available' attribute to enclosing instance method
1073 |         try Self.validate(apiKey: apiKey)
1074 |
1075 |         let acceptedWriteHasUnknownOutcome = Mutex(false)
     |                                              |- error: 'init(_:)' is only available in iOS 18.0 or newer
     |                                              `- note: add 'if #available' version check
1076 |         let response: AppServerAPI.Account.Login.Response
1077 |         do {
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:1081:52: error: 'withLock' is only available in iOS 18.0 or newer
   7 | /// JSON-RPC handshake, and routes server notifications to thread, turn, and
   8 | /// login domain objects.
   9 | public actor CodexAppServer {
     |              `- note: add '@available' attribute to enclosing actor
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
     :
1070 |     /// - Parameter apiKey: A nonempty API key without leading or trailing whitespace.
1071 |     /// - Throws: An input, transport, JSON-RPC, or app-server authentication error.
1072 |     public func login(apiKey: String) async throws {
     |                 `- note: add '@available' attribute to enclosing instance method
1073 |         try Self.validate(apiKey: apiKey)
1074 |
     :
1079 |                 AppServerAPI.Account.Login.Start.Request(params: .apiKey(apiKey)),
1080 |                 onWriteAccepted: {
1081 |                     acceptedWriteHasUnknownOutcome.withLock { $0 = true }
     |                                                    |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                                    `- note: add 'if #available' version check
1082 |                 },
1083 |                 retriesOverloadResponses: false,
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:1087:50: error: 'withLock' is only available in iOS 18.0 or newer
   7 | /// JSON-RPC handshake, and routes server notifications to thread, turn, and
   8 | /// login domain objects.
   9 | public actor CodexAppServer {
     |              `- note: add '@available' attribute to enclosing actor
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
     :
1070 |     /// - Parameter apiKey: A nonempty API key without leading or trailing whitespace.
1071 |     /// - Throws: An input, transport, JSON-RPC, or app-server authentication error.
1072 |     public func login(apiKey: String) async throws {
     |                 `- note: add '@available' attribute to enclosing instance method
1073 |         try Self.validate(apiKey: apiKey)
1074 |
     :
1085 |             )
1086 |         } catch is CancellationError {
1087 |             guard acceptedWriteHasUnknownOutcome.withLock({ $0 }) else {
     |                                                  |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                                  `- note: add 'if #available' version check
1088 |                 throw CancellationError()
1089 |             }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:1094:80: error: 'withLock' is only available in iOS 18.0 or newer
   7 | /// JSON-RPC handshake, and routes server notifications to thread, turn, and
   8 | /// login domain objects.
   9 | public actor CodexAppServer {
     |              `- note: add '@available' attribute to enclosing actor
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
     :
1070 |     /// - Parameter apiKey: A nonempty API key without leading or trailing whitespace.
1071 |     /// - Throws: An input, transport, JSON-RPC, or app-server authentication error.
1072 |     public func login(apiKey: String) async throws {
     |                 `- note: add '@available' attribute to enclosing instance method
1073 |         try Self.validate(apiKey: apiKey)
1074 |
     :
1092 |             throw Self.apiKeyLoginError(
1093 |                 from: error,
1094 |                 acceptedWriteHasUnknownOutcome: acceptedWriteHasUnknownOutcome.withLock { $0 }
     |                                                                                |- error: 'withLock' is only available in iOS 18.0 or newer
     |                                                                                `- note: add 'if #available' version check
1095 |             )
1096 |         }
/Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift:1342:48: error: 'milliseconds' is only available in iOS 16.0 or newer
   7 | /// JSON-RPC handshake, and routes server notifications to thread, turn, and
   8 | /// login domain objects.
   9 | public actor CodexAppServer {
     |              `- note: add '@available' attribute to enclosing actor
  10 |     /// Options for creating a Codex app-server container.
  11 |     public struct Configuration: Sendable {
     :
1316 |     }
1317 |
1318 |     package nonisolated static func turnSnapshots(
     |                                     `- note: add '@available' attribute to enclosing static method
1319 |         from turns: [AppServerAPI.Turn.Payload]
1320 |     ) -> [CodexTurnSnapshot] {
     :
1340 |                 startedAt: $0.startedAt.map { Date(timeIntervalSince1970: TimeInterval($0)) },
1341 |                 completedAt: $0.completedAt.map { Date(timeIntervalSince1970: TimeInterval($0)) },
1342 |                 duration: $0.durationMS.map { .milliseconds(Int64($0)) }
     |                                                |- error: 'milliseconds' is only available in iOS 16.0 or newer
     |                                                `- note: add 'if #available' version check
1343 |             )
1344 |         }
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServer.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile CodexAppServer.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServerNotificationRouter.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile CodexAppServerNotificationRouter.swift
SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/CodexAppServerRequest.swift (in target 'CodexAppServerKit' from project 'CodexKit')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode
    builtin-SwiftPerFileCompile CodexAppServerRequest.swift
SwiftEmitModule normal arm64 Emitting\ module\ for\ AsyncAlgorithms (in target 'AsyncAlgorithms' from project 'swift-async-algorithms')
SwiftCompile normal arm64 (in target 'AsyncAlgorithms' from project 'swift-async-algorithms')
    cd /Users/admin/builder/spi-builder-workspace/.swiftpm/xcode

PruneExplicitPrecompiledModules /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/SwiftExplicitPrecompiledModules
PruneExplicitPrecompiledModules /Users/admin/builder/spi-builder-workspace/.derivedData/Build/Intermediates.noindex/ExplicitPrecompiledModules
PruneExplicitPrecompiledModules /Users/admin/builder/spi-builder-workspace/.derivedData/SDKExplicitPrecompiledModules
2026-09-26 18:49:57.710 xcodebuild[853:5154] [MT] IDERunDestination: Supported platforms for the buildables in the current scheme is empty.
** BUILD FAILED **
The following build commands failed:
	SwiftCompile normal arm64 Compiling\ InterruptRaceResolver.swift,\ JSONRPC.swift,\ JSONRPCEnvelopeCodec.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/InterruptRaceResolver.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPC.swift /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift (in target 'CodexAppServerKit' from project 'CodexKit')
	SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/InterruptRaceResolver.swift (in target 'CodexAppServerKit' from project 'CodexKit')
	SwiftCompile normal arm64 /Users/admin/builder/spi-builder-workspace/Sources/CodexAppServerKit/JSONRPCEnvelopeCodec.swift (in target 'CodexAppServerKit' from project 'CodexKit')
	Building workspace CodexKit with scheme CodexKit-Package
(4 failures)
BUILD FAILURE 6.4 iOS