Repository navigation
T28 — Stop a host with its boxes, daemon and VM - #3022
Conversation
min host stop <host> stops each running box on the local host as min box stop does, then its daemon, and its VM on a VM host. With --force, each box gets the forced stop and the daemon is stopped without a wait for its clean shutdown. A VM is then stopped from this machine. The host-side VM stop that min stop --force uses moves into a shared helper, so both commands stop a VM the same way.
On a VM-backed lane, min host stop on the VM host stops two running boxes, then the daemon and its VM. The case checks the printed lines, that minvmd status reads the VM as stopped, and that each box stays listed as stopped.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
/revise Review at head bf0a2a2. cli.rs and cmd/mod.rs are accepted as wiring. Fix these:
Change nothing else. |
…t-with-its-boxes-daemon-and-vm
An unanswered probe, a failed box listing or a failed forced box stop on a VM host now falls through to the host-side VM stop. A host that does not answer exits 7, as min stop does. The box count leaves out boxes that had already exited, and the forced-stop caveat names boxes.
|
Round 1 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review.
Notes from the agent: Revise round 1, one item at a time. (1) In cmd_host_stop, |
|
/revise The
Update or add the tests that pin these lines. Change nothing else. |
…t-with-its-boxes-daemon-and-vm
Only a timeout or a lost connection prints "did not answer". A daemon refusal or a box gone before the stop is named. After the first stop with no answer, the remaining boxes are skipped and reported, so the forced shutdown follows at once. The box lines print before a shutdown error returns. Without --force, a ListBoxes error answer is named, not exit 7.
…t-with-its-boxes-daemon-and-vm
|
Round 2 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review.
Notes from the agent: Revise round 2. (1) A new rpc_unanswered in lifecycle.rs treats an error as no answer only for a russh error in the chain, the client's "RPC timed out after" deadline, or an empty reply that did not decode. minimal-client has no typed timeout error, so the timeout and the empty reply are matched on the client's message text. That crate is outside the layers. A refusal prints " was not stopped. The daemon on answered: ", and a box gone before the stop prints " was not stopped, because it is no longer on ." A failed write to out after a successful stop counts the box as stopped, and the write error returns after the VM stop. (2) After the first unanswered forced stop, the remaining boxes are not asked. Each prints " was not asked to stop, because did not answer the stop." (3) The lines print before the shutdown error returns. "It ended when its VM stopped." is appended only when the shutdown worked. (4) Without --force on a VM host, a ListBoxes error answer returns "the boxes on were not listed: ". A timeout or a lost connection still exits 7 with "does not answer". Item 4 is pinned by the classification test, not by an end-to-end test, because the harness daemon has no way to answer ListBoxes with an error. Deferred, not run: ./scripts/session-e2e.sh host_stop_stops_boxes_then_daemon_and_vm (lane: vm). just clippy-strict was not run. |
agent-137
left a comment
There was a problem hiding this comment.
Re-reviewed at 2910b43. fb6991f: 'did not answer' now prints only for a timeout or lost connection; an answered refusal is named, and a box gone since the listing says so. Under --force the first unanswered stop skips the remaining per-box stops and goes to the forced shutdown, naming the skipped boxes. The not-stopped lines print before a VM-stop error returns. Without --force a ListBoxes error answer is named, and only an unanswered listing exits 7. Every --force failure still ends in a VM stop. Low follow-ups (untested lines, subsystem refusal under version skew, RPC names in two rare messages) are in #3027.
|
/review |
|
Reviewed: 1 finding, none blocking at Address the comments on the diff. Clobber: none seen. |
…t-with-its-boxes-daemon-and-vm
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The code conforms to architecture.md line 540. Each running box stops as min box stop stops it, then the daemon stops, and on a VM host the VM stops too. --force forces both. The VM half has proof only in host_stop_stops_boxes_then_daemon_and_vm, and no CI lane runs that case. The KVM lane runs session-e2e.sh with no argument, and the case is not in that full run. Add the call to the full run, as C1 says.
Ruled at 2910b43 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
A Shutdown error that the daemon reported is an answer, and the VM stays up. min host stop now returns that error at once, not after a 20 s wait.
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The code conforms to architecture.md line 540. It stops each running box as min box stop does, then the daemon, and on a VM host the VM. --force forces both. The VM half has no proof that any lane runs. The e2e case host_stop_stops_boxes_then_daemon_and_vm is in the selector, but not in the whole-lane order that CI runs. Add the case to that order, as C1 says.
Ruled at fa288d4 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
Round 3 of 10 on the runtime's review findings, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
Notes from the agent: Revise round 3: one finding, fixed. The VM-host Shutdown error arm in shut_down_host_daemon now waits for the VM only when rpc_unanswered says the reply was lost. No new test pins this arm, because the in-process harness has no VM host. The existing test host_stop_force_forces_boxes_and_daemon_tells_no_answer_from_an_answer pins the rpc_unanswered classification. Deferred (lane: vm): ./scripts/session-e2e.sh host_stop_stops_boxes_then_daemon_and_vm, not run on this box. |
|
/revise Arch C1 (threads PRRT_kwDOPdfcxM6z3zeW, PRRT_kwDOPdfcxM6z39TL): |
…t-with-its-boxes-daemon-and-vm
|
Round 4 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
Notes from the agent: This round changes only scripts/session-e2e.sh, as the /revise note asks. The full run calls the host stop proof after proof_escapes_and_builds_stay_inside_box_rules and before proof_host_ip_deny_all. A comment says that the proof stops the VM host and that the next command autospawns a fresh one. Deferred (lane: vm): ./scripts/session-e2e.sh host_stop_stops_boxes_then_daemon_and_vm. I did not run it, because this box has no VM lane. bash -n passes on the script. The commitlint failure is on the earlier commit fa288d4: one body line is longer than 100 characters. The rules do not permit me to rewrite or force-push commits already on the branch, so that check stays red until a person rewords that commit or squashes on merge. |
|
/review |
There was a problem hiding this comment.
APPROVE withheld: 2 unresolved threads — minimal-arch[bot] scripts/session-e2e.sh:30856, minimal-arch[bot] scripts/session-e2e.sh:30856.
minimal-review — advisory review
Verdict COMMENT — No findings.
Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This head conforms to architecture.md line 540. The fdffc0f4 commit adds the host stop proof to the full run of scripts/session-e2e.sh, so the required VM lanes now run the VM half of min host stop. The earlier ruling stands for the Rust code, because the compare does not change it. The deferred VM leg must pass in ci-linux-kvm-success and ci-macos-success before the merge. A red lane reopens this ruling.
Ruled at fdffc0f against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @agent-137 closed the last one. The review of fdffc0f4f842 withheld this approval on the threads open then. Posted as a comment, as the review itself was; the check and the label carry it.
In the whole-lane run the earlier proofs can leave more boxes running, and a daemon respawn can leave the shared session stopped. The proof now starts two boxes of its own, and checks that the summary count equals the box lines that min host stop printed.
…t-with-its-boxes-daemon-and-vm
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change still conforms to architecture.md line 540. The code is the same as on fdffc0f4, which passed. The new commit changes only the e2e proof. The proof now starts its own two boxes. It checks that the summary count equals the box lines that min host stop printed. That still proves the rule, which is to stop each running box before the daemon and the VM.
Ruled at b156d93 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
Round 5 of 10 on a failed check suite, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. A person runs Notes from the agent: test-kvm: the job log excerpt shows no failure line, only the ::error:: strings in the workflow step source. So the cause is not certain. I found one fault that a whole-lane run hits. The proof asserted exactly 2 boxes and the shared session, but earlier proofs can leave more boxes running, and a daemon respawn can leave the shared session stopped. The proof now starts its own two boxes (e2e-host-stop-a, e2e-host-stop-b), and checks that the summary count is at least 2 and equals the |
agent-137
left a comment
There was a problem hiding this comment.
Re-reviewed at b156d93. d3d4abf makes the host-stop proof start its own two boxes (an earlier respawn in a whole-lane run can leave the shared session stopped) and checks that the summary's count equals the number of 'Stopped .' lines, at least 2, since earlier proofs can leave more running. The two boxes are then listed as stopped after the VM boots again.
|
/review |
…t-with-its-boxes-daemon-and-vm # Conflicts: # scripts/session-e2e.sh
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This head is a merge of main (#3028) and has no new branch commit. The one merge conflict is in the VM-lane selector of scripts/session-e2e.sh. The resolution keeps the case from #3028 and adds the host stop case. The host stop proof keeps its place in the full run. BCLI-049 conforms to architecture.md line 540, as it did on b156d936.
Ruled at bdd1651 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
A merge of main before round 6, not counted against the cap (1 of 3), pushed as Resolved conflicts in:
Verify Outside the task's
Converted to a draft: something above needs a person before review.
Notes from the agent: Revise round: resolved the merge conflict in scripts/session-e2e.sh. The VM-lane selector case list now carries both host_exposures_follow_the_table (from main) and host_stop_stops_boxes_then_daemon_and_vm (this task). The merge is committed. Deferred (lane: vm): ./scripts/session-e2e.sh host_stop_stops_boxes_then_daemon_and_vm was not run on this box. bash -n on the script passes. |
T28 — Stop a host with its boxes, daemon and VM
slice: S7
kind: task
covers: BCLI-049
size: M
est: 200 code, 160 tests
executor: agent
difficulty: needs care
model: standard
diagnostics:
min host stop <host>prints "Stopped boxes, the daemon and its VM on .", pinned by host_stop_force_forces_boxes_and_daemonobservability: the command's existing tracing span records the verb, the box id it resolved and the outcome
layers:
- client:
- crates/minimal/src/cmd/hosts.rs:
min host stop [--force]stops each running box, then the daemon and its VM- crates/minimal/src/cmd/boxes/lifecycle.rs: shares the daemon shutdown
- crates/minimal/src/tests.rs: the in-process minimald test harness gains this layer's tests
test: cargo nextest run -p minimal host_stop_force_forces_boxes_and_daemon
- e2e:
- scripts/session-e2e.sh: adds the host_stop_stops_boxes_then_daemon_and_vm case to the VM-lane selector
test (deferred: vm): ./scripts/session-e2e.sh host_stop_stops_boxes_then_daemon_and_vm
produces: none
consumes:
- crates/minimal/src/cmd/hosts.rs
proof:
min host stopstops each box on the host, then its daemon and its VM.depends on:
- blocked by #2900
Proof
A person can run
min host stop <host>on a local host. It stops each running box on that host and printsStopped <box>.for each one. Then it stops the daemon, and on a VM host also the VM, and prints "Stopped boxes, the daemon and its VM on ." ("Stopped boxes and the daemon on ." on a native host). With--force, each box gets the forced stop, and the daemon stops without a wait for its clean shutdown. The in-process test proves this for a native host. The VM half is in the deferred e2e case.Notes from the agent: Out of layers: crates/minimal/src/cli.rs (adds HostCommand::Stop and HostStopArgs) and crates/minimal/src/cmd/mod.rs (the verb name
host stopfor the root span, and the dispatch). The tree had nohost stopsubcommand, so the command cannot exist without these two routes-table edits. I did not touch crates/minimal/src/cmd/session.rs:min stopkeeps its own shutdown path. The shared part is the host-side VM stop (stop_vm_from_host_at), whichmin stop --forceandmin host stopnow both use.shut_down_host_daemonin lifecycle.rs is new and onlymin host stopcalls it. A follow-up can movemin stop(the bare-stopalias of BCLI-042) onto it.Wording: the task fixes "Stopped boxes, the daemon and its VM on ." I print that text on a VM host, with one deviation: n = 1 prints "1 box". A native host has no VM, so there the line is "Stopped boxes and the daemon on .". The pinned test checks the native line, because the in-process harness runs only a native daemon.
host_stop_summaryis unit-checked for the VM wording in the same test.Other printed text I added: " is not running." (the daemon is already down, exit 0). Refusals: the daemon is still busy, the daemon does not answer, or the VM is still shutting down. Each one that has a remedy names
min host stop <host> --force. For an unreachable VM host under --force, the VM is stopped from this machine, asmin stop --forcedoes…[truncated]Tests
cargo nextest run -p minimal host_stop_force_forces_boxes_and_daemonVerify
min task run agent-verifyexited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.Deferred
The plan marked these test lines deferred: the executor lacks the lane, so nothing here ran them and they still owe evidence.
./scripts/session-e2e.sh host_stop_stops_boxes_then_daemon_and_vmOut of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimal/src/cli.rscrates/minimal/src/cmd/mod.rsCloses #2910