Skip to content
CAI
Software that uses CAICheck a score

gradyzhuo/swift-kurrentdb

61.1

Adequate · 9 November 2026

17.4k

lines of production code

Swift

primary language

6

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add API methods for managing projections in all modes

The Projections API now exposes specific methods for creating and listing projections across all four supported modes: Any, Continuous, One-Time, and Transient. Users can now call \list()\ to retrieve statistics for projections in any, continuous, one-time, or transient modes, and use \create()\ to define new projections with JavaScript query strings. Continuous projections support optional configuration closures for settings like emit behavior, while one-time and transient projections offer simpler creation interfaces. The Any mode also includes a \restartSubsystem()\ method to restart the entire projection subsystem on the server.

Sources/KurrentDB/Projections/API · high confidence

Add Swift API for creating, updating, and reading persistent subscriptions

New Swift extension methods are introduced to support persistent subscription operations. The \EventStore\_Client\_PersistentSubscriptions+Additions\ file provides mapping logic to convert \CreateSettings\ and \UpdateSettings\ into gRPC request messages, allowing users to configure subscription parameters such as retry counts, checkpoint limits, buffer sizes, and filters. It also includes a \StreamFilter\ mapping for defining stream name or event type filters. Additionally, \ReadEvent+Additions\ enables the initialization of \ReadEvent\ objects from gRPC responses, exposing recorded events, linked events, and commit positions to the application layer.

Sources/KurrentDB/PersistentSubscriptions/Additions · high confidence

Add ability to list persistent subscriptions for all streams

Users can now retrieve a list of all persistent subscriptions across the entire event log using the new \PersistentSubscriptions.ListForAll\ usecase. This feature introduces a \ListFilter\ enum that allows filtering by either all subscriptions or a specific stream identifier, returning an array of \SubscriptionInfo\ objects for each matching subscription.

Sources/KurrentDB/PersistentSubscriptions/Usecase/All · high confidence

Add gossip read usecase with method descriptor and logging

The Gossip.Read usecase is introduced to handle reading cluster member information via the gossip protocol. This implementation conforms to the updated Usecase protocol by exposing a GRPCCore MethodDescriptor for server feature detection and includes a static name property to ensure the operation is automatically included in log entries.

Sources/KurrentDB/Gossip/Usecase · high confidence

Add local 3-node TLS cluster configurations for KurrentDB and EventStoreDB

New docker-compose files and environment configurations enable running a local 3-node cluster with mutual TLS for both KurrentDB (defaulting to image 26.1) and EventStoreDB (24.10). The setup includes automated certificate generation, data persistence volumes for KurrentDB, and increased gossip timeouts (10s) to prevent leader elections during CI load spikes.

server · high confidence

Add persistent subscription acknowledgement, negative acknowledgement, and subsystem restart use cases

The PersistentSubscriptions module now exposes dedicated use-case structs for acknowledging events (Ack), negatively acknowledging events with specific handling actions such as park, retry, skip, or stop (Nack), and restarting the persistent subscription subsystem (RestartSubsystem). These additions allow users to explicitly manage event processing outcomes and control subscription lifecycle states through the KurrentDB client.

Sources/KurrentDB/PersistentSubscriptions/Usecase · high confidence

Add real-time server monitoring and statistics API

Users can now query real-time KurrentDB server statistics via a new \monitoring\ property on the client and a dedicated \Monitoring\ service class. The \stats()\ method streams server statistics snapshots as an async sequence, allowing configuration of metadata inclusion and refresh intervals. The monitoring service also supports per-call authentication overrides via the \authenticated(\_:)\ method, enabling temporary credential changes for specific monitoring calls without altering the client's global settings.

Sources/KurrentDB/Monitoring · high confidence

Add server feature detection via GetSupportedMethods usecase

Introduces a new \GetSupportedMethods\ usecase that queries the server for its supported gRPC methods and version. This enables the client to detect server capabilities and guard against using features unsupported by the connected node, improving compatibility and error reporting for version mismatches.

Sources/KurrentDB/ServerFeatures/Usecase · high confidence

Add server stats monitoring via streaming RPC

The Monitoring module now includes a new \Stats\ usecase that opens a server-streaming RPC to yield periodic snapshots of server metrics. Users can configure whether to include metadata fields and set the interval between snapshots (defaulting to 10 seconds). The implementation handles connection lifecycle, error propagation, and graceful cancellation, returning an \AsyncThrowingStream\ of \Response\ objects containing key-value metric pairs.

Sources/KurrentDB/Monitoring/Usecase · high confidence

Add server-side filtering for $all reads and subscriptions

The \$all\ stream API now supports server-side filtering via a new \filter\ property in the \ReadAll.Options\ and \SubscribeAll.Options\ structs. Users can configure a \StreamFilter\ to select a subset of events from the global stream, reducing network traffic and client-side processing overhead. The implementation handles interleaved control frames (such as checkpoints and position updates) by skipping non-event messages during iteration, ensuring that only relevant events are yielded to the consumer.

