Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
11 lines
3.4 KiB
Python
11 lines
3.4 KiB
Python
import subprocess,os,json,hashlib
|
|
from pathlib import Path
|
|
p=Path('/tmp/erri-motorized-intercept-review');source=Path('/tmp/erri-mounted-intercept-root-1247/ERR_HQMountedDispatch.c');s=source.read_text()
|
|
nearest=s.replace(' ERR_HQRoute candidateRoute = m_Network.Route(unit.Radio, true);\n if (!candidateRoute) continue;',' ERR_HQRoute candidateRoute = null;').replace(' ERR_HQRoute route = bestRoute;', ' ERR_HQRoute route = m_Network.Route(best.Radio, true);').replace(' ERR_HQRoute bestRoute;','').replace(' bestRoute = candidateRoute;','').replace(' ERR_HQRoute candidateRoute = null;\n','')
|
|
cases={'clock-gate':s.replace('if (!m_MountedIntercept || !ERR_ForceRules.Finite(now)) return;','if (!m_MountedIntercept) return;'),'candidate-gate':s.replace(' if (!HasMountedInterceptCandidate(now)) return;',''),'nearest-radio':nearest,'claim-release':s.replace('if (unit && unit.LogisticsReservation == order.Token) unit.LogisticsReservation = 0;','if (unit) unit.LogisticsReservation = 0;'),'pending-apply':s.replace(' if (delivered == 0) return;',''),'whole-task-gate':s.replace('if (!MountedInterceptTaskAvailable(task)) continue;','if (!task || task.Stopped || !task.Ready || !task.Receipt || task.Vehicles.Count() != 6) continue;')}
|
|
res={};env=os.environ.copy();env.update(PYTHONDONTWRITEBYTECODE='1',PYTHONPATH='/home/jakub/devel/escapistsrereintroduced/tests')
|
|
for name,text in cases.items():
|
|
f=p/(name+'-mutated.c');f.write_text(text);env['ERR_HQ_MOUNTED_DISPATCH_SOURCE']=str(f);out=subprocess.run(['python3',str(p/'test_hq_mounted_dispatch.py')],env=env,capture_output=True,text=True);log=p/(name+'-red.log');log.write_text(out.stdout+out.stderr);res[name]={'exit':out.returncode,'runtime_assertion':'Assertion' in out.stderr,'log':str(log)}
|
|
review={'scope':'Actual dispatch methods executed; native radio/physical service and memory policy are boundary doubles','source':str(source),'source_sha256':hashlib.sha256(source.read_bytes()).hexdigest(),'test':str(p/'test_hq_mounted_dispatch.py'),'test_sha256':hashlib.sha256((p/'test_hq_mounted_dispatch.py').read_bytes()).hexdigest(),'green_log':str(p/'dispatch-green.log'),'mutations':res,'changes_by_reviewer':['Nonfinite Tick time returns without releasing exact claim through invalid native time.','No eligible original escort/fresh delivered status skips all road surveys.','Nearest no-radio candidate skipped; exact nearest reachable radio route retained.','Whole-task conflict guard shared by both scans, including sibling physical holds and queued downlinks/logistics claims.','Status appends escort, queued/delivered phase, source report and fixed destination.'],'integration_api_review':'HQ exact logistics token precedes physical ReserveIntercept; release detaches HQ first then releases service before conditionally clearing original unit token. API fields/types and token400001..400256 match rules and physical service; no blocker found after task guard. Service uses exact retained order+private claim on release, independent of mutable order.Token.','limits':['Separate rules/service suites cover native admission and policy Current, which are controlled boundaries here.','No native driving, actual radio timing or interception effectiveness proof.']}
|
|
(p/'dispatch-review.json').write_text(json.dumps(review,indent=2)+'\n');print(json.dumps(review,indent=2));assert all(x['exit']!=0 and x['runtime_assertion'] for x in res.values())
|