State management

AFFiNE does not have one global state-management layer. State is owned by the boundary that uses it, so begin with the module or package closest to the behavior.

Follow the service, entity, and test patterns already used by the target module. Avoid introducing a new cross-module store until ownership and lifecycle requirements have been reviewed.