from pathlib import Path import json,datetime,os def assert_tuning_open(): if Path('reports/frozen_selection.json').exists(): raise RuntimeError('Model selection is frozen and test labels may be open. Use independent new data for further tuning.') p=Path(os.environ.get('SETU_BUDGET_FILE','experiments/run_budget.json')) if p.exists() and datetime.datetime.now(datetime.timezone.utc)>=datetime.datetime.fromisoformat(json.load(open(p))['deadline_utc']): raise RuntimeError('Active research budget has expired. No further training started.')