  We find half-wormhole solutions in Jackiw-Teitelboim gravity by allowing the
geometry to end on a spacetime D-brane with specific boundary conditions. This
theory also contains a Euclidean wormhole which leads to a factorization
problem. We propose that half-wormholes provide a gravitational picture for how
factorization is restored and show that the Euclidean wormhole emerges from
averaging over the boundary conditions. The wormhole is known to be dual to a
Sachdev-Ye-Kitaev (SYK) model with random complex couplings. We find that the
free energy of the half-wormhole is strikingly similar to that of a single
realization of this SYK model. These results suggest that the gravitational
path integral computes an average over spacetime D-brane boundary conditions.
