<?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')!=='76d46a806e0eb45f97c1c38a1e8942893c3db61137e1fe6b1b68b0d8c4fc4398')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";
