For any invariant we need a tool that'd tell us if invariant can be replaced by throwing an AssertionException and if that'd guarantee that the operation won't continue execution but rather terminate and dispose OperationContext.
For that we need to sample as many stack traces from all the invariants across the query code base as we can and for each invariant check if there is any frame on any of its stack traces after the CommandInvocation::run or equivalent method that catches AssertionException.