I looked at the code again and these assertions actually verify that the version mutation done during indexing (+1 of internal, the same for external) maintain the semantics of the version type. Assertions are the typical way of it because it's a sanity check not real code. Of course, making things blow up (with right error message which is  tricky, I think) is also valid. My vote goes to assertions but if you prefer hard errors I'll change it.