Sources/KurrentDB/Streams/Usecase/All · high confidence

Add user management use cases (create, update, enable, disable, change/reset password, details)

The Users module now exposes a set of new use cases for managing user accounts. Users can create new users with login credentials and group memberships, update user profiles (full name, groups), enable or disable accounts, and manage passwords (change with current password or reset without it). Additionally, a streaming use case allows fetching detailed user information. These use cases are implemented as gRPC unary and unary-stream calls, integrating with the existing client infrastructure and supporting the UserGroup enum for group assignments.

Sources/KurrentDB/Users/Usecase · high confidence

Added KurrentDB v2 API support with new proto definitions and code generation

The proto definitions have been reorganized and expanded to support the KurrentDB v2 API. New protocol buffers for the Schema Registry (groups, schemas, validation) and Streams (AppendSession, AppendRecords) have been added, alongside updated error definitions for both the core platform and the Streams API. Existing v1 protos (cluster, gossip, monitoring, etc.) have been moved to a new directory structure and their Java package namespaces updated to reflect the KurrentDB branding. A new README documents the code generation process, which outputs Swift gRPC/protobuf code into the \_GRPCProtobufGenerated module.

proto · high confidence

Introduce Swift Package Index configuration and offline benchmark documentation

The package now includes a \.spi.yml\ file that directs the Swift Package Index to link to the external GitHub Pages documentation instead of building its own copy, and adds a \BENCHMARKS.md\ file that documents offline benchmark results and how to run the benchmark suite locally.

(repo-wide) · high confidence

Introduce gossip-based cluster discovery and topology reading

Added the Gossip subsystem (Gossip, MemberInfo, VNodeState, and KurrentDBClient extension) to enable discovering cluster members and reading the current topology via the gossip protocol. The new \readCluster(timeout:)\ API on \KurrentDBClient\ iterates configured endpoints (standalone, DNS, or seed nodes) to fetch a sorted list of \MemberInfo\ objects, allowing users to identify leaders and healthy nodes. The implementation routes gossip requests through the shared \ConnectionProvider\ and applies the configured gossip timeout and node preference sorting.

Sources/KurrentDB/Gossip · high confidence

Introduce server feature detection to check supported gRPC methods

The ServerFeatures module now exposes a \getSupportedMethods()\ API that queries the server for its version and a list of supported gRPC methods. This enables the client to perform runtime feature detection via \ServiceInfo.isSupported()\, allowing applications to verify method availability before use.

Sources/KurrentDB/ServerFeatures · high confidence

Introduce user management API with per-call authentication

The KurrentDB client now exposes a dedicated \users\ interface for managing user accounts. Users can create new accounts with specific login names, passwords, and group memberships (including built-in \$admins\ and \$ops\ groups or custom strings), and manage existing users by retrieving details, enabling/disabling accounts, updating profiles, and changing or resetting passwords. The \Users\ service also supports per-call authentication overrides via the \authenticated(\_:)\ method, allowing callers to supply credentials that differ from the client-level default for specific operations.

Sources/KurrentDB/Users · high confidence

Introduces EventRecord and ConsistencyCheck for v2 API and Dynamic Consistency Boundaries

The library adds support for the KurrentDB v2 API by introducing the \EventRecord\ type, which replaces the legacy \EventData\ with a structured payload containing explicit schema metadata (format, name, and optional version) and key-value properties. This new record type is designed for use with the new \AppendRecords\ capability, which enables Dynamic Consistency Boundaries (DCB) by allowing users to define pre-commit \ConsistencyCheck\ assertions on stream revisions or states. The \ConsistencyCheck\ struct lets you assert that a stream is at a specific revision or lifecycle state before an append commits, enabling complex multi-stream coordination patterns where checks can reference streams that are not being written to. Additionally, the \StreamEvent\ struct bundles these records with their target stream identifier and expected revision for batch appends, and the \ContentType\ enum standardizes payload encoding types (JSON, binary, etc.).

Sources/KurrentDB/Core/Event · high confidence

New KurrentDB v2 projection management API

The \Sources/KurrentDB/Projections/Usecase\ module now implements the KurrentDB v2 gRPC API for projection management. This adds new usecase structs for creating (Continuous, OneTime, Transient), updating, deleting, enabling, disabling, resetting, and retrieving statistics/results/state for projections, as well as restarting the subsystem. These usecases utilize the new \KurrentError\ type for error handling and the \CommandOptions\ protocol for configuration, replacing older EventStoreDB-specific patterns.

Sources/KurrentDB/Projections/Usecase · high confidence

New Operations Usecases for Server Management and Maintenance

This change introduces a set of new Usecase structs in the Operations module to expose specific KurrentDB server management and maintenance RPCs. Users can now initiate and control server operations including merging indexes, resigning nodes, setting node priority, restarting persistent subscriptions, shutting down the server, and managing scavenging tasks (starting and stopping with configurable thread counts and chunk offsets). Each usecase is implemented as a \UnaryUnary\ operation with a unique name for logging and includes the necessary \methodDescriptor\ for server feature detection.

