Function build_sop_engine
pub fn build_sop_engine(
config: SopConfig,
data_dir: &Path,
install_root: &Path,
audit_memory: Arc<dyn Memory>,
adapters: SopEngineAdapters,
) -> (Arc<Mutex<SopEngine>>, Arc<SopAuditLogger>)Expand description
Build a single shared SopEngine + SopAuditLogger pair.
This is the sole construction site for SOP state within a daemon.
Callers receive Arc<Mutex<SopEngine>> and Arc<SopAuditLogger>
handles — never call SopEngine::new or SopAuditLogger::new
directly outside this module.
The two directory arguments serve different roles and must not be conflated:
data_diris the daemon state dir. It anchors the durable run store, which lands at<data_dir>/sop/runs.dbunless[sop] run_state_diroverrides it.install_rootis the install root (config.install_root_dir(), i.e.config_path’s parent). It anchors SOP-definition loading, so a relative[sop] sops_dir(documentedshared/sops) resolves to<install>/shared/sops— the same directory the web/RPC SOP author writes to. Passingdata_dirfor both (the historical bug) made the engine load definitions from<data_dir>/sops, which authored SOPs never populate, so every manual trigger reported “no matching manual trigger”.