Files
EscapistsReintroduced/docs/evidence/crash-start-2026-10-03/validation/copy-frozen-archive.py
T
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

13 lines
1.0 KiB
Python

from pathlib import Path
import json,hashlib,shutil
B=Path('/tmp/erri-crash-root-1852');S=B/'frozen-source';R=Path('/home/jakub/devel/escapistsrereintroduced');n='docs/evidence/native-2026-10-03-crash-prison-default';src=S/n;dst=R/n
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()
runner=json.loads((src/'runner.json.txt').read_text());report=json.loads((src/'report.json').read_text())
assert runner['cleanup_confirmed'] and runner['source_unchanged_after_run'] and runner['external_addons_unchanged_after_run']
assert runner['result']=='smoke-completed' and report['smoke_completions']==1 and not report['script_or_runtime_failures']
manifest={str(p.relative_to(src)):sha(p) for p in src.rglob('*') if p.is_file()}
assert not dst.exists();shutil.copytree(src,dst)
for n,h in manifest.items():assert sha(dst/n)==h
(B/'frozen-archive-copy.json').write_text(json.dumps({'source':str(src),'destination':str(dst),'source_snapshot':str(S),'files':manifest},indent=2)+'\n')
print('Copied exact frozen native archive:',len(manifest),'files')