Sources/KurrentDB/Operations/Usecase · high confidence

New Streams API with lazy/buffered reads, batch appends, and consistency checks

The Streams API now provides new methods for reading and writing events. Reading from a specific stream or the $all stream can now be configured to return a ReadCall, allowing you to choose between lazy (streaming) or buffered (fetch-all) delivery to manage memory usage. Writing has been expanded with batchAppend for high-throughput, non-atomic pipelined appends, and appendRecords for atomic multi-stream appends with cross-stream consistency checks (Dynamic Consistency Boundary). Additionally, getMetadata() now correctly returns nil when a stream has no metadata, rather than throwing an error.

Sources/KurrentDB/Streams/API · high confidence

New core infrastructure for connection management, node discovery, and retry logic

This change introduces several foundational components for the KurrentDB client. A new \ConnectionProvider\ manages gRPC connection lifecycles, distinguishing between shared connections for short-lived RPCs and dedicated connections for long-running streams, with background sweeping for idle cleanup. \NodeSelector\ and \NodeDiscover\ handle gossip-based cluster node discovery and caching, while \OperationRetryPolicy\ and its \withRetry\ helper provide configurable exponential backoff and jitter for node failures. Additionally, \ResponseHandoff\ implements a zero-buffer, single-producer/single-consumer rendezvous for stream responses to manage backpressure, and \DeadlineCancellation\ ensures correct error mapping (e.g., \deadlineExceeded\) across different grpc-swift versions. The \StreamFilter\ API is also updated to support variadic prefixes.

Sources/KurrentDB/Core · high confidence

New stream identification and metadata types

Added new Swift types for stream identification (\StreamIdentifier\), metadata configuration (\StreamMetadata\), position tracking (\StreamPosition\), concurrency rules (\StreamRevision\), and stream selection (\StreamSelector\). \StreamIdentifier\ now supports creation from string literals and extracts category prefixes from hyphen-delimited names. \StreamMetadata\ provides a builder-style API for configuring retention, caching, and access control policies, including support for user and system ACLs.

Sources/KurrentDB/Core/Stream · high confidence

New v2 Streams API with AppendSession, AppendRecords, and BatchAppend

The Streams API has been expanded with new usecases for multi-stream operations: \AppendSession\ for pipelined appends across multiple streams, \AppendRecords\ for atomic multi-stream appends with cross-stream consistency checks (Dynamic Consistency Boundary), and \BatchAppend\ for non-atomic pipelined multi-stream appends. These new capabilities are part of the KurrentDB v2 API support, which also includes the \EventRecord\ type, \StreamEvent\ encapsulation, and server feature detection to guard against version mismatches.

Sources/KurrentDB/Streams/Usecase/Specified · high confidence

Removals

Removal of legacy EventStoreDB client implementation

The \Sources/EventStoreDB\ directory has been cleared of its previous client implementation, including \ClientSettings\, \EventData\, \EventStore\, and the entire \Library/Stream\ and \Library/Projection\ operation modules. This change removes the old API surface for connecting to and interacting with EventStoreDB, preparing the location for the introduction of the new \KurrentDB\ client architecture.

Sources/EventStoreDB · high confidence

Architecture

Refactor projection targets into a dedicated module with improved type safety

The projection target types have been reorganized into a new \Sources/KurrentDB/Projections/Target\ directory, introducing distinct structs for different projection scopes and modes. This includes \AnyProjectionsTarget\ for all modes, \NameTarget\ for named projections (including predefined system projections like \$by\_category\), and specific targets for continuous (\SpecifiedContinuousProjectionTarget\, \UnspecifiedContinuousProjectionTarget\) and transient (\SpecifiedTransientProjectionTarget\, \UnspecifiedTransientProjectionTarget\) projections. A new \ProjectionControlable\ protocol marks targets that support control operations by exposing their name, and \ProjectionsTarget\ serves as the base protocol. This change provides a more structured and type-safe API for interacting with projections.

Sources/KurrentDB/Projections/Target · high confidence

Behavioural changes

2 commits (0 fixes) modifying scripts

A change to existing behaviour in scripts — 2 commits, 1 file: “\[REMOVE\] the Python scripts: CI, the snippet check and the docs now use the Swift package (swift run --package-path scripts …)”; “\[ADD\] compile every documented Swift example in CI”.

scripts · medium confidence · unverified

2 commits (0 fixes) modifying scripts/Sources

A change to existing behaviour in scripts/Sources — 2 commits, 16 files: “\[ADD\] client-stack benchmarks against an in-process server, with gRPC-alone baselines and their scheduling-dependent allocation counts under their own measure, without a threshold”; “\[ADD\] scripts/ as a SwiftPM package: the five helper scripts rewritten in Swift with Swift Testing coverage”.

