Expand description
Worker registration and the instance card on Cloud (C0 2.0 §3.17.1,
§3.18.1): E10 POST /v1/workers and E44 PATCH /v1/instances/{id}/card
are signed by the instance key as domain ‖ canonical_json(body);
E11 PATCH /v1/workers/{wkr} rides on the instance token alone.
Structs§
- Account
- Card
State - Instance
Card - E44 response.
- Presence
Key - The bound presence key, as E44 returns it.
- Registered
Worker - E10 response: the worker as Cloud stored it.
- Registration
- Who is registered: the workspace worker, or its alias in one public
vault or swarm (
place_ref="{kind}:{id}").
Enums§
- Consent
Channel - Consent channel the engine reports; the server derives the real one from the bound presence key and a card can only downgrade it.
Constants§
- IDLE_
RETIRE - How long a worker no session used stays before the sync retires it
(
lean-ctx cloud worker retire --idledefaults to the same). - INSTANCE_
CARD_ DOMAIN - SESSION_
IDLE_ RETIRE - How long the worker of an ended app session stays (its role is never attached again once the session is gone).
- WORKER_
DOMAIN
Functions§
- announce_
instance - E44 for the enrolled instance, at
cloud connectand engine start. The engine reportsos_presenceonly with a bound presence key (§3.8.4); the server derives the real channel. - ensure_
registered - Register the worker a session attached to, once (E10 on the first event or bus post, SPEC-ENGINE §3.6), and remember it in the book. An already registered worker costs no request. Workers the book gave up are retired on Cloud first; one that cannot be retired now (offline, a Cloud without the route) is recorded and tried again next time, and the registration goes ahead (Cloud may still have room).
- instance_
card_ body - The signed E44 body.
clear_presence_keysendspresence_key: null, which drops the bound key (e.g. after the helper was removed); a card can never set or replace one. - on_
session_ end - When an agent session ends: give up the workers of app sessions that no
active session holds and none attached in the last
SESSION_END_GRACE(a session still starting up). No request; Cloud hears of them with the next sync or registration (retire_evicted). A worker the ending session still holds goes with the sync’ssweep. - patch
- E11: rename and/or a new card.
- register
- E10.
- register_
body - The signed E10 body. The name passes the local rule first
(
invalid_name, SPEC-ENGINE §3.6). - retire
- Retire one worker of this instance on Cloud (C0 2.2
DELETE /v1/workers/{id}): it no longer counts against the 32-worker cap. Done as well when Cloud says it does not know the worker (404not_found) or that another instance owns it (409worker_not_owned): nothing of this instance is left to free. A 404 without that code (a Cloud that has no such route) is not done: the worker still counts there. - retire_
evicted - Retire on Cloud the workers the book gave up for new ones (see
attach::attach), so a registration is not refused withworker_cap_reached. Every queued worker is tried; one Cloud could not retire now stays queued, and the first such error is returned. - send_
instance_ card - E44.
- sweep
- The sync’s sweep (owner 09.11.: workers that are not active do not
count): give up the workers idle for
IDLE_RETIREand those of ended app sessions idle forSESSION_IDLE_RETIRE, then retire on Cloud every worker queued so far. The ids given up now.