Skip to content
CAI
Software that uses CAICheck a score

Dzoukr/CosmoStore

49.0

Weak · 21 September 2026

1.6k

lines of production code

F#

with JavaScript

6

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

CosmoStore is a modular event sourcing library that provides a generic, versioned API for managing event streams. It supports multiple storage backends, including Cosmos DB, Azure Table Storage, Marten, ServiceStack, LiteDB, and an in-memory implementation. The system is designed to allow each storage provider to be built, tested, and published as an independent NuGet package, with comprehensive test coverage for each backend.

How it got here

2018 — Modularization and build system refactoring

4 changes.

The project underwent a significant architectural shift to support multi-provider storage backends by splitting the codebase into independent NuGet packages. This period focused on refactoring the core library into modular components and establishing a structured FAKE-based build system to manage the new package structure and test suite.

2019–2020 — Multi-backend expansion and test modernization

12 changes.

This period focused on significantly expanding the project's storage backends by introducing support for Marten, LiteDB, and in-memory stores, alongside modernizing the Azure Cosmos DB and Table Storage implementations. Concurrently, the testing infrastructure was overhauled by migrating to the Expecto framework and adding comprehensive integration tests for all new and existing storage providers.

Features

Introduce LiteDB-backed event store implementation

Added a new storage backend for CosmoStore using LiteDB, enabling users to persist event streams to a local file-based or in-memory database. This includes the core event store logic for appending and retrieving events, along with configuration options for store type (Memory vs LocalDB) and database modes (Exclusive, ReadOnly, Shared).

src/CosmoStore.LiteDb · high confidence

Introduce Marten-based event store implementation

Added a new event store implementation backed by the Marten library for PostgreSQL, enabling users to persist and query events using a document-store approach. The change introduces \EventStore.fs\ and \MartenConf.fs\ to handle stream operations, versioning, and correlation ID lookups, while \RELEASE\_NOTES.md\ and \paket.references\ define the initial release (v3.0.1) and its dependencies.

src/CosmoStore.Marten, src/CosmoStore.ServiceStack · high confidence

Introduce in-memory event store implementation

Added a new in-memory implementation of the CosmoStore event store, providing an alternative to database-backed stores for development and testing. The change introduces \EventStore.fs\ and \InMemoryConf.fs\ to manage in-memory collections of streams and events, supporting operations such as appending events, retrieving events by ID or correlation ID, and querying streams by prefix/suffix/contains. The release notes indicate this is version 3.1.2, fixing a version number issue and correcting package dependencies.

src/CosmoStore.InMemory · high confidence

Behavioural changes

Build system migrated to FAKE with multi-target packaging

The build process has been refactored from a simple \build.fsx\ script into a structured FAKE-based \Build.fs\ that defines separate pack, publish, and test targets for each storage provider (Cosmos DB, Table Storage, Marten, InMemory, LiteDB, and ServiceStack). This change enables each provider to be built, tested, and published as an independent NuGet package, while the solution file (\CosmoStore.sln\) and helper modules (\BuildHelpers.fs\, \BuildTools.fs\) are introduced to support this modular build pipeline.

(repo-wide) · high confidence

CosmoStore library refactored into modular components

The CosmoStore library has been refactored to improve code organization and reusability. The previous single-file structure has been split into distinct modules: \Conversion.fs\ handles event mapping, \Validation.fs\ enforces versioning rules, and \CosmoStore.fs\ defines the core domain types and the \EventStore\<'payload,'version\>\ interface. This modularization supports the generic payload and versioning system introduced in version 3.0.0, allowing for more flexible event sourcing implementations.

src/CosmoStore · medium confidence

Cosmos DB storage backend introduces versioned event tracking and configurable container settings

The Cosmos DB storage implementation now supports two storage versions (V2 and V3) that change how event versions are tracked in the database: V2 uses a 'position' field while V3 uses a 'version' field, with corresponding stored procedures (AppendEventsV2.js and AppendEventsV3.js) handling the respective logic. The Configuration record now exposes DatabaseName, ContainerName, ConnectionString, Throughput, and InitializeContainer properties, allowing users to customize the database and container names, connection string, throughput settings, and whether to automatically initialize the container.

