Files
leleka/control-plane/src/service_install.rs
T
Pavlo Ratushnyi 5dc28316ab STRA-338 S7: split worker, vision, prometheus, service_install and config by responsibility; name the modules after what they hold
* worker.rs (1271 lines, 1120 of them tests) is 149 lines; the supervisor tests are worker/tests.rs (shared fixtures) and
  worker/tests/{deadlines,handshake,generation,restart,lifecycle,reasoning}.rs. The test names are unchanged; their path
  gains the topic module (worker::tests::restart::..., see scripts/dev/test-outcomes.py compare: 23 MOVED, outcomes equal).
* vision.rs 402 -> 120 lines (tests are vision/tests.rs, same test ids); prometheus.rs 441 -> 50 (the series table is
  prometheus/series.rs); service_install.rs 436 -> 30 (the unix half is service_install/unix.rs and unix/tests.rs, same ids).
* config: Config::load_with_path (430 lines in one function) hands its limits, engine-worker and MCP sections to
  config/methods/load_sections.rs; the same checks run in the same order with the same messages.
* mcp, request_log, vision, worker, config: impl_*/note_*/check_* file names are now hub.rs, server.rs, stdio_transport.rs,
  http_transport.rs, parse_config.rs, obs_handle.rs, engine_counters.rs, encoder.rs, cleanup.rs, generation_result.rs, ...
  Public paths are unchanged (the modules re-export with glob as before).

Architecture gate: five oversize entries leave the baseline (worker.rs, vision.rs, prometheus.rs, service_install.rs,
config impl_config_2_2.rs); no number rose.
2026-11-05 20:33:04 +01:00

31 lines
1.2 KiB
Rust

//! Explicit per-user systemd installation. Never replaces a different unit.
use std::path::{Path, PathBuf};
const USAGE: &str = "usage: strata-next service-install --config ABSOLUTE_FILE --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE] [--unit strata-next[-NAME].service] [--enable] [--start]";
const INSTALL_READY_USAGE: &str = "service-install --start-ready requires --ready-url LOOPBACK_ORIGIN --ready-model ID [--ready-key-file FILE] [--ready-timeout-s N]; do not combine with --start";
#[derive(Debug)]
struct Options {
config: PathBuf,
working_dir: PathBuf,
env_file: Option<PathBuf>,
unit: String,
start: bool,
enable: bool,
}
const CONTROL_USAGE: &str = "usage: strata-next service-control status|start|stop|restart|enable|disable|start-ready|restart-ready|drain-stop|resume --config ABSOLUTE_FILE --working-dir ABSOLUTE_DIR [--env-file ABSOLUTE_FILE] [--unit strata-next[-NAME].service] [--ready-url LOOPBACK_ORIGIN --ready-model ID [--ready-key-file FILE] [--ready-timeout-s N]]";
#[cfg(unix)]
mod unix;
#[cfg(test)]
mod tests;
mod parse;
#[allow(unused_imports)]
pub use parse::*;
mod control;
#[allow(unused_imports)]
pub use control::*;