Files
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

41 lines
5.4 KiB
Python

from pathlib import Path
import hashlib,json,shutil,subprocess,sys
r=Path('/home/jakub/devel/escapistsrereintroduced');b=Path('/tmp/erri-gameplay-root-0011');e=r/'docs/evidence/active-restart-current-2026-10-03';ne=r/'docs/evidence/native-2026-10-03-active-restart-current'
load=lambda p:json.loads(p.read_text())
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()
def write(p,v):p.write_text(json.dumps(v,indent=2)+'\n')
base=load(b/'baseline.json');assert all((r/n).is_file() and sha(r/n)==h for n,h in base['files'].items())
suite=load(b/'suite-result.json');inputs=load(b/'suite-inputs.json')
assert suite['exit']==0 and suite['inputs_unchanged'] and suite['regression_programs']==292
assert len({x['path'] for x in suite['programs']})==292 and all(x['exit']==0 for x in suite['programs'])
assert all(sha(r/n)==h for n,h in inputs.items())
sys.path.insert(0,str(r/'tools'));from source_manifest import addon_manifest
source=addon_manifest(r);runner=load(ne/'runner.json.txt');report=load(ne/'report.json')
assert source==base['source']==load(ne/'source-sha256.json')==load(ne/'launch-source-sha256.json')
assert report['assertions_passed']==21 and report['smoke_completions']==2 and not report['script_or_runtime_failures'] and len(report['engine_errors'])==13
assert runner['cleanup_confirmed'] and runner['source_unchanged_after_run'] and runner['external_addons_unchanged_after_run'] and sha(ne/'console.log.txt')==runner['console_sha256']
log=(ne/'console.log.txt').read_text()
for n in [1,2]:assert f'ERR SMOKE COMPLETE: native-end round={n} preparing=0' in log
assert 'ERR SMOKE PASS: native-end second independently initialized instance removes its own marker' in log
index=hashlib.sha256(subprocess.check_output(['git','diff','--cached','--binary'],cwd=r)).hexdigest();assert index==base['index_diff_sha256']
original=load(Path('/tmp/erri-heartbeat-20260930-1542-reference.json'));assert all(sha(Path('/home/jakub/devel/escapists')/n)==h for n,h in original.items())
candidate=r/'.build/playtest-2026-10-02-convoy-survivors';seal=load(r/'docs/evidence/playtest-refresh-2026-10-02-convoy-survivors/candidate-sha256.json');assert {str(p.relative_to(candidate)):sha(p) for p in candidate.rglob('*') if p.is_file()}==seal
assert Path('/tmp/erri-round-review-0011/native-review.json').is_file()
previous=load(r/'docs/evidence/native-2026-10-02-intel-reroll-current/source-sha256.json');delta=[n for n,h in source.items() if previous.get(n)!=h]
assert delta==['addons/core/Scripts/Game/ERR/00_Core/ERR_TerrainTakeoverPresentation.c']
e.mkdir(exist_ok=False)
for n in ['baseline.json','native-end-active.log','finish.py','run-suite.py','regressions.log','suite-result.json','suite-inputs.json']:shutil.copyfile(b/n,e/n)
for folder,name in [('/tmp/erri-round-review-0011','round-review'),('/tmp/erri-memory-review-0011','memory-review'),('/tmp/erri-roadblock-next-0011','roadblock-plan')]:shutil.copytree(folder,e/name,ignore=shutil.ignore_patterns('__pycache__','*.pyc'))
write(e/'source-after.json',source)
result={'kind':'Current-source active native end and vanilla restart','authored_files':len(source),'fresh_regression_programs':292,'assertions':21,'completions':2,'script_failures':0,'engine_errors':13,'cleanup_source_external_unchanged':True,'strict_failure_retained':True,'source_delta_from_prior_reroll':delta,'delta_inherited_before_turn':True,'production_changes_this_turn':False,'original_reference_files_unchanged':len(original),'inherited_files_preserved_before_documentation':len(base['files']),'latest_candidate_files_unchanged':len(seal),'index_diff_sha256':index,'package_changes':False,'release_qualified':False,'next_bounded_implementation_plan':'roadblock-plan/plan.json','limits':'Prepared PRISON external EndGameMode and vanilla reload only. No pending native preload, active field logistics, human escape, remote multiplayer or FPS qualification. Paired-roadblock plan is unimplemented.'}
write(e/'review.json',result)
status=r/'docs/current-status.md';first,tail=status.read_text().split('\n',1)
section='''**3 October 2026 — current mission survives two native end/restart cycles:** the hidden/muted Core fixture passes **21 assertions across two independently initialized rounds**, with **zero script/runtime failures and thirteen retained engine errors**. Each round reaches the prepared prison phase, ends through vanilla `EndGameMode`, shuts down successor services once, cancels queued work and leaves stale callbacks inert. Native end data remains unchanged, no escape is invented, and vanilla reload initializes the second round with fresh state.
A fresh **292-program regression run passes** on the same **420-file authored source**, including the inherited terrain-presentation update; earlier source bindings are not reused. Cleanup and unchanged source/external inputs are confirmed. This checks local prepared-round termination and restart, not pending native preloads, field-logistics teardown, complete human play, multiplayer or FPS. Strict native failure remains recorded. No production code changed in this continuation; existing missions, inherited work and the packaged handoff are preserved. [Evidence and limits](evidence/active-restart-current-2026-10-03/review.json).
'''
status.write_text(first+'\n\n'+section+'\n'+tail.lstrip('\n'))
write(e/'documentation.json',{'before':base['files']['docs/current-status.md'],'after':sha(status)})
write(e/'evidence-sha256.json',{str(p.relative_to(e)):sha(p) for p in sorted(e.rglob('*')) if p.is_file()})
print(json.dumps(result,indent=2))