<?php
require __DIR__.'/common.php';if(is_file(__DIR__.'/private/request.json'))throw new RuntimeException('No auth replay');
$current=$source();$before=json_decode(file_get_contents(__DIR__.'/private/batch-before.json'),true);foreach($current as $k=>$v)if($v!==$before[$k])throw new RuntimeException('Auth source drift '.$k);
require __DIR__.'/app-init.php';new \app\p\logic\Stageanalyze();
$token=(new \app\p\logic\Login())->userTokenSet($current['actor'][0]);$cases=[];
foreach(['get_day_teampower_popout','get_day_teamnutrient_popout','get_stage_teampower_popout','get_stage_team_nutrient_popout']as $action){$stage=strpos($action,'get_stage_')===0;$params=$stage?['uuid'=>$u,'start_time'=>'2026-10-08','end_time'=>'2026-10-09','type'=>'1']:['uuid'=>$u,'menu_data'=>'2026-10-08','type'=>'1'];if(strpos($action,'nutrient')!==false)$params['types']='1';foreach(['positive','missing','type2']as $kind){$p=$params;if($kind==='missing')$p['uuid']='C8EAA110-0001-4000-8000-202610119999';if($kind==='type2')$p['type']='2';$cases[]=['label'=>$action.'-'.$kind,'action'=>$action,'kind'=>$kind,'path'=>'/p/stageanalyze/'.$action,'params'=>$p];}}
if($q('SELECT id FROM ydy_staff WHERE uuid=?',['C8EAA110-0001-4000-8000-202610119999'])!==[])throw new RuntimeException('Missing marker collision');
$save('request.json',['token'=>$token,'cases'=>$cases]);$save('auth-native.json',NRGate::$journal);$save('auth-source.json',$current);echo json_encode(['lane'=>$lane,'cases'=>12,'original_token_chain'=>true,'actor_status_unchanged'=>true,'password_login_tested'=>false]),"\n";
