From 4130f7aa6902eef50f8a2704a6eda70d993409fb Mon Sep 17 00:00:00 2001 From: Joshua Cartu Date: Wed, 2 Dec 2026 20:44:08 +0100 Subject: [PATCH] flare-cli, debian: sync flare.1 subcommands and fix "an orbit" wording The Debian manual page `packaging/debian/flare.1` listed only three of the nine visible `flare` CLI subcommands (`run`, `agent`, and `orbit`), omitting `download`, `inspect`, `doctor`, `trust`, `models`, and `parallax`, while its `run` summary did not mention downloading prepared cores from Hugging Face. Separately, four strings and doc comments in `flare-cli/src/orbit/` used the indefinite article "a orbit" instead of "an orbit", including the user-visible systemd unit `Description` installed by `flare agent install` and the core resolution error returned by `flare orbit run`. Before this change, `packaging/debian/flare.1` `.SH COMMANDS` documented only `run`, `agent`, and `orbit`, and four locations in `flare-cli/src/orbit/` contained "a orbit". After this change: - `packaging/debian/flare.1` `.SH COMMANDS` documents all nine visible subcommands defined in `flare-cli/src/cli.rs` (`run`, `download`, `inspect`, `doctor`, `agent`, `orbit`, `trust`, `models`, and `parallax`) in CLI help order with summaries matching `flare --help`. - `flare-cli/src/orbit/agent.rs` updates the generated systemd unit `Description` from `a orbit's` to `an orbit's`; `flare-cli/src/orbit/controller.rs` updates the core-access error message and the `CoreReference::Node` doc comment from `a orbit` to `an orbit`; and `flare-cli/src/orbit/mod.rs` updates the `PROTOCOL_VERSION` doc comment from `a orbit` to `an orbit`. - `flare-cli/src/cli.rs` adds `cli::tests::debian_man_page_documents_every_visible_subcommand` to assert that `packaging/debian/flare.1` `.SH COMMANDS` matches the visible subcommands in `Cli::command()`, and `flare-cli/src/orbit/agent.rs` extends `orbit::agent::tests::systemd_unit_quotes_core_cache_with_spaces_and_percent` to assert the updated `Description` line. Debian package users reading `man 1 flare` now see the complete set of visible CLI subcommands with accurate descriptions, future CLI subcommand additions cannot silently drift from `packaging/debian/flare.1` without failing `flare-cli` unit tests, and Orbit systemd unit metadata and diagnostics use grammatical English without changing runtime behavior or core compatibility. Validation: - Built the release `flare` binary (`cargo build --locked --release --manifest-path flare-cli/Cargo.toml --bin flare`) and verified `flare --help` against `packaging/debian/flare.1`. - Checked troff formatting and rendering with `groff -man -Tutf8 -ww -z packaging/debian/flare.1` (zero warnings) and `groff -man -Tutf8 packaging/debian/flare.1`. - Ran `cargo test --locked --release --manifest-path flare-cli/Cargo.toml`: all 246 executed tests passed across `src/main.rs` (220 passed, 3 ignored), `tests/cache_commands.rs` (9 passed), `tests/cli.rs` (6 passed), `tests/inspect.rs` (4 passed), and `tests/unverified_payload.rs` (7 passed), including `cli::tests::debian_man_page_documents_every_visible_subcommand` and `orbit::agent::tests::systemd_unit_quotes_core_cache_with_spaces_and_percent`. The 3 ignored unit tests require explicit multi-host or legacy-core fixtures (`export_signed_payload_distribution_fixture`, `receive_rank_accepts_old_metadata_with_empty_platform`, `serve_ring_transfer_fixture`) and were not run. - Ran `grep -rni "a orbit" . --exclude-dir=.git` and confirmed zero matches. - Limitations: the full Docker Debian package build (`./scripts/build_deb.sh`) and `systemctl --user` service installation were not executed in this environment. Fixes #452 Signed-off-by: Joshua Cartu Design-Signed-Off-By: Antigravity (Gemini 4 Neon); design-review=2e5b --- flare-cli/src/cli.rs | 37 +++++++++++++++++++++++++++++++ flare-cli/src/orbit/agent.rs | 5 ++++- flare-cli/src/orbit/controller.rs | 4 ++-- flare-cli/src/orbit/mod.rs | 2 +- packaging/debian/flare.1 | 28 ++++++++++++++++++++--- 5 files changed, 69 insertions(+), 7 deletions(-) diff --git a/flare-cli/src/cli.rs b/flare-cli/src/cli.rs index b5abcb17c..8981d380f 100644 --- a/flare-cli/src/cli.rs +++ b/flare-cli/src/cli.rs @@ -2417,6 +2417,43 @@ mod tests { .is_err() ); } + + #[test] + fn debian_man_page_documents_every_visible_subcommand() { + use clap::CommandFactory; + use std::path::Path; + + let man_page_path = Path::new(env!("CARGO_MANIFEST_DIR")) + .join("../packaging/debian/flare.1"); + let man_page = std::fs::read_to_string(&man_page_path) + .unwrap_or_else(|e| panic!("failed to read {}: {e}", man_page_path.display())); + + let mut in_commands = false; + let mut documented = Vec::new(); + for line in man_page.lines() { + if line == ".SH COMMANDS" { + in_commands = true; + continue; + } + if in_commands && line.starts_with(".SH ") { + break; + } + if in_commands && let Some(command) = line.strip_prefix(".B ") { + documented.push(command.trim().to_string()); + } + } + + let visible: Vec = Cli::command() + .get_subcommands() + .filter(|sub| !sub.is_hide_set() && sub.get_name() != "help") + .map(|sub| sub.get_name().to_string()) + .collect(); + + assert_eq!( + documented, visible, + "packaging/debian/flare.1 .SH COMMANDS must match visible flare subcommands" + ); + } } #[cfg(all(test, unix))] diff --git a/flare-cli/src/orbit/agent.rs b/flare-cli/src/orbit/agent.rs index 0f10c6180..f7e85ceca 100644 --- a/flare-cli/src/orbit/agent.rs +++ b/flare-cli/src/orbit/agent.rs @@ -2607,7 +2607,7 @@ fn systemd_unit(listen: &str, core_cache: Option<&Path>) -> String { .map(|path| format!(" --core-cache {}", systemd_quote(&path.to_string_lossy()))) .unwrap_or_default(); format!( - "[Unit]\nDescription=Flare agent: runs this host's rank of a orbit's serving group\nAfter=network-online.target\n\n[Service]\nExecStart=%h/.local/lib/flare-agent/flare agent --listen {listen}{cache_flag}\nRestart=on-failure\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n" + "[Unit]\nDescription=Flare agent: runs this host's rank of an orbit's serving group\nAfter=network-online.target\n\n[Service]\nExecStart=%h/.local/lib/flare-agent/flare agent --listen {listen}{cache_flag}\nRestart=on-failure\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n" ) } @@ -4885,6 +4885,9 @@ pub mod tests { #[test] fn systemd_unit_quotes_core_cache_with_spaces_and_percent() { let plain = systemd_unit("0.0.0.0:29900", None); + assert!(plain.contains( + "Description=Flare agent: runs this host's rank of an orbit's serving group\n" + )); assert!(plain.contains("ExecStart=%h/.local/lib/flare-agent/flare agent --listen 0.0.0.0:29900\n")); assert!(!plain.contains("--core-cache")); diff --git a/flare-cli/src/orbit/controller.rs b/flare-cli/src/orbit/controller.rs index 3ccbce23b..27dddba3e 100644 --- a/flare-cli/src/orbit/controller.rs +++ b/flare-cli/src/orbit/controller.rs @@ -201,7 +201,7 @@ pub struct LaunchOptions { #[derive(Clone, Debug, PartialEq, Eq)] pub enum CoreReference { Local(PathBuf), - /// A core a orbit node holds at an absolute path. + /// A core an orbit node holds at an absolute path. Node { node: String, path: String, @@ -1160,7 +1160,7 @@ impl Controller { match parse_core_reference(reference, |name| self.orbit.node(name).is_some()) { CoreReference::Local(path) => { let primary = path.canonicalize().map_err(|e| { - format!("cannot access core {reference}: {e}; a node-held core is NODE:/ABSOLUTE/PATH with NODE a orbit node") + format!("cannot access core {reference}: {e}; a node-held core is NODE:/ABSOLUTE/PATH with NODE an orbit node") })?; run_args.serving.verify_weights = verify_weights; let (authorized, publisher) = verify(&primary, run_args, origin, false)?; diff --git a/flare-cli/src/orbit/mod.rs b/flare-cli/src/orbit/mod.rs index c4f231552..a55ec0732 100644 --- a/flare-cli/src/orbit/mod.rs +++ b/flare-cli/src/orbit/mod.rs @@ -33,7 +33,7 @@ pub type Failure = Box; /// The agent's default port on every host. pub const PORT: u16 = 29900; -/// The agent protocol every node and controller of a orbit must share. +/// The agent protocol every node and controller of an orbit must share. pub const PROTOCOL_VERSION: u32 = 7; /// Frame tags. A request receives OK with a body or ERROR with a message. diff --git a/packaging/debian/flare.1 b/packaging/debian/flare.1 index 1c92a76cb..64d15ad01 100644 --- a/packaging/debian/flare.1 +++ b/packaging/debian/flare.1 @@ -12,13 +12,35 @@ and tensor-parallel size are required for serving. .SH COMMANDS .TP .B run -Load and serve a prepared model package. +Serve a local core, or download and serve a prepared core from Hugging Face. +.TP +.B download +Download a prepared core from the hardware's Hugging Face revision. +.TP +.B inspect +Summarize a core's metadata, with optional memory, graph, and frontend details. +.TP +.B doctor +Check Linux host readiness for PCIe and DGX Spark tensor-parallel serving. .TP .B agent -Run or install a host agent. +Run this host's agent, which pairs with controllers and supervises serving ranks, +or install and manage the agent service. .TP .B orbit -Pair hosts and manage multi-host serving groups. +Control an orbit of agents from this machine, pairing hosts and managing +multi-host serving groups. +.TP +.B trust +Manage remembered publisher trust. +.TP +.B models +List, inspect, and manage locally prepared models. +.TP +.B parallax +Monitor live expert-movement and persistent-worker telemetry from a serving +instance. Alias: +.BR worker . .SH OPTIONS .TP .B \-\-help