Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
31 lines
2.8 KiB
Python
31 lines
2.8 KiB
Python
"""Read-only reuse of the sealed crash suite; no compiler/native process."""
|
|
from pathlib import Path
|
|
import ast,hashlib,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):
|
|
from source_manifest import addon_manifest
|
|
pin_path=Path(__file__).with_name('binding-inputs.json');pin=load(pin_path)
|
|
for name,digest in pin['suite_files'].items(): assert sha(suite/name)==digest,name
|
|
inputs=load(suite/'suite-inputs.json'); result=load(suite/'suite-result.json')
|
|
assert result['exit']==0 and result['inputs_unchanged'] is True and not result.get('resumed')
|
|
assert result['regression_programs']==len(result['programs'])==307
|
|
assert len({x['path'] for x in result['programs']})==307 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))==307
|
|
assert {x['path'] for x in result['programs']}=={'tests/'+Path(n).name for n in registered}
|
|
assert addon_manifest(f)==authored and len(authored)==437
|
|
assert all(inputs.get(n)==h for n,h in authored.items())
|
|
# Detect new/missing inputs in every recursively recorded execution scope.
|
|
for folder in ['tests','tools','terrain-profiles','terrain-adapters','terrain-integrations']:
|
|
actual={str(p.relative_to(f)) for p in (f/folder).rglob('*') if p.is_file() and '__pycache__' not in p.parts and p.suffix!='.pyc'}
|
|
assert actual=={n for n in inputs if n.startswith(folder+'/')},folder
|
|
assert {str(p.relative_to(f)) for p in (f/'docs').iterdir() if p.is_file()}=={n for n in inputs if n.startswith('docs/') and len(Path(n).parts)==2}
|
|
current={n:sha(f/n) for n in inputs} # Includes retained historical test fixtures.
|
|
differences={n:{'before_sha256':h,'after_sha256':current[n]} for n,h in inputs.items() if h!=current[n]}
|
|
assert differences==pin['post_suite_docs']==load(suite/'post-suite-docs.json'),differences
|
|
assert set(differences)=={'docs/current-status.md','docs/mission-starts.md','docs/original-feature-coverage.json'}
|
|
assert 'All repository checks passed.' in (suite/'full-suite.log').read_text()
|
|
return {'kind':'reused complete frozen suite; exact authored source/tests/tools and three recorded documentation updates','regression_programs':307,'suite_inputs_sha256':sha(suite/'suite-inputs.json'),'suite_result_sha256':sha(suite/'suite-result.json'),'suite_log_sha256':sha(suite/'full-suite.log'),'binding_inputs_sha256':sha(pin_path),'documentation_differences':differences,'fresh_full_suite_claimed':False,'historical_fixture_hashes_verified':True,'live_source_equivalence_claimed':False}
|