def is_recovery_exercise(ex) -> bool: """True for warmup/cooldown-style recovery/stretch exercises.""" if ex is None: return False name = (getattr(ex, 'name', '') or '').lower() patterns = (getattr(ex, 'movement_patterns', '') or '').lower() if 'stretch' in name: return True blocked = ( 'mobility - static', 'static stretch', 'yoga', 'cool down', 'cooldown', 'breathing', 'massage', ) return any(token in patterns for token in blocked)