The Swift Package Index logo.Swift Package Index

Track the adoption of Swift 6 strict concurrency checks for data race safety. How many packages are Ready for Swift 6?

Build Information

Successful build of NyaruDB2, reference v0.1.0-alpha1 (deb780), with Swift 6.1 for macOS (SPM) on 26 Apr 2025 11:44:02 UTC.

Swift 6 data race errors: 1

Build Command

env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64

Build Log

========================================
RunAll
========================================
Builder version: 4.61.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/galileostudio/nyarudb2.git
Reference: v0.1.0-alpha1
Initialized empty Git repository in /Users/admin/builder/spi-builder-workspace/.git/
From https://github.com/galileostudio/nyarudb2
 * tag               v0.1.0-alpha1 -> FETCH_HEAD
HEAD is now at deb7809 Merge branch 'develop'
Cloned https://github.com/galileostudio/nyarudb2.git
Revision (git rev-parse @):
deb78093d59917248754fef39602d4209f8f50d4
SUCCESS checkout https://github.com/galileostudio/nyarudb2.git at v0.1.0-alpha1
========================================
ResolveProductDependencies
========================================
Resolving dependencies ...
{
  "identity": ".resolve-product-dependencies",
  "name": "resolve-dependencies",
  "url": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies",
  "version": "unspecified",
  "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies",
  "dependencies": [
    {
      "identity": "nyarudb2",
      "name": "NyaruDB2",
      "url": "https://github.com/galileostudio/nyarudb2.git",
      "version": "unspecified",
      "path": "/Users/admin/builder/spi-builder-workspace/.resolve-product-dependencies/.build/checkouts/nyarudb2",
      "dependencies": [
      ]
    }
  ]
}
Fetching https://github.com/galileostudio/nyarudb2.git
[1/864] Fetching nyarudb2
Fetched https://github.com/galileostudio/nyarudb2.git from cache (0.83s)
Creating working copy for https://github.com/galileostudio/nyarudb2.git
Working copy of https://github.com/galileostudio/nyarudb2.git resolved at v0.1.0-alpha1 (deb7809)
Found 0 product dependencies
========================================
Build
========================================
Selected platform:         macosSpm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/galileostudio/nyarudb2.git
https://github.com/galileostudio/nyarudb2.git
{
  "dependencies" : [
  ],
  "manifest_display_name" : "NyaruDB2",
  "name" : "NyaruDB2",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "15.0"
    },
    {
      "name" : "macos",
      "version" : "12.0"
    }
  ],
  "products" : [
    {
      "name" : "NyaruDB2",
      "targets" : [
        "NyaruDB2"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    },
    {
      "name" : "QuickStartRunner",
      "targets" : [
        "QuickStartRunner"
      ],
      "type" : {
        "executable" : null
      }
    },
    {
      "name" : "Benchmark",
      "targets" : [
        "Benchmark"
      ],
      "type" : {
        "executable" : null
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "QuickStartRunner",
      "module_type" : "SwiftTarget",
      "name" : "QuickStartRunner",
      "path" : "Sources/QuickStart",
      "product_memberships" : [
        "QuickStartRunner"
      ],
      "sources" : [
        "QuickStart.swift"
      ],
      "target_dependencies" : [
        "NyaruDB2"
      ],
      "type" : "executable"
    },
    {
      "c99name" : "NyaruDB2Tests",
      "module_type" : "SwiftTarget",
      "name" : "NyaruDB2Tests",
      "path" : "Tests/NyaruDB2Tests",
      "sources" : [
        "BTreeIndexPersistenceTest.swift",
        "BTreeIndexTest.swift",
        "CollectionCatalog.swift",
        "CompressionMethodTest.swift",
        "DocumentCollectionCRUDTest.swift",
        "IndexManagerTest.swift",
        "NyaruDB2Test.swift",
        "QueryEngineIndexTest.swift",
        "QueryEngineTest.swift",
        "ShardManagerTest.swift",
        "StatsEngineTest.swift",
        "StorageEngineTest.swift",
        "StorageRepartitionCollectionTest.swift"
      ],
      "target_dependencies" : [
        "NyaruDB2"
      ],
      "type" : "test"
    },
    {
      "c99name" : "NyaruDB2",
      "module_type" : "SwiftTarget",
      "name" : "NyaruDB2",
      "path" : "Sources/NyaruDB2",
      "product_memberships" : [
        "NyaruDB2",
        "QuickStartRunner",
        "Benchmark"
      ],
      "sources" : [
        "Core/CollectionEngine/CollectionCatalog.swift",
        "Core/CollectionEngine/DocumentCollection.swift",
        "Core/Commons/DynamicDecoder.swift",
        "Core/Commons/FileProtection.swift",
        "Core/IndexManager/BTreeIndex.swift",
        "Core/IndexManager/IndexManager.swift",
        "Core/QueryEngine/QueryEngine.swift",
        "Core/QueryEngine/QueryPlanner.swift",
        "Core/ShardManager/CompressionMethod.swift",
        "Core/ShardManager/Shard.swift",
        "Core/ShardManager/ShardManager.swift",
        "Core/StatsEngine/StatsEngine.swift",
        "Core/StorageEngine/StorageEngine.swift",
        "NyaruDB2.swift"
      ],
      "type" : "library"
    },
    {
      "c99name" : "Benchmark",
      "module_type" : "SwiftTarget",
      "name" : "Benchmark",
      "path" : "Sources/Benchmark",
      "product_memberships" : [
        "Benchmark"
      ],
      "sources" : [
        "Benchmark.swift"
      ],
      "target_dependencies" : [
        "NyaruDB2"
      ],
      "type" : "executable"
    }
  ],
  "tools_version" : "5.9"
}
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures
Building for debugging...
[0/12] Write sources
[2/12] Write QuickStartRunner-entitlement.plist
[2/12] Write Benchmark-entitlement.plist
[5/12] Write swift-version-2F0A5646E1D333AE.txt
[7/26] Compiling NyaruDB2 Shard.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:162:18: error: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
160 |     {
161 |         AsyncThrowingStream { continuation in
162 |             Task {
    |                  `- error: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
163 |                 do {
164 |                     let docs: [T] = try await self.loadDocuments()
    |                                               `- note: closure captures 'self' which is accessible to code in the current task
165 |                     for doc in docs {
166 |                         continuation.yield(doc)
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:166:38: error: sending 'doc' risks causing data races; this is an error in the Swift 6 language mode
164 |                     let docs: [T] = try await self.loadDocuments()
165 |                     for doc in docs {
166 |                         continuation.yield(doc)
    |                                      |- error: sending 'doc' risks causing data races; this is an error in the Swift 6 language mode
    |                                      `- note: task-isolated 'doc' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses
167 |                     }
168 |                     continuation.finish()
[8/27] Compiling NyaruDB2 CompressionMethod.swift
[9/27] Compiling NyaruDB2 BTreeIndex.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:98:25: error: sending 'key' risks causing data races; this is an error in the Swift 6 language mode
 96 |             return
 97 |         }
 98 |         await indexTree.insert(key: key, data: data)
    |                         |- error: sending 'key' risks causing data races; this is an error in the Swift 6 language mode
    |                         `- note: sending 'self'-isolated 'key' to actor-isolated instance method 'insert(key:data:)' risks causing data races between actor-isolated and 'self'-isolated uses
 99 |     }
100 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:117:32: error: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
115 |
116 |         guard let indexTree = indices[field] else { return [] }
117 |         return await indexTree.search(key: value) ?? []
    |                                |- error: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
    |                                `- note: sending 'self'-isolated 'value' to actor-isolated instance method 'search(key:)' risks causing data races between actor-isolated and 'self'-isolated uses
118 |     }
119 |
[10/27] Compiling NyaruDB2 IndexManager.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:98:25: error: sending 'key' risks causing data races; this is an error in the Swift 6 language mode
 96 |             return
 97 |         }
 98 |         await indexTree.insert(key: key, data: data)
    |                         |- error: sending 'key' risks causing data races; this is an error in the Swift 6 language mode
    |                         `- note: sending 'self'-isolated 'key' to actor-isolated instance method 'insert(key:data:)' risks causing data races between actor-isolated and 'self'-isolated uses
 99 |     }
100 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:117:32: error: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
115 |
116 |         guard let indexTree = indices[field] else { return [] }
117 |         return await indexTree.search(key: value) ?? []
    |                                |- error: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
    |                                `- note: sending 'self'-isolated 'value' to actor-isolated instance method 'search(key:)' risks causing data races between actor-isolated and 'self'-isolated uses
118 |     }
119 |
error: emit-module command failed with exit code 1 (use -v to see invocation)
[11/27] Compiling NyaruDB2 ShardManager.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/ShardManager.swift:181:43: error: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
179 |     /// of the shard manager.
180 |     private func startAutoMergeProcess() {
181 |         autoMergeTask = Task<Void, Never> { () async -> Void in
    |                                           `- error: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
182 |             while !Task.isCancelled {
183 |                 do {
184 |                     // Check and merge small shards (this is a placeholder for the actual merge logic)
185 |                     try await mergeSmallShards()
    |                               `- note: closure captures 'self' which is accessible to code in the current task
186 |                 } catch {
187 |                     print("Auto-merge error: \(error)")
[12/27] Compiling NyaruDB2 StatsEngine.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:255:40: error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
253 |     {
254 |
255 |         let shards = try await storage.getShardManagers(for: collection)
    |                                        `- error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
256 |
257 |         var totalDocs = 0
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:321:46: error: non-sendable result type '[String : IndexMetrics]' cannot be sent from actor-isolated context in call to instance method 'getMetrics()'; this is an error in the Swift 6 language mode
319 |         var stats = [String: IndexStat]()
320 |         for (collection, indexManager) in await storage.indexManagers {
321 |             let metrics = await indexManager.getMetrics()
    |                                              `- error: non-sendable result type '[String : IndexMetrics]' cannot be sent from actor-isolated context in call to instance method 'getMetrics()'; this is an error in the Swift 6 language mode
322 |             let counts = await indexManager.getIndexCounts()
323 |             var combinedTotalCount = 0
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/IndexManager/IndexManager.swift:26:15: note: consider making struct 'IndexMetrics' conform to the 'Sendable' protocol
 24 | ///   - `valueDistribution`: A dictionary that tracks the distribution of values associated with the index,
 25 | ///     where the keys are the values and the values are their respective counts. Defaults to an empty dictionary.
 26 | public struct IndexMetrics {
    |               `- note: consider making struct 'IndexMetrics' conform to the 'Sendable' protocol
 27 |     public var accessCount: Int = 0
 28 |     public var lastAccess: Date = .distantPast
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:370:43: error: non-sendable type '[String : ShardManager]' of property 'activeShardManagers' cannot exit actor-isolated context; this is an error in the Swift 6 language mode
368 |     public func getShardStats() async throws -> [ShardStat] {
369 |         var shardStats = [ShardStat]()
370 |         for (_, manager) in await storage.activeShardManagers {
    |                                           `- error: non-sendable type '[String : ShardManager]' of property 'activeShardManagers' cannot exit actor-isolated context; this is an error in the Swift 6 language mode
371 |             for shard in manager.allShards() {
372 |                 let stat = ShardStat(
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/ShardManager.swift:24:14: note: class 'ShardManager' does not conform to the 'Sendable' protocol
 22 | ///   - `fileProtectionType`: The file protection type applied to shard files.
 23 | ///   - `autoMergeTask`: An optional asynchronous task for automatically merging shards.
 24 | public class ShardManager {
    |              `- note: class 'ShardManager' does not conform to the 'Sendable' protocol
 25 |     private var shards: [String: Shard] = [:]
 26 |     private let baseURL: URL
[13/27] Compiling NyaruDB2 StorageEngine.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:82:44: error: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
 80 |
 81 |         let shardManager = try await getOrCreateShardManager(for: collection)
 82 |         let shard = try await shardManager.getOrCreateShard(id: partitionValue)
    |                                            `- error: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
 83 |
 84 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:111:14: error: non-sendable result type '[[T]]' cannot be sent from nonisolated context in call to instance method 'concurrentMap'; this is an error in the Swift 6 language mode
104 |     /// - Returns: An array of decoded objects of type `T`.
105 |     /// - Throws: An error if the fetch operation or decoding process fails.
106 |     public func fetchDocuments<T: Codable>(from collection: String) async throws
    |                                `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
107 |         -> [T]
108 |     {
109 |         try await activeShardManagers[collection]?
110 |             .allShards()
111 |             .concurrentMap { try await $0.loadDocuments() }
    |              `- error: non-sendable result type '[[T]]' cannot be sent from nonisolated context in call to instance method 'concurrentMap'; this is an error in the Swift 6 language mode
112 |             .flatMap { $0 } ?? []
113 |     }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:222:44: error: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
220 |                 key: partitionField
221 |             )
222 |             shard = try await shardManager.getOrCreateShard(id: partitionValue)
    |                                            `- error: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
223 |         } else {
224 |             shard = try await shardManager.getOrCreateShard(id: "default")
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:224:44: error: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
222 |             shard = try await shardManager.getOrCreateShard(id: partitionValue)
223 |         } else {
224 |             shard = try await shardManager.getOrCreateShard(id: "default")
    |                                            `- error: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
225 |         }
226 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:227:46: error: non-sendable result type '[T]' cannot be sent from nonisolated context in call to instance method 'loadDocuments()'; this is an error in the Swift 6 language mode
204 |     ///
205 |     /// - Note: This method is asynchronous and must be called with `await`.
206 |     public func updateDocument<T: Codable>(
    |                                `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
207 |         _ document: T,
208 |         in collection: String,
    :
225 |         }
226 |
227 |         var documents: [T] = try await shard.loadDocuments()
    |                                              `- error: non-sendable result type '[T]' cannot be sent from nonisolated context in call to instance method 'loadDocuments()'; this is an error in the Swift 6 language mode
228 |
229 |         guard let indexToUpdate = documents.firstIndex(where: predicate) else {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:517:48: error: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
515 |
516 |         for (partitionValue, docsGroup) in groups {
517 |             let shard = try await shardManager.getOrCreateShard(
    |                                                `- error: non-sendable result type 'Shard' cannot be sent from nonisolated context in call to instance method 'getOrCreateShard(id:)'; this is an error in the Swift 6 language mode
518 |                 id: partitionValue
519 |             )
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:562:19: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
557 |     /// - Returns: An array containing the transformed elements.
558 |     /// - Throws: Rethrows any error thrown by the `transform` closure.
559 |     func concurrentMap<T>(_ transform: @escaping (Element) async throws -> T)
    |                        `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
560 |         async rethrows -> [T]
561 |     {
562 |         try await withThrowingTaskGroup(of: T.self) { group in
    |                   `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
563 |             forEach { element in
564 |                 group.addTask { try await transform(element) }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:564:23: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
557 |     /// - Returns: An array containing the transformed elements.
558 |     /// - Throws: Rethrows any error thrown by the `transform` closure.
559 |     func concurrentMap<T>(_ transform: @escaping (Element) async throws -> T)
    |                        `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
560 |         async rethrows -> [T]
561 |     {
562 |         try await withThrowingTaskGroup(of: T.self) { group in
563 |             forEach { element in
564 |                 group.addTask { try await transform(element) }
    |                       `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
565 |             }
566 |             return try await group.reduce(into: []) { $0.append($1) }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StorageEngine/StorageEngine.swift:566:36: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
557 |     /// - Returns: An array containing the transformed elements.
558 |     /// - Throws: Rethrows any error thrown by the `transform` closure.
559 |     func concurrentMap<T>(_ transform: @escaping (Element) async throws -> T)
    |                        `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
560 |         async rethrows -> [T]
561 |     {
    :
564 |                 group.addTask { try await transform(element) }
565 |             }
566 |             return try await group.reduce(into: []) { $0.append($1) }
    |                                    `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
567 |         }
568 |     }
[14/27] Compiling NyaruDB2 DynamicDecoder.swift
[15/27] Compiling NyaruDB2 FileProtection.swift
[16/27] Emitting module NyaruDB2
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/CollectionCatalog.swift:11:23: error: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
  7 | /// to ensure a single, globally accessible instance throughout the application.
  8 |
  9 | public class CollectionCatalog {
    |              `- note: class 'CollectionCatalog' does not conform to the 'Sendable' protocol
 10 |
 11 |     public static let shared = CollectionCatalog()
    |                       |- error: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: add '@MainActor' to make static property 'shared' part of global actor 'MainActor'
    |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 12 |
 13 |     private var collections: [String: DocumentCollection] = [:]
[17/27] Compiling NyaruDB2 QueryEngine.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:127:26: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
125 |
126 |         // Usa um TaskGroup para executar a busca para cada valor do índice em paralelo
127 |         return try await withThrowingTaskGroup(of: [T].self) { group in
    |                          `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
128 |             for value in values {
129 |                 group.addTask {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:129:23: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
127 |         return try await withThrowingTaskGroup(of: [T].self) { group in
128 |             for value in values {
129 |                 group.addTask {
    |                       `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
130 |                     try await self.storage.fetchFromIndex(
131 |                         collection: self.collection,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:137:36: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
135 |                 }
136 |             }
137 |             return try await group.reduce(into: []) { $0 += $1 }
    |                                    `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
138 |         }
139 |     }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:130:44: error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchFromIndex(collection:field:value:)'; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
128 |             for value in values {
129 |                 group.addTask {
130 |                     try await self.storage.fetchFromIndex(
    |                                            `- error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchFromIndex(collection:field:value:)'; this is an error in the Swift 6 language mode
131 |                         collection: self.collection,
132 |                         field: indexField,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:162:26: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
160 |
161 |
162 |         return try await withThrowingTaskGroup(of: [T].self) { group in
    |                          `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
163 |             for shard in shards {
164 |                 group.addTask {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:164:23: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
162 |         return try await withThrowingTaskGroup(of: [T].self) { group in
163 |             for shard in shards {
164 |                 group.addTask {
    |                       `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
165 |                     let docs: [T] = try await shard.loadDocuments()
166 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:153:43: error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
151 |     private func executeHybrid(plan: ExecutionPlan) async throws -> [T] {
152 |
153 |         let allShards = try await storage.getShardManagers(for: collection)
    |                                           `- error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
154 |
155 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:192:27: error: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
190 |
191 |         let stream: AsyncThrowingStream<T, Error> =
192 |             await storage.fetchDocumentsLazy(from: collection)
    |                           `- error: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
193 |         for try await doc in stream {
194 |             if self.evaluateDocument(doc) {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:352:52: error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
350 |                 do {
351 |                     // Obtém os shards da coleção
352 |                     let shards = try await storage.getShardManagers(
    |                                                    `- error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
353 |                         for: collection
354 |                     )
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
[18/27] Compiling NyaruDB2 QueryPlanner.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:127:26: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
125 |
126 |         // Usa um TaskGroup para executar a busca para cada valor do índice em paralelo
127 |         return try await withThrowingTaskGroup(of: [T].self) { group in
    |                          `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
128 |             for value in values {
129 |                 group.addTask {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:129:23: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
127 |         return try await withThrowingTaskGroup(of: [T].self) { group in
128 |             for value in values {
129 |                 group.addTask {
    |                       `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
130 |                     try await self.storage.fetchFromIndex(
131 |                         collection: self.collection,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:137:36: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
135 |                 }
136 |             }
137 |             return try await group.reduce(into: []) { $0 += $1 }
    |                                    `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
138 |         }
139 |     }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:130:44: error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchFromIndex(collection:field:value:)'; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
128 |             for value in values {
129 |                 group.addTask {
130 |                     try await self.storage.fetchFromIndex(
    |                                            `- error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchFromIndex(collection:field:value:)'; this is an error in the Swift 6 language mode
131 |                         collection: self.collection,
132 |                         field: indexField,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:162:26: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
160 |
161 |
162 |         return try await withThrowingTaskGroup(of: [T].self) { group in
    |                          `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
163 |             for shard in shards {
164 |                 group.addTask {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:164:23: error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
162 |         return try await withThrowingTaskGroup(of: [T].self) { group in
163 |             for shard in shards {
164 |                 group.addTask {
    |                       `- error: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
165 |                     let docs: [T] = try await shard.loadDocuments()
166 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:153:43: error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
151 |     private func executeHybrid(plan: ExecutionPlan) async throws -> [T] {
152 |
153 |         let allShards = try await storage.getShardManagers(for: collection)
    |                                           `- error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
154 |
155 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:192:27: error: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
 17 | ///   - planner: The query planner responsible for optimizing and executing the query.
 18 | ///   - keyPathPredicates: A list of key path-based predicates used to filter the data.
 19 | public struct Query<T: Codable> {
    |                     `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
 20 |     private let collection: String
 21 |     private var predicates: [(field: String, op: QueryOperator)] = []
    :
190 |
191 |         let stream: AsyncThrowingStream<T, Error> =
192 |             await storage.fetchDocumentsLazy(from: collection)
    |                           `- error: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
193 |         for try await doc in stream {
194 |             if self.evaluateDocument(doc) {
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/QueryEngine/QueryEngine.swift:352:52: error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
350 |                 do {
351 |                     // Obtém os shards da coleção
352 |                     let shards = try await storage.getShardManagers(
    |                                                    `- error: non-sendable result type '[Shard]' cannot be sent from actor-isolated context in call to instance method 'getShardManagers(for:)'; this is an error in the Swift 6 language mode
353 |                         for: collection
354 |                     )
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/ShardManager/Shard.swift:46:14: note: class 'Shard' does not conform to the 'Sendable' protocol
 44 | ///   - `fileProtectionType`: The file protection level applied to the shard's storage.
 45 | ///   - `documentCache`: An in-memory cache for storing documents, keyed by their identifiers.
 46 | public class Shard {
    |              `- note: class 'Shard' does not conform to the 'Sendable' protocol
 47 |     public let id: String
 48 |     public let url: URL
[19/27] Compiling NyaruDB2 CollectionCatalog.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/CollectionCatalog.swift:11:23: error: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
  7 | /// to ensure a single, globally accessible instance throughout the application.
  8 |
  9 | public class CollectionCatalog {
    |              `- note: class 'CollectionCatalog' does not conform to the 'Sendable' protocol
 10 |
 11 |     public static let shared = CollectionCatalog()
    |                       |- error: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: add '@MainActor' to make static property 'shared' part of global actor 'MainActor'
    |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 12 |
 13 |     private var collections: [String: DocumentCollection] = [:]
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:148:46: error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
140 |     /// - Throws: An error if the fetch operation fails.
141 |     /// - Note: The generic type `T` must conform to the `Codable` protocol.
142 |     public func fetch<T: Codable>(
    |                       `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
143 |         query: [String: Any]? = nil,
144 |         shardKey: String? = nil,
    :
146 |     ) async throws -> [T] {
147 |         // Retrieve all documents from the collection (full scan)
148 |         let results: [T] = try await storage.fetchDocuments(from: metadata.name)
    |                                              `- error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
149 |
150 |         // Apply shard filtering if specified
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:203:40: error: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
201 |     /// - Note: The generic type `T` must conform to the `Codable` protocol.
202 |     public func query<T: Codable>() async throws -> Query<T> {
203 |     let indexStats = await statsEngine.getIndexStats()  // Using StatsEngine directly.
    |                                        `- error: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
204 |     let shardStats = try await statsEngine.getShardStats()
205 |     return Query<T>(collection: metadata.name,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:93:15: note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
 91 | ///   - accessCount: The number of times the index has been accessed.
 92 | ///   - lastAccess: The date and time when the index was last accessed.
 93 | public struct IndexStat {
    |               `- note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
 94 |     public var totalCount: Int
 95 |     public var uniqueValuesCount: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:204:44: error: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
202 |     public func query<T: Codable>() async throws -> Query<T> {
203 |     let indexStats = await statsEngine.getIndexStats()  // Using StatsEngine directly.
204 |     let shardStats = try await statsEngine.getShardStats()
    |                                            `- error: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
205 |     return Query<T>(collection: metadata.name,
206 |                     storage: storage,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:153:15: note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
151 | ///   - fieldRanges: A dictionary mapping field names to their respective minimum and maximum values.
152 | ///                  The values are represented as `AnyHashable` to allow for flexibility in data types.
153 | public struct ShardStat {
    |               `- note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
154 |     public let docCount: Int
155 |     public let fieldRanges: [String: (min: AnyHashable, max: AnyHashable)]
[20/27] Compiling NyaruDB2 DocumentCollection.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/CollectionCatalog.swift:11:23: error: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
  7 | /// to ensure a single, globally accessible instance throughout the application.
  8 |
  9 | public class CollectionCatalog {
    |              `- note: class 'CollectionCatalog' does not conform to the 'Sendable' protocol
 10 |
 11 |     public static let shared = CollectionCatalog()
    |                       |- error: static property 'shared' is not concurrency-safe because non-'Sendable' type 'CollectionCatalog' may have shared mutable state; this is an error in the Swift 6 language mode
    |                       |- note: add '@MainActor' to make static property 'shared' part of global actor 'MainActor'
    |                       `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
 12 |
 13 |     private var collections: [String: DocumentCollection] = [:]
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:148:46: error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
140 |     /// - Throws: An error if the fetch operation fails.
141 |     /// - Note: The generic type `T` must conform to the `Codable` protocol.
142 |     public func fetch<T: Codable>(
    |                       `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
143 |         query: [String: Any]? = nil,
144 |         shardKey: String? = nil,
    :
146 |     ) async throws -> [T] {
147 |         // Retrieve all documents from the collection (full scan)
148 |         let results: [T] = try await storage.fetchDocuments(from: metadata.name)
    |                                              `- error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
149 |
150 |         // Apply shard filtering if specified
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:203:40: error: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
201 |     /// - Note: The generic type `T` must conform to the `Codable` protocol.
202 |     public func query<T: Codable>() async throws -> Query<T> {
203 |     let indexStats = await statsEngine.getIndexStats()  // Using StatsEngine directly.
    |                                        `- error: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
204 |     let shardStats = try await statsEngine.getShardStats()
205 |     return Query<T>(collection: metadata.name,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:93:15: note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
 91 | ///   - accessCount: The number of times the index has been accessed.
 92 | ///   - lastAccess: The date and time when the index was last accessed.
 93 | public struct IndexStat {
    |               `- note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
 94 |     public var totalCount: Int
 95 |     public var uniqueValuesCount: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/CollectionEngine/DocumentCollection.swift:204:44: error: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
202 |     public func query<T: Codable>() async throws -> Query<T> {
203 |     let indexStats = await statsEngine.getIndexStats()  // Using StatsEngine directly.
204 |     let shardStats = try await statsEngine.getShardStats()
    |                                            `- error: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
205 |     return Query<T>(collection: metadata.name,
206 |                     storage: storage,
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:153:15: note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
151 | ///   - fieldRanges: A dictionary mapping field names to their respective minimum and maximum values.
152 | ///                  The values are represented as `AnyHashable` to allow for flexibility in data types.
153 | public struct ShardStat {
    |               `- note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
154 |     public let docCount: Int
155 |     public let fieldRanges: [String: (min: AnyHashable, max: AnyHashable)]
[21/27] Compiling NyaruDB2 NyaruDB2.swift
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:150:34: error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
147 |     /// - Returns: An array of decoded objects of type `T`.
148 |     /// - Throws: An error if the fetch operation fails or if decoding the documents fails.
149 |     public func fetch<T: Codable>(from collection: String) async throws -> [T] {
    |                       `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
150 |         return try await storage.fetchDocuments(from: collection)
    |                                  `- error: non-sendable result type '[T]' cannot be sent from actor-isolated context in call to instance method 'fetchDocuments(from:)'; this is an error in the Swift 6 language mode
151 |     }
152 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:166:23: error: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
163 |     ///
164 |     /// - Note: The generic type `T` must conform to the `Codable` protocol.
165 |     public func fetchLazy<T: Codable>(from collection: String) async -> AsyncThrowingStream<T, Error> {
    |                           `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
166 |         await storage.fetchDocumentsLazy(from: collection)
    |                       `- error: non-sendable result type 'AsyncThrowingStream<T, any Error>' cannot be sent from actor-isolated context in call to instance method 'fetchDocumentsLazy(from:)'; this is an error in the Swift 6 language mode
167 |     }
168 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:222:38: error: non-sendable result type 'CollectionStats' cannot be sent from actor-isolated context in call to instance method 'getCollectionStats'; this is an error in the Swift 6 language mode
220 |     /// - Note: This function is asynchronous and must be awaited.
221 |     public func getCollectionStats(for collection: String) async throws -> CollectionStats {
222 |         return try await statsEngine.getCollectionStats(collection)
    |                                      `- error: non-sendable result type 'CollectionStats' cannot be sent from actor-isolated context in call to instance method 'getCollectionStats'; this is an error in the Swift 6 language mode
223 |     }
224 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:36:15: note: consider making struct 'CollectionStats' conform to the 'Sendable' protocol
 34 | ///   - totalSizeInBytes: The total size of the collection in bytes.
 35 | ///   - shardDetails: An array of metadata information for each shard.
 36 | public struct CollectionStats: Codable {
    |               `- note: consider making struct 'CollectionStats' conform to the 'Sendable' protocol
 37 |     public let collectionName: String
 38 |     public let numberOfShards: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:234:38: error: non-sendable result type 'GlobalStats' cannot be sent from actor-isolated context in call to instance method 'getGlobalStats()'; this is an error in the Swift 6 language mode
232 |     /// - Throws: An error if the statistics retrieval fails.
233 |     public func getGlobalStats() async throws -> GlobalStats {
234 |         return try await statsEngine.getGlobalStats()
    |                                      `- error: non-sendable result type 'GlobalStats' cannot be sent from actor-isolated context in call to instance method 'getGlobalStats()'; this is an error in the Swift 6 language mode
235 |     }
236 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:75:15: note: consider making struct 'GlobalStats' conform to the 'Sendable' protocol
 73 | ///   - totalDocuments: The total number of documents across all collections.
 74 | ///   - totalSizeInBytes: The total size of the database in bytes.
 75 | public struct GlobalStats: Codable {
    |               `- note: consider making struct 'GlobalStats' conform to the 'Sendable' protocol
 76 |     public let totalCollections: Int
 77 |     public let totalDocuments: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:244:34: error: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
242 |     /// - Throws: An error if the operation to fetch index statistics fails.
243 |     public func getIndexStats() async throws -> [String: IndexStat] {
244 |         return await statsEngine.getIndexStats()
    |                                  `- error: non-sendable result type '[String : IndexStat]' cannot be sent from actor-isolated context in call to instance method 'getIndexStats()'; this is an error in the Swift 6 language mode
245 |     }
246 |
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:93:15: note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
 91 | ///   - accessCount: The number of times the index has been accessed.
 92 | ///   - lastAccess: The date and time when the index was last accessed.
 93 | public struct IndexStat {
    |               `- note: consider making struct 'IndexStat' conform to the 'Sendable' protocol
 94 |     public var totalCount: Int
 95 |     public var uniqueValuesCount: Int
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/NyaruDB2.swift:255:38: error: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
253 |     /// - Throws: An error if the statistics could not be retrieved.
254 |     public func getShardStats() async throws -> [ShardStat] {
255 |         return try await statsEngine.getShardStats()
    |                                      `- error: non-sendable result type '[ShardStat]' cannot be sent from actor-isolated context in call to instance method 'getShardStats()'; this is an error in the Swift 6 language mode
256 |     }
257 | }
/Users/admin/builder/spi-builder-workspace/Sources/NyaruDB2/Core/StatsEngine/StatsEngine.swift:153:15: note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
151 | ///   - fieldRanges: A dictionary mapping field names to their respective minimum and maximum values.
152 | ///                  The values are represented as `AnyHashable` to allow for flexibility in data types.
153 | public struct ShardStat {
    |               `- note: consider making struct 'ShardStat' conform to the 'Sendable' protocol
154 |     public let docCount: Int
155 |     public let fieldRanges: [String: (min: AnyHashable, max: AnyHashable)]
Running build ...
env DEVELOPER_DIR=/Applications/Xcode-16.3.0.app xcrun swift build --arch arm64
[0/1] Planning build
Building for debugging...
[0/7] Write swift-version-2F0A5646E1D333AE.txt
[2/21] Compiling NyaruDB2 Shard.swift
[3/21] Compiling NyaruDB2 CompressionMethod.swift
[4/21] Compiling NyaruDB2 CollectionCatalog.swift
[5/21] Compiling NyaruDB2 DocumentCollection.swift
[6/21] Compiling NyaruDB2 BTreeIndex.swift
[7/21] Compiling NyaruDB2 IndexManager.swift
[8/21] Compiling NyaruDB2 DynamicDecoder.swift
[9/21] Compiling NyaruDB2 FileProtection.swift
[10/21] Compiling NyaruDB2 QueryEngine.swift
[11/21] Compiling NyaruDB2 QueryPlanner.swift
[12/22] Compiling NyaruDB2 StatsEngine.swift
[13/22] Emitting module NyaruDB2
[14/22] Compiling NyaruDB2 ShardManager.swift
[15/22] Compiling NyaruDB2 StorageEngine.swift
[16/22] Compiling NyaruDB2 NyaruDB2.swift
[17/26] Compiling QuickStartRunner QuickStart.swift
[18/26] Emitting module QuickStartRunner
[18/26] Write Objects.LinkFileList
[20/26] Emitting module Benchmark
[21/26] Compiling Benchmark Benchmark.swift
[21/26] Write Objects.LinkFileList
[22/26] Linking QuickStartRunner
[23/26] Applying QuickStartRunner
[24/26] Linking Benchmark
[25/26] Applying Benchmark
Build complete! (2.47s)
Build complete.
{
  "dependencies" : [
  ],
  "manifest_display_name" : "NyaruDB2",
  "name" : "NyaruDB2",
  "path" : "/Users/admin/builder/spi-builder-workspace",
  "platforms" : [
    {
      "name" : "ios",
      "version" : "15.0"
    },
    {
      "name" : "macos",
      "version" : "12.0"
    }
  ],
  "products" : [
    {
      "name" : "NyaruDB2",
      "targets" : [
        "NyaruDB2"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    },
    {
      "name" : "QuickStartRunner",
      "targets" : [
        "QuickStartRunner"
      ],
      "type" : {
        "executable" : null
      }
    },
    {
      "name" : "Benchmark",
      "targets" : [
        "Benchmark"
      ],
      "type" : {
        "executable" : null
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "QuickStartRunner",
      "module_type" : "SwiftTarget",
      "name" : "QuickStartRunner",
      "path" : "Sources/QuickStart",
      "product_memberships" : [
        "QuickStartRunner"
      ],
      "sources" : [
        "QuickStart.swift"
      ],
      "target_dependencies" : [
        "NyaruDB2"
      ],
      "type" : "executable"
    },
    {
      "c99name" : "NyaruDB2Tests",
      "module_type" : "SwiftTarget",
      "name" : "NyaruDB2Tests",
      "path" : "Tests/NyaruDB2Tests",
      "sources" : [
        "BTreeIndexPersistenceTest.swift",
        "BTreeIndexTest.swift",
        "CollectionCatalog.swift",
        "CompressionMethodTest.swift",
        "DocumentCollectionCRUDTest.swift",
        "IndexManagerTest.swift",
        "NyaruDB2Test.swift",
        "QueryEngineIndexTest.swift",
        "QueryEngineTest.swift",
        "ShardManagerTest.swift",
        "StatsEngineTest.swift",
        "StorageEngineTest.swift",
        "StorageRepartitionCollectionTest.swift"
      ],
      "target_dependencies" : [
        "NyaruDB2"
      ],
      "type" : "test"
    },
    {
      "c99name" : "NyaruDB2",
      "module_type" : "SwiftTarget",
      "name" : "NyaruDB2",
      "path" : "Sources/NyaruDB2",
      "product_memberships" : [
        "NyaruDB2",
        "QuickStartRunner",
        "Benchmark"
      ],
      "sources" : [
        "Core/CollectionEngine/CollectionCatalog.swift",
        "Core/CollectionEngine/DocumentCollection.swift",
        "Core/Commons/DynamicDecoder.swift",
        "Core/Commons/FileProtection.swift",
        "Core/IndexManager/BTreeIndex.swift",
        "Core/IndexManager/IndexManager.swift",
        "Core/QueryEngine/QueryEngine.swift",
        "Core/QueryEngine/QueryPlanner.swift",
        "Core/ShardManager/CompressionMethod.swift",
        "Core/ShardManager/Shard.swift",
        "Core/ShardManager/ShardManager.swift",
        "Core/StatsEngine/StatsEngine.swift",
        "Core/StorageEngine/StorageEngine.swift",
        "NyaruDB2.swift"
      ],
      "type" : "library"
    },
    {
      "c99name" : "Benchmark",
      "module_type" : "SwiftTarget",
      "name" : "Benchmark",
      "path" : "Sources/Benchmark",
      "product_memberships" : [
        "Benchmark"
      ],
      "sources" : [
        "Benchmark.swift"
      ],
      "target_dependencies" : [
        "NyaruDB2"
      ],
      "type" : "executable"
    }
  ],
  "tools_version" : "5.9"
}
Done.