Fleet changelogs · dev.ecs0.net
rdmpw3275m-changelog-20260923-1025-tyrell-feat-20260903-06-cqrs-event-sourcing

rdmpw3275m-changelog-20260923-1025-tyrell-feat-20260903-06-cqrs-event-sourcing

One-line summary: Implemented CQRS event-sourced persistence engine with atomic command decider transactions, append-only event log, command idempotency receipts, turn pagination windowing, and thread settlement reactor with subagent safeguards for Tyrell (FEAT-20260903-06), verified 100% pass across Intel macOS 26.7.1 and Apple Silicon macOS 27.0.

Scope

Exact Files Touched

  1. Package.swift:
    • Added "Orchestration" to TyrellRemoteSupport target exclusion list to prevent namespace conflicts with remote transport bindings.
  2. Sources/TyrellCore/TyrellSQLite.swift:
    • Added fetchAll and fetchOne convenience methods on Database instance delegating to Row.fetchAll / Row.fetchOne.
  3. Sources/TyrellCore/Orchestration/OrchestrationEvents.swift (new):
    • Defined OrchestrationEventType, OrchestrationEvent, CommandReceipt, CommandReceiptStatus, ThreadProjection, ThreadTurnProjection, TurnPaginationCursor, TurnPaginationWindow, and DeciderCommand.
  4. Sources/TyrellCore/Orchestration/OrchestrationEngineActor.swift (new):
    • Implemented SQLite schema (orchestration_events, orchestration_command_receipts, projection_threads, projection_thread_turns).
    • Implemented atomic decider transaction executeCommand(_:) verifying idempotency, appending events, updating projection read-models, and recording receipts in a single transaction.
    • Implemented fetchTurnWindow (10-turn initial window, 20-turn historical pages with hasMore and nextCursor).
    • Implemented projection queries (fetchThreadProjection, fetchAllThreadProjections, fetchTurnProjection, fetchEvents, commandReceipt).
  5. Sources/TyrellCore/Orchestration/ThreadSettlementReactor.swift (new):
    • Implemented SubagentLivenessChecking, BlockSubagentLivenessChecker, evaluateSettlement, and evaluateAllThreads enforcing PRD §3.3.1 safety rules: deferring settlement if active subagents are detected or idle threshold (<60s) has not elapsed.
  6. Tests/TyrellCoreTests/CQRSEventSourcingTests.swift (new):
    • Comprehensive test suite covering all 5 acceptance criteria.

Verification Evidence

How to Undo