from __future__ import annotations import time from typing import Callable def wait_for(predicate: Callable[[], bool], *, timeout_s: float = 60.0, poll_s: float = 1.0) -> bool: """Minimal shared readiness helper.""" end = time.time() + timeout_s while time.time() < end: if predicate(): return True time.sleep(poll_s) return False