Skip to content
CAI
Software that uses CAICheck a score

hmlongco/Factory

67.0

Adequate · 14 November 2026

4.8k

lines of production code

Swift

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add ContainerTrait for isolated dependency injection in Swift Testing

Introduces the \ContainerTrait\ struct in the \FactoryTesting\ module, enabling developers to isolate the shared dependency container for individual Swift Testing test cases. This allows tests to run in parallel without interference by providing a scoped container via \TestTrait\ and \SuiteTrait\ conformance, automatically cloning the singleton scope and allowing optional pre-test transformations.

Sources/FactoryTesting · high confidence

Added FactorySimpleDemo app and tests

A new demo application, FactorySimpleDemo, has been added to showcase the FactoryKit dependency injection library. The app features a SwiftUI interface that displays a name loaded via a registered service and includes a button to reload the view. It demonstrates both formal and sugared service registration syntax within SwiftUI previews. Additionally, a corresponding test suite using the FactoryTesting framework has been included to verify service resolution and mocking capabilities.

FactorySimpleDemo · high confidence

Added scripts to copy FactoryKit files and generate documentation

A new Swift script (Scripts/copy.swift) was added to copy .swift files from the FactoryKit source directory to the Factory directory, and a shell script (Scripts/docs.sh) was introduced to generate static documentation for the FactoryKit target using Swift Package Manager.

Scripts · high confidence

Demo app adds concept examples for concurrency, async initialization, and dependency patterns

The FactoryDemo application now includes a new Concepts section demonstrating how to use FactoryKit with modern Swift features. This includes examples of injecting and using Actors and MainActor-isolated types, handling asynchronous initializers via a caching wrapper, and resolving circular dependencies. It also provides demonstrations of generic type injection, tagged factories with priority-based resolution, and best practices for defining non-extendable service containers.

FactoryDemo/FactoryDemo/Concepts · high confidence

Demo app adds container-specific and observation-based dependency injection examples

The FactoryDemo app now includes new SwiftUI views and view models that demonstrate advanced FactoryKit features. ContainerDemoView and ContainerDemoViewModel show how to use custom shared containers (MyCustomContainer) and inject them via @Injected. ObservableView demonstrates integrating the new Observation framework with FactoryKit on iOS 17+, allowing injected @Observable services to be mutated and trigger UI updates. Additionally, ModelTest shows how to use environment-specific registrations (onPreview, onTest) to provide different data for previews and tests, while the UI tests verify that launch arguments can trigger specific mock registrations.

FactoryDemo/FactoryDemo · high confidence

Initial repository structure and documentation for FactoryKit 3.4.1

This change establishes the initial repository layout for the FactoryKit dependency injection library, including the core source modules (FactoryKit and FactoryTesting), comprehensive DocC documentation, and a demo application. It introduces the \.spi.yml\ configuration for Swift Package Index documentation generation, a \CLAUDE.md\ guide for AI-assisted development, and a \Factory.xctestplan\ for test execution. The entry also includes the full changelog for version 3.4.1, which highlights scope performance optimizations, lock reclamation, and fixes for concurrent resolution and cache key collisions, alongside updated README and code of conduct files.

(repo-wide) · high confidence

Initialize FactoryDemo workspace configuration

The FactoryDemo workspace has been initialized with standard Xcode configuration files, including the workspace data file, workspace settings, and IDE checks. This establishes the basic project structure required to open and build the demo application in Xcode.

FactoryDemo/FactoryDemo.xcodeproj/project.xcworkspace · high confidence

Introduce Common module with FactoryKit dependency injection definitions

The FactoryDemo app now includes a new Common module that provides a shared framework for dependency injection using FactoryKit. This module defines a CommonType protocol and registers specific implementations within the DI container, including a standard Common implementation, a singleton fatalType factory, and a promisedType factory that returns nil. It also contains a MacroCommonType implementation, though its registration via macro is currently commented out.

FactoryDemo/Modules/Common/Common · high confidence

Networking module introduces dependency injection and test infrastructure

The Networking module now includes a public header for framework versioning and a Swift implementation that defines a NetworkType protocol. It registers network service instances within the FactoryKit dependency injection container and introduces a FatalCommonType class, establishing the module's internal structure and test capabilities.

