Skip to content
CAI
Software that uses CAICheck a score

davyddd/dddesign

59.7

Adequate · 21 September 2026

817

lines of production code

Python

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Python library providing a structured framework for implementing Domain-Driven Design (DDD) and Clean Architecture patterns. It offers a comprehensive set of base classes and utilities for modeling domain entities, aggregates, and data transfer objects, all built upon Pydantic for strict type safety and immutability. The library also includes infrastructure abstractions for adapters and repositories, alongside testing utilities for mocking and change tracking.

Features

Add BaseEnum and ChoiceEnum base classes for domain constants

Introduced new base classes for managing domain constants: BaseEnum provides a standard Enum with a string representation and a has\_value check, while ChoiceEnum extends it to automatically generate title-cased display labels and choice tuples for UI or form rendering.

dddesign/structure/domains/constants · high confidence

Added Aggregate and AggregateListFactory components for domain modeling

Introduced new domain structure components: the \Aggregate\ base model and the \AggregateListFactory\ and \AggregateDependencyMapper\ classes. These provide a typed, validated way to construct lists of aggregate objects from entities, handling dependency mapping and validation through Pydantic's \ConfigDict\ and model validators.

dddesign/structure/domains/aggregates · high confidence

Added Docker, linting, and development tooling configuration

Introduced a Dockerfile for building the Python 3.13.9 environment with Poetry 2.2.1, alongside a docker-compose.yaml for local development. Added configuration files for code quality tools: ruff.toml (with concise output format), mypy.toml, and a fabfile.py to manage build, lint, and test commands. Updated .gitignore to reflect the new tooling structure and cleaned up the README.md with installation and architectural documentation.

(repo-wide) · high confidence

Added dddesign/utils package with base\_model exports

A new dddesign/utils package has been introduced, providing a centralized location for utility functions. The package's \_\init\\_.py now exports the base\_model module, making its contents accessible via the dddesign.utils namespace.

dddesign/utils · high confidence

Added ddutils package and unittest.MagicMock helper

A new unittest.MagicMock class has been added to the dddesign/unittest module. This custom mock extends the standard unittest.mock.MagicMock to automatically copy and set values for Pydantic BaseModel subclasses, leveraging helper functions from the newly added ddutils package. The module now explicitly exports MagicMock via \_\all\\_.

dddesign/unittest · medium confidence

Introduce Application and ApplicationFactory for dependency mapping

Added new Application and ApplicationFactory classes to manage dependency mapping and instantiation. The Application class is now a frozen Pydantic BaseModel, and the ApplicationFactory uses a mapping strategy to resolve dependencies based on request attributes, ensuring unique enum classes and attribute names in the dependency mappers.

dddesign/structure/applications · high confidence

Introduce BaseError and CollectionError classes for structured error handling

The dddesign/structure/domains/errors module now provides a new BaseError class that enforces placeholder matching in error messages, ensuring that all template variables in error messages are provided as keyword arguments. Additionally, a CollectionError class is introduced to manage a collection of BaseError instances, supporting iteration and addition of errors. These changes enhance error handling by providing a more structured and validated approach to error management.

dddesign/structure/domains/errors · high confidence

Introduce Entity base class with selective field updates

Added a new Entity class in the domains/entities module that extends Pydantic's BaseModel. The class configures validation and type handling, and provides an update method that accepts a data object and an optional set of fields to exclude, allowing selective updates while avoiding frozen field errors.

dddesign/structure/domains/entities · high confidence

Introduce base classes for Data Transfer Objects and Value Objects

Users can now inherit from new base classes, DataTransferObject and ValueObject, which are implemented as Pydantic BaseModel instances configured with frozen=True to enforce immutability. These classes are available in the dddesign.structure.domains.dto and dddesign.structure.domains.value\_objects modules respectively.

_dddesign/structure/domains/dto, dddesign/structure/domains/value\objects · high confidence

Introduces AutoUUID value object and Errors DTO for domain modeling

