Tragedy of the commons comes from a lack of regulation. Put all the regulation you want, but make sure to guarantee your people live by a humane standard.
If San Francisco is handing out free homes to all who come, how would that not be a tragedy of the commons situation? “Everyone can come to SF to live by a humane standard” will never work.
Ok, I totally agree with that. We will never be able to solve the “how can anyone who wants to live in SF do so humanely” problem but we have a shot of doing it in a region with limited immigration (or humane is applied to legal residents only), like Singapore or Finland.