Saeviomagy said:
...
A former ally of the party, that the party has suspicions about, but never really decided was an enemy is, unknown to the party, invisibly present - does he get blessed? Does the answer change depending on whether he really is an ally or an enemy?
...
That really depends on if you think magic targeting is a metaphysical matter (what is acctually the case) or an epistemological matter (what you know to be the case). If not spell casting in general, at least if the designation of ally is knowledge-based or reality-based.
Similarly the doppleganger cases come to the same point. Does Bless target as a matter of who really is an ally or just who you think is an ally?
Cases like this might be useful to see what your intuitions on it are, but I don't think the RAW ever touches on the matter, although I could be wrong
To avoid silly linguistic/philosophical matters like this I tend to say 'ally' is equivalent to 'party member' (unless the party is attacking itself) and 'enemy' to mean 'thing trying to injure party member'.
Anyway, decide if you think magic targeting is a matter of what you think is the case or what really is the case and you have your answers to the tough questions (or show where the RAW says one way or the other).
If I had to go one way or the other, then I would tend to go with magic being knowledge-based in instances like targeting allies. If it were who was acctually an ally or not, then a smart mage could easily come up with a handy spell:
Mageo's Handy Ally Detector: all allies in a 30-ft. radius acquire an illusiory blue nimbus around their head.
Anyone without a blue glowing ring around their head after this spell is cast is either an enemy or simply not-an-ally. You could have a similar spell where on a failed save a red-ring indicated enemy. I think for this reason, if no other, ally-desnignation would need to be knowledge-based.
It should be noted then that if it is knowledge-based then it wouldn't necessarily be whoever has ever been an ally of the caster, but who the caster is currently thinking about being an ally, and thus the caster should enumerate all entities who he/she thinks are allies (and if someone is an ally and invisible and in the area and is not enumerated then they do not benefit from the Bless).
my 2 cp.
as an edit to continue my thought:
if it is knowledge-based then the doppleganger might not receive the bless even if he is perfectly disguised as an ally because he is not the entity refered to by 'Bob' when the caster says 'Bob' is an ally.
However, if the caster were to physically point out each ally, then he might mistakenly point out the doppleganger (and it would get the benefit of bless).
So, if ally-designation is knowledge-based are entity-references ever able to be tricked. When I say, "My allies for this spell are Squarehead, Blockman, Smilyface, and Myself" am I picking out the entities or am I picking out who I take to be the entities? I could still pick out specific entities who I think are allies (and be wrong that they are allies) and it would be knowledge based.
It's a similar designation to saying "The Joker wants to kill Batman, but he doesn't want to kill Bruce Wayne". That statement is simply false because Batman is necessarily identical to Bruce Wayne (unless you have a very bizzare theory of the world) and if The Joker wants to kill Batman, then he also necessarily wants to kill Bruce Wayne, he's just confused and doesn't know that by wanting to kill BM he really wants to kill BW because they just are the same person.
I think this is really just a giant can of worms if you have much to do with philosophy of language / mind / metaphysics and try to make sense of games in the light of that. Bad idea.