$host,'native'=>$native]as$name=>$db)foreach($before[$name]as$table=>$json){$rows=json_decode($json,true);$after=$db->table($table)->whereIn('id',array_column($rows,'id'))->orderBy('id')->get()->toJson();if($after!==$json)throw new LogicException('Original table changed '.$table);if(!in_array($table,['fr_calculations','fr_commands'],true)&&$db->table($table)->count()!==count($rows))throw new LogicException('Unexpected domain append '.$table);$checks[]=$name.'.'.$table;} if(hash_file('sha256',$s['root'].'/binding.json')!==$before['binding'])throw new LogicException('Original binding changed'); file_put_contents($work.'/document-math-preservation.json',json_encode(['passed'=>true,'identical_original_tables'=>$checks,'journals'=>27,'new_grants'=>0,'native_writes'=>0,'six_protected_records'=>'No connections or commands target protected databases/records','blocked_cache'=>'No clear/delete','new_demo'=>false],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'proof'=>$work.'/document-math-preservation.json']).PHP_EOL;