Correctness and contracts report · NVIDIA/hyperflare-inference #687

Raw Markdown for agents: https://autobot.eidonix.com/p/bff9ac7b-8391-47e5-9dd5-d7688342a6cd.md

Correctness, Contracts & System-Level Consequences — PR #687

Verdict: sound. No Blocker, no Major. The change is documentation prose, two user-visible English strings, one unit-file literal, and one new unit test. It touches no hot path, no lock, no buffer, no wire format, no captured-graph contract, no protocol constant (PROTOCOL_VERSION stays 7, flare-cli/src/orbit/mod.rs:36-37), and no default. Three Minor findings, all about coverage/scope of the guard and the prose rather than about behavior.

Key findings

  1. Minor — the new guard checks subcommand names and order only, never the summary text that #452 actually asked for. flare-cli/src/cli.rs:2441-2442,2452-2455.
  2. Minor — flare-cli's test suite now hard-fails when ../packaging/debian/flare.1 is absent (partial/sparse checkout); .unwrap_or_else(|e| panic!(...)), flare-cli/src/cli.rs:2426-2429. Mitigated by publish = false (flare-cli/Cargo.toml:7) and existing precedent (flare-cli/src/distribution/cache_tests.rs:852-853).
  3. Minor — man-page prose outside .SH COMMANDS is still stale and the PR body's "documents every visible flare subcommand accurately" overstates it. packaging/debian/flare.1:3,8-11,44-50 vs flare-cli/src/cli.rs:31,34-36.
  4. Because there is no display_order/next_help_heading anywhere in flare-cli/src (repo search at pr/687: no matches), clap help order is declaration order, so the ordered assert_eq! and the man page's ordering are both valid today — no ordering hazard.
  5. No system-level consequences: systemd_unit() is a pure format! (flare-cli/src/orbit/agent.rs:2605-2612) called once per install() (agent.rs:2633-2636); the string edits change no directive, so no restart/ExecStart/WantedBy semantics shift. Metric/rate span check: the PR changes no rate, latency, or admission metric, and samples no time span — not engaged.

Areas inspected and found sound (no findings)

Findings in detail

Finding 1 — Minor: the regression guard protects the tag list, not the summaries (#452's actual ask)

flare-cli/src/cli.rs:2441-2455:

            if in_commands && let Some(command) = line.strip_prefix(".B ") {
                documented.push(command.trim().to_string());
            }
...
        assert_eq!(
            documented, visible,
            "packaging/debian/flare.1 .SH COMMANDS must match visible flare subcommands"
        );

Only .B <name> tags are collected; the prose under each tag is never read and never compared to sub.get_about(). #452's Expected text asks for entries "with the same one-line summary the binary prints". The added summaries are paraphrases, not the clap strings — e.g. packaging/debian/flare.1:26-28 "Run this host's agent, which pairs with controllers and supervises serving ranks,\nor install and manage the agent service." versus flare-cli/src/cli.rs:57 "Run this host's agent, which pairs with controllers and supervises serving ranks."; and flare.1:30-32 adds ", pairing hosts and managing multi-host serving groups" over cli.rs:59 "Control an orbit of agents from this machine."

Impact: the exact drift #452 reported (stale summary text) can recur with a green test; only renames/reorders hiders are caught. Fix: capture each .B name plus the lines that follow it and assert a normalized prefix against Cli::command()'s get_about() for that subcommand (or generate the .SH COMMANDS block from clap).

Finding 2 — Minor: new hard cross-directory dependency in flare-cli's test suite

flare-cli/src/cli.rs:2426-2429:

        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()));

Impact: cargo test -p flare-cli now panics outright when the crate is built without the sibling packaging/ tree (partial or sparse checkout, extracted crate dir). Mitigations, all verified: publish = false (flare-cli/Cargo.toml:7) so no crates.io tarball can hit it; both CI test jobs use full checkouts (.github/workflows/native-serving.yml:69-73 (not opened)); the Debian image only builds, never tests; and a precedent already exists (flare-cli/src/distribution/cache_tests.rs:852-853 reads ../helios/tests/fixtures/legacy-cluster-custom). Fix: skip with an explanatory eprintln! when the file is missing instead of panicking, so a missing sibling tree degrades to "not checked" rather than a red suite.

Finding 3 — Minor: stale prose outside .SH COMMANDS; the "accurately" claim only holds for the command list

packaging/debian/flare.1:3 and 8-11:

 flare \- serve prepared model packages on NVIDIA GPUs
...
 Flare runs prepared CUDA graphs and provides an inference API.
 The executable also includes a host agent and Orbit cluster management.
 A compatible NVIDIA driver and a model package matching the GPU architecture

.SH NAME still says "model package" while the CLI's own about string is "Serve prepared models on NVIDIA GPUs" (cli.rs:31) and the new run entry says "prepared core" (flare.1:15); .SH DESCRIPTION names only the host agent and Orbit, omitting doctor, trust, models, parallax; and .SH OPTIONS (flare.1:44-50) lists only --help/--version, never the global --config (cli.rs:34-36). The same "package"→"core" chore is still open at docs/TODO.txt:164-166.

Impact: man 1 flare remains internally inconsistent and still under-describes the command set a reader discovers from flare --help; the PR body's "documents every visible flare subcommand accurately" (man 1 flare installed by the Debian package…) is true of .SH COMMANDS alone. Fix: either widen NAME/DESCRIPTION/OPTIONS in the same commit ("prepared cores", mention the diagnostic and model-cache commands, document --config) or narrow the PR body's claim to .SH COMMANDS.

Claims vs. evidence

PR-body claim Finding
Nine visible subcommands documented in CLI help order Verified — flare.1:12-43 order equals cli.rs:44-76 visible order (run, download, inspect, doctor, agent, orbit, trust, models, parallax), hidden HardwareRevision (cli.rs:52-56) and CheckpointTransport (cli.rs:61-66) plus clap's help excluded
"summaries aligned with flare --help" Accurate but weak — paraphrases, never asserted (Finding 1)
Four a orbit sites now an orbit Verified — agent.rs:2610, new assert agent.rs:4888-4890, controller.rs:204, controller.rs:1163, mod.rs:36; case-insensitive repo search at pr/687 returns no a orbit
grep -rni "a orbit" → zero matches Verified by the same search
246 tests pass (220/9/6/4/7, 3 ignored) Author-run only — no CI checks exist on 4130f7a; counts are not reproducible from the diff. The 3 ignored tests are legitimate fixture-gated cases (distribution.rs (not opened), distribution/cache_tests.rs, orbit/agent.rs)
groff -man -Tutf8 -ww -z → zero warnings Plausible by inspection — only .TP/.B/.BR added inside COMMANDS; .BR worker . renders "worker."
Runtime behavior and core compatibility unchanged Verified — PROTOCOL_VERSION = 7 unchanged (mod.rs:37); systemd_unit() keeps After=, ExecStart=, Restart=on-failure, RestartSec=5, WantedBy=default.target byte-identical (agent.rs:2610)
Declared unrun: ./scripts/build_deb.sh, systemctl --user install Confirmed unverified end to end — nothing shows the page installed at /usr/share/man/man1/flare.1 via packaging/debian/package.sh:25-26, or a host's regenerated unit. Note the unit file is rewritten only when flare agent install is re-run (agent.rs:2633-2636), so existing installs keep "a orbit's" until reinstall — expected, not a defect

Open questions / not found