Just to clarify: I don't like the QuakeSpasm method because it's dependent on a human being to not screw up.
For example, say a mapper releases a buggy V1 of a map then a few weeks later a bugfixed V2. They have the same name and go in the same gamedir. Which one does a LIT file belong to?
Maybe rather than just using the surface count, how about embedding some other counts from the original source .bsp into the header? A few other lumps interact with the faces lump, like edges, surfedges, vertexes. Stuff that can survive the hypothetical re-vis or entity embedding. Construct a "magic" from their counts; at the very least the possibility of multiple lumps having the same counts together with the same name should be so low as to be safely ignored.
There may be edge cases I've missed with this, so I'm not religiously welded to the proposal: I just want something more robust is all; how it's achieved isn't too important so long as it's sane.