"""Persist static progress while the chain-overlap comparison is running."""
import json,datetime,os
from pathlib import Path
O=Path(__file__).resolve().parents[1]/'results/r81'
def update(phase,completed,total,detail):
 data={'phase':phase,'completed':completed,'total':total,'detail':detail,'updated_utc':datetime.datetime.now(datetime.timezone.utc).isoformat(),'note':'Last recorded update; this file alone does not establish that a process is running.'};tmp=O/'progress.json.tmp';tmp.write_text(json.dumps(data,indent=2)+'\n');os.replace(tmp,O/'progress.json')