scripts/Sources · medium confidence · unverified

4 commits (0 fixes) modifying server/x509

A change to existing behaviour in server/x509 — 4 commits, 1 file: “\[UPDATE\] pin CI actions to commit SHAs, declare read-only permissions, and bind test cluster ports to loopback”; “\[ADD\] test X.509 user certificate authentication against a licensed node in CI”; “\[UPDATE\] run the X.509 user certificate suite on every CI run against an unlicensed KurrentDB 26.2 node”; and 1 more.

server/x509 · medium confidence · unverified

4 commits (1 fix) modifying scripts/transfer

A change to existing behaviour in scripts/transfer — 4 commits (1 fix), 1 file: “\[ADD\] Script to migrate single-node data into cluster node1 volume”; “\[UPD\] Recreate truncate.chk before chowning target volume”; “\[UPD\] Fix ownership and recreate truncate.chk after data migration”; and 1 more.

scripts/transfer · medium confidence · unverified

7 commits (3 fixes) modifying Benchmarks

A change to existing behaviour in Benchmarks — 7 commits (3 fixs), 4 files: “\[REFACTOR\] Introduce V1 Options types; strip builder methods from core Options”; “\[ADD\] offline benchmarks for append request encoding and read response decoding, and drop the ones that only construct values”; “\[FIX\] make the in-process server take each request whole and check its message count, keep the grpc-timeout header from it so only the client's deadline timer runs, and check the lazy read before measuring”; and 4 more.

Benchmarks · medium confidence · unverified

Cursor types split into PositionCursor and RevisionCursor

The generic cursor handling has been split into two distinct types: \PositionCursor\ for reading from the \$all\ stream and \RevisionCursor\ for reading from named streams. Each type now explicitly supports starting from the beginning (\start\), the end (\end\), or a specific point (\specified\), with \RevisionCursor\ providing a \from(\_:)\ convenience method for specifying a revision number.

Sources/KurrentDB/Core/Cursor · high confidence

Deprecated V1 compatibility layer for KurrentDB client operations

The Sources/KurrentDB\_V1 module now provides a compatibility layer that exposes convenience methods for stream operations, persistent subscriptions, projections, server operations, and user management on the KurrentDBClient. These methods are marked as deprecated and delegate to the new target-based API (e.g., client.operations(of:), client.streams(of:), client.projections(of:), client.persistentSubscriptions(of:), and client.users). The layer also includes V1-style options structs (such as StreamsAppendOptions, PersistentSubscriptionsCreateOptions, and ProjectionsContinuousCreateOptions) that use a builder pattern and bridge to the new target-based options, ensuring existing code continues to function while encouraging migration to the modern API.

_Sources/KurrentDB\V1 · high confidence

Enhanced error reporting for version conflicts and consistency violations

The client now provides detailed context for append failures. When a version conflict occurs, the \wrongExpectedVersion\ error includes structured \ExpectedRevisionOption\ and \CurrentRevisionOption\ enums to clearly indicate the expected state (e.g., stream existence, specific revision) and the actual server state. Additionally, a new \consistencyViolation\ error case captures specific pre-commit check failures from \AppendRecords\ transactions, reporting the index, stream, and expected/actual states for each failed check, allowing applications to refresh stale state efficiently.

Sources/KurrentDB/Core/Error · high confidence

Hardened error handling and per-call authentication support

The client now rejects negative wire revisions (preventing crashes on malformed server responses) and fails requests if credentials cannot be encoded into an Authorization header. It also introduces per-call authentication, allowing you to override default credentials for specific requests, while correctly handling X.509 certificates which must be configured at the connection level rather than per-request.

Sources/KurrentDB/Core/Additions · high confidence

Introduce KurrentDBClient v2 API with target-based stream access and protocol abstraction

The KurrentDB client has been updated to a v2 API that replaces the previous append/read methods with a target-based design. Users now access subsystems like streams and persistent subscriptions through factory methods (e.g., \client.streams(specified:)\, \client.allStreams\) that return scoped interfaces, enabling more explicit and type-safe operations. The primary entry point is now \KurrentDBClient\, which conforms to the new \KurrentDBClientProtocol\ to support dependency injection and testing. This change also includes internal refactoring such as renaming \KurrentDB.swift\ to \KurrentDBClient.swift\ and standardizing the API surface for better clarity and maintainability.

Sources/KurrentDB · high confidence

Introduces target-based design for administrative operations

The library now uses a target-based architecture for administrative capabilities, introducing specific protocols and target structs to manage cluster nodes, scavenge operations, and system-wide tasks. Users can now interact with node role management via \NodeOperations\, start new scavenge operations via \ScavengeOperations\, control active scavenge processes via \ActiveScavenge\, and perform system administration via \SystemOperations\. This change provides a more structured and type-safe way to access these operational features.

Sources/KurrentDB/Operations/Protocols, Sources/KurrentDB/Operations/Targets · high confidence

New Projections API with per-call authentication and typed error handling

