Skip to content
CAI
Software that uses CAICheck a score

daangn/ventyd

69.0

Adequate · 9 November 2026

3.9k

lines of production code

TypeScript

primary language

6

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Ventyd is an event sourcing library for TypeScript that manages entity state through immutable event logs and pluggable persistence adapters. It supports multiple schema validation libraries, including Zod, Valibot, and TypeBox, to ensure type-safe domain modeling. The system provides core components like repositories and entities, along with specific adapters such as Prisma, which handle event versioning and snapshotting for consistent data storage.

Features

Initial release of Ventyd event sourcing library

The library introduces core event sourcing capabilities, including the \Entity\ class for managing state through event logs, \createRepository\ for persistence with adapter and plugin support, and \defineSchema\/\defineReducer\ for type-safe domain modeling. It provides official schema providers for Valibot, Zod, ArkType, and TypeBox (including legacy v0 support), all unified via the Standard Schema V1 specification, and adds features like event versioning, snapshot support, and custom ID generation.

src · high confidence

Introduce Prisma adapter with event versioning and snapshot support

The Prisma adapter now supports event versioning and automatic snapshotting. It stores events with a version number and can save a snapshot of the entity state every N events (configurable via \snapshotEvery\), writing the snapshot in the same transaction as the events and view update to ensure consistency. The adapter manages three distinct tables: events, snapshots, and views, providing methods to retrieve events by entity and version, fetch the latest snapshot, and commit new events along with the corresponding view update.

src/adapter · high confidence

Introduces core type definitions for the event sourcing library

This change establishes the foundational TypeScript types for the Ventyd event sourcing system. It defines the \Adapter\ interface for pluggable persistence backends (supporting databases like Prisma or Drizzle, as well as in-memory stores) and the \Repository\ interface for entity persistence and retrieval. The \Entity\ and \EntityConstructor\ types model the lifecycle of entities, including creation, loading from state or events, and the new \UNSAFE\_mutable\ option for loading mutable entities from pre-computed state. A \ReadonlyEntity\ type is introduced to enforce immutability on loaded entities by stripping mutation methods, ensuring CQRS compliance. Additionally, the \Schema\ and \SchemaInput\ types provide a library-agnostic way to define entity structures and validate events/states, while \Plugin\ types allow for composable side effects like analytics or notifications after event commits.

src/types · high confidence

Behavioural changes

1 commit (0 fixes) modifying .yarn

A change to existing behaviour in .yarn — 1 commit, 1 file.

.yarn · low confidence · unverified

Docs generation script now skips execution when build output is missing

The \scripts/generate-docs.ts\ script has been updated to gracefully handle cases where the expected documentation build output (\docs/build/client/llms\) is not present. Instead of failing with an error, the script now detects the missing directory, logs a warning message instructing the user to run \npm run build:docs\, and exits cleanly. This prevents build failures when the embedded documentation source has not yet been generated.

scripts · high confidence

Test coverage

Added entity test fixtures for multiple schema libraries; Added test infrastructure for adapter backends and schema providers.

Dependencies

Introduce multi-schema support and documentation site

The package now exports separate entry points for multiple schema libraries (standard, valibot, typebox, typebox0, zod, arktype) and the Prisma adapter, allowing users to import only the validation logic they need. The build tooling has switched from bunchee to tsdown, and the project has upgraded to Yarn 4.18.0. Additionally, a new documentation site has been added under the docs directory, built with React Router, Fumadocs, and Tailwind CSS.

(dependencies) · high confidence

Housekeeping

Ventyd 1.20.4 release with production guide documentation

This release updates the package to version 1.20.4. The primary change is the addition of a production guide to the documentation, as indicated in the changelog. The repository configuration has also been updated to use Yarn 4.18.0 with global hardlinks, and the build system is configured via tsdown to output ESM and CJS formats for various schema integrations (Valibot, Zod, ArkType, TypeBox) and the Prisma adapter.

(repo-wide) · 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 57 → 69 (+11.8)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 98 → 98 (+0.2)
  • Architecture 95 → 95 (-0.1)
  • Maturity 39 → 63 (+23.4)
  • Readiness 61 → 61 (+0.0)
  • Security 69 → 78 (+9.5)
  • Performance 100 → 100 (+0.0)

Resolved (5)

  • High CVE: [GHSA redacted] (yarn.lock)
  • High CVE: [GHSA redacted] (yarn.lock)
  • Medium CVE: [GHSA redacted] (yarn.lock)
  • Off-boarding risk: anonymized user #1
  • generate-docs.stripMdxArtifacts (cognitive 19) (scripts/generate-docs.ts)

New (14)

  • Deprecated: image-size (yarn.lock)
  • High CVE: [GHSA redacted] (yarn.lock)
  • High CVE: [GHSA redacted] (yarn.lock)
  • Medium CVE: [GHSA redacted] (yarn.lock)
  • Medium CVE: [GHSA redacted] (yarn.lock)
  • Off-boarding risk: anonymized user #1
  • doc comments repeat the names (src/types/EntityConstructor.ts)
  • redundant comment (scripts/generate-docs.ts)
  • redundant comment (test/adapters/SQLiteAdapter.ts)
  • redundant comment (test/integration.spec.ts)
  • redundant comment (test/integration.spec.ts)
  • redundant comment (test/integration.spec.ts)
  • redundant comment (test/integration.spec.ts)
  • redundant comment (test/snapshot.spec.ts)

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

Survey your own repository

daangn/ventyd 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 d232eb505a8ba05ab66446bb7924f3b73e872729 — 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.