Michael Silverbane
Adventurer
He can't sneak attack because essentially he's been caught and his position is pinpointed.
This...
In the OP case, the rogue is entering the domain of the rat... who pinpoints him, ruining the sneak attack.
And this... are incorrect. Even though the rat can pinpoint the rogue's location, the rat cannot see the rogue, who still has concealment due to the darkness. The rogue may still sneak attack the rat.