The Projections module now exposes a new client API (\KurrentDBClient.projections(of:)\, \projections(name:)\, \projections(system:)\) that scopes operations to specific targets like continuous, one-time, or system projections. This update introduces per-call credential overrides via the \authenticated(\_:)\ method, allowing temporary authentication changes without altering global client settings. Additionally, all projection control methods (enable, disable, abort, reset, delete, update) and state retrieval methods now explicitly throw \KurrentError\ instead of generic errors, providing more precise error handling for users.

Sources/KurrentDB/Projections · high confidence

New Streams API with lazy/buffered reads and per-call authentication

The Streams module has been rewritten to support KurrentDB v2, introducing a new \Streams\ interface accessed via \client.streams(of:)\, \client.streams(specified:)\, \client.allStreams\, and \client.multiStreams\. Reads now return a \ReadCall\ that can be executed in \lazy\ mode (pulling events as you iterate with bounded memory) or \buffered\ mode (fetching the whole result), replacing the previous synchronous read behavior. The API also adds per-call authentication via the \authenticated(\_:)\ method, which overrides client-level credentials for specific calls, and introduces new types like \ReadEvent\ and \ReadResponse\ to handle event data and links more robustly.

Sources/KurrentDB/Streams · high confidence

New authentication methods and stricter connection string validation

The client now supports Bearer token and X.509 mutual TLS authentication alongside the existing username/password credentials, allowing users to configure these via the new \Authentication\ enum. Connection string parsing has been hardened to strictly follow RFC 3986, rejecting invalid characters and unknown parameters, while TLS configuration now explicitly refuses to connect if a specified CA certificate file cannot be read, preventing accidental fallback to system trust roots.

Sources/KurrentDB/Core/ClientSettings · high confidence

Persistent subscription API refactored with corrected default timeouts and new settings types

The persistent subscription API has been restructured to improve clarity and correctness. Default timeout values for \messageTimeout\ and \checkpointAfter\ have been corrected from milliseconds to seconds (30s and 2s respectively) to match server defaults, preventing premature message timeouts. The API now uses distinct \CreateSettings\ and \UpdateSettings\ structs for better flexibility, introduces a \SystemConsumerStrategy\ enum for dispatch strategies, and adds new types like \EventResult\, \ConnectionInfo\, and \StreamSelection\ to provide richer metadata and configuration options for persistent subscriptions.

Sources/KurrentDB/Core/PersistenSubscription · high confidence

Persistent subscription use cases for $all and specified streams are restructured with distinct Create/Update settings

The persistent subscription APIs for both the $all stream and specific named streams have been reorganized into dedicated use-case structs (Create, Delete, GetInfo, List, Read, ReplayParked, Update). A key behavioral change is the separation of subscription configuration into distinct CreateSettings and UpdateSettings structs, allowing users to configure creation parameters (like consumer strategy and timeouts) separately from update parameters. The Read operation now explicitly handles termination logic to prevent retain cycles and ensures errors are properly propagated to the completion handler. Additionally, the Update options now accept an optional PositionCursor (for $all) or RevisionCursor (for specified streams), enabling users to change the starting position during an update without affecting other settings.

Sources/KurrentDB/PersistentSubscriptions/Usecase/AllStream · high confidence

Persistent subscriptions API restructured with target-based scoping and per-call credentials

The PersistentSubscriptions API has been restructured to use a target-based design, introducing distinct targets for cluster-wide operations (AllPersistentSubscriptionTarget), the $all stream (AllStreamPersistentSubscriptionTarget), and specific named streams (SpecifiedPersistentSubscriptionTarget). This change provides dedicated factory methods on KurrentDBClient (such as allPersistentSubscriptions, persistentSubscriptions(stream:group:), and persistentSubscriptions(filterGroup:)) to access these scoped operations. The Subscription handle now exposes lastRevision and lastPosition properties to track the most recently received event, enabling callers to resume subscriptions after drops. Additionally, the API now supports per-call authentication overrides via the authenticated(\_:) method, allowing specific subscription calls to use different credentials than the client-level default.

Sources/KurrentDB/PersistentSubscriptions · high confidence

Redesign of Projection status, mode, and detail types

The Projection module has been refactored to replace the previous OptionSet-based status with a new \Projection.Status\ struct that parses slash-separated server strings into individual \Name\ components, allowing users to check for multiple states via an array. Additionally, \Projection.Mode\ is now a distinct enum (Continuous, OneTime, Transient, Any) and a new \Projection.Detail\ struct exposes comprehensive runtime statistics such as CPU time, progress, and checkpoint status for monitoring projection health.

Sources/KurrentDB/Core/Projection · high confidence

Refactor Usecase protocol to expose method descriptors for feature detection

The \Usecase\ protocol now requires a \methodDescriptor\ property and a static \name\, enabling the client to identify specific gRPC methods. This structural change supports server-side feature detection, allowing the library to gracefully handle version mismatches by checking if a server supports a required method before execution.

