Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
27 lines
2.4 KiB
Python
27 lines
2.4 KiB
Python
"""Read-only exact suite reuse proof; independently reviewed documentation-only deltas."""
|
|
from pathlib import Path
|
|
import ast,hashlib,json
|
|
REVIEW=Path('/tmp/erri-playtest-review-0644/preflight.json')
|
|
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
|
|
def load(p):return json.loads(p.read_text())
|
|
def verify_suite_binding(f,suite,authored):
|
|
inputs=load(suite/'suite-inputs.json');result=load(suite/'suite-result.json');review=load(REVIEW)
|
|
assert review['complete'] is True and review['reuse_allowed'] is True
|
|
assert result['exit']==0 and result['inputs_unchanged'] and not result.get('resumed')
|
|
assert result['regression_programs']==len(result['programs']) and all(x['exit']==0 for x in result['programs'])
|
|
registered=[n.value for n in ast.walk(ast.parse((f/'tools/check.py').read_text())) if isinstance(n,ast.Constant) and isinstance(n.value,str) and n.value.endswith('.py') and (n.value.split('/')[-1].startswith('test_') or n.value.endswith('_regression.py'))]
|
|
assert len(registered)==len(set(registered))==result['regression_programs']
|
|
assert {x['path'] for x in result['programs']}=={'tests/'+Path(n).name for n in registered}
|
|
assert all(inputs.get(n)==h for n,h in authored.items())
|
|
current={n:sha(f/n) for n in inputs}
|
|
differences=[{'path':n,'before':h,'after':current[n]} for n,h in sorted(inputs.items()) if current[n]!=h]
|
|
assert all(x['path'].startswith('docs/') for x in differences), differences
|
|
binding=review['suite']
|
|
assert binding['inputs_sha256']==sha(suite/'suite-inputs.json') and binding['result_sha256']==sha(suite/'suite-result.json')
|
|
assert binding['programs']==result['regression_programs'] and binding['source_tests_tools_unchanged'] is True
|
|
assert sorted(binding['docs_only_differences'],key=lambda x:x['path'])==differences
|
|
assert review['current_inputs']==current and review['authored_files']==len(authored)
|
|
assert review['native']['source_match'] is True
|
|
assert 'All repository checks passed.' in (suite/'full-suite.log').read_text()
|
|
return {'kind':'reused completed suite; unchanged authored source/tests/tools with independently reviewed documentation-only deltas','regression_programs':result['regression_programs'],'suite_inputs_sha256':sha(suite/'suite-inputs.json'),'suite_result_sha256':sha(suite/'suite-result.json'),'suite_log_sha256':sha(suite/'full-suite.log'),'independent_review':str(REVIEW),'independent_review_sha256':sha(REVIEW),'documentation_differences':differences,'fresh_full_suite_claimed':False}
|