Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
28 lines
2.5 KiB
Python
28 lines
2.5 KiB
Python
"""Read-only exact suite reuse proof; four independently reviewed prose deltas only."""
|
|
from pathlib import Path
|
|
import ast,hashlib,json
|
|
REVIEW=Path('/tmp/erri-playtest-review-0150/preflight.json')
|
|
ALLOWED={'docs/current-status.md','docs/mounted-interception.md','docs/original-feature-coverage.json','docs/original-feature-coverage.md'}
|
|
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']==294==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))==294
|
|
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 {x['path'] for x in differences}==ALLOWED, 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']==294 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 four reviewed prose-only deltas','regression_programs':294,'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}
|