src/CosmoStore.CosmosDb · high confidence

Migrate to Azure.Data.Tables and support sovereign clouds

The Table Storage implementation has been updated to use the modern Azure.Data.Tables client library instead of the legacy WindowsAzure.Storage package. This change introduces support for sovereign cloud environments by allowing a custom endpoint suffix in the configuration, and adds authentication via SAS tokens and Azure AD credentials alongside the existing shared key authentication. Additionally, the codebase now handles backward compatibility with older 2.x data formats by checking for and updating the legacy 'Position' field to ensure correct versioning.

src/CosmoStore.TableStorage · high confidence

Test coverage

Added LiteDB test suite; Added Marten-based test suite for CosmoStore; Added ServiceStack integration tests; Added V2 integration tests for Cosmos DB and Table Storage; Added comprehensive test suite for CosmoStore; Added in-memory test suite for CosmoStore; Added test suite for Table Storage; Migrated test suite to Expecto framework.

Dependencies

Split library into separate packages for each storage provider

The CosmoStore library has been split into distinct packages for each storage backend: CosmosDb, InMemory, LiteDb, Marten, ServiceStack, and TableStorage. Each backend now has its own project file (e.g., CosmoStore.CosmosDb.fsproj) and corresponding test project. The core API is now in the base CosmoStore package, while storage-specific implementations are separated. This change also updates the build system to use .fsproj for the build script and migrates tests to the Expecto framework.

(dependencies) · high confidence

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

How this codebase got here

Score

  • CAI 50 → 49 (-1.0)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 96 → 95 (-0.7)
  • Architecture 93 → 100 (+6.9)
  • Maturity 32 → 32 (+0.0)
  • Readiness 36 → 36 (+0.0)
  • Security 100 → 87 (-13.3)

Resolved (12)

  • Change coupling: EventStore.fs ↔ AppendEventsV2.js (src/CosmoStore.CosmosDb/EventStore.fs)
  • Dependency hygiene not measured — no packages were read
  • Duplicated block (10 lines × 3) (src/CosmoStore.ServiceStack/EventStore.fs)
  • Duplicated block (12 lines × 2) (src/CosmoStore.TableStorage/Serialization.fs)
  • Duplicated block (13 lines × 2) (src/CosmoStore.ServiceStack/EventStore.fs)
  • Duplicated block (13 lines × 2) (src/CosmoStore/Validation.fs)
  • Duplicated block (14 lines × 2) (src/CosmoStore.Marten/EventStore.fs)
  • Duplicated block (6 lines × 2) (src/CosmoStore.CosmosDb/EventStore.fs)
  • No exposed public API
  • Test reliability not included
  • complexity unreadable for .fs — churn × complexity hotspots could not be measured
  • dormant codebase — no living knowledge left to concentrate

New (10)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (11–13 lines × 3) (src/CosmoStore.InMemory/EventStore.fs)
  • Duplicated block (12–14 lines × 2) (src/CosmoStore/Validation.fs)
  • Duplicated block (17–19 lines × 2) (src/CosmoStore.LiteDb/EventStore.fs)
  • Duplicated block (19–21 lines × 2) (src/CosmoStore.InMemory/EventStore.fs)
  • Duplicated block (25–26 lines × 2) (src/CosmoStore.LiteDb/EventStore.fs)
  • Duplicated block (32 lines × 2) (src/CosmoStore.CosmosDb/Serialization.fs)
  • Duplicated block (5 lines × 2) (src/CosmoStore.CosmosDb/EventStore.fs)
  • End-of-life runtime: .NET net6.0

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

Survey your own repository

Dzoukr/CosmoStore 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 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit baadb0b762c8f4485207cbab6e78c1ce2d02688d — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b84573e22831.