Skip to main content

Module core

Module core 

Source
Expand description

The daemon loop (SPEC §10, §13) and request handling (§14, §16).

Each tick does the following, in order:

  1. assemble state;
  2. advance the incidents and journal any that changed;
  3. re-probe the targets of diagnostic incidents;
  4. unless the machine is busy or interlocked, ask the diagnoser for one incident and submit its proposal through the executor;
  5. 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
CoreConfig
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§

ResumeKind 🔒

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 UserData among its sensitivities, where snapshots are unsupported (always, in Phase A: no snapshot backend is wired), logs NoSnapshot and 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.