Files
EscapistsReintroduced/docs/evidence/hq-native-checkpoint-2026-10-03/validation/finalize.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

90 lines
11 KiB
Python

from pathlib import Path
import hashlib,json,subprocess,shutil
R=Path('/home/jakub/devel/escapistsrereintroduced');B=Path('/tmp/erri-gameplay-root-1659');E=R/'docs/evidence/hq-native-checkpoint-2026-10-03'
sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()
load=lambda p:json.loads(p.read_text())
suite=load(B/'suite-result.json');inputs=load(B/'suite-inputs.json')
assert suite['exit']==0 and suite['inputs_unchanged'] and suite['regression_programs']==305
assert len({p['path'] for p in suite['programs']})==305 and all(p['exit']==0 for p in suite['programs'])
for name,h in inputs.items():assert sha(R/name)==h,name
assert load(B/'preservation.json')['complete']
index=hashlib.sha256(subprocess.check_output(['git','diff','--cached','--binary'],cwd=R)).hexdigest()
assert index==load(B/'baseline.json')['staged_diff_sha256']
native={}
for name,passes,complete,failures,errors in [
('native-2026-10-03-hq-search-normal',64,1,0,13),
('native-2026-10-03-hq-search-patrol-failed',90,0,1,14),
('native-2026-10-03-hq-search-patrol-no-responders',156,0,1,14),
('native-2026-10-03-hq-search-patrol',172,1,0,13)]:
d=R/'docs/evidence'/name;r=load(d/'report.json');runner=load(d/'runner.json.txt')
assert (r['assertions_passed'],r['smoke_completions'],len(r['script_or_runtime_failures']),len(r['engine_errors']))==(passes,complete,failures,errors),name
assert runner['cleanup_confirmed'] and runner['source_unchanged_after_run'] and runner['external_addons_unchanged_after_run'],name
native[name]={'passes':passes,'completions':complete,'script_failures':failures,'retained_engine_errors':errors,'files':{str(p.relative_to(d)):sha(p) for p in d.rglob('*') if p.is_file()}}
current=R/'docs/evidence/native-2026-10-03-hq-search-patrol'
for name,h in load(current/'launch-source-sha256.json').items():assert sha(R/name)==h,name
assert 'queued=45 native=45' in (current/'console.log.txt').read_text()
old=load(R/'docs/evidence/native-2026-10-03-hq-search-normal/launch-source-sha256.json')
normal_delta={n:{'normal':h,'current':sha(R/n)} for n,h in old.items() if sha(R/n)!=h}
assert set(normal_delta)=={'addons/core/Scripts/Game/ERR/00_Core/ERR_ScenarioComponent.c','addons/core/Scripts/Game/ERR/10_AI/ERR_NativePatrolHQProbe.c','addons/core/Scripts/Game/ERR/40_Chat/ERR_NativeSmoke.c'}
additions={
'docs/current-status.md':'''**3 October 2026 — latest mission and HQ native checks completed:** the scripted normal Everon escape route completes **64 assertions and one round**, with zero script/runtime failures. A separate corrected HQ fixture completes **172 assertions and one round**: an original two-member mobile team receives the copied **45 m** native search radius, pauses/resumes its queued search under injected contact, and returns to its existing home-defence waypoint on release. A separate six-member permanent guard patrol physically completes five ordered native moves and travels at least 8 m.
The first patrol attempt remained in the deliberately frozen prison phase; the second reached physical patrol completion but its historical catalog had no mobile responders. Both failures remain archived. Workbench-only setup now opens the prison through the canonical participant API, prepares two finite responders through the normal site owner, and checks their HQ queue before observing the separate permanent patrol. Ordinary mission behavior, movement criteria and deadlines are unchanged. All **305 registered regression programs pass** on the final unchanged snapshot.
Each completed native run retains **13 engine errors**, so strict clean-build qualification still fails. Both ran hidden and muted with unchanged source/dependency inputs and confirmed cleanup. The normal route preceded the three diagnostic source edits; exact snapshots and deltas are recorded. Radio transit, same-group physical search/resumption, a 110 m search sweep, twelve-player multiplayer and FPS are not established by these fixtures. Original missions and sealed packages are unchanged; the packages still predate recent source changes. [Checkpoint, failures and next work](evidence/hq-native-checkpoint-2026-10-03/README.md).
''',
'docs/site-patrols.md':'''## Current verification — 3 October 2026
The [corrected isolated fixture](evidence/native-2026-10-03-hq-search-patrol/report.json) completes 172 assertions with one round, zero script/runtime failures and thirteen retained engine errors. Its historical catalog receives two finite mobile outpost responders before ordinary site preparation; the six permanent guards and their route are preserved. This arrangement applies only to the Workbench `patrol-hq` selector. The fixture uses canonical prisoner admission to leave the prison phase, allowing the intended enemy-AI hold to release.
The mobile responder group receives an actual native Search waypoint with queued/native radius both 45 m. The actual delivery method, injected combat pause, quiet-period resume, release and restoration of its existing Defend waypoint are checked first. The separate permanent guard group then moves at least 8 m and completes five ordered native Move events across a cycle boundary within the unchanged 180-second bound. This is not physical resumption of the same group after HQ retasking. The older generic completion-log label must be interpreted using these distinct targets. Radio transit, actual search coverage, the 110 m bound, remote clients and FPS remain unverified.
Two earlier failures are retained: the fixture waited for movement during the intended prison freeze, then the historical catalog lacked the required mobile team. Production policy was not weakened to make them pass. [Implementation, full regressions and scope](evidence/hq-native-checkpoint-2026-10-03/README.md). The historical authoring and September evidence below remain bound to their own versions.
'''
}
docs={}
for name,addition in additions.items():
text=(R/name).read_text();first,rest=text.split('\n',1);content=first+'\n\n'+addition+rest.lstrip('\n');docs[name]={'before':sha(R/name),'after':hashlib.sha256(content.encode()).hexdigest(),'content':content}
assert not E.exists()
stage=B/'final-evidence';stage.mkdir()
def copy(src,name):
p=stage/name;p.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(src,p);assert sha(src)==sha(p)
for label,folder in [('prison-admission',Path('/tmp/erri-patrol-start-1659')),('responder-fixture',Path('/tmp/erri-patrol-responders-1659'))]:
m=load(folder/'source-manifest.json')
for n in ['fix.patch','source-manifest.json','finding.json','independent-review.json']:
copy(folder/n,'proposals/'+label+'/'+n)
for p in folder.glob('*.log'):copy(p,'proposals/'+label+'/'+p.name)
for name in m['files']:
copy(folder/name,'proposals/'+label+'/source/'+name);copy(folder/'baseline'/name,'proposals/'+label+'/baseline/'+name)
for name in ['baseline.json','suite-inputs.json','suite-result.json','full-suite.log','run-suite.py','integrate.py','integrate-responders.py','preservation.json','normal-review.json','patrol-review.json','finalize.py']:
copy(B/name,'validation/'+name)
for p in (B/'first-suite-1715').iterdir():copy(p,'validation/first-suite-1715/'+p.name)
for name in ['plan.json','resource-audit.json']:copy(Path('/tmp/erri-start-choice-1659')/name,'next-work/'+name)
for src,name in [('/tmp/erri-player-review-1659/finding.json','player-review.json'),('/tmp/erri-hq-review-1659/review.json','hq-review.json')]:copy(Path(src),'review/'+name)
for name,v in docs.items():
p=stage/'documentation'/name;p.parent.mkdir(parents=True,exist_ok=True);p.write_text(v['content'])
review={'complete':True,'regression_programs':305,'native':native,'normal_to_final_diagnostic_source_delta':normal_delta,'native_limits':'45m getter, manual delivery trigger and injected contact; separate permanent-patrol motion. No radio transit, same-group physical search/resumption, 110m coverage, multiplayer or FPS proof. All native strict failures retained.','docs':{n:{k:v[k] for k in ['before','after']} for n,v in docs.items()},'staged_diff_sha256':index,'next_work':'Refresh an isolated development playtest candidate from current source after exact-source validation, then implement independent static crash-start selection using next-work plan and measured full wreck footprint. Flight/input experiments remain paused.'}
(stage/'review.json').write_text(json.dumps(review,indent=2)+'\n')
(stage/'README.md').write_text('''# Native mission and HQ checkpoint — 3 October 2026
The normal scripted escape route completes 64 assertions; the corrected HQ fixture completes 172. Both retain 13 engine errors and strict qualification failure, with no script/runtime failure, unchanged inputs and confirmed hidden/muted cleanup. `review.json` binds all four native archives, including both failed patrol attempts.
The Workbench fixture now leaves prison through canonical admission and prepares two original mobile responders through ordinary finite site preparation. It checks a copied 45 m radius against the actual native getter, queue preemption, injected-contact pause/resume and home-Defend restoration. The separate six-member permanent patrol completes five ordered native moves and at least 8 m displacement. The generic historical completion label is not evidence of same-group physical search/resumption. Radio transit, 110 m area coverage, multiplayer and FPS remain unproven.
All 305 registered regression programs pass on final unchanged inputs. The first 305-program pass, proposal baselines, compiled failing controls, independent reviews and four-file final delta are retained. The normal route preceded the final diagnostic changes; exact differences are listed. Only two prose documents were updated after the final suite, with their final text and hashes retained.
Original 533 referenced files, staged Git content and four sealed candidates remain unchanged. This checkpoint does not rebuild or publish a package. `next-work` contains a read-only plan/resource metadata for independent static crash aftermath, not an implemented feature; measured collision bounds and replicated wrapper authoring remain prerequisites. No third-party asset bytes are included.
''')
files={str(p.relative_to(stage)):sha(p) for p in sorted(stage.rglob('*')) if p.is_file()}
(stage/'artifact-sha256.json').write_text(json.dumps(files,indent=2)+'\n')
shutil.copytree(stage,E)
for name,h in files.items():assert sha(E/name)==h,name
for name,v in docs.items():
assert sha(R/name)==v['before'],name
(R/name).write_text(v['content'])
for name,h in inputs.items():assert sha(R/name)==(docs[name]['after'] if name in docs else h),name
assert hashlib.sha256(subprocess.check_output(['git','diff','--cached','--binary'],cwd=R)).hexdigest()==index
print(json.dumps({'complete':True,'sealed_files':len(files),'programs':305,'normal_assertions':64,'hq_assertions':172,'strict_native_qualification':False,'documentation_changes':list(docs)}))