Expand description
The laterite.plugins built-in module: a registry table recording each
plugin’s operator enable/disable state, read at boot to decide which plugins
load. record_roster records the compiled plugins here at boot, set_enabled
is the enable/disable service (applied on the next boot), and list_plugins
feeds the admin screen. The quarantined_* columns hold the system’s verdict
(written by a later slice).
The admin screen (index, toggle) lists the roster and lets an operator
flip a plugin on or off; the change is an intent stored here and applied on
the next boot, so the screen says so plainly.
Structs§
- Plugin
Row - A plugin’s registry row, for the admin screen.
- Plugins
Module - The built-in module owning the plugin-registry table.
- Reconcile
Report - What
reconcile_bootchanged, for the boot log.
Constants§
- CRASH_
REASON - Reason recorded when a plugin is auto-quarantined because its init crashed
the previous boot (a crash no
catch_unwindcould catch). - MODULE_
ID - Stable id of this built-in module.
Functions§
- binary_
fingerprint - Fingerprint of the running binary (its size and modification time): stable across restarts of the same executable, changed by a rebuild or redeploy. The journal uses it to tell “the same binary crashed again” from “a new binary may be fixed”. Falls back to a constant when the executable cannot be inspected.
- clear_
loading - Clears the load marker once a plugin’s init has succeeded.
- disabled_
ids - The plugin ids an operator has disabled (rows with
enabledfalse). An absent row means enabled, so a fresh install disables nothing. - list_
plugins - Every registered plugin with its state, ordered by id, for the admin screen.
- mark_
loading - Durably records that
plugin_id’s init is about to run underfingerprint. Written before the plugin migrates or registers, so a hard crash leaves the marker for the next boot’sreconcile_bootto find. - quarantine
- Persists a quarantine against
plugin_id: the reason, the time, and the binaryfingerprintit failed under (so a later, different binary lifts it). Also clears any load marker, since the attempt is now resolved. A quarantined plugin is skipped at boot until it is re-enabled or the binary changes. - quarantined
- The ids and reasons of currently-quarantined plugins. The boot skips these and reports the reason.
- reconcile_
boot - Reconciles the journal against the current binary
fingerprintat boot, before deciding what loads: - record_
roster - Records the compiled plugins, inserting an enabled row for any not seen before and leaving existing rows (and their operator state) untouched. Called at boot so the table is the full plugin roster the admin screen lists.
- set_
enabled - Sets a plugin’s operator enable/disable state (upsert). Takes effect on the next boot: a disabled plugin is skipped, an enabled one migrates and registers.