From the door there are two spaces in front that are considered part of the house (one in line with the fence, then one more in front) and then I think there needs to be another 1 block border around the house so I'd say you've got it as close as possible.
I'm pretty sure one space is fine. I've had villagers plot right next to the cliff walls before with just a space in between. Think 2 of my houses are actually in that position now actually but I'm not on my game to check
So yes, I can't think why a houses next to a cliff would be any different
Only one space is enough I've had villagers placing their houses just one square away from the cliff, or the train rails, or the path descending to beach... yeah, kinda annoying as hell
Also minding the projects, one square is all the space they need.
yeah, can confirm one space is fine... my town isn't hacked but Kitty has her house exactly one tile away from the cliff on the east side. i was really surprised lol