<?php
require __DIR__.'/oracle.php';$auditSource=$source;$state=$auditSource();$pre=json_decode(file_get_contents(__DIR__.'/private-preflight.json'),true);try{require __DIR__.'/init.php';$logic=new \app\p\logic\SyllabusEvaluate();$checks=[];foreach(json_decode(file_get_contents(__DIR__.'/private-spec.json'),true)as $s){if(in_array($s['label'],['missing_staff','missing_uuid'],true))continue;if($s['method']==='lists'){$expected=['rows'=>array_map($listProjection,array_slice($state['rows'],((int)$s['params']['page']-1)*$pre['pagesize'],$pre['pagesize'])),'content'=>$state['ext']?$state['ext'][0]['content']:'','total'=>count($state['rows'])];$value=$logic->lists(['staff_uuid'=>$scope['staff_uuid']],(int)$s['params']['page'],$pre['pagesize'],['id'=>'desc'],['uuid,staff_uuid,test_content,test_time,achievement,demo']);$checks[$s['label'].'_all_values_types']=$value===['code'=>0,'message'=>'查询成功','data'=>$expected];}else{$value=$logic->info($s['params']['uuid']);$checks[$s['label'].'_all_values_types']=$value===($s['label']==='source_info'?['code'=>0,'message'=>'查询成功','data'=>$state['rows'][0]]:['code'=>1,'message'=>'大纲考核纪要不存在']);}}
$checks['source_staff_ext_unchanged']=$state===$auditSource();$checks['actor_unchanged']=$actor===$actorNow();$report=['lane'=>$lane,'passed'=>!in_array(false,$checks,true),'checks'=>$checks];$save('private-runtime-gate.json',$report);echo json_encode($report),"\n";exit($report['passed']?0:2);
}catch(Throwable $e){$save('private-init-error.json',['class'=>get_class($e),'message'=>$e->getMessage(),'file'=>$e->getFile(),'line'=>$e->getLine()]);echo json_encode(['class'=>get_class($e),'reason_sha256'=>hash('sha256',$e->getMessage())]),"\n";exit(2);}
