* fix(core): clean up orphaned temp files on atomic write failure * fixed reviewer suggestion * removed whitespace