Files
EscapistsReintroduced/docs/evidence/playtest-refresh-2026-10-04-ui-bmp/independent-final-check.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

46 lines
5.5 KiB
Python

from pathlib import Path
import sys,json,hashlib,re,runpy
B=Path(__file__).parent
# Re-run only read-only static hash/provenance checks; no tests/native or candidate writes.
runpy.run_path(str(B/'independent-static-check.py'))
R=Path('/home/jakub/devel/escapistsrereintroduced');F=R/'.build/playtest-source-2026-10-04-ui-bmp';C=R/'.build/playtest-2026-10-04-ui-bmp';E=R/'docs/evidence/packed-2026-10-04-ui-bmp';P=Path('/tmp/erri-packed-chat-ui-bmp-20261004')
sys.path.insert(0,str(F/'tools'))
from packed_external import inventory,evidence
import headless_game
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest();load=lambda p:json.loads(p.read_text())
def tree(p):return {str(q.relative_to(p)):sha(q) for q in sorted(p.rglob('*')) if q.is_file()}
runner=load(P/'packed-runner.json');report=load(P/'packed-startup-report.json');manifest=load(P/'packed-input-provenance.json');logs=Path(runner['session'])
assert logs.resolve().is_relative_to(P.resolve())
assert manifest['schema_version']==4 and manifest['kind']=='packed-chat-external-runtime-input' and manifest['project']=='chat' and manifest['addon_order']==['core']
assert runner['cleanup_confirmed'] and runner['packed_inputs_unchanged_after_run'] and runner['packed_external_inputs_unchanged_after_run']
assert runner['runner_error'] is None and runner['packed_input_error'] is None
assert runner['packed_launch_id']==manifest['launch_id'] and runner['packed_input_provenance_sha256']==sha(P/'packed-input-provenance.json')
assert manifest['captured_unix']<=runner['started_unix']<=runner['stopped_unix']
assert runner['console_sha256']==sha(logs/'console.log')
assert runner['result']=='game-failed' and runner['failure_observed_during_polling'] and not runner['packed_consumption_verified']
assert runner['display']=='headless Gamescope' and runner['audio']=='-noSound plus own silent sink'
for rootname,logname in [('packed-runner.json','runner.json'),('packed-input-provenance.json','packed-input-provenance.json'),('packed-startup-report.json','game-startup-report.json')]:
assert (P/rootname).read_bytes()==(logs/logname).read_bytes()==(E/rootname).read_bytes()
assert (logs/'console.log').read_bytes()==(E/'console.log.txt').read_bytes()
packed={'input':Path(manifest['runtime_directory']),'external_records':manifest['external_addons'],'external_names':manifest['external_project_names']}
raw=evidence((logs/'console.log').read_text(),packed,Path(runner['executable']).parents[3],Path(manifest['profile']),headless_game)
assert all(report[k]==v for k,v in raw.items())
for k in ['normal_mission_ready','local_participant_verified','packed_loaded_paths_verified','packed_normal_modules','workbench_undefined']:assert report[k],k
assert not report['unexpected_smoke_fixture'] and not report['script_or_runtime_failures'] and not report['packed_input_violations']
assert report['external_addon_count']==7 and len(report['engine_errors'])==17
normal=lambda rows:sorted(re.sub(r'\s+',' ',re.sub(r'^\d\d:\d\d:\d\d\.\d+\s*','',x)).strip() for x in rows)
assert normal(report['engine_errors'])==normal(load(R/'docs/evidence/packed-2026-10-03-crash-start/packed-startup-report.json')['engine_errors'])
handoff=load(C/'handoff.json');assert inventory(C/'packages')==inventory(P/'input/addons')==manifest['artifacts']==handoff['runtime_files']
assert handoff['normal_mission_ready'] and handoff['local_participant_verified'] and handoff['packed_script_failures']==0 and handoff['packed_resource_errors']==17
assert handoff['repository_regression_programs']==309 and not handoff['strict_packed_consumption_verified'] and not handoff['release_qualified'] and not handoff['published']
assert handoff==load(R/'docs/evidence/package-2026-10-04-ui-bmp/handoff.json')
for n,v in load(E/'archive-sha256.json').items():assert sha(E/n)==v
assert not C.is_symlink() and not any(q.is_symlink() for q in C.rglob('*'))
files=tree(C)
r=load(B/'independent-static-review.json');r.pop('pending');r.update(complete=True,approved=True,blockers=[],candidate=str(C),candidate_files=files)
r['packed']={'runner_sha256':sha(P/'packed-runner.json'),'manifest_sha256':sha(P/'packed-input-provenance.json'),'report_sha256':sha(P/'packed-startup-report.json'),'console_sha256':sha(logs/'console.log'),'archive_seal_sha256':sha(E/'archive-sha256.json'),'launch_id':manifest['launch_id'],'raw_evidence_recomputed':True,'runtime_manifest_exact':True,'normal_mission_ready':True,'local_prisoner_verified':True,'script_failures':0,'known_engine_errors':17,'strict_result':'game-failed','strict_consumption_verified':False,'cleanup_inputs_external_unchanged':True}
r['finalizer_review']='Exact reviewed finish.py requires root-approved SHA of this review and whole candidate_files equality twice before writes; only candidate README may then change. Final prose accurately scopes unqualified development, retained strict errors and no natural injury/interception/human escape/MP/FPS qualification.'
r['limits']=['Source/test/tool regression evidence reused from exact full309 pass with two separately pinned later prose changes; no new full-suite run by reviewer.','Exact-source normal route64/1/0script13engine and ordinary packed mission/local prisoner0script17engine; retained strict packaging and startup verdicts are not clean release acceptance.','No installed runtime replaced, no Workshop/publication, no human input/escape, multiplayer/JIP/reconnect or performance qualification.']
q=B/'independent-review.json';q.write_text(json.dumps(r,indent=2)+'\n');assert tree(C)==files
print(json.dumps({'complete':True,'candidate_files':len(files),'review_sha256':sha(q)}))