"""Execute current JavaScript helpers without booting the live server.""" from pathlib import Path import shutil import subprocess def ui_contract(name: str) -> None: node = shutil.which("node") assert node is not None, "Node.js is required for UI regression contracts" script = Path(__file__).with_name("ui_legacy_contracts.cjs") result = subprocess.run([node, str(script), name], capture_output=True, text=True, timeout=20) assert result.returncode == 0, result.stdout + result.stderr assert f"PASS UI contract: {name}" in result.stdout, result.stdout + result.stderr