SAN FRANCISCO — For years, a school principal’s job was to make sure students were not creating a ruckus in the hallways or smoking in the bathroom. Vigilance ended at the schoolhouse gates.