Which rig writes. It is recorded in the manifest, and only a manifest it wrote is trusted.
Allow a directory that is not empty. The files the previous run's manifest lists are removed and replaced; everything else is kept, and a file that would be overwritten but is not in that manifest stops the run before anything changes.
How WriteGeneratedFiles treats a directory that already holds files.