Theseus is a Linux service supervisor and PID 1. Cascadia boots it by default in its x86-64 live image and persistent VM. Both offer OpenRC recovery. Cascadia distribution and downloads
It is written in Nelua. Its native service model is declared in CUE. No Lua runtime, no maintained C implementation, no YAML service language, and no database is required to boot.
The OpenRC adapter runs installed Alpine service scripts through the system OpenRC runtime. Native Theseus services have their own lifecycle and dependency model. See OpenRC compatibility for the command surface and package evidence.
CUE says what should be true. Nelua makes it true.
Theseus is intended to be boring under stress: small, explicit, inspectable, deterministic, and hard to surprise.
The command surfaces are deliberately split:
theseus openrc postgresql restart # explicit mutation
the status of openrc postgresql # observation
the is the short read/query interface to the exact same typed state used by theseus.
Maintained project sources are restricted to:
*.neluafor implementation, tests, tools, compatibility mechanisms, and CLIs;*.cuefor schemas, service declarations, targets, and policy data.
Generated C from Nelua is a build artifact, never maintained source. Shell scripts supplied by existing OpenRC packages are external compatibility inputs, not part of the Theseus implementation.
- Userspace Nelua supervisor, typed service state machine, dependency graph, and deterministic
thegrammar. - CUE service schema and deterministic compilation into a small runtime record format.
- Process supervision using Linux process identity and event primitives.
- OpenRC compatibility against the real Alpine init-script corpus.
- Native targets, readiness, restart/backoff, resource ownership, and structured lifecycle events.
- PID 1 only after the supervisor and compatibility layers have been abused for long enough to deserve it.
The userspace daemon supervises an individual foreground service or a
native target. It tracks direct children with Linux pidfds, applies
bounded restart policy, and serves status and shutdown requests over
a local Unix socket. It reaps adopted descendants while running. A target uses the validated dependency order and
waits for the configured service readiness before admitting subsequent
services. Run it with theseusd --target TARGET.
On an installed Cascadia VM with Theseus r14 or later, the status of default
shows the target’s phase and running counts. Use the services of default
to see each member’s state. A rollback names the failed hard requirement
while the daemon stops its other services. Live query reference
Set THESEUS_CGROUP_ROOT to a delegated cgroup v2 directory to track
and clean up each service's descendants. See
resource ownership.
A private runtime directory
enables automatic cleanup on restart after a daemon crash.
Unix socket readiness can also require a successful application probe.
The PostgreSQL example uses pg_isready to wait until the database
accepts connections. The Alpine soak procedure exercises native targets and live OpenRC packages together. The full guest check covers boot and shutdown under Alpine init. Broader Alpine package qualification remains open. The rescue entry point below is separate from the service
supervisor.
Other Linux systems can opt in to the native PID 1 entry point for isolated VM qualification. It supervises the native daemon and enters console rescue on boot failure. An additional boot option runs the installed OpenRC boot and shutdown runlevels. Verified Linux bundles and versioned installation cover download, trial boots, and rollback.
The opt-in nebox build uses src/theseus/earlyboot.nelua as the initramfs
entry point. It mounts procfs and sysfs, starts an interactive nebox shell
on the boot console, reaps children, and restarts the shell after exit.
The module uses the Spaceghost Nelua fork's control flow, compound
assignment, conditional expressions, and string interpolation extensions.
This entry point is for bring-up and rescue. The CUE service model and long-lived userspace supervisor are separate from this boot path. See the nebox README for the build and QEMU smoke commands.