fx-init is a single cosmocc APE binary with one poll(2) event loop. It reads the CURRENT store generation, performs boot-status + roll-forward rollback, execs dhake on the generation's buildfile to materialize the rootfs (/etc, /bin symlinks, /run), then starts and supervises services with readiness, health, restart policy, and backoff.
It is the sole writer of the volatile runtime DB and the log DB. The actor model is enforced structurally: dl_open takes a process-lifetime exclusive fcntl lock, so the immutable store DB is opened only transiently for reads / rollback / activate — never held. fxctl never opens a DB directly; every query goes through the control socket.
| Binary | Role |
|---|---|
| fx-init | Lean PID1/supervisor (U-C1). Boot-status + roll-forward rollback, execs dhake to materialize rootfs, supervises services, sole writer of the runtime DB. |
| fx-activate | Build-time activation (U-B). Evaluates config.dhall, computes the closure, emits a per-generation Dhakefile, writes generation facts, publishes a store snapshot. |
| fxctl | The datalog control/query plane (U-D). Pure POSIX client — links nothing from vendor; every request is one line over /run/fx/control.sock. |
| fx_probe / fx_log | The init-hosted probe loop (U-C2) over /proc,/sys and the compact DAFSA-interned service log DB. |
This repo is self-contained — it owns the entire running-system surface and composes the org's proven components as vendored submodules. No glue scripts; each component is a real, independently-built artifact.
| Component | Role |
|---|---|
| fxstore | the content-addressed store — store / closure / snapshot primitives. |
| datalog-dafsa | the Datalog / DAFSA engine — runtime + log relations, hybrid search. |
| dafsa | the compact shared-suffix store — log message interning. |
| dhake | the Dhall build runner — rootfs materialization at boot. |
| dhall-c | the config language evaluator — activation. |