One Package, Three Imports: Understanding Swift Modules
Learn how Swift packages, products, targets, modules, imports, and linking fit together using PhotoEvidenceKit as a concrete example.
Start here: One Package, Three Imports: Understanding Swift Modules explains packages, products, targets and imports using PhotoEvidenceKit before you read the individual package architecture guides.
RawCull is the composition root for five architecture packages and four small
rsync/persistence support packages. Package repositories are separately versioned;
paths under Sources/ and Tests/ refer to the named repository, not files copied
into this documentation site. The app translates between package contracts and
owns selection, file access, caches, persistence, and review decisions.
The November 8, 2026 review uses RawCull 3.4.0 build 434. Existing guides retain their explicitly dated architecture audits and add current integration notes. PhotoEvidenceKit has a new guide covering the resolved 1.0.7 implementation. Sibling checkout HEADs do not redefine the application’s resolved baseline.
The application lockfile records 24 remote pins. Since build 462, PhotoAIKit moved from 1.0.0 to 3.1.0 and PhotoAnalysisKit from 1.3.9 to 1.4.1. PhotoEvidenceKit changed its repository URL from SSH to HTTPS at the same version and revision. The MCP helper has a separate package graph. Application lockfile · MCP helper lockfile
| Identity | Version | Revision |
|---|---|---|
coreai-models | 1.0.0 | 5de95c6cd29e5e390fb36d87e13b2396668f7974 |
decodeencodegeneric | 1.0.0 | b5ecbbbe1b244191efec1532a979f6ae342d6617 |
eventsource | 1.6.0 | bb4b61273b5a976bb571859c17f903ebc3439df1 |
parsersyncoutput | 1.0.0 | e079e0c9d34bf07f7f2a4312b40feea79ae14847 |
photoaikit | 3.1.0 | 26647c62d9933968d92bd00b162290cdd7c78fee |
photoanalysiskit | 1.4.1 | 2f41e8b756f006e0218f86b103801ebb47cf8983 |
photoevidencekit | 1.1.5 | e49d34adcfa2e2c43a4240c2e962dbe9defa4cad |
rawcullcore | 1.1.5 | ea8ac2fc6611949af2b55ec433456bfe502cf886 |
rawparserkit | 1.3.3 | 26df4abc2178d5c07d08f3883d84d0648f5141d3 |
rsyncarguments | 1.0.0 | 0ff6518136c208dfbecc1a918f045048ca79853d |
rsyncprocessstreaming | 1.0.0 | dd86f012b352888fd146e0b6e103740dc237f740 |
swift-asn1 | 1.7.4 | 917b472dbe53ba699cbb0495f9a95a084bc6364d |
swift-atomics | 1.3.1 | 0442cb5a3f98ab802acb777929fdb446bda11a34 |
swift-collections | 1.7.5 | f96b909e1a9e469620bc5037c1e24e00153f376f |
swift-crypto | 4.5.2 | da9d28d69ebe3894b18376c8f2395c2f37b8448f |
swift-huggingface | 1.0.0 | c30143a4616f3fa994ee3ab3e3464f752845c07c |
swift-jinja | 3.0.0 | a091d6ae559ee97e904a0f3c2890b21949d0306f |
swift-log | 1.17.0 | e3da04078777e6a1b72ce19981fbd6539b0847d8 |
swift-nio | 2.105.0 | 2f58d8ef84438d6517fc78bcea2f8527e3c72936 |
swift-sdk | 0.12.1 | a0ae212ebf6eab5f754c3129608bc5557637e605 |
swift-system | 1.8.1 | 869129b7bf4ecc57b97d0193ad29690ca2134750 |
swift-transformers | 1.4.0 | 402a8a1105f52038b0949d9596981fc9e32bed17 |
xgrammar | 0.2.2 | 4d145cc13d878c751ebeed36af1c013074be76bc |
yyjson | 0.13.0 | 6447536015f3d600f3d65323b10976103b337ca7 |
At the November 9 review, the version-3.4.5 branch used two local package references.
Its source baseline is RawCull 3.4.5, build 436, commit a68253b73cbad14a7b1030dba6b439e6bce7d3da.
The revisions identify the sibling checkouts used to verify the integration.
| Package | Xcode path | Checkout revision | Close Up responsibility |
|---|---|---|---|
| PhotoAnalysisKit | ../PhotoAnalysisKit | 27d422b100214dd1520f7ca11123f58a86f04e99 | Human face rectangles and preview detail |
| PhotoEvidenceKit | ../PhotoEvidenceKit | 35e8aca4135ac2151cbce033e4e9baefb8bafabc | Crop rendering and manual inspection UI |
The animal head and eye pilot lives in RawCull and uses Apple’s Vision framework. It required no package release or dependency update. The November 8 table below is the historical remote snapshot. Build 436 retains the other 17 entries at their recorded revisions. See the Close Up guide for the workflow and the distinction between detected and manual crops.
This table is derived from the local RawCull
RawCull.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved,
reviewed November 8, 2026 alongside project.pbxproj and source imports.
“App” means RawCull directly consumes package products; “transitive” means a
package owns the dependency. There are 19 resolved entries.
| Identity | Relationship | Version/branch | Revision |
|---|---|---|---|
| DecodeEncodeGeneric | app | 1.0.0 | b5ecbbbe1b244191efec1532a979f6ae342d6617 |
| ParseRsyncOutput | app | 1.0.0 | e079e0c9d34bf07f7f2a4312b40feea79ae14847 |
| PhotoAIKit | app | 1.0.0 | 4b85056e6c2603b5e382987710ca2f16f4c5c155 |
| PhotoAnalysisKit | app | 1.3.1 | 2a1466e04d821fa2628d6985296643e0d0c7e465 |
| PhotoEvidenceKit | app | 1.0.7 | 7614fd1528bb7cf2549799fb937678ea39d90228 |
| RawCullCore | app | 1.1.2 | d25a51e65ad32a82bf82f86fa0ec07d6e14498e9 |
| RawParserKit | app | 1.3.3 | 26df4abc2178d5c07d08f3883d84d0648f5141d3 |
| RsyncArguments | app | 1.0.0 | 0ff6518136c208dfbecc1a918f045048ca79853d |
| RsyncProcessStreaming | app | 1.0.0 | dd86f012b352888fd146e0b6e103740dc237f740 |
| coreai-models | transitive | 1.0.0 | 5de95c6cd29e5e390fb36d87e13b2396668f7974 |
| EventSource | transitive | 1.6.0 | bb4b61273b5a976bb571859c17f903ebc3439df1 |
| swift-asn1 | transitive | 1.7.4 | 917b472dbe53ba699cbb0495f9a95a084bc6364d |
| swift-collections | transitive | 1.7.5 | f96b909e1a9e469620bc5037c1e24e00153f376f |
| swift-crypto | transitive | 4.5.2 | da9d28d69ebe3894b18376c8f2395c2f37b8448f |
| swift-huggingface | transitive | 1.0.0 | c30143a4616f3fa994ee3ab3e3464f752845c07c |
| swift-jinja | transitive | 3.0.0 | a091d6ae559ee97e904a0f3c2890b21949d0306f |
| swift-transformers | transitive | 1.4.0 | 402a8a1105f52038b0949d9596981fc9e32bed17 |
| xgrammar | transitive | 0.2.2 | 4d145cc13d878c751ebeed36af1c013074be76bc |
| yyjson | transitive | 0.13.0 | 6447536015f3d600f3d65323b10976103b337ca7 |
Do not infer the app boundary from every transitive pin. Xcode product references and source imports define what RawCull actually consumes.
| Package | Products imported by RawCull | Values or protocols crossing the boundary |
|---|---|---|
| RawParserKit | RawParserKit | RawImageLoader, RawImageMetadata, RawFocusPoint, RawFormatRegistry, CGImage results; the app maps them through RawParserKitImageLoader |
| PhotoAnalysisKit | PhotoAnalysisKit | PhotoAnalyzer, PhotoAnalysisInput, PhotoAnalysisDescriptor, PhotoAnalysisResult, focus evidence and mask values |
| RawCullCore | RawCullCore | RawCullFileItem, RawCullSourceCatalog, ExifMetadata, burst inputs/results/configurations, ranking evidence, histograms; the app exposes compatibility typealiases such as FileItem |
| PhotoAIKit | PhotoAIContracts, CoreAICLIPBackend, CoreAIQwenBackend, CoreAISAM3Backend, CoreAIEfficientSAMBackend, VisionFeaturePrintBackend, PhotoAIWorkflows, PhotoAIStorage | AIImageSource, model identities/resources, similarity artifacts/descriptors, provider protocols, segmentation requests/results, mask stores and workflows |
| PhotoEvidenceKit | PhotoEvidenceContracts, PhotoEvidenceEngine, PhotoEvidenceUI | CloseUpFrame, region/viewport/source descriptors, AF availability, renderer and region-store protocols, CloseUpModel, CloseUpPanel |
| RsyncArguments | RsyncArguments | rsync argument builders used by Params and ArgumentsSynchronize |
| RsyncProcessStreaming | RsyncProcessStreaming | RsyncProcess and ProcessHandlers used by the copy executor |
| ParseRsyncOutput | ParseRsyncOutput | parsed transfer progress and totals used by RemoteDataNumbers |
| DecodeEncodeGeneric | DecodeEncodeGeneric | generic JSON encode/decode used by saved-file persistence |
RawCull owns the translations between these vocabularies. None of the five architecture packages imports another merely to share an app model.
flowchart TD
UI["RawCull SwiftUI"] --> Host["RawCull composition, adapters, policy, persistence"]
Host --> Parser["RawParserKit\nRAW decode + normalized metadata"]
Host --> Analysis["PhotoAnalysisKit\nmeasurements + masks"]
Host --> AI["PhotoAIKit products\nAI contracts + backends + workflows"]
Host --> Core["RawCullCore\npure grouping + ranking"]
Host --> Evidence["PhotoEvidenceKit products\nmanual close-up inspection"]
Host --> Args["RsyncArguments"]
Host --> Process["RsyncProcessStreaming"]
Host --> Output["ParseRsyncOutput"]
Host --> JSON["DecodeEncodeGeneric"]
Parser -. "app adapter" .-> Core
Analysis -. "app adapter" .-> Core
AI -. "app adapter" .-> CoreSolid arrows are compile-time imports by the app. Dotted arrows are value translation performed by RawCull, not package dependencies.
The three rsync support packages do not depend on one another. RawCull connects argument building, process execution and streamed-output parsing in its copy workflow. The runtime sequence is not a package import chain.
When a package pin changes, compare its manifest and public source at the new resolved revision before updating this documentation. A sibling checkout may be ahead of the revision RawCull actually builds.
Compared with the October 31 snapshot, PhotoEvidenceKit is newly resolved at 1.0.7. EventSource moves from 1.5.1 to 1.6.0, swift-asn1 from 1.7.3 to 1.7.4, swift-collections from 1.7.3 to 1.7.5, swift-jinja from 2.5.1 to 3.0.0, swift-transformers from 1.3.5 to 1.4.0, and yyjson from 0.12.0 to 0.13.0. The eight previously direct package pins and the other transitive pins retain the revisions recorded in the October 31 table.
The Xcode project also lists PhotoEvidenceDemo, the package’s executable
example, as a product reference. RawCull source imports the three library
products above; the demo is not a fourth library API.
| Step | Package output | RawCull responsibility |
|---|---|---|
| Decode | RawParserKit image and metadata | Retain sandbox access, select preview/development policy, cache decoded work |
| Measure | PhotoAnalysisKit scores, evidence, masks | Combine source identity with analysis descriptor and reject stale results |
| Infer | PhotoAIKit embeddings, semantic results, segmentation | Install models, admit requests, choose fallback and publish current results |
| Recommend | RawCullCore grouping and ranking values | Supply ordered inputs and evidence; preserve photographer decisions |
| Inspect | PhotoEvidenceKit crops and session state | Supply truthful source labels, file/settings revisions, AF mapping and region storage |
PhotoEvidenceKit consumes host-rendered images through an injected renderer. It does not import the decoder, analysis, AI, or ranking packages. A close-up can help a photographer evaluate a recommendation without becoming new ranking evidence automatically. See the individual guides for invalidation and failure behavior at each boundary.
Learn how Swift packages, products, targets, modules, imports, and linking fit together using PhotoEvidenceKit as a concrete example.
A detailed guide to PhotoAIKit’s contracts, CLIP image and text inference, semantic comparison, SAM 3 and EfficientSAM, workflows, storage, concurrency, and model identity.
A detailed guide to PhotoAnalysisKit’s image-analysis boundary, sharpness pipeline, focus evidence, masks, calibration, batching, feature prints, resources, and concurrency.
A detailed guide to RawCullCore’s package-safe models, capture-time and EV-aware burst grouping, ranking evidence, confidence rules, histograms, concurrency, and tests.
A detailed guide to RawParserKit’s vendor dispatch, TIFF and MakerNote parsing, embedded previews, structured capture and exposure metadata, orientation, decode limiting, cancellation, compatibility APIs, and tests.
PhotoEvidenceKit contracts, close-up geometry, bounded rendering, retained references, region persistence, AF assistance, and RawCull integration.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.