Sort files before pruning them
Memoize output_file output so that it stays the same even if a task runs into the next day.