Reconciling
The guardian compares what each record declares with what is alive, and acts on the difference. Nothing it does is on a timer: it is told, or it notices a Core end.
| Wakes it | It reconciles |
|---|---|
| starting | every record |
| reconcile this record | that one |
| reconcile everything | every record |
| a Core it watches ending | that Core's record |
| a Core it watches falling silent | the same — Watching a Core |
What it derives
Current state is derived when asked, from facts that cannot lie.
| The question | Answered by |
|---|---|
| is a Core alive for this instance | its claim, which the kernel releases when the holder dies |
| what still belongs to it | its control group |
| is it observable | the liveness the Core sends, which begins at observability |
A cached answer is allowed only as a labelled cache with the moment it was taken, and never as the answer.
What it brings up
| Pass | Brings up |
|---|---|
| at boot | every instance whose autostart is set and whose desired state was not left stopped |
| any other time | every instance whose desired state is running |
An ephemeral record is never eligible for autostart.
Starting one
- Read the record, refusing one whose
nameis not its directory's. - Resolve the bundle:
<install root>/<id>/<version>/bundle/, or the working directory an ephemeral record'ssourcenames. - Run the gate. Nothing may execute a Core without it.
- Create the instance's control group.
- Execute the Core inside it, the binary
manager.confnames, handing it the engine's address and the retention ceiling. - Wait for it to become observable — its first beat — and watch for the absence of the next.
The guardian writes nothing to the record.
Stopping one
The manager writes the desired state; the guardian asks the Core to stop, waits the stop window, terminates it, and empties the control group. An ephemeral record is removed once its instance is down.
A refused start
A refusal is not a failure, and is not retried.
- The desired state is not altered: the record still says what somebody declared.
- The guardian's account changes: refused, with the gate's findings, carried by the channel.
- It is recorded where the guardian's output goes, so a start nobody watched leaves something to find.
- Nothing enters the restart policy. An explicit reconcile this record tries it again.
A failed start
A failure is retried: the wait grows, stops growing at a ceiling, and a stability window measured
from observability resets the count. The figures are the deployment's own policy.restart, and are not
separately declarable.
An ephemeral run that fails is not retried: its record is marked outcome: failed and kept.
The control group
An instance that loses its Core loses everything in it, because the Core and everything launched under it share one control group, which is emptied in one operation without enumerating anything.
| What | How it gets there |
|---|---|
| the Core | the guardian executes it inside the group |
| a host unit | a child of the Core, it inherits the group |
| a containerised unit | the Core names the group as the parent of every container it launches |
- It is a systemd slice,
yoke-<instance>.slice, underyoke.slice, in the subtree the session manager delegates to the account — a container engine driven through systemd accepts only a slice as a container's parent. - The guardian creates it before executing anything, so it can empty it when the Core is what went wrong.
- It is emptied after an instance stops, after a silent Core is terminated, and before an instance is brought back.
Where a host cannot provide one
Without control-group delegation, the guardian signals the process group and reaps the containers
carrying the instance's label. That is a declared weaker arrangement, reported by the gate as
confinement.no_cgroup_delegation, class weaker, and repeated whenever the instance is read. It is
weaker twice: reaping works only while the guardian is alive, and it makes the guardian address the
container engine.