@projectpac/daemon
v0.6.0
Published
Part of PAC: @projectpac/daemon.
Readme
@projectpac/daemon
The composition root: it brings a node up and is the only place that decides what "up" means.
Boot is the one ordered thing in the node:
Preflight refusals, before anything opens. Each is also enforced by the core plugin that owns it, so editing an entry file cannot get around a check.
Process guards, before the tree. cordis's loader floats the promise from a failing entry's activation, so the daemon classifies unhandled rejections: one an entry already carries is reported and the node keeps running, and anything else is fatal.
The tree, over two entry files in the data directory:
spine.yml, the core plugins. Written on first boot fromsrc/spine.tswith every default filled in, and thereafter only added to: a row's configuration is the operator's, and a disabled row is a decision. A row deliberately deleted comes back; disable it instead.plugins.yml, the installed set. Written on first boot from the rows setup named -- the package source it seeded into the module directory, which the node could not have fetched for itself -- and the host's to rewrite from then on.
Two files rather than two halves of one: nothing that installs a plugin can reach a spine row, and which tree an entry belongs to is what tells a core plugin apart from an installed one when a caller is derived.
The settle audit. Waiting is a normal state, so the report names what each entry is waiting for, and a failed plugin appears with its reason instead of taking the node down.
Shutdown reverses it: the tree unloads, each plugin's effects disposing in reverse order, and a second signal escalates to a hard stop.
