StaticrunStaticshutdownGraceful-shutdown counterpart to run(). Owns the backend-layer
teardown that must run before the process exits — currently the
world-clock snapshot so the next boot resumes continuously.
Invoked from Server.stop(); kept here (not in services/) so
transport code stays free of engine concerns.
Run the boot sequence in dependency order. Every step must complete before the next begins; any failure throws and stops boot.
Sequence:
Mongo connect — every later step touches PM.
Seed templates from disk into
domain(idempotent — existing docs are left alone). Runs FIRST after connect because PM.loadHooks below clones the DomainHook template out ofdomain, and the bootstrap manifest may reference other seeded templates too.Load PM hooks (folder/leaf invariant on Collections.Domain, etc.) — clones the seeded hook templates and registers them with the persistence pipeline. Seeds must exist before this runs.
Controllers are not pre-loaded; dispatch clones a fresh one per command via
StuffApi.clone('/obj/command/<Name>').Preload command YAMLs and resolve each
validators: [...]spec into a live function. Validators are inert until this runs (runValidatorsearly-returns on absent_resolvedValidators), so this MUST happen before the server accepts traffic.Bootstrap runtime instances from the engine manifest. All prior steps must be complete; failures here prevent boot.