As San Francisco struggles under ballooning pension and health care costs, the city’s retirees will receive unexpected cost-of-living bonuses totaling $170 million. The city’s anticipated budget deficit for the coming year is $360 million.