A core soft-robotics challenge for underwater locomotion is reconciling soft actuation's compliance with the control tractability and robustness of rigid structures. We present SpineWave, a biomimetic robotic fish that adopts a compliant design within a hybrid soft-rigid architecture: rigid, additively manufactured vertebrae embed opposing magnets that provide passive magnetic compliance, enabling soft-like undulatory bending and impact tolerance while retaining a pressure-tolerant, analytically tractable backbone. Rather than manual tuning, we optimize a low-parameter central-pattern-generator (CPG) controller via hardware-in-the-loop efficient global optimization (EGO). The EGO-tuned gaits deliver a 38% increase in cruising speed and a 35% reduction in turning radius relative to pre-optimization baselines, and achieve 29% energy savings when exploiting vortex wakes, while maintaining stable body-wave propagation across modular morphologies. To our knowledge, SpineWave is the first fish robot to realize soft-like compliance and field robustness using an entirely rigid, magnetically coupled exoskeleton-endoskeleton. This combination of passive magnetic compliance and data-driven CPG optimization advances soft-robotic locomotion and offers a pressure-tolerant, modular platform for long-duration environmental monitoring and exploration.