pub async fn ensure_registered(
cfg: &SharedConfig,
path: &Path,
registration: &SharedRegistration,
stop: &Arc<AtomicBool>,
) -> Result<RegistrationGate>Expand description
Loop auto_register::tick on a 30s cadence until worker_id +
auth_token are populated (Approved → RegistrationGate::Ready),
a stop signal arrives (→ RegistrationGate::Stopped), or the
operator rejects the worker (→ Err with recovery guidance).