The dddesign/components package now includes a new AutoUUID value object that automatically generates UUID4 values when instantiated without arguments, while remaining fully compatible with Pydantic v1 and v2 for use as a field type. Additionally, an Errors DTO has been added to wrap and manage collection errors, providing a structured way to handle multiple validation or domain errors in a single response.

dddesign/components · high confidence

Introduces core infrastructure components: Adapters, Repository, and Service base classes

The dddesign/structure/infrastructure module now provides foundational building blocks for domain-driven design. It introduces \ExternalAdapter\ and \InternalAdapter\ as immutable Pydantic models, a \Repository\ base class that enforces a strict whitelist of allowed database operations (including \exists\ and \count\), and an abstract \Service\ base class. All components are configured as frozen Pydantic models to ensure immutability and type safety.

dddesign/structure/infrastructure · high confidence

New base model utilities for change tracking and error handling

Added a new \base\_model\ utility module providing tools for Pydantic models. This includes a \TrackChangesMixin\ that allows models to track field modifications, exposing properties for changed fields, a dictionary of changed data, and a diff of initial versus current states. Additionally, the module introduces a \flatten\_model\_dump\ function to recursively flatten nested model dumps into a single-level dictionary, and error-handling utilities (\wrap\_error\, \create\_pydantic\_error\_instance\) that assist in processing and wrapping validation errors.

_dddesign/utils/base\model · high confidence

Behavioural changes

Exposed structure package submodules via \_\_all\_\_

The \dddesign.structure\ and \dddesign.structure.domains\ packages now explicitly export their submodules (e.g., \applications\, \domains\, \aggregates\, \entities\) through their \\_\all\\_\ declarations. This change makes these internal modules available for direct import from the package namespace, simplifying access to domain-related components.

dddesign/structure, dddesign/structure/domains · medium confidence

dddesign package gains type hints and cleaner exports

The dddesign package now includes a py.typed marker file, enabling static type checking for consumers of the library. Additionally, the package's \_\init\\.py has been updated to explicitly export the 'structure', 'unittest', and 'utils' modules via \\all\\_, providing a cleaner public API surface.

dddesign · medium confidence

Test coverage

Added empty \_\init\\.py for tests/utils package; Added empty \\init\\_.py to tests directory; Added structural tests for infrastructure components; Added test coverage for aggregate domain components; Added test coverage for error domain components; Added tests for ApplicationFactory and ApplicationDependencyMapper; Added tests for ValueObject; Added tests for structure validators; Added tests for the Application class; Added tests for the DataTransferObject component; Added tests for the Entity component; Added unit tests for BaseEnum and ChoiceEnum; Added unit tests for Errors DTO and AutoUUID components; Added unit tests for base model utilities.

Dependencies

Updated Python, Pydantic, and dependency constraints

The project now requires Python 3.10 or higher (dropping 3.9 support) and restricts the Python version to less than 3.14. Pydantic is constrained to versions 2.1 through 2.14, and the \ddutils\ dependency is limited to versions below 0.2.0. Additionally, \idna\ is pinned to ^3.15, and development tools like \mypy\ and \ruff\ are updated to specific recent 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 57 → 60 (+2.6)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (+0.4)
  • Architecture 69 → 69 (+0.0)
  • Maturity 56 → 59 (+2.3)
  • Readiness 46 → 50 (+3.9)
  • Security 70 → 84 (+14.2)

Resolved (17)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • 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)
  • 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)
  • High: security finding (details withheld)
  • Medium IaC: CKV_DOCKER_3 (Dockerfile)
  • No exposed public API
  • Off-boarding risk: anonymized user #1
  • Test reliability not included

New (17)

  • Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency
  • 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)
  • 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)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium IaC: WD-DOCKER-0003 (Dockerfile)
  • Medium IaC: WD-DOCKER-0010 (Dockerfile)
  • No dependency advisory monitoring
  • Workflow holding a long-lived secret is unscoped

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

Survey your own repository

davyddd/dddesign 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 f3e56bb859856adb27e8eb3e32eef0fc2ca9d593 — 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-fa71c66cabd8.