in_array($t,['sr_outbox','sr_deliveries'],true)?'event_id':(in_array($t,['sc_catalogue_meta','pd_due_meta','fo_meta','fs_meta','rm_meta','hp_meta'],true)?'policy':(in_array($t,['hr_qa_profiles','sgf_presentation_profiles'],true)?'profile_key':(in_array($t,['fs_results','fs_result_lines'],true)?'snapshot_key':($t==='company_memberships'?'user_id':'id'))));foreach($before as$name=>$tables){$db=$name==='host'?$host:$native;foreach($tables as$table=>$json){if($db->table($table)->orderBy($order($table))->when($table==='fs_result_lines',fn($q)=>$q->orderBy('account_id'))->get()->toJson()!==$json)throw new LogicException('Accepted facts changed '.$table);$same[]=$name.'.'.$table;}} foreach($installation['hashes']as$file=>$sha)if(hash_file('sha256',$s['app'].'/'.$file)!==$sha)throw new LogicException('Installed file changed');$older=json_decode(file_get_contents(json_decode(file_get_contents($s['root'].'/remunerations-backup-pointer.json'),true)['root'].'/preservation-private.json'),true);foreach(['binding'=>'binding.json','single_binding'=>'single-bindings.json','stock_binding'=>'stock-binding.json']as$key=>$file)if(hash_file('sha256',$s['root'].'/'.$file)!==$older[$key])throw new LogicException('Binding changed');if($host->table('hp_versions')->count()!==16||$host->table('hp_commands')->count()!==16||$host->table('rm_versions')->count()!==6||$native->table('gl_journals')->count()!==27)throw new LogicException('Original counts changed');file_put_contents($work.'/coverage-reconciliation-preservation.json',json_encode(['passed'=>true,'identical_original_tables'=>$same,'all_installed_hashes_verified'=>true,'three_bindings_unchanged'=>true,'business_commands_8085'=>0,'new_grants'=>0,'new_profiles'=>0,'new_schema'=>false,'cache_cleared'=>false,'protected_six_targeted'=>false],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'identical_tables'=>count($same),'proof'=>$work.'/coverage-reconciliation-preservation.json']).PHP_EOL;