Skip to content
CAI
Software that uses CAICheck a score

streakphp/streak

61.8

Adequate · 21 September 2026

9.8k

lines of production code

PHP

primary language

4

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

Lenses

  • Code Health 88 → 92 (+3.9)
  • Architecture 100 → 97 (-2.9)
  • Maturity 52 → 44 (-8.6)
  • Readiness 61 → 64 (+3.0)
  • Security 53 → 91 (+38.2)

Resolved (29)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (12 lines × 2) (src/Domain/Event/Listener/Listening.php)
  • Duplicated block (13 lines × 2) (src/Infrastructure/Domain/Event/Sourced/Subscription.php)
  • Duplicated block (18 lines × 5) (src/Application/Sensor/Processing.php)
  • Duplicated block (21 lines × 2) (src/Domain/Command/Handling.php)
  • Duplicated block (22 lines × 2) (src/Domain/Event/Listener/Filtering.php)
  • Duplicated block (30 lines × 2) (src/Infrastructure/Domain/Event/Sourced/Subscription.php)
  • Duplicated block (8 lines × 2) (src/Infrastructure/Domain/Event/Subscription/DAO/DbalPostgresDAO.php)
  • Duplicated block (9 lines × 2) (src/Infrastructure/Domain/Event/Subscription/DAO/DbalPostgresDAO.php)
  • Duplicated block (9 lines × 3) (src/Infrastructure/Domain/EventStore/DbalPostgresEventStore.php)
  • 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)
  • …and 9 more

New (83)

  • Ambiguous factory creation strategies. Two distinct factory methods exist with different signatures and likely different internal logic (one by ID, one by event type), but they are grouped under the same interface without clear semantic separation in naming.
  • ClassTooLong: DbalPostgresEventStore (src/Infrastructure/Domain/EventStore/DbalPostgresEventStore.php)
  • Confusingly similar method names with different semantic weights. registerAggregateRoot and registerAggregate sound like they might be overloads or interchangeable, but they register different domain concepts. The naming does not clearly distinguish between 'Root' and non-root entities.
  • Dependency hygiene PARTLY measured — Composer dependencies read, no committed lock to grade for currency
  • Duplicated block (11 lines × 3) (src/Infrastructure/Domain/Event/Sourced/Subscription/Event/SubscriptionIgnoredEvent.php)
  • Duplicated block (13–14 lines × 2) (src/Domain/Event/Listener/Listening.php)
  • Duplicated block (15 lines × 2) (src/Application/Sensor/Processing.php)
  • Duplicated block (15 lines × 5) (src/Application/Sensor/Processing.php)
  • Duplicated block (16 lines × 3) (src/Domain/Command/Handling.php)
  • Duplicated block (18 lines × 3) (src/Application/Sensor/Processing.php)
  • Duplicated block (18 lines × 4) (src/Domain/Command/Handling.php)
  • Duplicated block (19 lines × 2) (src/Infrastructure/Domain/Event/Sourced/Subscription.php)
  • Duplicated block (21 lines × 2) (src/Domain/Command/Handling.php)
  • Duplicated block (21 lines × 2) (src/Domain/Command/Handling.php)
  • Duplicated block (30 lines × 2) (src/Domain/Event/Listener/Filtering.php)
  • Duplicated block (5 lines × 2) (src/Infrastructure/Domain/Event/Subscription/DAO/DbalPostgresDAO.php)
  • Duplicated block (59–63 lines × 2) (src/Infrastructure/Domain/Event/Sourced/Subscription.php)
  • Duplicated block (7 lines × 2) (src/Infrastructure/Domain/Event/Subscription/DAO/DbalPostgresDAO.php)
  • Duplicated block (7–8 lines × 4) (src/Infrastructure/Domain/EventStore/DbalPostgresEventStore.php)
  • Duplicated block (8 lines × 4) (src/Domain/Event/Subscription/Exception/SubscriptionAlreadyCompleted.php)
  • …and 63 more

Written by watchdog.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 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 221bea0e4c40a41cd05a260365fcb1853b47f4d4 — 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.