Skip to content

System Overview

The runtime has one state document per game. Domain facades and game-specific state share that document; the network carries Automerge synchronization data between replicas.

flowchart TB
  Examples[examples / CLI / MCP] --> Engine[engine/Engine.ts]
  Engine --> Actions[engine/actions.ts\nTypeScript ActionRegistry]
  Actions --> Chronicle[core/Chronicle.ts\nAutomerge document]
  Chronicle --> Containers[Token / Stack / Space / Source]
  Chronicle --> History[HistoryManager checkpoints]
  Chronicle --> Consensus[ConsensusCore]
  Consensus --> Network[network transports and servers]
  Chronicle --> Storage[StorageAdapter implementations]
  Browser[core/browser] --> Examples

The central invariant is the single action path: application code calls engine.dispatch(), registry handlers mutate the Chronicle, and events notify dependent systems. There is no active alternative WASM action backend.