Somehow — and we're not precisely sure of the precise sequence of events — it seems that I managed to break the bike chain. The broken chain then got itself entangled in the rear derailleur. Since I was still pedaling, fairly hard, this caused the rear derailleur to be ripped from the frame.
All of this happened within the space of about a second. The next second would be even more exciting.
Since I was still pedaling, and the chain was still on the front chainring, the derailleur was then dragged through the narrow space between the rear wheel and the right-side seatstay. Since this part of the frame is a crispy brittle carbon fiber tube, the derailleur managed to take a nice chunk of tube with it as it went sailing past.
This is an interesting bit of damage. I'd never seen it before and although the bike, after a bit of chain tool activity, was still seemingly ridable, it was difficult to know exactly how dire a problem it was. Unlike steel which will bend considerably, carbon fiber tends to fail all at once and catastrophically. So it's a safe conclusion that this is a big problem.
The internet wasn't terribly helpful. Apparently, this is not an uncommon thing. There's a company outside of Santa Cruz called Calfee Design which seems to do almost all the repair work for everybody and everybody seems to recommend their work. Sadly, their work starts at a $300 minimum, requires the entire frame to be stripped down and shipped, and they don't make any particular guarantees.
The first bikeshop people I talked to were anxious to sell me a new bike. A friend who knows a thing or two about frames said to chuck it and buy a new frame. Trek, the company who made the frame with the brittle part right there in the derailleur flight path, would happily sell me a new frame through their "crash replacement" program which borders on a complete scam and briefly made me hate them.
Things weren't looking good.
Then I ran into James at the Missing Link bike shop in Berkeley. While everyone else had been pessimistic and dour, James was brim full of gung ho. And while he had no actual personal experience in this department, he knew someone who had heard of someone who had done it himself.
Good enough! This was precisely the encouragement I needed. So I rolled the bike home and set about figuring out what I'd need.
The entire project took three days, almost all of that spent waiting for stuff to dry. Materials mostly came from TAP Plastics, a local chain selling all kinds of fascinating and deadly polymers. There's a large selection of cheaper alternatives on the internet but I wanted to get this done in a hurry. You probably have a similar place in your nearest large urbanization.
What follows is a set of photos and notes on the process. I hope this is helpful. As far as whether this is a safe or effective way to repair a frame, you're on your own. Seek the advice of a qualified professional. I am neither.