Skip to content
CAI
Software that uses CAICheck a score

streakphp/streak

56.5

Adequate · 9 November 2026

9.8k

lines of production code

PHP

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a PHP-based framework, named Streak, designed to implement event-sourced domain models using a clean architecture. It provides a structured foundation for building applications with command and query buses, supporting both command processing and event-driven query handling. The framework includes infrastructure for managing aggregate roots, sensors, and event listeners, all backed by PostgreSQL and Redis. Comprehensive test coverage ensures the reliability of its core messaging and event-sourcing capabilities.

How it got here

2017 — Initial project scaffolding and domain modeling

5 changes.

The period focused on establishing the foundational architecture of the Streak PHP framework, including repository initialization, dependency management, and containerized development environments. It introduced core application-layer interfaces for commands, queries, and sensors, alongside domain primitives for event sourcing and command handling. Comprehensive tests were added to validate the new domain classes.

2018–2025 — Application layer and infrastructure test coverage

10 changes.

This period focused on implementing core application-layer components for sensor processing, command handling, and query execution. Comprehensive unit tests were added to verify the behavior of these new features alongside the existing infrastructure layer.

Features

Added .gitkeep file to src/.scratchpad

A .gitkeep file was added to the src/.scratchpad directory. This ensures the directory is tracked by version control, preventing it from being ignored or removed by git when the directory is empty.

src/.scratchpad · high confidence

Added AggregateRootHandler for command processing

A new AggregateRootHandler class has been introduced in the Application layer to process commands targeting aggregate roots. This handler retrieves the specified aggregate from the repository and delegates command handling to it, ensuring that only supported commands are processed and that missing aggregates are properly reported.

src/Application/CommandHandler · high confidence

Added EventListenerHandler for query execution

Introduced a new EventListenerHandler class that implements the QueryHandler interface. This component enables the system to process queries by locating a specific listener via a subscription repository, validating that the listener supports query handling, and delegating the query execution to that listener. This adds support for querying listeners as part of the application's query handling mechanism.

src/Application/QueryHandler · high confidence

Added default configuration files for PHP 8.0, PostgreSQL, and Redis in Docker

The Docker environment now includes explicit configuration files for its services: a PHP 8.0 CLI \php.ini\ tailored for production, a \postgresql.conf\ for database settings, and a \redis.conf\ for caching. These files establish the baseline behavior for each service within the containerized environment.

docker · high confidence

Initial project scaffolding and development tooling

The repository was initialized with essential configuration files to support the Streak PHP framework. This includes a \.editorconfig\ for consistent code formatting, a \.php-cs-fixer.dist.php\ for PHP code style enforcement, and a \rector.php\ for automated PHP 7.4/8.0 migration rules. The project also introduced a \depfile.yaml\ to enforce architectural layering (Domain, Application, Infrastructure) using Deptrac, and a \phpunit.xml.dist\ to configure the test suite with PostgreSQL and Redis environments. Additionally, a \docker-compose.yml\ was added to containerize the PHP, PostgreSQL, and Redis services for local development, while \.gitignore\ and \UPGRADE.md\ were updated to reflect the new project structure and migration paths.

(repo-wide) · high confidence

Introduce application-layer interfaces for commands, queries, and sensors

The application layer now defines three new interfaces: CommandBus for dispatching commands, QueryBus for dispatching queries, and Sensor for processing messages. These interfaces establish the contracts for the application's core messaging and eventing capabilities, enabling the rest of the system to interact with these components through well-defined abstractions.

src/Application · high confidence

Introduce domain primitives for event sourcing and command handling

The domain layer now includes foundational interfaces and traits for event-sourced aggregates, command handling, and event listeners. Specifically, the diff adds \Aggregate\ and \AggregateRoot\ interfaces with their respective \Id\, \Comparison\, \EventSourcing\, and \Identification\ components, enabling entities to track and apply state from an event stream. Additionally, \Command\ and \CommandHandler\ interfaces are introduced to standardize command processing, while \Event/\*\ interfaces (such as \Listener\, \Consumer\, and \Envelope\) define how the system consumes and filters events. These changes provide the core building blocks for implementing domain logic that reacts to and produces events.

src/Domain · high confidence

Introduced core sensor application interfaces and processing traits

Added new application-layer components for the sensor domain: the \Factory\ and \Id\ interfaces, the \Identification\ trait for managing sensor identity, and the \Processing\ trait which enables automatic message routing to handler methods based on type matching. These changes establish the foundation for processing sensor events and managing sensor state within the application layer.

src/Application/Sensor · high confidence

Behavioural changes

Added empty placeholder files for build tool directories

The build directory now includes empty .gitkeep files for .composer, .deptrac, .php-cs-fixer, .phpunit, and .rector directories. This ensures these tool-specific directories are tracked by version control, preventing them from being deleted or ignored by Git.

build · high confidence

Test coverage

Added tests for domain classes; Added tests for the AggregateRootHandler; Added tests for the command bus, query bus, and aggregate root snapshotting infrastructure; Added unit tests for Sensor application components; Added unit tests for the EventListenerHandler.

Dependencies

Initial project setup with PHP 8.0 and key dependencies

The project introduces a new composer.json defining the library 'streak/streak' with a minimum PHP version of 8.0. It establishes core dependencies including doctrine/dbal, ramsey/uuid, and ext-redis, alongside development tools like php-cs-fixer, rector, and phpunit.

(dependencies) · medium 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 49 → 56 (+7.5)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 64 → 64 (+0.0)
  • Architecture 90 → 89 (-1.8)
  • Maturity 35 → 57 (+21.9)
  • Readiness 44 → 44 (+0.0)
  • Security 91 → 91 (+0.0)
  • Domain Modelling 89 → 89 (+0.0)

Resolved (5)

  • Documentation: no installation or build instructions (docs/tutorials/building-a-saga.md)
  • Duplicate 'Listening' interface. Streak.Domain.Event.Listener.Listening is identical to Streak.Domain.Event.Listener.on, which is already part of the base Listener interface. This suggests Listener might be intended as a composite interface or Listening is redundant.
  • Inconsistent 'Find' semantics and signatures across Repository/Storage interfaces. Domain Repositories use find(id) returning an entity, while Snapshotter Storages use find(aggregate) returning a serialized string (snapshot). This mixes identity-based lookup with object-based lookup and returns different types (Entity vs Data), violating the Repository pattern abstraction.
  • Inconsistent Envelope creation. The class has both a constructor and a static new factory method with different signatures. new omits uuid and name, implying they are generated, while __construct requires them. This creates two ways to create the same object with different requirements.
  • Redundant 'Handling' interfaces. Streak.Domain.Command.Handling and Streak.Domain.Query.Handling duplicate the functionality of Streak.Domain.CommandHandler and Streak.Domain.QueryHandler respectively, but with different naming conventions (handleCommand vs handle). This creates confusion about which interface should be implemented for a handler.

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

Survey your own repository

streakphp/streak 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 221bea0e4c40a41cd05a260365fcb1853b47f4d4 — 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.