Cohomology foundations of one-loop amplitudes in pure spinor superspace