Skip to content
CAI
Software that uses CAICheck a score

krew-solutions/ascetic-ddd-python

54.4

Adequate · 21 September 2026

22.1k

lines of production code

Python

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Ascetic DDD is a Python framework for building Domain-Driven Design applications, providing foundational infrastructure for event sourcing, command mediation, and saga orchestration. It includes a sophisticated test data generation system (Faker) that supports complex statistical distributions, relational dependencies, and PostgreSQL-backed persistence. The library also offers robust utilities for secure data handling, including tenant-isolated encryption, idempotent message processing via inbox/outbox patterns, and a specification-based query engine that ensures consistency between in-memory evaluation and SQL generation.

Features

Add Json value object for immutable data handling

A new \Json\ value object has been introduced in the domain values module to wrap arbitrary objects and provide a consistent hash representation. This allows JSON-like data structures to be used reliably in sets or as dictionary keys by ensuring their hash is based on the frozen content of the underlying object.

_ascetic\ddd/faker/domain/values · high confidence

Add PostgreSQL specification visitor and relation resolver

Introduces the \PgSpecificationVisitor\ and \ProviderRelationResolver\ components within the \ascetic\_ddd/faker/infrastructure/specification\ module. The visitor translates domain query specifications into PostgreSQL SQL, leveraging the new \ProviderRelationResolver\ to map aggregate provider structures to SQL table information, thereby enabling the faker infrastructure to generate queries for nested relations.

_ascetic\ddd/faker/infrastructure/specification · high confidence

Add PostgreSQL-based sequencer implementation

The faker infrastructure now includes a new PgSequencer class and its factory, enabling the generation of unique sequential identifiers backed by PostgreSQL tables and sequences. This implementation handles table creation, sequence initialization via triggers, and cleanup, allowing the system to distribute sequence scopes across different providers using a dedicated database schema.

_ascetic\ddd/faker/infrastructure/sequencers · high confidence

Add REST stats observers for session metrics

New observer classes have been added to the session infrastructure to capture and report REST API performance metrics. The \RestStatsObserver\ records request response times and status codes using a generic stats collector, while the \RestStatsdObserver\ sends timing and increment metrics to a StatsD-compatible backend (via \aiodogstatsd\) upon request and session completion.

_ascetic\ddd/faker/infrastructure/session/observers · high confidence

Add sync and async signal observables with composite support

The \ascetic\_ddd/signals\ module now provides \SyncSignal\ and \AsyncSignal\ classes for event notification, supporting observer attachment/detachment with optional IDs and disposable cleanup. It also introduces \SyncCompositeSignal\ and \AsyncCompositeSignal\, which allow multiple signal instances to be combined so that notifications propagate to all delegates. The implementation includes interfaces (\ISyncSignal\, \IAsyncSignal\) and comprehensive unit tests for both signal types and their composite variants.

_ascetic\ddd/signals · high confidence

Add validation library with built-in validators and error handling

Introduces a new validation module providing core validators including Required, Regex, Email, Length, and Number, along with composite validators (ChainValidator, MultivalueValidator, MappingValidator) for complex validation scenarios. The module includes a comprehensive exception hierarchy (ValidationError, ChainValidationError, MappingValidationError) that supports error chaining and mapping, enabling users to validate data structures and collect multiple validation errors efficiently.

_ascetic\ddd/validators · high confidence

Added PostgreSQL logging observer for query events

A new PgLoggingObserver component has been introduced to the session module, enabling detailed logging of database query events. When a query ends, this observer logs the process ID, response time, SQL statement, and parameters at the debug level, providing visibility into database interactions for debugging and monitoring purposes.

_ascetic\ddd/session/observers · high confidence

Added empty \_\_init\_\_.py files to seedwork and specification modules

This change adds empty or minimal \_\init\\_.py files to the ascetic\_ddd/seedwork, ascetic\_ddd/seedwork/domain, ascetic\_ddd/seedwork/infrastructure, and ascetic\ddd/specification directories. These files are necessary to make these directories Python packages, allowing them to be imported by other parts of the application. The domain and infrastructure \\init\\_.py files contain a comment indicating they were copied from an external source.

(repo-wide) · high confidence

Added statistical analysis utilities for benchmarking

The \ascetic\_ddd/faker\ package now includes a \Stats\ class and a \Collector\ utility in \domain/utils/stats.py\. This addition provides comprehensive statistical analysis capabilities—including mean, standard deviation, quartiles, and outlier detection (Tukey and StdDev methods)—for processing performance data, likely to support benchmarking or performance testing within the faker module.

(repo-wide) · high confidence

CLI entry point for DDD scaffold command

The CLI module now exposes a \scaffold\ subcommand that generates DDD bounded context code from a YAML domain-model definition. Users can specify the input YAML file, output directory, base package name, and optional custom templates directory via command-line arguments.

_ascetic\ddd/cli · high confidence

Event store now encrypts event payloads using per-stream data encryption keys

The event repository in the seedwork infrastructure now transparently encrypts event payloads before persistence. This is achieved by introducing a \DekStore\ that manages per-stream Data Encryption Keys (DEKs) with versioning and rewrapping capabilities, integrated with the Key Management Service (KMS). The \EventStore\ and \EventGetQuery\ now use a codec pipeline (JSON, Zlib compression, and Encryption) to handle these encrypted payloads, ensuring that event data is stored securely in the \event\_log\ table while maintaining backward compatibility through versioned cipher support.

