Theory of nuclear-induced spectral diffusion: Spin decoherence of phosphorus donors in Si and GaAs quantum dots | Synapse