Files
EscapistsReintroduced/docs/evidence/hunter-capture-2026-10-02/independent/review_integration.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

26 lines
6.3 KiB
Python

from pathlib import Path
import json,hashlib,ast,subprocess,sys
r=Path('/home/jakub/devel/escapistsrereintroduced');b=Path('/tmp/erri-gameplay-root-2237');p=Path('/tmp/erri-hunter-capture-2237');o=Path('/tmp/erri-hunter-capture-review-2237');e=r/'docs/evidence/native-2026-10-02-hunter-capture-normal'
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest();load=lambda p:json.loads(p.read_text())
sys.dont_write_bytecode=True;sys.path.insert(0,str(r/'tools'));from source_manifest import addon_manifest;from native_report import analyze
proposal=load(p/'source-manifest.json');assert all(sha(r/n)==h for n,h in proposal['files'].items())
old=r/'.build/playtest-source-2026-10-02-convoy-survivors/tools/check.py';new=(r/'tools/check.py').read_text();assert new.replace("'test_hunter_capture.py', ",'')==old.read_text()
source=addon_manifest(r);assert source==load(e/'source-sha256.json')==load(e/'launch-source-sha256.json');suite=load(b/'suite-result.json');assert suite['exit']==0 and suite['inputs_unchanged'] and not suite.get('resumed')
constants=sorted((n for n in ast.walk(ast.parse(new)) if isinstance(n,ast.Constant) and isinstance(n.value,str) and n.value.endswith('.py') and (Path(n.value).name.startswith('test_') or n.value.endswith('_regression.py'))),key=lambda n:(n.lineno,n.col_offset));expected=['tests/'+Path(n.value).name for n in constants]
assert len(expected)==len(set(expected))==suite['regression_programs']==292;assert [x['path'] for x in suite['programs']]==expected;assert all(x['exit']==0 for x in suite['programs']);assert 'All repository checks passed.' in (b/'regressions.log').read_text()
inputs=dict(source)
for folder in ['tests','tools','terrain-profiles','terrain-adapters','terrain-integrations']:
inputs.update({str(q.relative_to(r)):sha(q) for q in (r/folder).rglob('*') if q.is_file() and '__pycache__' not in q.parts and q.suffix!='.pyc'})
inputs.update({str(q.relative_to(r)):sha(q) for q in (r/'docs').iterdir() if q.is_file()})
for n in ['README.md','.gitignore']:inputs[n]=sha(r/n)
assert inputs==load(b/'suite-inputs.json')
nr=load(e/'runner.json.txt');report=load(e/'report.json');assert report==analyze((e/'console.log.txt').read_text(),report['log']);assert sha(e/'console.log.txt')==nr['console_sha256'];assert sha(e/'launch-source-sha256.json')==nr['launch_source_sha256']==nr['end_source_sha256'];assert all(nr[k] for k in ['cleanup_confirmed','source_unchanged_after_run','external_addons_unchanged_after_run']);meta=load(e/'launch-source.json');assert nr['launch_id']==meta['launch_id'];raw=Path(nr['session']);assert (raw/'console.log').read_bytes()==(e/'console.log.txt').read_bytes()
baseline=load(b/'baseline.json');allowed={'tests/test_convoy_survivors.py','addons/core/Scripts/Game/ERR/10_AI/ERR_ConvoyService.c','addons/core/Scripts/Game/ERR/10_AI/ERR_HunterService.c','tests/test_hunter_lifecycle.py','tools/check.py'};changed={n for n,h in baseline['files'].items() if not (r/n).is_file() or sha(r/n)!=h};assert changed==allowed
index=hashlib.sha256(subprocess.check_output(['git','diff','--cached','--binary'],cwd=r)).hexdigest();assert index==baseline['index_diff_sha256']
original=load(Path('/tmp/erri-heartbeat-20260930-1542-reference.json'));assert len(original)==533;assert all(sha(Path('/home/jakub/devel/escapists')/n)==h for n,h in original.items())
root=r/'.build/playtest-2026-10-02-convoy-survivors';seal=r/'docs/evidence/playtest-refresh-2026-10-02-convoy-survivors/candidate-sha256.json';actual={str(q.relative_to(root)):sha(q) for q in root.rglob('*') if q.is_file()};assert actual==load(seal)
aborted=b/'aborted-preintegration-check';reason=load(aborted/'reason.json');assert reason['exit']==130 and reason['suite_aborted'];assert not (aborted/'suite-result.json').exists();before=load(aborted/'suite-inputs.json');assert before!=inputs;assert 'All repository checks passed.' not in (aborted/'regressions.log').read_text()
finalizer=b/'finish.py';ast.parse(finalizer.read_text())
d={'complete':True,'decision':'Exact integrated source and fresh complete suite/normal native evidence approved for bounded documentation/evidence finalization.','reviewed_source_test_hashes':proposal['files'],'tools_check_sha256':sha(r/'tools/check.py'),'registration_only_change':True,'authored_files':len(source),'suite':{'programs':292,'fresh':True,'exit':0,'exact_registered_order':True,'full_current_input_inventory_equal':True,'seconds':suite['seconds'],'result_sha256':sha(b/'suite-result.json'),'inputs_sha256':sha(b/'suite-inputs.json'),'log_sha256':sha(b/'regressions.log')},'normal':{'assertions':report['assertions_passed'],'completions':report['smoke_completions'],'script_failures':len(report['script_or_runtime_failures']),'engine_errors':len(report['engine_errors']),'raw_console_archive_exact':True,'report_recomputed':True,'source_current_launch_end_exact':True,'cleanup_source_external_unchanged':True,'console_sha256':nr['console_sha256'],'launch_manifest_sha256':nr['launch_source_sha256']},'preservation':{'baseline_paths':len(baseline['files']),'changed_existing_paths':sorted(changed),'only_added_test':'tests/test_hunter_capture.py','index_unchanged':True,'index_diff_sha256':index,'original533_unchanged':True,'latest_candidate_files':len(actual),'candidate_seal_sha256':sha(seal),'latest_candidate_exact':True},'aborted_preintegration':{'excluded_from_qualification':True,'parent_reason':reason,'no_complete_suite_result':True,'input_manifest_differs_from_final':True,'sha256':{q.name:sha(q) for q in aborted.iterdir() if q.is_file()}},'finalizer':{'sha256':sha(finalizer),'source_review_no_blocker':True,'gates_current_suite_and_normal_hashes':True,'preserves_aborted_attempt_and_latest_package':True,'writes_current_status_only_plus_new_evidence_directory':True,'no_native_capture_or_new_package_claim':True,'executed_by_reviewer':False},'limits':['Fresh full suite and normal native prove modeled policy, compilation and ordinary-loop integration only. No native capture timing, multiplayer or FPS claim.','Existing convoy-survivors package intentionally predates this source fix; no package refresh performed.','Strict thirteen installed engine errors remain retained.'],'reviewer_target_edits':False,'reviewer_native_or_compiler_runs_for_integration':False}
(o/'integration-review.json').write_text(json.dumps(d,indent=2)+'\n');print(json.dumps({'path':str(o/'integration-review.json'),'sha256':sha(o/'integration-review.json'),'normal':d['normal'],'preservation':d['preservation']},indent=2))