Sources/GRPCEncapsulates/Usecase · high confidence

Refactor gRPC layer with Buildable API and scoped stream lifecycle

The gRPC encapsulation layer has been refactored to support a new fluent \Buildable\ API for constructing requests and options, replacing the previous \Builderable\ naming. A new \ScopedStreamResponse\ protocol introduces a scoped call lifecycle for lazy reads on shared connections, allowing callers to own iteration and backpressure while the library handles response mapping. Additionally, native Swift conformances for \GoogleProtobufValueProtocol\ are now available for standard numeric, string, boolean, array, and dictionary types, simplifying property serialization in event records.

Sources/GRPCEncapsulates · high confidence

Refactored gRPC connection management and error handling for KurrentDB use cases

The KurrentDB client now uses a refined connection strategy: unary and buffered-stream responses share a pooled connection, while long-lived server-streaming subscriptions (like \$all\ reads) open dedicated connections that are properly closed when the stream ends or the client shuts down. This change improves reliability by ensuring deadlines and cancellations are handled correctly, prevents resource leaks in long-running subscriptions, and adds server feature detection to gracefully reject calls unsupported by older server versions.

Sources/KurrentDB/Core/Additions/Usecase · high confidence

Refactored stream target types into a dedicated module

The stream target types (AllStreams, MultiStreams, SpecifiedStream, etc.) have been reorganized into a dedicated \Target\ folder with clearer naming (e.g., \AllStreamsTarget\, \MultiStreamsTarget\). This change improves code organization and makes the API more explicit about the scope of stream operations, such as targeting the global \$all\ stream, multiple streams, or specific named streams.

Sources/KurrentDB/Streams/Target · high confidence

Refactored user target types into distinct protocols and implementations

The user management API has been restructured to separate concerns between creating new accounts and managing existing ones. A new \UsersTarget\ marker protocol defines the scope, while \UserCreatable\ and \UserControllable\ protocols distinguish targets that support account creation from those that support management of a specific user by login name. Corresponding implementations, \AllUsersTarget\ and \SpecifiedUserTarget\, provide static accessors (\all\ and \specified(\_:)\) to construct these scoped targets, clarifying which operations are available for each scope.

Sources/KurrentDB/Users/Target · high confidence

Regenerated gRPC Swift stubs with updated error codes and cluster services

The generated code in the \_GRPCProtobufGenerated module has been updated to reflect changes in the underlying protocol buffers. This includes new server error codes for the Kurrent Platform (such as accessDenied, notLeaderNode, and serverOverloaded) and their associated detail messages, as well as regenerated client stubs and message types for the cluster and gossip services (e.g., EventStore\_Cluster\_Gossip and EventStore\_Client\_Gossip\_Gossip).

_Sources/\GRPCProtobufGenerated · high confidence

Target-scoped server operations with per-call authentication

The Operations module now exposes a new \operations(of:)\ API on \KurrentDBClient\ that returns a target-specific interface (e.g., \.system\, \.scavenge\, \.activeScavenge(scavengeId:)\, \.node\), constraining available methods at compile time. This includes scavenge management (\startScavenge\, \stopScavenge\), system administration (\mergeIndexes\, \restartPersistentSubscriptions\, \shutdown\), and node control (\resignNode\, \setNodePriority\). Each scoped interface supports per-call credential overrides via \authenticated(\_:)\, allowing temporary authentication changes without altering client-level settings. All operations now explicitly throw \KurrentError\ for standardized error handling.

Sources/KurrentDB/Operations · high confidence

Fixes

Introduce KurrentDBPool for safe, leak-free client borrowing

This change introduces the KurrentDBPool target, providing a new \withBorrowedClient\ API that safely borrows a client from a pool, performs an operation, and guarantees the client is returned. The implementation fixes critical lifecycle bugs found in previous designs: it prevents lease leaks by ensuring \giveBack\ is called even on cancellation or errors, avoids deadlocks by using non-blocking \tryAcquire\ for candidate rotation, and ensures connectivity by validating nodes via \NodeSelector\ (matching actual RPC paths) rather than just gossip seeds. It also resolves credential leaks by parsing the \KURRENTDB\_POOL\_URLS\ environment variable as a JSON array and suppressing raw connection strings in error messages.

Sources/KurrentDBPool · high confidence

Strict RFC 3986 connection string parsing

The client now parses connection strings strictly according to RFC 3986, rejecting ambiguous inputs such as numeric hosts that could be misinterpreted as IP addresses or non-ASCII schemes. The parser splits the string into components, percent-decodes credentials and query parameters, and ensures that special characters in passwords or values do not alter the host or parameter structure. Error messages now explicitly name the invalid parameter rather than echoing potentially sensitive input values.

Sources/KurrentDB/Core/ClientSettings/Parser · high confidence

Test coverage

