Expand description
Server bootstrap sequence, extracted from main().
Each function here corresponds to one (or a small cluster of) the
numbered phases that used to live inline in async fn main():
crash-monitor branch -> parent-process watchdog -> logging init ->
PATH enrichment -> CLI/config parsing -> data-dir + migration setup ->
DB/store opening -> event bus + subagent watcher + background task
spawns -> TCP listener binds -> router/AppState build -> ESTART stderr
emission -> stdin-watch thread -> SIGINT/SIGTERM handler.
This module is purely a relocation of that logic into named functions;
main() calls them in the same order with the same effect.
Re-exportsΒ§
pub use watchers::*;pub use logging::*;pub use stores::*;pub use background::*;pub use network::*;pub use plumbing::*;pub use shutdown::*;pub use delivery::*;
ModulesΒ§
- background π
- Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.3).
- delivery π
- Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.3).
- logging π
- Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.3).
- network π
- Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.3).
- plumbing π
- Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.3).
- shutdown π
- Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.3).
- stores π
- Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.3).
- watchers π
- Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md Β§4.3).
MacrosΒ§
- eprintln_
lossy π eprintln!that canβt panic. srvβs stderr is a pipe the launcher reads, so once the launcher is gone a write fails with EPIPE (Rust ignores SIGPIPE), andeprintln!panics on a failed write. On the paths that must run when the launcher has died, the parent and stdin watchers, that panic killed the watcher thread before it could shut srv down, which left srv running with no launcher, holdingsrv.lock, so the app could not be opened again.