Well, Sanskrit does not have a /z/ which means we have a "problem", if you will, when we have an s स् followed by a voiced sound, because the usual voicing assimilation rules of Sanskrit in external saṃdhi cannot apply. Of course, it's entirely possible in Sanskrit to have the combination sva स्व, indeed there is such a word. However, in external saṃdhi, usually voiceless sounds at the end of words should become voiced when followed by a word beginning with a voiced sound, e.g. ग्रामात् वनम् grāmāt vanam ---> ग्रामाद्वनम् grāmād vanam (the words are written together in Devanagari, though generally separated in transliteration, where possible). What to do with s स्, for we cannot have lobhaz vasati, for there is no /z/?
Well the answer as we know is word-final -as -अस्, when followed by a voiced consonant ---> o -ओ, e.g. पुत्रस् धावति putras dhāvati ---> पुत्रो धावति putro dhāvati.
Now, -s -स् is not allowed to remain at the end of a word, and neither is -r -र्. In pausa, these become visarga and, of course, the visarga remains in certain other contexts as well. I leave it up to the historians to decide whether the visarga saṃdhi is really originally just saṃdhi of word-final -s -स् (and sometimes -r -र्) - which seems likely - or whether word-final -s -स् and -r -र् always become visarga and then undergo saṃdhi.
Let me explain if that's not clear.
Is the example I gave above derived:
Putras पुत्रस् + dhāvati धावति ---> putro dhāvati पुत्रो धावति;
Or:
Putras पुत्रस् + dhāvati धावति ---> putraḥ dhāvati पुत्रः धावति ---> putro dhāvati पुत्रो धावति?
I think more likely the former, but it is, I think, more common (possibly more in line with traditional Sanskrit grammar, too, I don't know) to treat this saṃdhi under the heading of visarga saṃdhi. So (in fact, not everybody even bothers to mention this much) we learn that visarga is from word final -s -स् and sometimes -r -र् (e.g. punaḥ पुनः < punar पुनर्). But then in the paradigm, rather than going kūpas कूपस्, kūpam कूपम्, etc., we teach kūpaḥ कूपः, kūpam कूपम्, etc. and then merely learn 'visarga saṃdhi'. We sometimes even pretend that visarga isn't from word-final -s -स् and -r -र्, but for our own convenience, we imagine the visarga to be original, instrinsic. So we don't treat vadāmaḥ वदामः as vadāmas वदामस्, we pretend it was really vadāmaḥ वदामः all along. So if we see vadāmaḥ वदामः at the end of a sentence, we forget that what's really happened is vadāmas वदामस् has gone to vadāmaḥ वदामः because Sanskrit does not allow word-final -s -स् and pretend that the word is actually vadāmaḥ वदामः. Then, we we see vadāmo vayam वदामो वयम्, we pretend that what's happened is:
Vadāmaḥ वदामः + vayam वयम् ---> vadāmo vayam वदामो वयम्;
Rather than:
Vadāmas वदामस् + vayam वयम् ---> vadāmo vayam वदामो वयम्.
In other words, all I'm really trying to say is that I think saṃdhi of -as अस् and saṃdhi of -aḥ अः are essentially two ways of teaching the same thing here. I think the reality of the language is that -aḥ -अः is really just the result of saṃdhi being applied to -as अस् in certain circumstances, e.g. at the end of a sentence. However, for pedagogical reasons, it's quite common not to think about it in this way (it's also possible that tradditional grammarians did not think of their language in this way) and instead think of all of this as saṃdhi of visarga, rather than saṃdhi of s स्. It's something I always found very confusing, as you might be able to tell from my rather waffly explanation.
Additionally remember that visarga also results from word final -r -र् and that final -s -स् sometimes becomes r र्, e.g. manus gacchati मनुस् गच्छति ---> manur gacchati मनुर्गच्छति. However, it also common to think of this too as visarga saṃdhi and pretend that we have manuḥ gacchati मनुः गच्छति ---> manur gacchati मनुर्गच्छति.
William Dwight Whitney preferred to use the underlying -s -स् and -r -र्, as does Monier-Williams, to my knowledge. Other authors like to convert them into visarga. So while Whitney has agnis अग्निस्, agnī अग्नी, agnayas अग्नयस्, others have agniḥ अग्निः, agnī अग्नी, agnayaḥ अग्नयः.
It's up to you, whatever you feel comfortable with, but that's why Whitney is talking about -as -अस् and not -aḥ -अः, if any of that made sense?
I hope I'm right and am not leading you astray. Others will surely soon confirm or deny, but I've never heard of -as/-aḥ -अस्/-अः + va व ---> -aḥ va -अः व.