# Changelog

## Score

- CAI 64 → 66 (+2.1)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

## Lenses

- Code Health 100 → 100 (+0.0)
- Architecture 99 → 99 (-0.2)
- Maturity 39 → 48 (+8.5)
- Readiness 84 → 84 (+0.0)
- Security 80 → 73 (-7.5)

## Resolved (6)

- High secret: WD-SECRET-0005 (docs/package-lock.json)
- Reconstitution logic is duplicated across both the Aggregate Root class and its Behavior trait/class. While this is a common pattern in Event Sourcing to separate state from behavior, the signatures are nearly identical for the event-based reconstitution, leading to code duplication if the logic isn't strictly delegated. More critically, `AggregateRoot` and `AggregateRootBehaviour` both expose `aggregateRootId()` and `aggregateRootVersion()`, which are identical signatures, suggesting one is redundant or they are tightly coupled implementation details that leak into the public API surface.
- Rotate the exposed credentials — git history can't be un-committed
- The repository interface exposes two persistence methods with distinct intents but similar naming. `persist` takes the aggregate root object, while `persistEvents` takes raw events and metadata. This forces implementers to maintain two separate code paths or delegate between them, creating confusion about which method handles the actual state transition vs. event storage.
- The repository interface provides two retrieval methods that overlap in intent. `retrieveAll` gets all events, while `retrieveAllAfterVersion` gets events after a specific version. In event sourcing, 'all events' is often just 'events after version 0'. This duplication forces implementers to handle two code paths for essentially the same data stream, differing only by a starting point.
- There are two dispatcher interfaces: `MessageDispatcher` and `EventDispatcher`. `MessageDispatcher` takes `Message` objects, while `EventDispatcher` takes raw `events` (objects) and has a separate method for headers. This splits the dispatching concern unnecessarily. Users must choose between a low-level message dispatcher and a higher-level event dispatcher, leading to confusion about which to inject.

## New (12)

- Orphaned file (src/CodeGeneration/CodeDumper.php)
- Orphaned file (src/CodeGeneration/DefinitionGroup.php)
- Orphaned file (src/CodeGeneration/PayloadDefinition.php)
- Orphaned file (src/CodeGeneration/YamlDefinitionLoader.php)
- Orphaned file (src/EventSourcedAggregateRootRepository.php)
- Orphaned file (src/Message.php)
- Orphaned file (src/Serialization/ConstructingMessageSerializer.php)
- Orphaned file (src/Snapshotting/ConstructingAggregateRootRepositoryWithSnapshotting.php)
- Orphaned file (src/TestUtilities/AggregateRootTestCase.php)
- Orphaned file (src/TestUtilities/AntiCorruptionLayerTestCase.php)
- Orphaned file (src/TestUtilities/MessageConsumerTestCase.php)
- Orphaned files with no living knowledge
