Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
16 lines
2.9 KiB
Python
16 lines
2.9 KiB
Python
from pathlib import Path
|
|
import hashlib,json,difflib,subprocess
|
|
p=Path('/tmp/erri-hunter-capture-2237');r=Path('/home/jakub/devel/escapistsrereintroduced')
|
|
files=['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','tests/test_convoy_survivors.py','tests/test_hunter_capture.py']
|
|
patch=''
|
|
for f in files:
|
|
old=(p/'baseline'/f).read_text() if (p/'baseline'/f).exists() else ''
|
|
patch+=''.join(difflib.unified_diff(old.splitlines(True),(p/f).read_text().splitlines(True),fromfile='a/'+f if old else '/dev/null',tofile='b/'+f))
|
|
(p/'fix.patch').write_text(patch)
|
|
q=subprocess.run(['git','apply','--check',str(p/'fix.patch')],cwd=r,capture_output=True,text=True);(p/'apply-check.log').write_text(q.stdout+q.stderr+'exit='+str(q.returncode)+'\n');assert q.returncode==0
|
|
sha=lambda x:hashlib.sha256(x.read_bytes()).hexdigest()
|
|
sdk=Path('/tmp/erri-vanilla-stock/scripts/Game/Vehicle/SCR_CompartmentAccessComponent.c')
|
|
(p/'source-manifest.json').write_text(json.dumps({'files':{f:sha(p/f) for f in files},'patch_sha256':sha(p/'fix.patch'),'sdk':{'path':str(sdk),'sha256':sha(sdk),'signature_line':64,'ordering':'native general subscribers invoked first at66-67; GetOwner accessed at70; hook signature matches production override'}},indent=2)+'\n')
|
|
(p/'finding.json').write_text(json.dumps({'problem':'Active original hunter entry capture was only sampled once per second. Current control/occupancy can disappear before next Tick; predecessor records entry event immediately.','fix':'Server canonical current-player entry matches only active original tracked hunter roots with existing bounded32 ancestry and15 record cap. Latch precedes Release/native callbacks. Hunter clears Downlink/stops Recovery; base rejects survivor retention even if live occupancy absent. Physical entities, finite allowance and registered original identifiers preserved.','scope':'Already Released hunter ignored: abandoned asset entry does not revoke independently retained former infantry. No helicopter, supply-convoy event dispatch, spawn/refill/deletion/refund, or replay of registration. Polling fallback unchanged.','tests':json.loads((p/'test-results.json').read_text()),'baseline':'red.log: actual baseline compiles then fails capture latch/released assertion; baseline-adapter-unused.log retained separate rejected compiler-only control.','mutation':'mutation.log: removing base !PlayerCaptureObserved guard compiles then fails unregister-vs-retain assertion with live occupancy unavailable.','limits':'Offline actual-method boundary doubles, not native multiplayer callback timing or ordinary input qualification. SDK callback is supported; root owns native validation.','registration_needed':'tests/test_hunter_capture.py only; parent owns tools/check.py','changed_files':files,'source_unchanged':all(sha(r/f)==v['working'] for f,v in json.loads((p/'baseline.json').read_text()).items())},indent=2)+'\n')
|
|
print(sha(p/'fix.patch'))
|