FactoryDemo/Modules/Networking/Networking · high confidence

Behavioural changes

FactoryDemo modules restructured into standalone Xcode projects

The Common and Networking modules in the FactoryDemo app have been reorganized from their previous structure into distinct Xcode projects (Common.xcodeproj and Networking.xcodeproj). Each module is now built as a standalone framework (Common.framework and Networking.framework) with its own unit test bundle. The Networking module explicitly depends on and embeds the Common framework, while both modules integrate with the FactoryKitDynamic dependency. This change affects how the demo app's internal module boundaries are defined and built within Xcode.

FactoryDemo/Modules/Common/Common.xcodeproj, FactoryDemo/Modules/Networking/Networking.xcodeproj · high confidence

FactoryDemo project restructured for multi-module and concurrency support

The FactoryDemo Xcode project has been updated to demonstrate modern Swift concurrency patterns and multi-module architectures. The demo app now includes examples for Observable views, UI testing, and automatic registration, while also integrating external modules like Common and Networking. Additionally, the project configuration has been adjusted to support Swift 6 conformance and Xcode 16, ensuring compatibility with the latest language and toolchain features.

FactoryDemo/FactoryDemo.xcodeproj · medium confidence

FactoryKit 3.0: New container architecture and concurrency-safe injection

FactoryKit has been updated to version 3.0, introducing a redesigned container system with \SharedContainer\ and \ManagedContainer\ protocols to better support both service locator and explicit dependency injection patterns. The library now uses \@TaskLocal\ for the shared container to enable safer isolation in concurrent environments, particularly for test parallelization. Concurrency safety has been significantly improved by replacing legacy locking mechanisms with atomics and \os\_unfair\_lock\ (or \pthread\_mutex\ on non-Apple platforms), fixing data races in \@LazyInjected\ and \@WeakLazyInjected\ wrappers during concurrent first access. Additionally, the \dependency()\ function is now the preferred way to resolve dependencies via keypaths, deprecating the older \resolve()\ function, and new context-aware registration features allow factories to behave differently in previews, tests, or debug modes.

Sources/FactoryKit/FactoryKit · high confidence

Test coverage

Added Swift Testing suite for isolation, nonisolated, and parallel container behaviors; Added comprehensive test suite for FactoryKit; Added concurrency and isolation test fixtures; Added initial test scaffolding for Common and Networking modules; Added parallel-safe testing infrastructure and mock registration tests; Configured Xcode scheme to run unit and UI tests with code coverage.

Dependencies

FactoryKit 3.0 release with Swift 6 concurrency and expanded platform support

The Factory dependency injection framework has been updated to version 3.0, introducing full Swift 6 conformance with strict concurrency checking enabled. This release raises the minimum deployment targets to iOS 15, tvOS 15, watchOS 9, macOS 12, and visionOS 1, while adding a new dynamic library product (FactoryKitDynamic) and a dedicated testing target (FactoryTesting). The package now includes a privacy manifest resource and depends on the Swift DocC plugin for documentation generation.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 67 → 67 (-0.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 99 → 97 (-1.1)
  • Architecture 97 → 97 (-0.0)
  • Maturity 63 → 63 (+0.0)
  • Readiness 51 → 50 (-0.2)
  • Security 99 → 97 (-1.3)
  • Performance 100 → 100 (+0.0)

Resolved (1)

  • Duplicated block (11 lines × 2) (Sources/FactoryKit/FactoryKit/Scopes.swift)

New (2)

  • Duplicated block (11 lines × 2) (Sources/FactoryKit/FactoryKit/Scopes.swift)
  • Edited copy of a member (4 corresponding lines) (Sources/FactoryKit/FactoryKit/Scenes.swift)

Changes since last survey

  • 3 commits — 3 feature/other, 0 fixes

By area

  • (repo) — 1 commit
  • (root) — 1 commit
  • Sources/FactoryKit — 1 commit

Notable commits

  • change: Merge pull request #391 from niktishakov/foundation-essentials-off-darwin
  • change: Use FoundationEssentials on Linux and Android
  • change: Use FoundationEssentials on Linux and Android #391

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

hmlongco/Factory was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 5f4ea2bf876fd08db3442af96270424120bd2c70 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.