Skip to content
CAI
Software that uses CAICheck a score

osoykan-archive/ProductContext-EventSourcing

43.3

Weak · 21 September 2026

7.1k

lines of production code

C#

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a .NET-based product management service that implements event sourcing and CQRS patterns to manage product data. It exposes a RESTful API for creating and updating products, content, and variants, while persisting state changes as events in EventStore. The system maintains read models in Couchbase and supports local development and Kubernetes deployment through automated infrastructure scripts.

Features

Add Docker and build infrastructure for local development

The project now includes a Dockerfile and docker-compose.yml to containerize the .NET application and its dependencies (EventStore, Couchbase) for local development and integration testing. Additionally, Cake build scripts (build.sh, build.ps1, build.cake) are added to automate build, test, and publish tasks, and the solution file is updated to include all project references and test projects.

(repo-wide) · high confidence

Added Helm charts for Couchbase, EventStore, and ProductContext deployments

New Helm chart packages have been added to the deployments directory for three services: Couchbase, EventStore, and ProductContext. Each chart includes standard Kubernetes templates for Deployments, Services, and Ingresses, along with default values and helper templates. The ProductContext chart is specifically configured with host networking, a rolling update strategy, and health check probes, while the other two charts follow a simpler default configuration.

deployments · high confidence

Added explicit state and routing infrastructure for aggregate roots and entities

The library introduces new base classes for building event-sourced aggregates: \AggregateRootEntity\ and \Entity\ (along with their generic counterparts \AggregateRootEntity\<TEntityState\>\ and \Entity\<TEntityState\>\) that provide core infrastructure for tracking state changes, routing events to handlers, and recording applied events. These classes support explicit state management and explicit routing, allowing developers to build domain models that track and replay events. The change also includes comprehensive unit tests for these new components, verifying behaviors such as null-checks, event application, and handler registration.

lib/AggregateSource · high confidence

Added product domain model with content and variant management

The product domain now supports creating products and managing their content and variants. Users can create a product, add content, and add variants with barcodes. The domain model includes aggregate roots for Product, ProductContent, ProductVariant, and VariantTypeValue, along with corresponding events and value types. Command handlers are provided for CreateProduct, AddContentToProduct, and AddVariantToProduct. The implementation also includes snapshot support for efficient state restoration.

src/ProductContext.Domain/Products · high confidence

Automated Couchbase initialization and configuration

The Docker environment for Couchbase is now fully automated. A new Dockerfile and accompanying scripts (configure.sh, by\_productId.ddoc) handle the complete setup of the Couchbase server, including memory quotas, service configuration, and the creation of the 'ProductContext' bucket with a specific 'by\_productId' view. This removes the need for manual database setup steps.

docker · high confidence

Initial WebAPI project structure with EventStore and Couchbase integration

The ProductContext.WebApi project is introduced, establishing the entry point (Program.cs) and startup configuration (Startup.cs) for the web application. The startup configuration registers dependencies for EventStore, Couchbase, and MediatR, and initializes projections using a Couchbase-based checkpoint store. Additionally, environment-specific configuration files (appsettings.Development.json, appsettings.Production.json, appsettings.Stage.json, and appsettings.json) are added to manage settings for different environments.

src/ProductContext.WebApi · high confidence

Introduce event sourcing and snapshotting infrastructure

The framework now includes core components for event sourcing and snapshotting. This adds a \ProjectionManager\ to manage event streams and projections, along with \DefaultEventDeserializer\ and \DefaultSnapshotDeserializer\ for handling event data. A \CouchbaseCheckpointStore\ is provided for persisting projection checkpoints, and an \EventStoreSnapshotter\ enables automatic snapshotting of aggregates. These changes support a new behavioral capability where the system can now track event positions, run projections, and maintain aggregate snapshots.

src/ProductContext.Framework · high confidence

Introduce product domain contracts and status enums

Added new command classes for creating products, adding content, and adding variants, all implementing MediatR's IRequest interface. Also added enums for product content status (Draft, Preparing, Approved) and variant types (Size, Color).

src/ProductContext.Domain/Contracts · high confidence

New Product Command API Endpoints

A new controller, ProductCommandsApi, has been added to handle product creation and content management. It exposes HTTP PUT endpoints for creating products, adding content, and adding variants, all routed under /api/product. The controller uses MediatR to dispatch commands, providing a consistent interface for product-related write operations.

src/ProductContext.WebApi/Controllers · high confidence

Behavioural changes

Product projections migrated to Couchbase

