  Generating high fidelity spin-spin entanglement is an essential task of
quantum repeater networks for the distribution of quantum information across
long distances. Solid-state based spin-photon interfaces are promising
candidates to realize nodes of a quantum network, but are often limited by
spectral diffusion of the optical transition, which results in phase errors on
the entangled states. Here, we introduce a method to correct phase errors from
quasi-static frequency fluctuations after the entangled state is generated, by
shelving the emitters in the excited state to refocus the unknown phase. For
quasi-static frequency fluctuations, the fidelity is determined only by the
lifetime of the excited state used for shelving, making it particularly
suitable for systems with a long-lived shelving state with correlated spectral
diffusion. Such a shelving state may be found in Kramers doublet systems such
as rare-earth emitters and color centers in Si or SiC interfaced with
nanophotonic cavities with a strongly frequency-dependent Purcell enhancement.
The protocol can be used to generate high-fidelity entangled spin pairs without
reducing the rate of entanglement generation.
