from pathlib import Path import shutil, hashlib, re, json root = Path('.') original = root/'output/original_submission' original.mkdir(exist_ok=True) files = ['handoff.md', 'requirements.csv', 'check_deliverables.py'] for name in files: dest = original/name if dest.exists(): raise RuntimeError('Original snapshot already exists; will not overwrite') shutil.copyfile(root/'output'/name, dest) manifest = {name: hashlib.sha256((original/name).read_bytes()).hexdigest() for name in files} (original/'sha256.json').write_text(json.dumps(manifest, indent=2)+'\n') archive = (root/'inputs/archive.md').read_text() parts = re.split(r'^## ', archive, flags=re.M)[1:] for part in parts: if not part.startswith('NOTE-'): print('## '+part.strip()+'\n') notes = [part for part in parts if part.startswith('NOTE-')] assert len(notes) == 60 for note in notes: for phrase in ['not launch acceptance', 'No production approval was granted', 'preserve existing customer data and attach evidence', 'Atlas Mobile experiment is not part of Atlas Web release scope', 'not a measured service guarantee']: assert phrase in note, (note[:8], phrase) print('Checked all 60 routine notes for the shared qualifications used in the handoff.') print('Original submission preserved; SHA-256 manifest written.')