Repository navigation
feat(minimal): T31 — Remove the old session verbs and move their callers to the box verbs - #3678
Conversation
`min session activate|destroy|exec|rename|policy|hooks|run`, bare `min stop` and `min task run --path` leave the command model. Each now fails as clap fails for any unknown command or flag, with exit 2. `min session list` and `min session attach` stay (BCLI-042). The handlers of the old verbs stay as library functions, because crates/minimal/tests/cli.rs still drives them. update_check, task.rs and a create.rs test helper drop their references to the removed parts. BREAKING CHANGE: the old session verbs, bare `min stop` and `min task run --path` are unknown commands. Use the `min box` verbs, `min host stop` and `-C <dir>`.
A `min` from this release on has no bare `min stop`. The installer now stops each local host that runs with `min host stop <host>`. Before a graceful stop it checks for running boxes itself, because `min host stop` refuses nothing. A running box, or a box listing that fails, leads to the same question as before. An older `min` without `min host stop` still gets bare `min stop`.
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
…-old-session-verbs-and-move-their-call
The binary tests in tests/cli.rs and tests/otel_cli.rs still ran `min session activate`, `session exec`, `session run` and `task run --path`, which BCLI-042 removed. They now run `-C <dir> session start --detach`, `box exec` and `-C <dir> task run`. The otel test drops `session run`, because no box verb runs a task in an existing box.
|
Round 1 of 10 on a failed check suite, pushed as
Verify Outside the task's
Converted to a draft: verify exited 100; outside the task's The old Notes from the agent: Revise round 1: the CI 'tests' job failed on 14 tests in crates/minimal/tests/cli.rs and crates/minimal/tests/otel_cli.rs. They still ran the removed verbs through the |
|
/arch-review |
|
Reviewed: no findings; approval withheld, 6 threads unresolved at APPROVE withheld: 6 unresolved threads — minimal-foundry[bot] scripts/install.sh, minimal-foundry[bot] scripts/install.sh, minimal-arch[bot] crates/minimal/src/cli.rs:1282, minimal-arch[bot] crates/minimal/src/tests.rs, minimal-arch[bot] scripts/install.sh:949, …. Resolving the last thread releases the approval on this head. Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none seen. |
| if ! _boxes="$("$bindir/min" box list --all -o json 2>/dev/null </dev/null)"; then | ||
| echo "$boxes_unknown_msg" >&2 | ||
| return 1 | ||
| fi | ||
| if printf '%s\n' "$_boxes" | grep -qE '"state": *"running"'; then | ||
| echo "$sessions_live_msg" >&2 | ||
| return 1 | ||
| fi |
There was a problem hiding this comment.
HIGH · correctness · confidence 0.60 · in min_stop
The running-box check can pass while a box runs. min box list exits 0 when a host is unreachable. It only prints a line to stderr, which this call discards. live_hosts includes a host in state not responding. So min_stop finds no running box, skips the refusal, and runs min host stop on that host. That ends its boxes without consent. The comment says a failed listing never ends a box without consent, but a partial listing is not a failed one.
What the reviewer checked
list.rs: Err(HostRead::Unreachable(err)) => { ... eprintln!(unreachable_host_line) } then Ok(()); install.sh:982 only tests the exit status and greps for state running
Hand this to an agent
Act on a code-review finding.
File: scripts/install.sh
Lines: 982-989
Category: correctness
Severity: high (reviewer confidence 0.60)
Finding:
The running-box check can pass while a box runs. `min box list` exits 0 when a host is unreachable. It only prints a line to stderr, which this call discards. `live_hosts` includes a host in state `not responding`. So `min_stop` finds no `running` box, skips the refusal, and runs `min host stop` on that host. That ends its boxes without consent. The comment says a failed listing never ends a box without consent, but a partial listing is not a failed one.
First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.
👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.
There was a problem hiding this comment.
Addressed in 8cbd18661ab2: min_stop now reads the stderr of min box list. A 'its boxes are not listed' line counts as a failed listing, so the installer asks before min host stop can end a box. Test HS8 in install_test.sh.
| _hosts="$(live_hosts)" | ||
| [ -n "$_hosts" ] || return 0 |
There was a problem hiding this comment.
MEDIUM · correctness · confidence 0.55 · in min_stop
live_hosts hides the failure of min host list (2>/dev/null, pipe to awk). An empty result then makes min_stop return 0. A failed listing, for example from version skew after the swap, looks like no running host. The installer then reports a successful stop and replaces binaries under a live daemon. The box listing below treats its own failure as a refusal. Treat a failed host list the same way, with a distinct message.
What the reviewer checked
live_hosts: "$bindir/min" host list 2>/dev/null </dev/null | awk ...; min_stop: [ -n "$_hosts" ] || return 0
Hand this to an agent
Act on a code-review finding.
File: scripts/install.sh
Lines: 979-980
Category: correctness
Severity: medium (reviewer confidence 0.55)
Finding:
`live_hosts` hides the failure of `min host list` (2>/dev/null, pipe to awk). An empty result then makes `min_stop` return 0. A failed listing, for example from version skew after the swap, looks like no running host. The installer then reports a successful stop and replaces binaries under a live daemon. The box listing below treats its own failure as a refusal. Treat a failed host list the same way, with a distinct message.
First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.
👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.
There was a problem hiding this comment.
Addressed in 8cbd18661ab2: live_hosts now fails when min host list fails. min_stop then refuses with 'min host list failed', and the pre-swap stop aborts before any executable is replaced, with or without --force-stop. Test HS9.
There was a problem hiding this comment.
arch-review: CONDITIONS · 3 conditions · the full ruling
The removal of the session verbs and bare min stop follows the design's command tree. Three gaps remain. First, min task run build --path sub/dir still runs the task, because clap passes --path after the name to the task. BCLI-042 says this form exits 2 and runs nothing (C1). Second, spec 28's Rollout gives this PR the spec amendments, and the PR edits no spec. Installer R5.5 still specifies bare min stop (C2). Third, the old handlers in cmd/session.rs stay as dead code, and the follow-up has no issue (C3).
Ruled at 1accff2 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
| /// task name is a task argument, never a project path. | ||
| #[arg(long)] | ||
| pub path: Option<String>, | ||
| // BCLI-042: no `--path`. The global `-C <dir>` names the project. |
There was a problem hiding this comment.
C1 · args below is trailing_var_arg and allow_hyphen_values. So min task run build --path sub/dir parses with --path as a task argument, and the task runs. Refuse --path among the task arguments in task::run_entry, before any typed --, with exit 2, next to misplaced_run_flag.
There was a problem hiding this comment.
Addressed in 8cbd18661ab2: run_entry refuses --path or --path= among a task run's arguments before any typed --, next to misplaced_run_flag. It exits 2 through RunFlagMisplaced, before a box exists.
| // run --path` fail as the parser fails for any unknown command or flag. | ||
| // The exit is 2, and nothing runs, because the parse gives no command. | ||
| #[test] | ||
| fn removed_session_verbs_are_unknown_commands() { |
There was a problem hiding this comment.
C1 · Rename this test to removed_session_verbs_fail_as_unknown_commands. The BCLI-042 verify: line runs that name. Add the forms with --path after the task name, and assert exit 2 with no box created.
There was a problem hiding this comment.
Addressed in 8cbd18661ab2: Renamed to removed_session_verbs_fail_as_unknown_commands. It now runs both --path forms through cmd_task_run and asserts exit 2 and an empty ListSessions.
| # this inside the component loop). | ||
| sessions_live_msg='daemon has active sessions' | ||
|
|
||
| # A `min` from this release on has no bare `min stop`: `min host stop <host>` |
There was a problem hiding this comment.
C2 · This changes the installer's stop. Installer spec R5.5 (07-spec-installer.md lines 278-348) still specifies bare min stop. Amend R5.5 and its tests in this PR to min host stop <host>, the running-box check, and the fallback for an older client.
There was a problem hiding this comment.
Addressed in 8cbd18661ab2: R5.5 and its tests in 07-spec-installer.md now specify min host stop , the installer's own running-box check, the refusals for a box or host listing that fails, and the bare min stop fallback.
| List(BoxListArgs), | ||
| /// Activate (create) a new session | ||
| Activate(ActivateArgs), | ||
| // BCLI-042: no `activate`, `destroy`, `exec`, `rename`, `policy`, |
There was a problem hiding this comment.
C3 · The handlers for these verbs stay in cmd/session.rs as dead public functions, and tests/cli.rs calls them directly. Delete them and move those tests to the box verbs. Or open an issue and name it in the PR body as a residual.
There was a problem hiding this comment.
Addressed in 8cbd18661ab2: Deleted the removed verbs' handlers, their arg structs, session_run_task_env and the helpers only they used. The tests/cli.rs callers now use min session start, min box rm, min box rename and min box show --network.
|
/revise Arch's ruling at 1accff2 (CONDITIONS) asks for three things. Do all three in this PR. For C3, remove the dead code here; do not leave it as a residual.
Run |
|
That Round 2 of 10 was not counted; #2917 carries the same sentence. |
|
/revise Arch's ruling at 1accff2 (CONDITIONS) asks for three things. Do all three in this PR. For C3, remove the dead code here; do not leave it as a residual.
Run |
…-old-session-verbs-and-move-their-call
min task run build --path sub/dir parsed --path as a task argument, and the task ran in the current project. The run now refuses --path before any typed -- with exit 2, before it creates a box (BCLI-042). The handlers of the removed session verbs and bare min stop, their arg structs, session_run_task_env and the helpers only they used are gone, with their tests. The BCLI-042 test takes the name its verify line runs.
The tests in tests/cli.rs called the handlers of the removed session verbs. Activations now run min session start --detach with -C, and the destroy, rename and policy tests run min box rm, min box rename and min box show --network. The tests of bare min stop and session hooks are gone with the commands. The cleanup warnings that named min session destroy now name min box rm --force.
min box list exits 0 when it cannot reach a host, and leaves that host's boxes out. min_stop now reads its stderr and treats that as a failed listing, so it asks before min host stop can end a box. A failed min host list made min_stop stop nothing and report success. It now refuses with its own message, and the pre-swap stop aborts before it replaces an executable.
min stop is gone (BCLI-042), so the CLI source no longer prints the active-sessions refusal the gate read. The gate now pins the text of an older min stop, which released clients carry, and checks that the installer prints the same literal for its own running-box check.
R5.5 now specifies min host stop <host> with the installer's own running-box check, the refusal when the boxes or the hosts are not listed, and the bare min stop fallback for an older client. The R10.4 card test names min, not the removed min session activate.
NET-015, NET-018, NET-020, NET-035, NET-040, NET-049, NET-051 and NET-058 named min session activate, exec, run, policy and destroy, which BCLI-042 removed. They now name min session start, min box exec, min box show --network and min box rm --force. The NET-035 test reads min session start --help.
Hooks are turned off with min session start --no-hooks, and min box spec <box-id> lists the stored hooks. BCLI-042 removed min session activate and min session hooks.
BEP-043 names min box rm --force, and the BEP-085 note names the min box show <box> --network row. BCLI-042 removed min session destroy and min session policy.
BCLI-042 removed bare min stop. min host stop sends the Shutdown that TEL-011's test measures.
BCLI-042 removed min session activate. A session box now comes from min session start or a bare min.
|
Round 1 of 10 on a /revise note, pushed as
Verify Converted to a draft: verify exited 101. The old min session verbs and bare min stop fail as unknown commands, and session list and session attach still work. The installer uses min host stop and falls back to bare min stop on an older client. After this round, the AppArmor remedy and the macOS finalize-install --undo note tell the user to run min host stop , not the removed bare min stop. Notes from the agent: Revise round 1. The /revise note asked for three changes. (1) sandbox AppArmor remedy: now 'run min host stop , then your command again'. The sandbox crate and minimald do not know the host name that min host list assigns (local0, local-minvmd0), so the message uses the placeholder. (2) MACOS_UNDO_VM_RUNNING_NOTE: now 'run min host stop for each host that min host list shows as running, and end any minvmd process still running'. cmd/hosts.rs prints the state 'running' in min host list, so this wording matches what the user sees. (3) The pinning tests at sandbox lib.rs, minimald rpc/tests.rs and minimal tests/cli.rs (two places) are updated and pass. Two long lines were rewrapped. cargo fmt --check passes. The full 'cargo nextest run -p sandbox -p minimald -p minimal' that the note asks for was started once but did not finish within the 30-minute tool limit, so I have no exit code for it. The runner or CI must provide that evidence. Residual, not changed because the note says to change nothing else: the version-skew refusal in crates/minimald/src/box_manager.rs line 1607 still says 'Run |
|
/arch-review |
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
C1 from the last ruling is still open. README.md and docs/guide/ still tell users to run min session activate, min session destroy, min session run and min session policy. These commands are not in the design command tree (architecture.md line 410), and BCLI-042 removes them. The T31 Rollout entry in spec 28 says this PR moves every doc that uses them. Commit 75691abe fixes the AppArmor and undo notes correctly, but it does not change these docs. Make the edits in C1.
Outside the diff
README.md:95: C1 · Lines 86, 95, 105, 131, 169 and 227 name removed verbs. Usemin session start(with--detach,--nameor--loadoutas needed). Usemin box show <box> --networkfor the policy. Remove--sync none, becausemin session startdoes not take it.docs/guide/setup.md:62: C1 · Lines 2 and 62 namemin session activate. Replace it withmin session start.docs/guide/agents.md:21: C1 · Replacemin session activate --attach .withmin session start.docs/guide/dev-shell.md:14: C1 · Lines 14 and 17 namemin session activate. Usemin session start. On line 102, replacemin session destroy <session>withmin box rm --force <box>.docs/guide/migrate-to-minimal-session.md:61: C1 · Lines 61 and 63 namemin session activate. Usemin session start --detachfor the form that only creates, andmin session startfor the form that attaches.docs/guide/tasks.md:9: C1 · Remove themin session run <session> <name>clause. That verb has no successor (#3216).
Ruled at 9ca75a9 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 6 unresolved threads — minimal-foundry[bot] scripts/install.sh, minimal-foundry[bot] scripts/install.sh, minimal-arch[bot] crates/minimal/src/cli.rs:1282, minimal-arch[bot] crates/minimal/src/tests.rs, minimal-arch[bot] scripts/install.sh:949, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
/revise Arch's ruling at 9ca75a9 (CONDITIONS) keeps C1 open: the user docs still name the removed verbs. Spec 28's Rollout entry for T31 says this PR moves every doc that uses them. Make exactly these edits.
Then grep |
|
That Round 2 of 10 was not counted; #2917 carries the same sentence. |
|
/arch-review |
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The removal of the old verbs and the move to min host stop in the installer conform to the design. Some callers still print a removed command. The no-TTY min report in cmd/list.rs names min session run and min session activate --attach ., and both now fail with exit 2. Fix it as C1 says. Fix or file the other messages that C2 lists. The design (architecture.md line 458) keeps min session activate --sync until gominimal/arch#163 rules, and this change removes it. That is escalation E1 for a person, not a change for this PR.
Outside the diff
crates/minimal/src/cmd/list.rs:185: C1 · This hint namesmin session run, which now fails with exit 2. Printmin task run <task>here. Architecture.md line 442 says a task ismin task run.crates/minimal/src/cmd/list.rs:187: C1 · This hint namesmin session activate --attach ., which now fails with exit 2. Printmin session starthere (architecture.md line 442). Update the tests that pin this line.
Ruled at 9ca75a9 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
|
/revise Arch's ruling at 9ca75a9 (CONDITIONS) C1: bare
Change nothing else. C2 is filed as #3685 and is not part of this round. Run |
…-old-session-verbs-and-move-their-call
Without a terminal, bare min suggested min session run and min session activate, which no longer exist. It now suggests min task run <task> and min session start.
The merge from main brought a test that sets the removed --path field. The test already names the project through -C.
…-old-session-verbs-and-move-their-call
|
Round 2 of 10 on a /revise note, pushed as
Verify Converted to a draft: verify exited 100. The old Notes from the agent: Revise round 2, C1. In render_bare_status, the Next lines now print |
|
/arch-review |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
C1 is met. Bare min now prints min task run <task> and min session start in its Next: lines, and the tests pin the new text. C2 is met as a residual: the PR body names #3685 for the stale product messages and the docs. The compare adds no new use of a removed verb. One design question stays open as E1. Architecture line 458 keeps min session activate --sync on an alias, but spec 28 removes it with no alias. A person must settle that in gominimal/arch.
Ruled at 3fd76f9 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 6 unresolved threads — minimal-foundry[bot] scripts/install.sh, minimal-foundry[bot] scripts/install.sh, minimal-arch[bot] crates/minimal/src/cli.rs:1282, minimal-arch[bot] crates/minimal/src/tests.rs, minimal-arch[bot] scripts/install.sh:949, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
T31 — Remove the old session verbs and move their callers to the box verbs
slice: S8
kind: task
covers: BCLI-042, BCLI-066
size: M
est: 250 code, 150 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics:
min session activate(and each removed spelling) fails with clap's unknown-command error and exit 2, andmin session list/min session attachstill work, pinned by removed_session_verbs_are_unknown_commands and kept_session_list_and_attach_still_workobservability: none new; the removed verbs no longer have a span
layers:
- client:
- crates/minimal/src/cli.rs: removes the old subcommands and flags from the one command model
- crates/minimal/src/cmd/mod.rs: drops their dispatch
- crates/minimal/src/cmd/session.rs: removes
session activate|destroy|exec|rename|policy|hooks|run- crates/minimal/src/main.rs: removes bare
min stop- crates/minimal/src/tests.rs: the in-process minimald test harness gains this layer's tests
test: cargo nextest run -p minimal removed_session_verbs_are_unknown_commands
test: cargo nextest run -p minimal kept_session_list_and_attach_still_work
- installer:
- scripts/install.sh: matches
min host stopwith its own running-box check- scripts/install_test.sh: tests the
min host stoppath and the fallback to baremin stopproduces: none
consumes: none
proof: The old
min sessionverbs and baremin stopfail as unknown commands;session listandsession attachstill work; the installer usesmin host stop, falling back to baremin stopon an older client.depends on:
- blocked by #3217
- blocked by #3524
- blocked by #3525
- blocked by #3589
- blocked by #3634
- blocked by #3638
- blocked by #2890
- blocked by #2898
- blocked by #2903
- blocked by #2905
- blocked by #2907
- blocked by #2910
Proof
At this branch,
min session activate|destroy|exec|rename|policy|hooks|run, baremin stopandmin task run --pathfail with clap's unknown-command or unknown-argument error and exit 2. They are not in--helpor completions.min session listandmin session attachstill parse, and they list and attach to a session box through the in-process daemon. The installer stops each running local host withmin host stop <host>after its own running-box check. It falls back to baremin stopwhen the installedminhas nomin host stop.Notes from the agent: Out-of-layer files that the removal forces, each a minimal edit: crates/minimal/src/update_check/mod.rs drops
Command::Stopfrom a match. crates/minimal/src/cmd/boxes/create.rs: the test helperparsed_activate_argsparsesActivateArgsdirectly, becauseSessionCommand::Activateis gone. crates/minimal/src/task.rs:TaskRunArgshas nopathfield, soRunEntry::from(TaskRunArgs)setspath: None, and three tests drop the field.Round 1 left two things undone, and round 2 did both (arch C3 at 1accff2). The handlers
cmd_activate'smin session activateentry,cmd_destroy,cmd_stop,cmd_rename,cmd_session_policy,cmd_session_hooks,cmd_exec,cmd_session_runandtask::session_run_task_envare deleted, and the tests in tests/cli.rs that ran a removed spelling now run the box verbs. CI is green at 9ca75a9.Tests
cargo nextest run -p minimal removed_session_verbs_are_unknown_commandscargo nextest run -p minimal kept_session_list_and_attach_still_workVerify
min task run agent-verifyexited 100, so this PR is a draft.Out of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimal/src/cmd/boxes/create.rscrates/minimal/src/task.rscrates/minimal/src/update_check/mod.rsResiduals
Closes #2917