observed

suspend fun <T> observed(type: AggregateType, what: StateRead, caller: QueryCaller, rows: (T) -> Long = { 1 }, read: suspend () -> T): T

Runs read, one state read of type for caller asking what, observed as a query is: observer starts it as a stage of work of StateRead.queryType, is told how it ended, and audits it with the rows it returned (one state, or the commits of a trace). A read answered as not found throws me.ahoo.wow.query.state.StateNotFoundException, whose reason only the audit records.

The caller is first authorized to read the type's snapshot model by what's operation (ReadAuthorizer), before anything is read: a refused caller learns nothing, not even whether the state exists.