2 commits adding/updating tests in Tests/X509Tests; 2 commits adding/updating tests in scripts/Tests; Added OperationsTests for admin RPCs and CI stability improvements; Added comprehensive integration and lifecycle tests for persistent subscriptions; Added comprehensive integration tests for the target-based Streams API and new multi-stream append operations; Added comprehensive test suite for KurrentDBPool; Added integration tests for projection lifecycle and advanced operations; Added test coverage for authentication, connection string parsing, and client settings; Added test infrastructure to verify documentation examples compile; Added test resources for persistent subscriptions and streams; Added tests for cluster gossip API; Added tests for server statistics monitoring; Added unit and integration tests for user management operations; New MockClientTests suite for verifying client internals and factory routing; Removed obsolete XCTest test files.

Dependencies

Upgrade to gRPC-Swift 2 and Swift 6 with new platform support

The package has been upgraded to require Swift 6.0 and now supports macOS 15, iOS 18, tvOS 18, watchOS 11, and visionOS 2. The core gRPC dependency has been migrated from grpc-swift 1.x to grpc-swift 2.0.0, introducing new sub-packages (grpc-swift-nio-transport, grpc-swift-protobuf) and updating the swift-protobuf dependency to version 1.33.3. The package name has changed from EventStoreDB to swift-kurrentdb, and the resolved dependency lock file has been removed.

