Saving the breach flag and day-start value together fixes the restart problem you describe. I would also test a restart during the file write: if the saved state is missing or unreadable, new entries should stay disabled until it is restored, rather than use the current equity as a fresh baseline. Does the revised version keep the halt in that interrupted-write case?