Structural transitions and mechanochemical coupling in the nucleoprotein filament explain homology selectivity and Rad51 protein cooperativity in cellular DNA repair.