A maintenance worker poking around above the ceiling panels of San Francisco’s brand-new bus terminal found the crack. It was, honestly, hard to miss. Running a foot and a half through a girder holding up the building’s roof, the crack could have led to catastrophe. The $2.2 billion Transbay Terminal, spanning three city blocks, expected to serve 100,000 travelers a day and lead the city and state into the future of transportation, had a broken spine.

So about six weeks after the long-delayed terminal opened, it closed. In late September 2018, buses from 11 regional transit systems—from Marin County to the north, Berkeley and Oakland to the east, the peninsula to the south—rerouted to the utilitarian, parking lot-like, temporary facility they had used since 2010, when the original terminal closed after seven decades of service. And the agencies responsible for constructing the new building set out to understand what happened and what to do about it.

This weekend, buses and passengers will finally roll into the Transbay Terminal again. Blame will eventually get assigned. The Transbay Joint Powers Authority, the designers, and multiple contractors are likely to sue one another. But the whodunnit is perhaps less interesting than the howdunnit, and the what-got-dun. Inspections found more cracks; figuring out what caused them would require forensics at scales ranging from the diameter of atoms to the width of city streets. The investigation involved physics, metallurgy, and the crystalline strength of steel at work. In the end, it would take less than 11 months for a team of science detectives to return one of San Francisco’s most important pieces of infrastructure to service.

The Transbay Terminal is enormous, a million square feet including a rooftop park and a “box” of a basement that’ll someday, we promise, accommodate trains including California’s perpetually-in-development high-speed rail system. Enrobed in an undulating white metal mesh, the building cuts east-west like a cyborg kaiju eel swimming among downtown skyscrapers, bridging two busy boulevards—First Street and Fremont Street.

This exploded view of the Transbay Terminal shows the rooftop garden, the bus deck, and First and Fremont streets passing below. Transbay Joint Powers Authority

The spans over those streets were the problem. Or rather, one span was. Both Fremont and First were bridged by two main girders, 60-foot-long tapered I-beams, three feet wide and eight feet tall in the middle. That first crack was in one of the Fremont girders; inspections soon found one more on the other side of the same girder, and another crack in a second Fremont girder. But the girders over First Street—apparently the same design and material—were fine. The mystery deepened.

That’s roughly when Robert Vecchio got the call. The chief executive of New York-based LPI, Vecchio is a PhD engineer with a specialty in fracture mechanics and fatigue; his prior investigations include the Exxon Valdez, the 1993 and 2001 terrorist attacks on the original World Trade Center towers, and the collapse of the I-35 bridge in Minneapolis. So he’s kind of used to it. “I jumped on a plane probably the next day or so and went out to San Francisco,” Vecchio says. “It was nice to hear that there wasn’t a catastrophic event.” Nice, in other words, to get called before a building fell down.

Within a day, Vecchio was up in the ceiling with engineers from the Transbay agency and Thornton Tomasetti, the structural engineer of record. Together they figured out how to install hulking hydraulic lifts to support both spans. Now they could get to work.

The brittle-fracture crack in the girder over Fremont Street was 18 inches long, through a 4-inch-thick steel flange. LPI, Inc

The first step was to remove the sections of the steel around the cracks. The girders broke along their lower flanges, the four-inch-thick horizontal plates at the bottom of the I. Engineers clambered up to the girders and slowly excised the cracked chunks with a diamond-oxide-studded cable saw, “so we could cut through it without heating it up and disturbing any of the evidence,” says Karl Frank, a civil engineer and steel-failure specialist working with Herrick, another company involved in building the terminal. “The pieces weren’t that big. They could be boxed up and shipped by truck to New York.”