"""Does the checker actually check? Copy one committed durable snapshot and
roll the last scheduler transition back to an older lease epoch, which is what
a stale scheduler writing after a takeover would look like."""
import json, sys
src, dst = sys.argv[1], sys.argv[2]
snap = json.load(open(src, encoding='utf-8-sig'))
last = snap['History'][-1]
print(f"revision {last['Revision']}: SchedulerEpoch {last['SchedulerEpoch']} -> {last['SchedulerEpoch'] - 1}")
last['SchedulerEpoch'] -= 1
json.dump(snap, open(dst, 'w'))
