Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,16 @@ For detailed schema workflows and integration:
- **AI Schema Workflow** (`Examples/CelestraCloud/.claude/AI_SCHEMA_WORKFLOW.md`) - Comprehensive guide for understanding, designing, modifying, and validating CloudKit schemas with text-based tools
- **Quick Reference** (`Examples/SCHEMA_QUICK_REFERENCE.md`) - One-page cheat sheet with syntax, patterns, cktool commands, and troubleshooting

## Import Conventions

Every `import` statement must carry an explicit access modifier — `internal import X` or `public import X`. Bare `import X` is forbidden. Default to `internal`; use `public import` only when the module's types appear in this file's `public` API (e.g. `public import HTTPTypes` where `HTTPRequest` is part of a `public` signature).

Exceptions:
- `@testable import …` is its own modifier — no `internal`/`public` prefix.
- `Sources/MistKitOpenAPI/` is generated by swift-openapi-generator and currently emits a single bare `import HTTPTypes` in `Client.swift`. The generator doesn't expose an `accessModifierOnImports` setting yet, so that one line is a documented carve-out (SwiftLint already excludes this directory).

The convention is not lint-enforced (SwiftLint has no rule for import visibility), so it's a reviewer responsibility plus the precedent set by the codebase after #159.

## Additional Notes
- We are using explicit ACLs in the Swift code
- type order is based on the default in swiftlint: https://realm.github.io/SwiftLint/type_contents_order.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

@main
internal struct BushelCloudCLI {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelCloudKit
import BushelFoundation
import BushelUtilities
import Foundation
internal import BushelCloudKit
internal import BushelFoundation
internal import BushelUtilities
internal import Foundation

internal enum ClearCommand {
internal static func run(_ args: [String]) async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelCloudKit
import BushelFoundation
import Foundation
import MistKit
internal import BushelCloudKit
internal import BushelFoundation
internal import Foundation
internal import MistKit

internal enum ExportCommand {
// MARK: - Export Types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelCloudKit
import BushelFoundation
import Foundation
import MistKit
internal import BushelCloudKit
internal import BushelFoundation
internal import Foundation
internal import MistKit

internal enum ListCommand {
internal static func run(_ args: [String]) async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelCloudKit
import BushelFoundation
import Foundation
internal import BushelCloudKit
internal import BushelFoundation
internal import Foundation
internal import MistKit

internal enum StatusCommand {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelCloudKit
import BushelFoundation
import BushelUtilities
import Foundation
internal import BushelCloudKit
internal import BushelFoundation
internal import BushelUtilities
internal import Foundation

internal enum SyncCommand {
internal static func run(_ args: [String]) async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
public import BushelFoundation
public import BushelLogging
public import Foundation
import Logging
internal import Logging
public import MistKit

#if canImport(FelinePineSwift)
import FelinePineSwift
internal import FelinePineSwift
#endif

/// CloudKit service wrapper for Bushel demo operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Authentication method for CloudKit Server-to-Server
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Validates CloudKit Server-to-Server Key ID format
internal enum KeyIDValidator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Classifies CloudKit operations as creates or updates
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Validates PEM format for CloudKit Server-to-Server private keys
internal enum PEMValidator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelLogging
import BushelUtilities
import Logging
internal import BushelLogging
internal import BushelUtilities
internal import Logging
public import MistKit

#if canImport(FelinePineSwift)
import FelinePineSwift
internal import FelinePineSwift
#endif

// MARK: - Export Operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public import BushelFoundation
public import BushelLogging
public import BushelUtilities
public import Foundation
import Logging
internal import Logging
public import MistKit

#if canImport(FelinePineSwift)
import FelinePineSwift
internal import FelinePineSwift
#endif

/// Orchestrates the complete sync process from data sources to CloudKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
//

public import BushelFoundation
import Foundation
import MistKit
internal import Foundation
internal import MistKit

// MARK: - Configuration Error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation
public import MistKit

// MARK: - CloudKit Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

// MARK: - Sync Configuration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import ConfigKeyKit
import Foundation
internal import ConfigKeyKit
internal import Foundation

/// Configuration keys for reading from providers
internal enum ConfigurationKeys {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelFoundation
import Foundation
internal import BushelFoundation
internal import Foundation

// MARK: - Configuration Loading

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import ConfigKeyKit
import Configuration
import Foundation
internal import ConfigKeyKit
internal import Configuration
internal import Foundation

/// Actor responsible for loading configuration from CLI arguments and environment variables
public actor ConfigurationLoader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Represents a single macOS build entry from AppleDB
internal struct AppleDBEntry: Codable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@

public import BushelFoundation
public import BushelLogging
import BushelUtilities
import Foundation
import Logging
internal import BushelUtilities
internal import Foundation
internal import Logging

#if canImport(FelinePineSwift)
import FelinePineSwift
internal import FelinePineSwift
#endif

#if canImport(FoundationNetworking)
import FoundationNetworking
internal import FoundationNetworking
#endif

/// Fetcher for macOS restore images using AppleDB API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Represents file hashes for verification
internal struct AppleDBHashes: Codable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Represents a download link for a source
internal struct AppleDBLink: Codable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Represents an installation source (IPSW, OTA, or IA)
internal struct AppleDBSource: Codable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Represents a commit in GitHub API response
internal struct GitHubCommit: Codable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Response from GitHub API for commits
internal struct GitHubCommitsResponse: Codable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Represents a committer in GitHub API response
internal struct GitHubCommitter: Codable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import Foundation
internal import Foundation

/// Represents the signing status for a build
/// Can be: array of device IDs, boolean true (all signed), or empty array (none signed)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelFoundation
import Foundation
internal import BushelFoundation
internal import Foundation

// MARK: - Deduplication
extension DataSourcePipeline {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelFoundation
import Foundation
internal import BushelFoundation
internal import Foundation

// MARK: - Private Fetching Methods
extension DataSourcePipeline {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

import BushelFoundation
internal import BushelFoundation

// MARK: - Reference Resolution
extension DataSourcePipeline {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
//

public import BushelFoundation
import BushelLogging
import Foundation
internal import BushelLogging
internal import Foundation

/// Orchestrates fetching data from all sources with deduplication and relationship resolution
public struct DataSourcePipeline: Sendable {
Expand Down
Loading
Loading