_ascetic\ddd/seedwork/infrastructure/repository · high confidence

Initial commit of application seedwork and command module structure

This change introduces the foundational structure for the application layer within the seedwork package. It adds the \\_\init\\.py\ file for the \application\ module, which includes a reference to its source, and creates the \commands\ sub-package with its own \\\init\\_.py\. This establishes the directory layout and module boundaries for command handling infrastructure.

_ascetic\ddd/seedwork/application · high confidence

Initial project scaffolding and configuration

The repository is initialized with core configuration files including a Makefile for linting and type-checking, a pyrightconfig.json specifying Python 3.14 and strict type-checking rules, and a docker-compose.yml defining a local Vault service. Utility scripts (wait-for.sh, wait-for-file.sh) and updated .gitignore rules are added to support development workflows, while the README clarifies the project's status as an active, pre-1.0.0 framework.

(repo-wide) · high confidence

Initial release of ascetic\_ddd package with factory utilities

The ascetic\_ddd package is introduced, providing core infrastructure for Domain-Driven Design in Python. The package exposes a factory module containing a BuildingBlocksFactory class, which allows users to asynchronously create in-memory message buses (IBus) for session management. This initial release establishes the foundational components for event handling within the library.

_ascetic\ddd · high confidence

Initialization of the FP domain module

The \ascetic\ddd/faker/domain/fp\ package has been initialized with a new \\\init\\_.py\ file. This establishes the module structure for the functional programming (FP) providers within the faker domain, serving as the entry point for this specific area of the codebase.

_ascetic\ddd/faker/domain/fp · medium confidence

Introduce Deferred pattern for asynchronous operations

Adds a new \ascetic\_ddd.deferred\ module providing a \Deferred\ class and \IDeferred\ interface that implement the Deferred/Promise pattern for handling asynchronous operations with success and error callbacks. The implementation follows the Promises/A+ specification, supporting callback registration via \then()\, resolution and rejection, handler chaining, and error collection via \occurred\_err()\. It also includes a \Deferred.all()\ static method to wait for multiple deferreds to resolve, similar to \Promise.all\. Unit tests are included to verify basic resolution, rejection, chaining, and error propagation behaviors.

_ascetic\ddd/deferred · high confidence

Introduce Inbox pattern for idempotent, causally consistent message processing

Added the Inbox module to handle incoming integration messages with guaranteed idempotency and causal consistency. The implementation uses a PostgreSQL-backed table (with bytea payloads and JSONB metadata) and supports partitioned, concurrent processing via worker IDs and configurable concurrency levels. Users can publish messages, dispatch them to subscribers with partition-aware selection, or use the async iterator for continuous polling. The module includes strategies for partitioning by stream identity or URI to preserve causal order where needed.

_ascetic\ddd/inbox · high confidence

Introduce Mediator pattern with request/response and event/pub-sub capabilities

The \ascetic\_ddd/mediator\ module now provides a concrete Mediator implementation alongside its interface definitions. This adds support for sending typed requests to registered handlers via \send\ and \register\, as well as publishing events to subscribed handlers via \publish\ and \subscribe\. The implementation also supports request pipelines through \add\_pipeline\, allowing for cross-cutting concerns to be applied to request handling.

_ascetic\ddd/mediator · high confidence

Introduce Money pattern with multi-currency support and expression-based arithmetic

Added a new Money domain value object in the seedwork layer, implementing the Money pattern from Kent Beck's 'Test Driven Development By Example'. This introduces a Currency enum (USD, EUR, RUB, GBP) with symbol support, a Money class for representing amounts, and an Expression interface that enables composite arithmetic operations (Sum) and scalar multiplication. A Bank class provides currency conversion via exchange rates, allowing expressions involving multiple currencies to be reduced to a single target currency. The module also includes an export mechanism (IMoneyExporter/MoneyExporter) for serializing money data.

_ascetic\ddd/seedwork/domain/values/money · high confidence

Introduce MongoDB-like query DSL for faker providers

The faker domain now supports a structured query language for specifying filtering criteria, modeled after MongoDB's query syntax. Users can define complex conditions using operators such as $eq, $ne, $gt, $in, $is\_null, $not, $any, $all, $len, and $rel, as well as logical combinations like $or and implicit AND. The system includes a parser to convert dictionary-based queries into an internal operator tree, visitors to transform queries into different formats (e.g., plain values or dict representations), and an evaluator to check if objects match the specified criteria, including support for resolving related aggregates via the $rel operator.

_ascetic\ddd/faker/domain/query · high confidence

Introduce PostgreSQL query compiler for faker infrastructure

Added a new query compilation layer in the faker infrastructure that translates MongoDB-style query operators into PostgreSQL SQL using JSONB containment (@\>) and EXISTS subqueries. This includes the PgQueryCompiler and ScalarPgQueryCompiler classes, support for nested value object fields, and operators such as IsNull, comparison ($gt, $gte, $lt, $lte), and relation resolution via IRelationResolver.

_ascetic\ddd/faker/infrastructure/query · high confidence

Introduce Transactional Outbox for reliable message publishing

