"""Execution pins and one-main-review gate; original approved code stays unchanged.""" from pathlib import Path from freeze_g1_components import sha from s2_custody_common import checked, read_json from run_s3a_score import review_gate def contract(root): root = Path(root) c = review_gate(root) implementation = read_json(root/'implementation.json') if implementation['contract_sha256'] != sha(root/'contract.json'): raise ValueError('Implementation bound to different scientific contract') checked(root/'main-review.json', implementation['review_sha256']) for path, digest in implementation['code_sha256'].items(): checked(path, digest) frozen = read_json(root/'implementation-freeze.json') if not frozen.get('git_commit') or frozen['implementation_sha256'] != sha(root/'implementation.json'): raise ValueError('Implementation must be Git frozen before launch') if len(c['jobs']) != 390 or len(c['cells']) != 30 or c['limits']['worker_cpu_seconds'] != 72000: raise ValueError('Unexpected S3-A scope') return c