Expand description
The daemon loop (SPEC §10, §13) and request handling (§14, §16).
Each tick does the following, in order:
- assemble state;
- advance the incidents and journal any that changed;
- re-probe the targets of diagnostic incidents;
- unless the machine is busy or interlocked, ask the diagnoser for one incident and submit its proposal through the executor;
- expire approvals, compact the journal, and run the boot-confirmation checkpoint.
Every change goes through Executor::submit; nothing here calls a mutating
backend method.
Structs§
- Core
- Core
Config - LogRecord
- The executor log (I7): one record per submitted proposal.
- Peer
- The caller of a request, from
SO_PEERCRED, group membership and logind. - Resume
- How to finish a request whose slow part ran elsewhere.
Enums§
Constants§
- CHAIN_
CHECK_ EVERY - How often the running daemon re-reads its journal’s hash chain (I18).
- CONFIRM_
AFTER - The 10-minute checkpoint for boot confirmation and initial enrollment (§10, §16).
- GC_
CHECK - How often the daemon checks the §12b collection bounds.
- HOLD_
RETRY_ MAX - HOLD_
RETRY_ MIN - §12d: the first and the longest wait between re-applies of a hold whose firewall table is missing.
- HOLD_
UNCONFIRMED_ RETRY - §12d: how long a hold the host has not confirmed waits before it is asked for again (its job may still land meanwhile; the host is checked every tick).
- HOLD_
WAIT - §12d: how long a tick waits for the host to confirm a hold the daemon asks for on a network tool’s stop outside Planarian; past it the hold counts as held (fail closed) and its job goes on in the host.
- NEW_
DECLARATIONS_ FOR - How long a generation’s new declarations are named in incident reports (§15).
- NOTICES_
KEPT 🔒 - RESTART_
REMINDER 🔒 - The “restart to finish” notice repeats this often while a change waits for its boot (§12f).
- SLOW_
TICK_ WARN_ EVERY - P9: a slow tick is warned at most this often (the count rides along).
- UNREACHABLE_
AFTER 🔒 - How long an external dependency’s probes time out before it is said.
Functions§
- agent_
principal - An agent’s principal id: in its own range, above every uid and the daemon’s ids, stable across restarts (FNV-1a of the name).
- foreground_
depends_ 🔒on - §12f: units foreground work plausibly depends on, whose repairs quiet mode does not defer: a user’s own units (audio), devices (sound, GPU, input, network cards), and units whose restart drops a session or the network (compositor, display manager, network, Bluetooth).
- no_
snapshot 🔒 - §12 step 6 (C18): a transaction that got past step 5 (it ran, or waits
for its activation window) with
UserDataamong its sensitivities, where snapshots are unsupported (always, in Phase A: no snapshot backend is wired), logsNoSnapshotand continues. - outcome_
of 🔒 - signal_
name 🔒 - urgent 🔒
- Notices quiet mode never holds back (§12f): alarms, integrity findings, what a repair did, and anything that needs a person.