Production-Ready Event Sourcing #13

Open
opened 2026-03-14 23:51:44 +00:00 by freemo · 0 comments
Owner

Background and Context

The event sourcing system was introduced in commit 1a6b78a2 (June 2025) as an architectural initiative to add CQRS/ES capabilities to Aethyr using the Sequent framework with ImmuDB. While structurally substantial (~8,000 lines of code and documentation), the system was never finished and remains disabled by default.

Current state: 15 event classes, 16 command classes, 3 domain aggregates, 2 separate ImmuDB event store implementations, dual-write hooks in Manager/Storage/GameObject, but zero integration with the 90+ game action commands, missing command handlers for inventory/equipment, no projection schema, and no working tests.

Expected Behavior (End State)

Event sourcing is a fully operational, optional subsystem that:

  • Has a single, canonical ImmuDB event store using JSON serialization with Prometheus metrics
  • Covers all game domains: objects, players, rooms, inventory, equipment
  • Integrates transparently with game actions via the Manager facade
  • Has working projection tables with schema migrations and rebuild capability
  • Is covered by unit and integration tests at 85%+ coverage
  • Can be enabled with a single config flag and works correctly with or without ImmuDB

Acceptance Criteria

  • Single consolidated ImmuDB event store implementation
  • All 16 commands have working command handlers and aggregate methods
  • Game actions emit events transparently when event sourcing is enabled
  • Projection schema is defined and auto-created on first enable
  • rebuild_world_state performs actual replay, not just verification
  • Unit test coverage >= 85% for all event sourcing components
  • Integration tests verify the dual-write path end-to-end
  • Configuration is consolidated to ServerConfig with documented defaults
## Background and Context The event sourcing system was introduced in commit 1a6b78a2 (June 2025) as an architectural initiative to add CQRS/ES capabilities to Aethyr using the Sequent framework with ImmuDB. While structurally substantial (~8,000 lines of code and documentation), the system was never finished and remains disabled by default. **Current state:** 15 event classes, 16 command classes, 3 domain aggregates, 2 separate ImmuDB event store implementations, dual-write hooks in Manager/Storage/GameObject, but zero integration with the 90+ game action commands, missing command handlers for inventory/equipment, no projection schema, and no working tests. ## Expected Behavior (End State) Event sourcing is a fully operational, optional subsystem that: - Has a single, canonical ImmuDB event store using JSON serialization with Prometheus metrics - Covers all game domains: objects, players, rooms, inventory, equipment - Integrates transparently with game actions via the Manager facade - Has working projection tables with schema migrations and rebuild capability - Is covered by unit and integration tests at 85%+ coverage - Can be enabled with a single config flag and works correctly with or without ImmuDB ## Acceptance Criteria - [ ] Single consolidated ImmuDB event store implementation - [ ] All 16 commands have working command handlers and aggregate methods - [ ] Game actions emit events transparently when event sourcing is enabled - [ ] Projection schema is defined and auto-created on first enable - [ ] `rebuild_world_state` performs actual replay, not just verification - [ ] Unit test coverage >= 85% for all event sourcing components - [ ] Integration tests verify the dual-write path end-to-end - [ ] Configuration is consolidated to `ServerConfig` with documented defaults
freemo self-assigned this 2026-03-15 04:25:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: aethyr/Aethyr#13
No description provided.