in_array($table,['sr_outbox','sr_deliveries'],true)?'event_id':(in_array($table,['sc_catalogue_meta','pd_due_meta'],true)?'policy':'id'); $checks=[];foreach($before as$name=>$tables){$db=$name==='host'?$host:$native;foreach($tables as$table=>$json){if($db->table($table)->orderBy($order($table))->get()->toJson()!==$json)throw new LogicException('Original facts changed '.$table);$checks[]=$name.'.'.$table;}}if($binding!==hash_file('sha256',$s['root'].'/binding.json'))throw new LogicException('Binding changed');foreach($installation['hashes']as$file=>$hash)if(hash_file('sha256',$s['app'].'/'.$file)!==$hash)throw new LogicException('Installed code changed');file_put_contents($work.'/workshop-period-preservation.json',json_encode(['passed'=>true,'installation_proof'=>$baseline.'/workshop-period-installation.json','identical_original_tables'=>$checks,'business_commands'=>0,'new_grants'=>0,'new_demo'=>false,'cache_cleared'=>false,'native_writes'=>0,'binding_unchanged'=>true],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/workshop-period-preservation.json']).PHP_EOL;