damgru/stupid-event-sourcing
44.7
Weak · 22 September 2026
731
lines of production code
PHP
primary language
6
measurements over time
What this system is
This system is an event-sourcing infrastructure library that manages domain events and synchronizes read models. It provides an AggregateRoot base class to simplify recording domain events and an EventStore optimized for efficient querying. Additionally, it includes a ReadModel framework to process events and maintain synchronized local state, coordinated by a manager that tracks processing progress.
Features
Introduce Read Model infrastructure for event-driven data synchronization
Added new PHP classes in the src/ReadModel directory to support event sourcing read models. This includes the ReadModel and ReadModelManager interfaces, along with concrete implementations like InMemoryReadModel and PdoReadModel, which handle pulling events from the event store and updating local state. A PdoReadModelManager is also introduced to coordinate multiple read models, persist their last processed event timestamps in a 'read\_models' database table, and trigger updates.
src/ReadModel · high confidence
Behavioural changes
AggregateRoot adds a recordEvent helper method
The AggregateRoot class now includes a protected recordEvent method that simplifies the creation and recording of domain events. By wrapping the AggregateEvent::create factory, this new helper allows subclasses to easily record events with a specific name, payload, and category, reducing boilerplate when implementing domain logic.
src · high confidence
Improved EventStore query performance with database indexes
The PdoEventStore now creates database indexes on the 'aggregate\_id' and 'created' columns of the events table. This change optimizes query performance for lookups and time-based filtering, addressing the initialization logic in the EventStore component.
src/EventStore · medium confidence
Dependencies
Bumped package version to 0.0.3
The composer.json manifest was updated to version 0.0.3, reflecting a change in the package's version number.
(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
Score
- CAI 45 → 45 (-0.0)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (-0.3)
- Architecture 69 → 69 (+0.0)
- Maturity 55 → 55 (+0.0)
- Readiness 17 → 17 (+0.0)
- Security 100 → 100 (+0.0)
Resolved (7)
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- No exposed public API
- Scanner failed to run — not a clean result
- early-stage repository — too little history to judge knowledge freshness
- git history depth insufficient
- git history depth insufficient
- single-maintainer — knowledge-concentration (bus factor) risk
New (7)
- Ambiguous reconstruction intent. fromEvents takes a single AggregateEvent (singular) but returns a root, which is semantically incorrect for reconstructing state from a stream. load in the repository handles the full stream loading. The method name fromEvents (plural) suggests a collection, but the signature accepts a single item.
- Documentation: no project overview (README.md)
- Duplicate intent with different names. withReadModel and registerReadModel appear to perform the same action of associating a read model with the manager, but the naming convention is inconsistent (with vs register).
- Duplicated block (18 lines × 2) (src/ReadModel/InMemoryReadModel.php)
- Inconsistent parameter naming vs. type. The parameter is named events (plural) but the type is AggregateEvent (singular). This is a documentation/signature mismatch that implies a collection is expected but only one is accepted.
- Inheritance/Interface inconsistency. PdoReadModelManager duplicates registerReadModel from ReadModelManager. If PdoReadModelManager extends ReadModelManager, this is redundant. If they are separate interfaces, the duplication is acceptable, but the presence of both ReadModelManager and PdoReadModelManager alongside ReadModel and PdoReadModel suggests a fragmented hierarchy where the base interface might be unused or inconsistently implemented.
- Redundant creation paths with conflicting signatures. The static factory create omits the version parameter (implying it sets it to 0 or null), while the constructor requires it. This creates confusion about whether create is the intended public entry point and what the initial version state is.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
damgru/stupid-event-sourcing 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 22 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 7e618e12d82c8ee03d612532aa8e7021f1b4837c — 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-821afab8930d.