<?php
// Filesystem/socket only: before any PDO/config/Auth.
$lane=$argv[1]??'';if(!in_array($lane,['B','C'],true)||__DIR__!=='/tmp/cdx-store-food-fixed-20261011')throw new RuntimeException('Exact new runtime');$port=$lane==='B'?18997:18998;if(@fsockopen('127.0.0.1',$port,$n,$e,0.3)||is_file(__DIR__.'/private/pid.json')||is_dir(__DIR__.'/cache'))throw new RuntimeException('Fresh port/cache/runtime collision');$lock=json_decode(file_get_contents(__DIR__.'/source-lock.json'),true);$actual=[];$it=new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__.'/source/application',FilesystemIterator::SKIP_DOTS));foreach($it as $f){if($f->isLink())throw new RuntimeException('No source symlink');if($f->isFile())$actual[substr($f->getPathname(),strlen(__DIR__.'/source/application/'))]=hash_file('sha256',$f->getPathname());}ksort($lock);ksort($actual);if($actual!==$lock||count($actual)!==959||hash_file('sha256',__DIR__.'/source-lock.json')!=='f26f6dd15e86f3b34e23cde8413b660683cc5656f542b85973581c441c747738')throw new RuntimeException('Actual959 exact pin before PDO');$r=['lane'=>$lane,'source_files'=>959,'source_mapping_sha256'=>hash_file('sha256',__DIR__.'/source-lock.json'),'Activity_sha256'=>$actual['p/logic/Activity.php'],'helper_sha256'=>$actual['common.php'],'port'=>$port,'port_collision0'=>true,'new_cache_exclusive'=>true,'DB'=>0,'SQL'=>0,'HTTP'=>0];$f=__DIR__.'/private/prepare.json';$h=fopen($f,'xb');fwrite($h,json_encode($r,JSON_PRETTY_PRINT));fclose($h);chmod($f,0600);echo json_encode($r),PHP_EOL;
