<?php
declare(strict_types=1);require __DIR__.'/common.php';$check($lane==='B','Only Root-approved B tool retry now');$case=json_decode(file_get_contents($runtime.'/cases-original.json'),true)['PROBLEM_CREATE'];$failed=json_decode(file_get_contents($runtime.'/wire-original-PROBLEM_CREATE.json'),true);$check(json_decode($failed['raw'],true)['message']==='Exact INSERT SET assignment','Original documented B tool red');foreach($small() as $rows)foreach($rows as $row)$check(!in_array((int)$row['type'],[6,7,8,9],true),'Fresh Problem scope zero');$scenario='PROBLEM_CREATE_RETRY';$check(!file_exists($runtime.'/client-original-'.$scenario.'.json'),'One approved B retry only');$token=json_decode(file_get_contents($runtime.'/tokens.json'),true)['one'];$headers=['Host: '.$case['host'],'Platform: POC','Content-Type: application/json','Access-Token: '.$token,'X-Pilot-Scenario: '.$scenario];$ctx=stream_context_create(['http'=>['method'=>'POST','header'=>implode("\r\n",$headers),'content'=>$case['body_raw'],'timeout'=>120,'ignore_errors'=>true]]);$raw=file_get_contents('http://127.0.0.1:18911'.$case['path'],false,$ctx);$persist('client-original-'.$scenario.'.json',['case'=>$case,'response_headers'=>$http_response_header,'raw'=>$raw]);$result=json_decode($raw,true);echo json_encode(['lane'=>$lane,'case'=>$scenario,'status'=>$result['status']??null,'message'=>$result['message']??null,'harness_error'=>$result['harness_error']??null],JSON_UNESCAPED_UNICODE),"\n";