The product context now stores its read-model data in Couchbase instead of the previous storage mechanism. New document classes (ProductDocument, ProductContentDocument, ProductVariantDocument) have been introduced to represent the projected state, and the ProductProjection handler has been updated to persist events (ProductCreated, ContentAddedToProduct, VariantAddedToProduct) to the Couchbase bucket using the Projac framework.

src/ProductContext.Domain/Projections · high confidence

Test coverage

Added Docker-based integration test infrastructure for Couchbase and EventStore; Added domain tests for Product entity scenarios; Added unit tests for framework helpers and resolvers.

Dependencies

Updated project files and package references for the AggregateSource library

The build configuration for the AggregateSource library and its integrations (EventStore, NEventStore, Reactive, SqlStreamStore) has been updated. This includes adding new .csproj and packages.config files that define dependencies such as NUnit, EventStore.Client, NEventStore, and CompareNETObjects, ensuring the project can resolve and build against the correct library versions.

(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

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 45 → 43 (-1.3)
  • Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 54 → 53 (-0.2)
  • Architecture 99 → 99 (+0.0)
  • Maturity 53 → 53 (+0.0)
  • Readiness 52 → 52 (+0.0)
  • Security 29 → 28 (-0.9)
  • Domain Modelling 100 → 80 (-20.2)

Resolved (17)

  • Bounded contexts not declared
  • Duplicated block (6 lines × 2) (lib/AggregateSource/src/Testing/AggregateSource.Testing.NUnit/ExtensionsForCommandScenario.cs)
  • Duplicated block (6 lines × 2) (lib/AggregateSource/src/Testing/AggregateSource.Testing.NUnit/ExtensionsForConstructorScenario.cs)
  • Duplicated block (6 lines × 2) (lib/AggregateSource/src/Testing/AggregateSource.Testing.NUnit/ExtensionsForFactoryScenario.cs)
  • Duplicated block (8 lines × 2) (lib/AggregateSource/src/EventStore.NetCore/AggregateSource.EventStore/AsyncRepository.cs)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • LLM evaluation failed
  • Medium IaC: DS-0001 (Dockerfile)
  • Monorepo: only 1 of 10 solutions was scored
  • No exposed public API
  • Test runner surfaced no tests
  • XML-doc coverage: AggregateSource.Testing (lib/AggregateSource/src/Testing/AggregateSource.Testing/AggregateSource.Testing.csproj)
  • dormant codebase — no living knowledge left to concentrate
  • redundant comment (lib/Value/Value/DictionaryByValue.cs)
  • redundant comment (lib/Value/Value/DictionaryByValue.cs)

New (44)

  • CommentedOutCode (src/ProductContext.Domain/Projections/ProductProjection.cs)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no project overview (README.md)
  • Duplicated block (10–11 lines × 2) (lib/AggregateSource/src/EventStore.NetCore/AggregateSource.EventStore/AsyncRepository.cs)
  • Duplicated block (11–14 lines × 2) (lib/AggregateSource/src/EventStore.NetCore/AggregateSource.EventStore/AsyncRepository.cs)
  • Duplicated block (12 lines × 8) (lib/AggregateSource/src/Testing/AggregateSource.Testing.NUnit/ExtensionsForCommandScenario.cs)
  • Duplicated block (13 lines × 2) (lib/AggregateSource/src/EventStore.NetCore/AggregateSource.EventStore/Snapshots/AsyncSnapshotableRepository.cs)
  • Duplicated block (14 lines × 6) (lib/AggregateSource/src/Testing/AggregateSource.Testing.NUnit/ExtensionsForCommandScenario.cs)
  • Duplicated block (48–49 lines × 4) (lib/AggregateSource/src/Testing/AggregateSource.Testing.NUnit/ExtensionsForCommandScenario.cs)
  • Duplicated block (60–61 lines × 3) (lib/AggregateSource/src/Testing/AggregateSource.Testing.NUnit/ExtensionsForCommandScenario.cs)
  • Duplicated block (7 lines × 3) (lib/AggregateSource/src/EventStore.NetCore/AggregateSource.EventStore/AsyncRepository.cs)
  • Duplicated block (8 lines × 2) (lib/AggregateSource/src/EventStore.NetCore/AggregateSource.EventStore/Snapshots/AsyncSnapshotReader.cs)
  • End-of-life runtime: .NET netcoreapp2.0
  • High IaC: WD-COMPOSE-0002 (docker-compose.yml)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Low IaC: DS-0026 (docker/couchbase/Dockerfile)
  • …and 24 more

API surface

  • Unchanged — 2 HTTP endpoints

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

Survey your own repository

osoykan-archive/ProductContext-EventSourcing 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 95f41497bbdfa1b2af31df74a8367172de799056 — 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-28e75b8e3254.