Files
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

24 lines
2.1 KiB
Python

from pathlib import Path
import sys,json,hashlib,shutil,subprocess
R=Path('/home/jakub/devel/escapistsrereintroduced');B=Path(__file__).parent;F=R/'.build/playtest-source-2026-10-04-ui-bmp';S=Path('/tmp/erri-native-root-20261004');N=R/'docs/evidence/native-2026-10-04-ui-bmp-normal-route'
sys.path.insert(0,str(R/'tools'))
from source_manifest import addon_manifest
from suite_binding import checked_inputs,sha,load
inputs,changes,result=checked_inputs(R,S);authored=addon_manifest(R)
assert authored==load(N/'launch-source-sha256.json')==load(N/'source-sha256.json')
runner=load(N/'runner.json.txt');assert runner['cleanup_confirmed'] and runner['source_unchanged_after_run'] and runner['external_addons_unchanged_after_run']
assert sha(N/'launch-source-sha256.json')==runner['launch_source_sha256'] and sha(N/'console.log.txt')==runner['console_sha256']
from native_report import analyze
report=load(N/'report.json');assert analyze((N/'console.log.txt').read_text(),report['log'])==report
assert report['smoke_completions']==1 and report['assertions_passed']>0 and not report['script_or_runtime_failures']
assert not F.exists() and not F.is_symlink();F.mkdir()
for n,h in inputs.items():
p=F/n;p.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(R/n,p);assert sha(p)==h,n
for n,h in inputs.items():assert sha(R/n)==h,n
assert addon_manifest(F)==authored
write=lambda p,v:p.write_text(json.dumps(v,indent=2)+'\n')
write(B/'baseline.json',{'files':inputs,'authored':authored,'staged_diff_sha256':hashlib.sha256(subprocess.check_output(['git','diff','--cached','--binary'],cwd=R)).hexdigest(),'frozen_root':str(F),'suite_reused_from':str(S),'suite_result_sha256':sha(S/'suite-result.json')})
write(F/'frozen-source.json',authored);write(B/'authored.json',authored);write(B/'frozen-inputs.json',inputs)
write(B/'binding-inputs.json',{'suite_files':{n:sha(S/n) for n in ['suite-inputs.json','suite-result.json','suite.log','post-suite-docs.json']},'post_suite_docs':changes,'frozen_inputs':inputs})
print('Frozen',len(authored),'authored files;',result['regression_programs'],'registered programs bound')