Added a new Transactional Outbox implementation in the \ascetic\_ddd/outbox\ module to ensure atomic persistence of integration messages alongside business state changes. The feature includes a PostgreSQL schema (\init.sql\) with an \outbox\ table for storing messages and an \outbox\_offsets\ table for tracking consumer group positions, supporting URI-based routing and partitioning across multiple workers. The Python implementation provides an \Outbox\ class that exposes \publish\ for storing messages within a database transaction and \dispatch\/\run\ for asynchronously delivering messages to subscribers, guaranteeing at-least-once delivery and correct ordering via PostgreSQL transaction IDs.

_ascetic\ddd/outbox · high confidence

Introduce batch query collection for bulk INSERT operations

The \ascetic\_ddd/batch\ module now provides a mechanism to defer and batch database queries, specifically targeting INSERT statements to resolve N+1 query problems. It introduces \QueryCollector\, \ConnectionCollector\, and \CursorCollector\ which mimic standard session interfaces but store queries instead of executing them immediately. Users can pass these collectors to queries to accumulate them, then call \evaluate\ on a real session to execute the collected queries in bulk. The module includes \MultiQuery\ and \AutoincrementMultiInsertQuery\ implementations that combine individual INSERTs into single bulk operations, handling both standard inserts and those with RETURNING clauses to resolve deferred results with the appropriate rows.

_ascetic\ddd/batch · high confidence

Introduce disposable pattern and utility modules

This change introduces a new \disposable\ module providing \Disposable\ and \CompositeDisposable\ classes to manage asynchronous resource cleanup via an \IDisposable\ interface, alongside a set of new utility modules in \ascetic\_ddd/utils\. These utilities include \amemo\ for async function memoization, \JSONEncoder\ for serializing complex types like dates and dataclasses, \pg\ for SQL identifier escaping, \profiler\ for async function performance profiling, \property\ for class-level property decorators, and \serializer\ for base64-encoded pickle serialization.

_ascetic\ddd/utils · high confidence

Introduce in-memory Sequencer and factory for ID generation

The \ascetic\_ddd/faker/domain/sequencers\ module now provides a new \Sequencer\ implementation and its corresponding factory. This component generates sequential integer IDs in memory, keyed by an optional scope, and supports setup/cleanup hooks via the \ISession\ interface. The \ISequencerFactory\ protocol is defined as non-generic, and the factory function allows specifying a provider name for potential database table naming conventions.

_ascetic\ddd/faker/domain/sequencers · high confidence

Introduce infrastructure for PostgreSQL database dumps with local, S3, and composite storage options

This change adds a new \dump\ infrastructure module that provides capabilities to back up and restore PostgreSQL databases. It defines protocol interfaces (\IFileDump\, \IDump\) and implements concrete strategies: \PgDump\ and \SinglePgDump\ for executing \pg\_dump\/\psql\ and \pg\_restore\ commands, \GzipDump\ for compression, \FileDump\ for local file storage with TTL-based existence checks, and \S3Dump\ for uploading/downloading archives to AWS S3. A \CompositeDump\ allows chaining multiple storage delegates. Factory functions \make\_dumper\ and \make\_single\_dumper\ in \utils.py\ wire these components together, supporting optional AWS credentials for remote storage.

_ascetic\ddd/faker/infrastructure/dump · high confidence

Introduce public Specification pattern API with logical, comparison, and mathematical operators

This change adds the public API for the Specification pattern in \ascetic\ddd/specification/domain/public\, exposing protocols and adapter classes that enable fluent, operator-based query construction. Users can now build specifications using standard Python operators: logical operations (\&\, \\|\, \\~\, \is\\) via the \Logical\ class, comparisons (\==\, \!=\, \\<\, \\>\, \\<=\, \\>=\) via \Comparison\, and mathematical/bitwise operations (\+\, \-\, \\*\, \/\, \%\, \\<\<\, \\>\>\) via \Mathematical\. The API also supports nullability checks (\is\_null\, \is\_not\null\) through the \Nullable\ adapter and provides concrete type wrappers (\Boolean\, \Number\, \Datetime\, \Text\ and their \Null\\ variants) in \datatypes.py\ to simplify common specification scenarios. Helper functions \object\_\ and \field\ allow referencing domain objects and fields by name.

_ascetic\ddd/specification/domain/public · high confidence

Introduce query-based specification with nested relation support

