Expand description
Auto-register state machine — the only registration path.
On first launch the worker POSTs /workers/register-request
to the studio with a self-generated install id + a registration
secret (only its SHA-256 hash leaves the box), then polls
/workers/register-requests/<id> every 30s for the operator’s
decision. On Approved we persist worker_id + auth_token to
config.toml and fall through to the normal heartbeat / claim
loops. On Rejected we surface the reason; the user clears state
with studio-worker register --reset to retry.
tick() does at most one HTTP round-trip per call so the outer
orchestrator can sleep between polls. All persistence goes
through config::save so a crash mid-flight leaves consistent
on-disk state.
Enums§
- Registration
State - What
tick()returns + what the UI Status tab reads. Distinct from the persisted config fields, which carry the raw building blocks (install_id,registration_request_id, …).
Functions§
- shared_
initial - tick
- One iteration of the state machine.
Type Aliases§
- Shared
Registration - Shared in-memory mirror of
RegistrationStatefor the UI to read (the persisted source of truth isConfig).