Only commit checkpoints to the object store if the run of the stage or assembler was successful. Otherwise we commit a empty, corrupted or old tree to the store. Any subsequent run might then pick up that bogus tree as a starting point.
dir_fd
os.scandir()