The specification module now includes QueryLookupSpecification, which allows filtering aggregates by evaluating nested relations (e.g., checking a related object's status) at check time using an EvaluateWalker. This is supported by new interfaces (ISpecification, ISpecificationVisitor) and an EmptySpecification that always returns true, enabling more flexible and dynamic query-based filtering without pre-computing nested states.

_ascetic\ddd/faker/domain/specification · high confidence

Introduce stateless functional programming factory components

The \ascetic\_ddd/faker/domain/fp/factories\ module now provides a suite of stateless factory decorators and composable building blocks for generating test data. This includes \ValueFactory\ for leaf values, \StructureFactory\ for dict composition, \ModeledFactory\ for transforming dicts to domain models, \PersistedFactory\ for repository persistence with ID lookup, \DistributedFactory\ for distributor-based value selection, \ReplicatedFactory\ for creating lists of items, \SequenceFactory\ for generating sequential integers, and \Pipe\ for orchestrating top-down aggregate generation. These components replace the previous mutable factory cycle with a functional, composable approach.

_ascetic\ddd/faker/domain/fp/factories · high confidence

Introduce tenant-isolated Key Management Service with AAD and Vault support

The ascetic\_ddd/kms module now provides a Key Management Service that encrypts Data Encryption Keys (DEKs) using Tenant Encryption Keys (KEKs) scoped to specific tenants. To prevent cross-tenant key confusion attacks, the implementation binds each KEK to its tenant ID using Additional Authenticated Data (AAD) during encryption and decryption. The service supports multiple algorithms (currently AES-256-GCM) and offers two backends: a local PostgreSQL implementation (PgKeyManagementService) that stores encrypted KEKs in a new kms\_keys table, and an adapter for HashiCorp Vault Transit (VaultTransitService) for external key management.

_ascetic\ddd/kms · high confidence

Introduce typed DAG-based change notification system

Added the \ascetic\_ddd.dag\_change\_typed\ module, which implements a hybrid dependency graph for change notifications. This system supports both instance-based and type-based subscriptions, allowing observers to automatically wire themselves to new subjects of a specific type (auto-wiring). It includes a \DAGChangeManager\ that performs topological sorting during notifications to ensure correct propagation order in complex dependency graphs, along with interfaces and concrete classes for subjects and observers.

_ascetic\_ddd/dag\_change\typed · high confidence

Introduces DAG-aware change propagation with topological ordering

Adds a new \ascetic\_ddd.dag\_change\ module that implements the Observer pattern for dependency graphs. It includes \DAGChangeManager\, which propagates changes through a Directed Acyclic Graph (DAG) in topological order, ensuring each observer is notified exactly once even in diamond dependencies. The module also provides \SimpleChangeManager\ for basic registration without ordering, \ChangeSubject\ and \ChangeObserver\ classes for node implementation, and a comprehensive test suite verifying correct propagation, deduplication, and topological sequencing.

_ascetic\_ddd/dag\change · high confidence

Introduces Option type with Some/Nothing semantics and comprehensive tests

Adds a new \Option\ generic type to the \ascetic\_ddd.option\ module, providing \Some\ and \Nothing\ constructors to handle optional values safely. The implementation includes methods for unwrapping values (\unwrap\, \unwrap\_or\, \unwrap\_or\_else\), mapping (\map\, \map\_or\), chaining (\and\_then\), and fallback logic (\or\, \or\_else\), along with equality and hashing support. A full test suite in \test\_option.py\ validates these behaviors, ensuring that \Nothing\ correctly short-circuits operations and raises errors on unsafe unwraps.

_ascetic\ddd/option · high confidence

Introduces domain aggregate seedwork with event sourcing and value object support

The \ascetic\_ddd/seedwork/domain/aggregate\ package now provides the foundational building blocks for Domain-Driven Design, including abstract interfaces and concrete implementations for versioned aggregates, event-sourced aggregates, and domain events. It introduces a causal dependency system to track stream relationships and exporter classes to serialize aggregate state and event metadata. Additionally, the \values\ subpackage adds value objects for geolocation coordinates (leveraging geopy) and time ranges (leveraging PostgreSQL timestamptz ranges), complete with their own serialization exporters.

_ascetic\ddd/seedwork/domain/aggregate · high confidence

Introduces new provider architecture for test data generation

The \ascetic\_ddd/faker/domain/providers\ module has been rewritten to introduce a structured provider hierarchy for generating test data. This includes base mixins for lifecycle management and cloning, and specific provider types: \ValueProvider\ for simple immutable value objects, \CompositeValueProvider\ for composing multiple values, \AggregateProvider\ for managing entity aggregates with repositories, \ReferenceProvider\ for handling many-to-one relationships, and \DependentProvider\ for one-to-many relationships. A \ProviderChangeManager\ is added to orchestrate population order using topological sorting to resolve diamond dependencies. The system uses a query-based criteria system (\require\) and signals (\on\_required\, \on\_populated\) to manage state and events, supporting features like transient providers, distributed value selection, and nested relation lookups.

_ascetic\ddd/faker/domain/providers · high confidence

Introduction of generic Identity base class with typed implementations

The \ascetic\_ddd.seedwork.domain.identity\ module now provides a generic \Identity\ base class that implements \Hashable\ and \IAccessible\, enabling domain entities to use hashable, comparable identity values. This change introduces specific typed implementations (\IntIdentity\, \StrIdentity\, and \UuidIdentity\) that enforce type safety at initialization, allowing users to define domain identities that are safe to use in sets and dictionaries while maintaining strict type constraints for integer, string, and UUID values.

_ascetic\ddd/seedwork/domain/identity · high confidence

Introduction of in-memory event bus with subscription management

The \ascetic\_ddd/bus\ module now provides an in-memory implementation of an event bus, defined by \IBus\ and \IHandler\ interfaces and realized by \InMemoryBus\. This component allows users to subscribe to message URIs via handlers, publish messages to those URIs, and manage subscriptions using disposable tokens for automatic unsubscription. The change includes the core interfaces, the in-memory implementation, and a test suite verifying publish, unsubscribe, and disposable behavior.

_ascetic\ddd/bus · high confidence

Native JSONPath parser with parameterized specifications

The JSONPath specification module now includes a pure-Python parser that supports RFC 9535 syntax and C-style placeholders (e.g., %d, %s, %f, %(name)s). This allows users to define parameterized JSONPath filters that can be reused with different values, eliminating the need for external dependencies and enabling efficient parsing where the template is processed once and matched against multiple data contexts.

_ascetic\ddd/specification/domain/jsonpath · high confidence

New AOP provider architecture with pipeline and decorator-based composition

The faker domain now uses a new AOP (Aspect-Oriented Programming) provider system located in \ascetic\_ddd/faker/domain/aop/providers\. This introduces a core \IProvider\ interface and a \Pipe\ mechanism that executes steps sequentially, passing context from upstream to downstream to eliminate diamond conflicts in aggregate generation. The system includes several new provider types: \ValueProvider\ for leaf values, \StructureProvider\ for composing named child providers into dicts, \ReferenceProvider\ for foreign key resolution with lazy loading support, \ModeledProvider\ for transforming raw data into domain models, \PersistedProvider\ for repository-based persistence, \DistributedProvider\ for distributor-based value selection, \ReplicatedProvider\ for creating lists of items, and \SequenceProvider\ for generating sequential integers with scope support.

_ascetic\ddd/faker/domain/aop · high confidence

New Railway-Oriented Programming toolkit for error handling

The \ascetic\_ddd.rop\ module introduces a Railway-Oriented Programming (ROP) toolkit, providing a \Result\ type that supports two-track outcomes: success values or accumulated lists of errors. This allows developers to chain operations using methods like \map\, \and\_then\ (bind), and \both\, which automatically short-circuit on failure while accumulating error details. The module also includes utility functions such as \apply\, \map2\-\map4\, \switch\, \tee\, \try\catch\, \plus\, \and\\, \compose\, and \pipe\ to facilitate functional composition and error management within the domain-driven design context.

_ascetic\ddd/rop · high confidence

New data utility functions for hashing, freezing, and merging

The \ascetic\_ddd/seedwork/domain/utils/data\ module now provides four new helper functions: \hashable\ and \freeze\ convert mutable structures like dicts and lists into immutable, hashable forms suitable for use as dictionary keys or in sets; \is\_subset\ performs recursive checks to determine if one nested structure is contained within another; and \deepmerge\ recursively merges source dictionaries and lists into a destination object, preserving existing keys while adding new ones.

_ascetic\ddd/seedwork/domain/utils · high confidence

New generator infrastructure for the Faker domain

The \ascetic\_ddd/faker/domain/generators\ package has been introduced to centralize value generation logic. This change adds a new \IInputGenerator\ protocol and a suite of concrete implementations—including \IterableGenerator\, \ListGenerator\, \HypothesisStrategyGenerator\, \CallableGenerator\, \CountableGenerator\, \SequenceGenerator\, \RangeGenerator\, and \TemplateGenerator\—along with a \prepare\_input\_generator\ factory. These components allow the Faker system to produce test data from various sources such as Hypothesis strategies, callables, and sequences, while supporting session and query context injection.

_ascetic\ddd/faker/domain/generators · high confidence

New graph utilities for stable topological sorting and circular dependency detection

Added the \ascetic\_ddd.graph\ package containing \stable\_toposort\ for deterministic topological ordering of nodes (breaking ties via a key function and handling cycles by appending remaining nodes) and \strongly\_connected\_components\/\find\_circular\_sccs\ for detecting circular module dependencies using an iterative Tarjan's algorithm. These utilities are designed to support parser logic by providing generic graph operations without schema-specific dependencies.

_ascetic\ddd/graph · high confidence

New lambda filter package for Specification Pattern

A new \lambda\_filter\ package has been added to the specification domain, introducing a \LambdaParser\ that converts Python lambda functions into Specification AST nodes. This allows users to define filtering logic using standard Python lambda expressions (e.g., \lambda x: x.age \> 25\) which are then parsed and transformed into structured query nodes, supporting comparisons, boolean operations, and nested scopes for comprehensions.

_ascetic\_ddd/specification/domain/lambda\filter · high confidence

New one-to-many (O2M) distributors for controlled data generation

The faker domain now includes a dedicated set of one-to-many (O2M) distributors, allowing users to define how many child entities are created for each parent. This location introduces the \IO2MDistributor\ interface and several concrete implementations: \SkewDistributor\ for power-law distributions, \WeightedDistributor\ for partition-based weighting, \WeightedRangeDistributor\ for bounded integer ranges with optional weights, and \DistributionDistributor\ for arbitrary statistical distributions (e.g., exponential, Pareto, log-normal). Additionally, \RangeDistributorAdapter\ bridges these O2M distributors to the existing M2O provider interface, enabling seamless integration with the current data generation pipeline.

_ascetic\ddd/faker/domain/distributors/o2m · high confidence

New repository implementations for PostgreSQL, REST, In-Memory, and Composite storage

The faker infrastructure now provides a suite of new repository implementations to support various data storage backends. This includes PgRepository and InternalPgRepository for persistent storage in PostgreSQL (with the internal variant handling JSONB-based object storage and auto-setup), RestRepository for persisting aggregates via HTTP POST requests to external APIs, InMemoryRepository for fast, in-memory testing with specification-based querying, and CompositeRepository to coordinate writes between internal and external repositories. These components are exported from the repositories package and implement the standard aggregate lifecycle (insert, update, get, find) along with async signals for insertion and update events.

_ascetic\ddd/faker/infrastructure/repositories · high confidence

New utility modules for dataclasses, dictionaries, and JSON encoding

The \ascetic\_ddd/faker/infrastructure/utils\ package now includes new modules providing foundational utilities. \dataclasses.py\ introduces \IDataclass\ and \DataclassProtocol\ protocols for type-checking dataclass instances. \dict.py\ adds \flatten\_dict\ and \flatten\_dict\_gen\ functions to recursively flatten nested dictionaries into a single-level structure. \json.py\ defines a \JSONEncoder\ that extends the base encoder to specifically handle \Json\ domain values, ensuring they are serialized correctly.

_ascetic\ddd/faker/infrastructure/utils · high confidence

PostgreSQL-backed distributors with weighted and skew distributions

The faker infrastructure now includes a new set of PostgreSQL-based distributors in the \m2o\ module, allowing fake data generation to leverage database-level storage and selection strategies. This introduces \PgWriteDistributor\ as a shared storage layer, alongside \PgWeightedDistributor\ for custom weight-based selection and \PgSkewDistributor\ for power-law (skewed) distribution. A factory function \pg\_distributor\_factory\ simplifies instantiation by automatically composing these components, handling null weights, and managing provider naming. Users can now generate fake data with more realistic distribution patterns (e.g., skewed popularity) directly from PostgreSQL tables, with support for specification-based filtering and probabilistic new-value creation.

_ascetic\ddd/faker/infrastructure/distributors/m2o · high confidence

Saga pattern implementation with routing slip, parallel/fallback activities, and serialization

The \ascetic\_ddd/saga\ module introduces a new Saga pattern implementation using a routing slip approach for managing distributed transactions. It provides core components like \Activity\ (with \do\_work\ and \compensate\ methods), \RoutingSlip\, and \ActivityHost\ to orchestrate forward and backward (compensation) paths. New capabilities include \ParallelActivity\ for executing multiple routing slips concurrently and \FallbackActivity\ for trying alternative routing slips until one succeeds. The module also supports serialization of routing slips to JSON via \SerializableRoutingSlip\ and \ActivityTypeResolver\, enabling transmission across distributed services. Example activities for a travel booking scenario (car, hotel, flight) are included to demonstrate usage.

_ascetic\ddd/saga · high confidence

Scaffold templates for domain value objects

The CLI scaffold now generates Python files for domain value objects, including simple primitives, enums, identities, and composite structures. Generated simple value objects enforce constraints such as required status, blank checks, and maximum length for strings, while composite value objects include an abstract exporter interface and a concrete exporter implementation to handle serialization of nested fields. Enum value objects inherit from str Enum and provide an export method, and identity value objects extend a configurable base class with optional null-checking.

_ascetic\ddd/cli/scaffold/templates/domain/values · high confidence

Behavioural changes

Empty distributors module initialization

The distributors package has been initialized with an empty \_\init\\_.py file, establishing the module structure for the faker domain layer without introducing any immediate functionality or exports.

_ascetic\ddd/faker/domain/distributors · medium confidence

Empty distributors package initialization

The distributors package has been initialized with an empty \_\init\\_.py file, establishing the directory structure for the faker infrastructure's distribution logic.

_ascetic\ddd/faker/infrastructure/distributors · medium confidence

New Jinja2 macros for field serialization and import generation

The scaffold templates now include dedicated macro files (\_field\_macros.j2 and \_macros.j2) to handle the generation of exporter/reconstitutor methods and value object imports. This introduces structured logic for dispatching field exports (handling primitives, entities, and collections) and automates the generation of import statements for value objects, including their associated exporters when needed.

_ascetic\ddd/cli/scaffold/templates · high confidence

Refactored M2O distributors to support CQRS and weighted/skewed distributions

The M2O (many-to-one) distributor module has been restructured to support a Command-Query Responsibility Segregation (CQRS) pattern, introducing a shared WriteDistributor that allows multiple distributors to pool values. New distribution strategies have been added, including WeightedDistributor for custom weight-based selection and SkewDistributor for power-law distributions, both configurable via a unified factory. The system now supports nullable values through NullableDistributor and uses a Cursor mechanism to signal when new values need to be generated based on a mean usage count.

_ascetic\ddd/faker/domain/distributors/m2o · high confidence

Scaffold generator refactored with AST-based merging and entity support

The CLI scaffold tool has been restructured to support generating code for entities alongside aggregates and value objects, with templates now organized in nested directories. A new AST merge module allows the generator to add missing imports, classes, and method parameters to existing files without overwriting user code. The parser now handles imported ValueObjects and uses topological sorting to resolve nested composite dependencies, while the renderer leverages Jinja2 templates and the inflection library for naming conventions.

_ascetic\ddd/cli/scaffold · high confidence

Separate internal and external PostgreSQL session connections

The session infrastructure now distinguishes between internal and external database connections via new \IInternalPgSession\ and \IExternalPgSession\ protocols. This allows the application to explicitly route read-only queries (external) and write operations (internal) to different connection pools, improving isolation and potentially performance by using \READ\_UNCOMMITTED\ isolation levels for external read models.

_ascetic\ddd/faker/infrastructure/session · high confidence

Session layer restructured with new interfaces, identity map, and composite sessions

The session package has been reorganized into a new structure under \ascetic\_ddd/session\, introducing a unified interface layer (\ISession\, \ISessionPool\) and a new \IdentityMap\ component that supports configurable isolation levels (Read Uncommitted, Read Committed, Repeatable Reads, Serializable) to cache entities and prevent redundant database queries. A \CompositeSession\ and \CompositeSessionPool\ have been added to allow wrapping multiple session pools, delegating atomic operations and events across them. Existing implementations for PostgreSQL (\PgSession\), REST (\RestSession\), and Tortoise ORM (\TortoiseSession\) have been migrated to this new architecture, adopting renamed event signals (\on\_atomic\_started\, \on\_atomic\_ended\) and a new \ObjectNotFound\ exception, while maintaining backward-compatible session lifecycle management.

_ascetic\ddd/session · high confidence

Specification evaluator now mirrors PostgreSQL arithmetic and comparison semantics

The specification domain now implements arithmetic (addition, subtraction, multiplication, division, modulo, shifts, negation) and comparison (equality, ordering) operators that strictly follow PostgreSQL's behavior rather than Python's native operators. This ensures that the in-memory evaluator and the database reading the compiled query tree produce identical results for edge cases such as integer overflow/underflow, float division by zero, NaN handling, and signed remainder. The evaluator also enforces SQL-style three-valued logic for NULLs in comparisons and logical connectives (AND/OR/NOT), ensuring that a specification is only satisfied when the result is explicitly true, not null.

_ascetic\ddd/specification/domain · high confidence

Support for composite keys and schema-driven SQL generation in PostgreSQL specifications

The specification infrastructure now supports composite keys via the new \CompositeExpression\ class, which correctly handles equality and inequality comparisons for multi-part values (e.g., composite primary keys) and ensures that null checks are applied appropriately. Additionally, the PostgreSQL visitor and compilation functions (\compile\_specification\, \compile\_to\_sql\) now accept an optional \SchemaRegistry\. This allows the system to map domain field paths to specific storage columns and handle relational vs. embedded collection storage strategies, ensuring that generated SQL uses correct table aliases, quoted identifiers, and foreign key relationships defined in the schema.

_ascetic\ddd/specification/infrastructure · high confidence

Updated application command scaffolding templates

The CLI scaffold templates for the application layer have been updated to generate command classes that inherit from the IRequest interface and include a command\_version field, while command handlers now accept an ISession instance and raise NotImplementedError by default.

_ascetic\ddd/cli/scaffold/templates/application · high confidence

Test coverage

Added comprehensive test suite for specification infrastructure; Added comprehensive test suite for the native JSONPath parser; Added integration and unit tests for the KMS module; Added integration tests for PostgreSQL specification evaluation; Added integration tests for faker infrastructure; Added integration tests for repository codecs and DEK store; Added integration tests for the Inbox pattern; Added test coverage for faker domain providers; Added test infrastructure for database session pooling; Added test package initialization for seedwork domain; Added test package structure for faker domain distributors; Added test suite for PostgreSQL sequencer; Added test suite for the DDD scaffold CLI; Added test utilities for database connections, mock servers, and payload handling; Added tests for IdentityMap behavior and isolation levels; Added tests for PostgreSQL distributor implementations; Added tests for PostgreSQL specification visitor and nested relations; Added tests for QueryLookupSpecification; Added tests for the Faker query compiler and operators; Added tests for the Sequencer component; Added unit and integration tests for batch query processing; Added unit and integration tests for the Outbox component; Added unit tests for Inbox and InboxMessage components; Added unit tests for O2M distributors; Added unit tests for Specification domain logic and public API; Added unit tests for the Faker Query system; Added unit tests for the Mediator component; Added unit tests for the lambda filter parser.

Dependencies

Initial release of ascetic-ddd Python package

This change introduces the initial version (0.1.7) of the 'ascetic-ddd' toolkit, establishing the project's dependency structure via pyproject.toml and docs/requirements.txt. The package requires Python 3.14 and includes core dependencies such as aiohttp, cryptography, faker, mimesis, and psycopg for database interactions. It also defines optional CLI dependencies (jinja2, pyyaml, inflection) and development tooling (mypy, hypothesis), alongside documentation requirements (sphinx, myst-parser, sphinxcontrib-mermaid).

(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 53 → 54 (+1.7)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 88 → 97 (+8.2)
  • Architecture 97 → 93 (-4.0)
  • Maturity 51 → 47 (-4.1)
  • Readiness 44 → 46 (+2.0)
  • Security 59 → 81 (+22.2)
  • Domain Modelling 67 → 63 (-3.7)

Resolved (61)

  • Change coupling: aggregate_provider.py ↔ entity_provider.py (ascetic_ddd/faker/domain/providers/aggregate_provider.py)
  • Change coupling: composite_value_provider.py ↔ entity_provider.py (ascetic_ddd/faker/domain/providers/composite_value_provider.py)
  • Change coupling: composite_value_provider.py ↔ value_provider.py (ascetic_ddd/faker/domain/providers/composite_value_provider.py)
  • Change coupling: dummy_distributor.py ↔ nullable_distributor.py (ascetic_ddd/faker/domain/distributors/m2o/dummy_distributor.py)
  • Change coupling: dummy_distributor.py ↔ pg_weighted_distributor.py (ascetic_ddd/faker/domain/distributors/m2o/dummy_distributor.py)
  • Change coupling: dummy_distributor.py ↔ weighted_distributor.py (ascetic_ddd/faker/domain/distributors/m2o/dummy_distributor.py)
  • Change coupling: factory.py ↔ factory.py (ascetic_ddd/faker/domain/distributors/m2o/factory.py)
  • Change coupling: interfaces.py ↔ skew_distributor.py (ascetic_ddd/faker/domain/distributors/m2o/interfaces.py)
  • Change coupling: nullable_distributor.py ↔ pg_weighted_distributor.py (ascetic_ddd/faker/domain/distributors/m2o/nullable_distributor.py)
  • Change coupling: nullable_distributor.py ↔ weighted_distributor.py (ascetic_ddd/faker/domain/distributors/m2o/nullable_distributor.py)
  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (10 lines × 2) (ascetic_ddd/specification/domain/jsonpath/examples/jsonpath2_parser_example.py)
  • Duplicated block (10 lines × 2) (ascetic_ddd/specification/domain/jsonpath/examples/jsonpath2_parser_example.py)
  • Duplicated block (11 lines × 2) (ascetic_ddd/dag_change/dag_change_manager.py)
  • Duplicated block (12 lines × 2) (ascetic_ddd/faker/domain/distributors/o2m/skew_distributor.py)
  • Duplicated block (12 lines × 2) (ascetic_ddd/specification/domain/jsonpath/examples/jsonpath_example.py)
  • Duplicated block (13 lines × 2) (ascetic_ddd/faker/domain/aop/providers/structure_provider.py)
  • Duplicated block (14 lines × 2) (ascetic_ddd/faker/infrastructure/query/pg_query_compiler.py)
  • Duplicated block (14 lines × 2) (ascetic_ddd/specification/domain/jsonpath/examples/jsonpath2_parser_example.py)
  • …and 41 more

New (62)

  • Banned license: psycopg
  • Banned license: psycopg-pool
  • Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency
  • Documentation: no installation or build instructions (docs/requirements.txt)
  • Documentation: written for insiders
  • Duplicated block (10 lines × 3) (ascetic_ddd/faker/domain/providers/_mixins.py)
  • Duplicated block (10 lines × 3) (ascetic_ddd/seedwork/domain/aggregate/causal_dependency_exporter.py)
  • Duplicated block (10–11 lines × 2) (ascetic_ddd/specification/domain/jsonpath/jsonpath_parser.py)
  • Duplicated block (12 lines × 2) (ascetic_ddd/faker/domain/distributors/o2m/skew_distributor.py)
  • Duplicated block (13 lines × 2) (ascetic_ddd/seedwork/domain/aggregate/causal_dependency_exporter.py)
  • Duplicated block (16 lines × 2) (ascetic_ddd/inbox/inbox.py)
  • Duplicated block (17 lines × 2) (ascetic_ddd/faker/domain/distributors/o2m/skew_distributor.py)
  • Duplicated block (17 lines × 2) (ascetic_ddd/faker/infrastructure/query/pg_query_compiler.py)
  • Duplicated block (18 lines × 2) (ascetic_ddd/faker/domain/providers/sequence_provider.py)
  • Duplicated block (19 lines × 2) (ascetic_ddd/faker/domain/query/evaluate_visitor.py)
  • Duplicated block (21 lines × 2) (ascetic_ddd/faker/domain/aop/providers/structure_provider.py)
  • Duplicated block (27 lines × 2) (ascetic_ddd/dag_change/dag_change_manager.py)
  • Duplicated block (28 lines × 2) (ascetic_ddd/faker/domain/providers/_mixins.py)
  • Duplicated block (35–45 lines × 2) (ascetic_ddd/faker/infrastructure/distributors/m2o/pg_skew_distributor.py)
  • Duplicated block (38 lines × 3) (ascetic_ddd/saga/examples/reserve_car_activity.py)
  • …and 42 more

Changes since last survey

  • 14 commits — 13 feature/other, 1 fixes

By area

  • ascetic_ddd/specification — 12 commits
  • ascetic_ddd/inbox — 2 commits

Notable commits

  • fix: Fix worker partitioning: clear the sign bit of hashtext in inbox and outbox
  • change: A JSONPath template is a function of its parameters; a specification has no placeholder
  • change: A composite of one part is that part; one of no parts is refused by name
  • change: A constant with nothing but constants beside it has its type said in the text
  • change: A float result too small to be one is out of range, and a NaN divided by zero is a NaN
  • change: A name is quoted where it is written: it is the column's, whatever else PostgreSQL knows by it
  • change: A template is parsed in the time it takes to read it: its placeholders are counted once
  • change: A template's tree is no taller than its bound, and the parser goes no deeper than its own
  • change: Align inbox and outbox schema with the Rust port: bytea payload, message_id
  • change: Align specification with the Rust port: one semantics for both readers, one JSONPath parser
  • change: An Option of a value is what it holds, or a null, to the readers of a specification
  • change: An object on the way to a member is looked up in the schema: read through its key, or a composite in its row
  • change: Equality with a value the mapping made the storage's null is the null test
  • change: compile_specification takes the schema: a mapping and a schema are given together

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

Survey your own repository

krew-solutions/ascetic-ddd-python 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 a235c38005ac50eb376a7c369bb8d3b7f5a44e87 — 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.