<?php
require __DIR__.'/common.php';if(is_file(__DIR__.'/private/request.json'))throw new RuntimeException('No auth replay');
if(hash_file('sha256',__DIR__.'/log-http-plan.json')!=='aaef22d925f876109c3d60a763ca433191eff53fa72960d6e9c41a72d76876e7')throw new RuntimeException('Plan SHA');
$current=$source();$before=json_decode(file_get_contents(__DIR__.'/private/batch-before10.json'),true);unset($before['sentinel']);if($current!==$before)throw new RuntimeException('Auth source drift');
require __DIR__.'/app-init.php';new \app\p\logic\Stageanalyze();$token=(new \app\p\logic\Login())->userTokenSet($current['actor'][0]);$cases=json_decode(file_get_contents(__DIR__.'/log-http-plan.json'),true)['cases'];$save('request.json',['token'=>$token,'cases'=>$cases]);$save('auth-native.json',NRGate::$journal);$save('auth-source.json',$current);echo json_encode(['lane'=>$lane,'cases'=>count($cases),'original_token_chain'=>true,'actor_status_unchanged'=>true]),"\n";
