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

15 lines
3.4 KiB
Python

from pathlib import Path
import subprocess,os,json,hashlib,difflib
r=Path('/home/jakub/devel/escapistsrereintroduced');o=Path('/tmp/erri-resupply-tests-0826');a=Path('/tmp/erri-resupply-source-0826');rel='addons/core/Scripts/Game/ERR/10_AI/ERR_InfantryResupply.c';p=a/rel;test=o/'tests/test_infantry_resupply_planning.py'
env=dict(os.environ,PYTHONPATH=str(r/'tests'),TMPDIR=str(o/'scratch'))
results=[]
for name,source,expected in [('baseline-red',a/'baseline'/rel,False),('green',p,True)]:
env['ERR_INFANTRY_RESUPPLY_SOURCE']=str(source)
with (o/(name+'.log')).open('w') as f:res=subprocess.run(['python3',str(test)],env=env,stdout=f,stderr=subprocess.STDOUT)
log=(o/(name+'.log')).read_text();assert (res.returncode==0)==expected,(name,log)
if not expected:assert 'Assertion' in log and 'failed.' in log and "Command '['g++'" not in log,(name,log)
results.append({'name':name,'exit_code':res.returncode,'compiled':True,'source_sha256':hashlib.sha256(source.read_bytes()).hexdigest(),'log_sha256':hashlib.sha256((o/(name+'.log')).read_bytes()).hexdigest()})
before=(r/'tests/test_infantry_resupply_planning.py').read_text();after=test.read_text();patch=''.join(difflib.unified_diff(before.splitlines(True),after.splitlines(True),fromfile='a/tests/test_infantry_resupply_planning.py',tofile='b/tests/test_infantry_resupply_planning.py'));(o/'fix.patch').write_text(patch)
review={'status':'pass','source_sha256':hashlib.sha256(p.read_bytes()).hexdigest(),'test_sha256':hashlib.sha256(test.read_bytes()).hexdigest(),'test_baseline_sha256':hashlib.sha256((r/'tests/test_infantry_resupply_planning.py').read_bytes()).hexdigest(),'compatible_source_sha256':hashlib.sha256((r/'addons/core/Scripts/Game/ERR/10_AI/ERR_InfantryAmmoTransfer.c').read_bytes()).hexdigest(),'patch_sha256':hashlib.sha256((o/'fix.patch').read_bytes()).hexdigest(),'results':results,'coverage':['Actual TryPlan, new CompatibleStock and retained LauncherStock wrapper plus actual ERR_InfantryAmmoTransfer.Compatible execute together. Native weapon/muzzle/well/item/ownership boundaries are doubled; same native shape as existing transfer regression.','Wrong well, empty magazine, missing well, invalid zero capacity or overcapacity refuse before shared report consumption/cooldown, original group/truck claims, downlink or hold. Stock matching only launcher cannot satisfy small-arms planning.','Two original convoy service instances share consumption/cooldown maps: incompatible first truck refuses untouched; compatible later truck accepts the exact same original recipient and delivered report with its own exact token.','Surviving frozen/unspent membership required; compatible post-freeze insertion cannot qualify. Restoring compatible original unspent stock allows planning.32-member/96-stock caps and last-of96 compatible stock covered.','Real separate rifle and reloadable launcher fixtures preserve launcher planning, with disposable launcher refusal. Existing entire planning harness retained, including convoy identities, receipt/startup barriers, source guards, token ranges, shared cooldown, claims and uncertain transfer cleanup.'],'limits':['C++ actual-method translation, no native/Enforce/physics proof. StoredUnder is a narrow direct-parent native ownership boundary double for these launcher fixtures.','No target changes, full suite, native runs or mutation sweep. Source author patch remains separate.'],'all_compilers_finished':True}
(o/'review.json').write_text(json.dumps(review,indent=2)+'\n');print(json.dumps(review,indent=2))