From bef1cf2481f2102b0fb00c5f2e53ad7fd4e71246 Mon Sep 17 00:00:00 2001 From: "gominimal-aw-bot[bot]" <281738952+gominimal-aw-bot[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2026 02:55:34 +0000 Subject: [PATCH 1/3] fix(minimal): say the finalize-install egress item plainly The classifier item of min finalize-install --show rendered in design vocabulary a reader cannot act on: "classifier", "host-address boxes", "run unenforced", "egress verdict", "placement unit", "runs unplaced", "delegation", "socket table lookup", "did not read". Reword its label, its three today lines, its this-step line, its eight cannot-do causes, and the matching KVM-item cause in plain language that names the CLI words (--network host_ip with --deny-all-egress), and update the six pinned unit-test assertions. Wording only: no behaviour, flag, JSON key, item id or exit code changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 9920ade82118b0ac23e0f7370e6598027861892f) --- crates/minimal/src/cmd/finalize_install.rs | 86 ++++++++++++---------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/crates/minimal/src/cmd/finalize_install.rs b/crates/minimal/src/cmd/finalize_install.rs index 92db7a20e4..b3a9a268cc 100644 --- a/crates/minimal/src/cmd/finalize_install.rs +++ b/crates/minimal/src/cmd/finalize_install.rs @@ -712,7 +712,8 @@ pub(crate) mod linux { pub(crate) const USERNS_ID: &str = "userns-profile"; const USERNS_LABEL: &str = "the private sandbox every box runs in"; pub(crate) const CLASSIFIER_ID: &str = "classifier"; - const CLASSIFIER_LABEL: &str = "per-box egress limits for host-address boxes"; + const CLASSIFIER_LABEL: &str = "deny-all egress enforced for boxes that share this \ + machine's address (--network host_ip with --deny-all-egress)"; const KVM_LABEL: &str = "KVM access for the Linux VM provider"; /// The profile the step installs, the very file the checkout ships. @@ -998,9 +999,9 @@ pub(crate) mod linux { CLASSIFIER_ID, CLASSIFIER_LABEL, format!( - "the classifier tree at {CLASSIFIER_TREE_ROOT} is installed for another \ - account (uid {uid}); running this step would replace their delegation, \ - so that account removes it with `min finalize-install --undo` first" + "egress enforcement at {CLASSIFIER_TREE_ROOT} is installed for another \ + account (uid {uid}), and this step would replace it; that account must \ + run `min finalize-install --undo` first" ), ); } @@ -1008,9 +1009,9 @@ pub(crate) mod linux { return Item::cannot( CLASSIFIER_ID, CLASSIFIER_LABEL, - "this command runs as root, but the classifier is installed for the account \ - whose daemon it places and watches that account's socket: run it as that \ - account (it asks for sudo itself)" + "this command runs as root, but this step is installed for the account \ + that runs the Minimal daemon: run it as that account (it asks for sudo \ + itself)" .to_string(), ); } @@ -1019,12 +1020,12 @@ pub(crate) mod linux { } let cause = match facts.mount { Cgroup2Mount::Absent => { - "no cgroup2 filesystem is mounted at /sys/fs/cgroup, which the classifier \ - tree lives in" + "no cgroup2 filesystem is mounted at /sys/fs/cgroup, which egress \ + enforcement needs" } Cgroup2Mount::WithoutNsdelegate => { - "cgroup2 is mounted without nsdelegate, so a box's cgroup is no boundary it \ - cannot leave" + "cgroup2 is mounted without nsdelegate, which egress enforcement needs to \ + keep a box inside its own cgroup" } // The two names ride in a shell single-quoted word, in a unit // file (systemd expands `%` specifiers everywhere and `$` in @@ -1036,45 +1037,46 @@ pub(crate) mod linux { // that never finds the daemon. Cgroup2Mount::Delegated => { if operator.is_empty() { - "this process's user name did not read, so there is no account to \ - delegate the classifier tree to" + "could not read this process's user name, so there is no account to \ + install this step for" } else if !operator .chars() .all(|c| c.is_ascii_alphanumeric() || "._-".contains(c)) { "this process's user name carries a character outside [A-Za-z0-9._-], \ - which the step's shell word and unit file cannot take" + which the install script and its systemd units cannot handle" } else if socket.is_empty() { - "this host's daemon socket path did not resolve, so there is nothing \ - for the placement unit to watch" + "could not work out this machine's daemon socket path, which the \ + step's systemd unit watches" } else if !socket .chars() .all(|c| c.is_ascii_alphanumeric() || "._/-".contains(c)) { - "this host's daemon socket path carries a character outside \ - [A-Za-z0-9._/-], which the step's shell word, unit file and socket \ - table lookup cannot take" + "this machine's daemon socket path carries a character outside \ + [A-Za-z0-9._/-], which the install script and its systemd units \ + cannot handle" } else { return Item::missing( CLASSIFIER_ID, CLASSIFIER_LABEL, if !facts.table_present { - "host-address boxes run unenforced: the classifier's privileged \ - step is not installed, or did not finish, so no box's egress \ - verdict is decided per box" + "deny-all egress is not enforced for boxes that share this \ + machine's address: the step that enforces it is not \ + installed, or did not finish" } else if !facts.copy_current { - "the root-owned copy of the classifier's privileged step is not \ - this build's, so the placement unit runs a stale step" + "the installed copy of the step that enforces deny-all egress \ + is not this version of min's, so an out-of-date copy runs at \ + every daemon start" } else { - "the classifier is installed but its systemd units are not, so a \ - daemon restart runs unplaced and a reboot loses the tree" + "the step that enforces deny-all egress is installed but its \ + systemd units are not, so enforcement stops after a daemon \ + restart or a reboot" } .to_string(), format!( - "installs the classifier's cgroup tree and packet filter for \ - {operator}'s daemon, a boot unit that re-installs them, and a \ - systemd path unit that places the daemon's listener in its leaf \ - on every daemon start" + "installs the cgroup tree and packet filter that enforce it \ + for {operator}'s daemon, and systemd units that restore them \ + at boot and on every daemon start" ), classifier_steps(operator, socket), ); @@ -1260,8 +1262,8 @@ pub(crate) mod linux { return Item::cannot( KVM_ID, KVM_LABEL, - "this process's user name did not read, so there is no account to \ - add to the kvm group" + "could not read this process's user name, so there is no account \ + to add to the kvm group" .to_string(), ); } @@ -2056,13 +2058,18 @@ mod tests { sock, "without nsdelegate", ), - (bare, "", sock, "user name did not read"), + (bare, "", sock, "could not read this process's user name"), (bare, "al ice", sock, outside), (bare, "al'ice", sock, outside), (bare, "al%ice", sock, outside), (bare, "al$ice", sock, outside), (bare, "al\\ice", sock, outside), - (bare, "alice", "", "socket path did not resolve"), + ( + bare, + "alice", + "", + "could not work out this machine's daemon socket path", + ), (bare, "alice", "/run/it's.sock", outside), (bare, "alice", "/run/my dir/ssh.sock", outside), (bare, "alice", "/run/my\tdir/ssh.sock", outside), @@ -2078,7 +2085,7 @@ mod tests { } let item = classifier_item_over(&bare, "alice", sock); assert_eq!(item.state, ItemState::Missing, "{item:?}"); - assert!(item.today.as_deref().unwrap().contains("unenforced")); + assert!(item.today.as_deref().unwrap().contains("is not enforced")); assert!(item.step.as_deref().unwrap().contains("every daemon start")); // The marker over a stale copy: the step is there, but the one the // units run is not this build's, so it is missing again and the @@ -2095,7 +2102,7 @@ mod tests { ); assert_eq!(stale.state, ItemState::Missing, "{stale:?}"); assert!( - stale.today.as_deref().unwrap().contains("stale step"), + stale.today.as_deref().unwrap().contains("out-of-date copy"), "{stale:?}" ); assert_eq!( @@ -2301,7 +2308,12 @@ mod tests { assert!(absent.cause.unwrap().contains("/dev/kvm is not there")); let unnamed = kvm_item_over(denied(), "", false); assert_eq!(unnamed.state, ItemState::Cannot); - assert!(unnamed.cause.unwrap().contains("did not read")); + assert!( + unnamed + .cause + .unwrap() + .contains("could not read this process's user name") + ); let unquotable = kvm_item_over(denied(), "al ice", false); assert_eq!(unquotable.state, ItemState::Cannot); assert!( From 6bfa6dd531900591dd439176bb729f891fb46328 Mon Sep 17 00:00:00 2001 From: "gominimal-aw-bot[bot]" <281738952+gominimal-aw-bot[bot]@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:04:57 -0700 Subject: [PATCH 2/3] fix(minimal): state what the egress item's missing units and stale copy cost Without its systemd units a daemon restart leaves the daemon outside the tree, so a deny-all box is refused, not run unenforced; only a reboot loses the tree. The stale-copy state also covers a host with no copy at all. The label becomes a noun phrase so a done line never reads as a claim that deny-all egress is enforced on a host whose table is not refusing, and drops the flag form, which named only one of the two ways to declare it. --- crates/minimal/src/cmd/finalize_install.rs | 40 ++++++++++++++-------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/crates/minimal/src/cmd/finalize_install.rs b/crates/minimal/src/cmd/finalize_install.rs index b3a9a268cc..02460cdef0 100644 --- a/crates/minimal/src/cmd/finalize_install.rs +++ b/crates/minimal/src/cmd/finalize_install.rs @@ -712,8 +712,8 @@ pub(crate) mod linux { pub(crate) const USERNS_ID: &str = "userns-profile"; const USERNS_LABEL: &str = "the private sandbox every box runs in"; pub(crate) const CLASSIFIER_ID: &str = "classifier"; - const CLASSIFIER_LABEL: &str = "deny-all egress enforced for boxes that share this \ - machine's address (--network host_ip with --deny-all-egress)"; + const CLASSIFIER_LABEL: &str = "deny-all egress enforcement for boxes that share this \ + machine's address (--network host_ip)"; const KVM_LABEL: &str = "KVM access for the Linux VM provider"; /// The profile the step installs, the very file the checkout ships. @@ -1065,18 +1065,20 @@ pub(crate) mod linux { installed, or did not finish" } else if !facts.copy_current { "the installed copy of the step that enforces deny-all egress \ - is not this version of min's, so an out-of-date copy runs at \ - every daemon start" + is missing or out of date, so this version of min's step is \ + not what runs at boot or at daemon start" } else { "the step that enforces deny-all egress is installed but its \ - systemd units are not, so enforcement stops after a daemon \ - restart or a reboot" + systemd units are not, so after a daemon restart a deny-all \ + box is refused, and after a reboot it starts with deny-all \ + egress not enforced" } .to_string(), format!( - "installs the cgroup tree and packet filter that enforce it \ - for {operator}'s daemon, and systemd units that restore them \ - at boot and on every daemon start" + "installs the cgroup tree and packet filter that enforce \ + deny-all egress for {operator}'s daemon, and systemd units \ + that restore them at boot and place the daemon under them on \ + every daemon start" ), classifier_steps(operator, socket), ); @@ -2102,7 +2104,11 @@ mod tests { ); assert_eq!(stale.state, ItemState::Missing, "{stale:?}"); assert!( - stale.today.as_deref().unwrap().contains("out-of-date copy"), + stale + .today + .as_deref() + .unwrap() + .contains("missing or out of date"), "{stale:?}" ); assert_eq!( @@ -2120,10 +2126,16 @@ mod tests { sock, ); assert_eq!(unitless.state, ItemState::Missing, "{unitless:?}"); - assert!( - unitless.today.as_deref().unwrap().contains("units are not"), - "{unitless:?}" - ); + // An unplaced daemon refuses a deny-all box (the probe cannot read + // the table); only the reboot, which loses the tree, runs it unenforced. + let today = unitless.today.as_deref().unwrap(); + for words in [ + "units are not", + "after a daemon restart a deny-all box is refused", + "after a reboot it starts with deny-all egress not enforced", + ] { + assert!(today.contains(words), "{unitless:?}"); + } // A stale copy on a mount the tree cannot live in is still the mount's fault. assert_eq!( classifier_item_over( From b64acd28b802b38ddfd8b16051bf5fb41b09a06b Mon Sep 17 00:00:00 2001 From: "gominimal-aw-bot[bot]" <281738952+gominimal-aw-bot[bot]@users.noreply.github.com> Date: Sun, 11 Oct 2026 20:11:03 -0700 Subject: [PATCH 3/3] fix(minimal): hedge the egress item's missing-units line and pin its label The missing-units line fires when any one unit or wants link is absent, so it says what a daemon restart and a reboot can cost, not what they always cost. The label names the flag pair that declares the box and a unit test pins it. --- crates/minimal/src/cmd/finalize_install.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/crates/minimal/src/cmd/finalize_install.rs b/crates/minimal/src/cmd/finalize_install.rs index 02460cdef0..38603f92db 100644 --- a/crates/minimal/src/cmd/finalize_install.rs +++ b/crates/minimal/src/cmd/finalize_install.rs @@ -713,7 +713,7 @@ pub(crate) mod linux { const USERNS_LABEL: &str = "the private sandbox every box runs in"; pub(crate) const CLASSIFIER_ID: &str = "classifier"; const CLASSIFIER_LABEL: &str = "deny-all egress enforcement for boxes that share this \ - machine's address (--network host_ip)"; + machine's address (--network host_ip with --deny-all-egress)"; const KVM_LABEL: &str = "KVM access for the Linux VM provider"; /// The profile the step installs, the very file the checkout ships. @@ -1069,9 +1069,9 @@ pub(crate) mod linux { not what runs at boot or at daemon start" } else { "the step that enforces deny-all egress is installed but its \ - systemd units are not, so after a daemon restart a deny-all \ - box is refused, and after a reboot it starts with deny-all \ - egress not enforced" + systemd units are missing or not enabled, so a daemon restart \ + can leave deny-all boxes refused, and a reboot can leave \ + deny-all egress not enforced" } .to_string(), format!( @@ -2088,6 +2088,12 @@ mod tests { let item = classifier_item_over(&bare, "alice", sock); assert_eq!(item.state, ItemState::Missing, "{item:?}"); assert!(item.today.as_deref().unwrap().contains("is not enforced")); + // The label prints after a done mark too, so it names the thing, not a state. + assert_eq!( + item.label, + "deny-all egress enforcement for boxes that share this machine's address \ + (--network host_ip with --deny-all-egress)" + ); assert!(item.step.as_deref().unwrap().contains("every daemon start")); // The marker over a stale copy: the step is there, but the one the // units run is not this build's, so it is missing again and the @@ -2128,11 +2134,12 @@ mod tests { assert_eq!(unitless.state, ItemState::Missing, "{unitless:?}"); // An unplaced daemon refuses a deny-all box (the probe cannot read // the table); only the reboot, which loses the tree, runs it unenforced. + // Any one missing unit or link lands here, so the sentence says "can". let today = unitless.today.as_deref().unwrap(); for words in [ - "units are not", - "after a daemon restart a deny-all box is refused", - "after a reboot it starts with deny-all egress not enforced", + "units are missing or not enabled", + "a daemon restart can leave deny-all boxes refused", + "a reboot can leave deny-all egress not enforced", ] { assert!(today.contains(words), "{unitless:?}"); }