The relevant text for the class feature (as errata'd; I think the old version, which simply increased the range at which the sniper could sneak attack, is better if for no other reason than it doesn't invoke this question):
when the sniper makes an attack against a target who is within [range] and completely unaware of his presence
There are some obvious cases: if the target is asleep (and there are no extenuating factors), they're clearly "completely unaware" of the sniper's presence. Similarly, if the target is talking to the sniper, they are clearly aware of the sniper's presence.
As the GM, I will need to figure out how to handle the in-between cases; off the top of my head:
- the target is aware of the party generally but not the sniper in particular - they heard the party fighting in the next room and are buffing or something
- the target can see some of the party members but the sniper was able to hide from the target
- the target is a shifter of some sort and has talked to the sniper in their persona as captain of the guard, but is now encountering the party in their persona as the head of the Evil Cult of Evil(tm); the shifter is invisible, magically silenced, incorporeal, flying, and hiding in shadows. The target is clearly aware of the sniper (they've talked in the past), but has no reason to think that the sniper is currently 15 feet behind them, Ghost Touch bow drawn.
The only other place in the SRD I've found with similar wording (and intentionality) is the Divine Fighting Technique Way of the Silent Shiv, which says
Whenever you attack an opponent that is completely unaware of your presence (such as when you are using the Stealth skill or invisible)
which makes me think I'm overthinking the sniper ability.
So, is it that simple: stealth vs. perception (with, eg., tremorsense trumping stealth), or are there other factors that need to be taken into account?