from pathlib import Path import hashlib, json, shutil root = Path(__file__).resolve().parents[2] evidence = root / 'code/tests/evidence/undo-redo-2026-11-24' paths = [root/'code/packages', root/'documents/submissions', root/'documents/slides'] files = [p for folder in paths for p in folder.rglob('*') if p.is_file()] hashes = {str(p.relative_to(root)): hashlib.sha256(p.read_bytes()).hexdigest() for p in files} (evidence/'protected-before.json').write_text(json.dumps(hashes, indent=2), encoding='utf-8') for name in ['TikZRefinery.pdf', 'TikZRefinery-Developers-Edition.pdf']: destination = root/'documents/submissions/baselines/architecture-0.1.4-alpha-before-history-2026-11-24'/name destination.parent.mkdir(parents=True, exist_ok=True) shutil.copy2(root/'documents'/name, destination) shutil.copy2(root/'HANDOFF.md', evidence/'HANDOFF-before.md') print(f'Protected {len(hashes)} files and preserved pre-implementation reports.')