I should know this, but I think it has always bothered me. Take δημοκρατία. Suppose we look in the dictionary and get the genitive also: δημοκρατίαs. (It is often said that if if you have the nominative and the genitive, then you can figure out the declension. Indeed, LSJ just gives the two cases.) But how do we know that the iota isn't short and that the noun doesn't belong to the short vowel feminine alpha declension?

It's not just about this word. There is a whole class of long alpha declension nouns that end in iota-alpha. And more generally, I've always been bothered (in the back of my mind) by the whole matter of long and short vowels as it relates to the matter of accent placement. Sometimes authors, such as Mastronarde, will indicate long vowels; but I have always doubted my ability to determine the vowel length in all the other instances. Perhaps the problem is just one in the neighborhood of the alpha declensions; I haven't thought about it in a while. But maybe it crops up elsewhere. I don't have another kind of example handy, but there may be some.

so the answer to your query, at least as i understand your query, is this - you can see from the dictionary entry δημοκρατία that it's not short-alpha ending, otherwise it'd be *δημοκράτια in the dictionary, which it isn't.

highly recommend that you work through probert's new guide to accentuation of ancient greek. there's a chapter or two on base accents which covers this point.

for getting more comfortable with quantity in general, the most useful thing i did was lots of verse comp – you spend a lot of time looking up the quantity of vowels by seeing them in non-anceps positions in iambic tris – to see some e.g.s from my own notes, see pgs 58 and ff. of my notes on tragic iambic verse comp, particularly the lines in red on the left-hand side (where i've looked up each doubtful vowel in anceps position and found its quantity by finding another verse where that doubtful vowel is not in anceps position)

if all those references to anceps etc. are vocab overload, perhaps have a go at my intro to iambic verse comp article, where i tried to "hide" the main rules for verse comp in a much simpler technique where you just slot words into a table:

I went back and looked more closely at Mastronarde and he does say that the short-alpha endings "tend" to be indicated by the accent. In other words, just as you say, "you can see from the dictionary entry δημοκρατία that it's not short-alpha ending, otherwise it'd be *δημοκράτια in the dictionary, which it isn't." I missed it because usually his accent discussions are paragraphs unto themselves.

Thanks for the links and the recommendations. I will look at them when I begin Sophocles. I just need to finish Thucydides first.