What a unit arrives with
What a Plugin unit is given before it speaks, what it is deliberately not given, the order of its first acts, and the one window that bounds them.
What the launch supplies
Five environment variables, and nothing else.
| Variable | Carries | For |
|---|---|---|
YOKE_PLUGIN | the plugin's namespaced identity | the name the Registry authorises and the Manifest declares |
YOKE_UNIT | this copy's identity | the name everything about this copy is keyed by |
YOKE_SOCKET | the path of the instance's plugin channel | where the unit registers and opens its Session |
YOKE_BIND | the path this unit binds | its own socket, derived by the Core from the unit's identity |
YOKE_TOKEN | the bootstrap token | proof that this process was launched by this Core, for this unit, just now |
- The environment belongs to the process and disappears with it; a token written to a file would outlive the launch it proves.
- A deployment may not set a variable in the
YOKE_prefix. It is refused before anything runs, withunit.env.reserved. - There is no configuration file to find, no discovery step and no default path. Every path is derived from the instance.
What it is not given
| Not given | Because |
|---|---|
| its authorised scope | it is the answer to registration, not an input to it |
| any view of the Registry | a unit sees policy only as its own grant |
| the identities or addresses of other units | units never address each other |
| a Session identity | admission assigns it |
| the Core's configuration | it is not the unit's concern |
| which incarnation it is | a number a process states about itself would be a claim doing the work of an observation |
A unit knows who it is, where to reach the Core, and — once admitted — what it was granted.
The order of the first acts
Bind before registering. A unit that registers first is admitted and unreachable for a while: admission may probe the socket, the supervisor assumes an admitted unit answers, and a dependent may already be waiting on it.
| # | The unit | The Core |
|---|---|---|
| 1 | reads the environment | — |
| 2 | binds YOKE_BIND | — ; the socket's existence is what admission may probe |
| 3 | registers on YOKE_SOCKET, presenting YOKE_TOKEN | decides, in nine ordered stages (Admission) |
| 4 | reads the answer: its granted scope and its heartbeat terms | has computed both |
| 5 | opens the Session; the first envelope carries the identity it was given | resolves the identity, or closes the stream (The Session) |
| 6 | starts sending health on the assigned interval | judges liveness against the terms it set |
| 7 | serves commands, answers queries, emits only on activated streams | activates and stops streams, creating each transport |
Opening the Session (5) is a separate call from registering (3). A unit admitted with a narrowed scope may choose not to go on, and a unit that dies between the two stays distinguishable from one that was refused.
An SDK performs these steps in this order on the author's behalf.
The startup window
One number, three uses. The default is 30s.
| Use | Bound |
|---|---|
| the bootstrap token | it expires at the end of the window |
| registration | it must complete within the window |
| a dependency | a unit waiting for this one to become ready gives up at the same bound |
- A unit whose initialisation is slow should register first and do the rest afterwards; registration itself is cheap.
- The window is set per unit where the deployment is described, with the deployment's value as the default. It is never set in a Manifest: a program does not declare how long its own credential lasts.
The identifying code
A Plugin presents an identifying code, and it is checked before the process exists.
| Unit | The code is |
|---|---|
| on the host | a digest of the executable, computed at launch through the descriptor that is then executed |
| in a container | the image digest, which the engine verifies before running anything |
The code identifies the binary, not its declaration: the case it exists for is a Manifest left untouched and the executable replaced.