(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

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 62 → 61 (-0.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 73 → 73 (+0.2)
  • Architecture 92 → 89 (-3.6)
  • Maturity 70 → 75 (+5.4)
  • Readiness 54 → 55 (+0.5)
  • Security 59 → 53 (-5.7)
  • Event Sourcing 100 → 100 (+0.0)
  • Performance 83 → 100 (+16.9)

Resolved (20)

  • ADR has no Consequences section (docs/adr/0001-read-becomes-lazy-in-3-0.md)
  • Documentation: no project overview (docs/superpowers/specs/2026-10-09-ca-certificate-fallback-design.md)
  • Duplicate operation names for the same intent. Both methods perform appending events to a stream with identical signatures (StreamIdentifier/String, events, options).
  • Duplicated block (27 lines × 2) (Sources/KurrentDB/Streams/Usecase/All/Streams.SubscribeAll.swift)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Inconsistent naming for creation operations. Persistent subscriptions use createPersistentSubscription, while projections use specific types like createOneTimeProjection. This makes the API surface unpredictable.
  • Inconsistent naming for listing subscriptions. listAllPersistentSubscription uses singular 'Subscription' while others use plural 'Subscriptions'. Also, listAll vs list is inconsistent with the pattern of listPersistentSubscriptionsToAllStream.
  • Inconsistent naming for metadata operations. The client-level method uses setStreamMetadata while the fluent Streams object uses setMetadata. This breaks the pattern where Streams methods should mirror client methods or be clearly distinct.
  • Inconsistent naming for metadata retrieval. The client uses getStreamMetadata while the fluent Streams object uses getMetadata.
  • Inconsistent naming for stream deletion. The client uses deleteStream while the fluent Streams object uses delete.
  • Inconsistent naming for stream tombstoning. The client uses tombstoneStream while the fluent Streams object uses tombstone.
  • RPCError.rethrow (cognitive 16) (Sources/KurrentDB/Core/Error/KurrentError.swift)
  • RPCError.rethrow (cyclomatic 17) (Sources/KurrentDB/Core/Error/KurrentError.swift)
  • Repeated repair: Sources/KurrentDB/Core/Additions/Usecase/StreamStream.swift (Sources/KurrentDB/Core/Additions/Usecase/StreamStream.swift)
  • Repeated repair: Sources/KurrentDB/Core/Additions/Usecase/StreamUnary.swift (Sources/KurrentDB/Core/Additions/Usecase/StreamUnary.swift)
  • Repeated repair: Sources/KurrentDB/Core/Additions/Usecase/UnaryUnary.swift (Sources/KurrentDB/Core/Additions/Usecase/UnaryUnary.swift)
  • Typo in property and method names. cerificates and cerificate are misspelled (should be certificates and certificate).
  • generate-doc-snippets.extract (cognitive 20) (scripts/generate-doc-snippets.py)
  • generate-doc-snippets.main (cognitive 19) (scripts/generate-doc-snippets.py)

New (25)

  • Classify ADR enforcement: ADR 0001 — read() delivers events lazily in 3.0 (docs/adr/0001-read-becomes-lazy-in-3-0.md)
  • Duplicated block (10 lines × 2) (Sources/KurrentDB/Streams/Usecase/All/Streams.SubscribeAll.swift)
  • Duplicated block (12 lines × 2) (Sources/KurrentDB/Streams/Usecase/All/Streams.SubscribeAll.swift)
  • Duplicated block (5 lines × 2) (scripts/Sources/Tooling/BenchToBMF.swift)
  • High IaC: WD-COMPOSE-0002 (server/docker-compose.single.yaml)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • KurrentError.streamsErrorDetails (cognitive 18) (Sources/KurrentDB/Core/Error/KurrentError+StreamsErrorDetails.swift)
  • Low coverage: scripts/Sources/Tooling/Entry.swift (scripts/Sources/Tooling/Entry.swift)
  • Medium IaC: WD-COMPOSE-0002 (server/docker-compose.single.yaml)
  • Medium IaC: WD-COMPOSE-0002 (server/standalone/docker-compose.yaml)
  • No assertions: caseUsesCurrentRevision (Tests/MockClientTests/CurrentRevisionStateRenameTests.swift)
  • No assertions: missingStream (Tests/MockClientTests/DeleteWrongExpectedVersionTests.swift)
  • No assertions: otherDomain (Tests/KurrentCoreTests/StreamsErrorDetailsMappingTests.swift)
  • No assertions: rejectedReadIsFullyMapped (Tests/MockClientTests/ServerExceptionMappingTests.swift)
  • No assertions: revisionConflictConstants (Tests/KurrentCoreTests/StreamsErrorDetailsMappingTests.swift)
  • No assertions: testDeleteMissingStreamThrowsWrongExpectedVersion (Tests/StreamsTests/StreamsReadTests.swift)
  • No assertions: testTombstoneMissingStreamThrowsWrongExpectedVersion (Tests/StreamsTests/StreamsReadTests.swift)
  • …and 5 more

Changes since last survey

  • 70 commits — 36 feature/other, 34 fixes

By area

  • (root) — 21 commits
  • .github/workflows — 18 commits
  • Sources/KurrentDB — 18 commits
  • Benchmarks/OfflineBenchmarks — 5 commits
  • Tests/MockClientTests — 2 commits
  • scripts/check-release-readiness.py — 2 commits
  • Sources/_GRPCProtobufGenerated — 1 commit
  • docs/index.html — 1 commit
  • scripts/Sources — 1 commit
  • server/standalone — 1 commit

Notable commits

  • fix: [FIX] accept only a bullet ending with (X.Y.Z) as a patch release's What's new entry, not any mention of the version
  • fix: [FIX] build once per Swift version and share it with that version's KurrentDB test jobs, and upload the coverage Codecov has not received since March
  • fix: [FIX] cancel the held call only once it waits in the wrapped transport, so the test covers cancelling a call in progress rather than one that never started
  • fix: [FIX] check the markdown pass too before publishing it: its report must hold every benchmark the JMH export holds, since package-benchmark lists failures only in the export
  • fix: [FIX] collect coverage through LLVM_PROFILE_FILE instead of swift test --enable-code-coverage, whose JSON export added about 140 s per run on Swift 6.4, and keep SwiftPM's git mirrors in the artifact
  • fix: [FIX] convert coverage with llvm-cov instead of swift-coverage-action, which finds no .xctest in Swift 6.4's per-target test libraries
  • fix: [FIX] copy the request metadata only for a call that carries grpc-timeout, so the other calls pay no copy, and say that the gRPC baseline runs behind the same erased transport
  • fix: [FIX] decode the v2 Streams error details, so an AppendSession to a tombstoned stream throws resourceDeleted instead of a grpcError that is retried as a node failure
  • fix: [FIX] deploy GitHub Pages with a build version unique to each run, so a release tag on main's commit replaces main's site
  • fix: [FIX] describe the erased transport's forwarding as grpc-swift uses it: the method config and a stream on every RPC, a connect on every connection, nothing per message
  • fix: [FIX] end a subscription to a tombstoned stream with resourceDeleted instead of delivering $streamDeleted and a raw RPCError
  • fix: [FIX] fail the Benchmarks job when a benchmark throws, instead of uploading a report without it: package-benchmark only lists the failure and exits 0
  • fix: [FIX] fail the coverage step when either test run left no profile, and name profiles %p-%m so a reused pid merges instead of truncating
  • fix: [FIX] give each build artifact download 5 minutes and one retry, and pack Swift 6.4's build without its intermediate files
  • fix: [FIX] go back to actions/deploy-pages: the Pages API rejects a build version that is not a commit SHA with 404
  • fix: [FIX] keep a record's custom metadata and properties instead of dropping them: parse customMetadata with JSONDecoder and encode every property as JSON
  • fix: [FIX] keep the CA key out of the standalone node, regenerate incomplete certificate pairs, and note the port and password encoding in the connection instructions
  • fix: [FIX] list the largest .build directories in the pack step: du skips a directory it already counted under .build, so it printed only the total
  • fix: [FIX] make the in-process server take each request whole and check its message count, keep the grpc-timeout header from it so only the client's deadline timer runs, and check the lazy read before measuring
  • fix: [FIX] map a buffered read the server rejects, such as access denied, the way a lazy read maps it
  • …and 50 more

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

Survey your own repository

gradyzhuo/swift-kurrentdb 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 9 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 aa5c8a5aaa462504e6290452c40ae8bbc3363b7a — the exact code this score is about.
  • Scored under rubric-2026.11.2 — 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.3+preprod-bb0cb800cd0f.