"""Bind approved S3-A plan to new queue sources; does not launch workers.""" import json from pathlib import Path import shutil from freeze_g1_components import sha from run_s3a_score import review_gate from s2_recovery_supervisor import save PLAN = Path('artifacts/s3a-planning-2026-11-15') ROOT = Path('artifacts/s3a-execution-2026-11-15') SOURCES = ['tools/s3a_runtime.py', 'tools/run_s3a_fit.py', 'tools/run_s3a_queue.py', 'tools/test_s3a_queue.py', 'tools/prepare_s3a_execution.py'] def main(): c = review_gate(PLAN) ROOT.mkdir(exist_ok=False) shutil.copy2(PLAN/'contract.json', ROOT/'contract.json') shutil.copy2(PLAN/'main-review.json', ROOT/'main-review.json') save(ROOT/'implementation.json', dict(version='S3-A-queue-v1', contract_sha256=sha(ROOT/'contract.json'), review_sha256=sha(ROOT/'main-review.json'), approved_plan_commit='b0390231f0161fa55ae72494a32a38863e1b96c0', approval_slack='1794732829.567629', code_sha256={p: sha(p) for p in SOURCES}, scope='Fit queue only; stops at immutable terminal freeze, never automatically evaluates test labels', first_trials=[0, 12], dispatch='0,12 then all remaining indices in ascending order', maximum_new_fits=len(c['jobs']), GPU=False, retries=0)) save(ROOT/'prelaunch.json', dict(status='IMPLEMENTED_NOT_STARTED', contract_sha256=sha(ROOT/'contract.json'), implementation_sha256=sha(ROOT/'implementation.json'), fits_started=False, baseline_refits=0, labels_decoded=False, approved=True)) print(json.dumps(dict(root=str(ROOT), implementation_sha256=sha(ROOT/'implementation.json')))) if __name__ == '__main__': main()