Skip to content

feat: T61 — Every box verb refuses a box on a stopped VM with NET-058's answer - #3647

Merged
agent-137 merged 2 commits into
mainfrom
agent/3634-every-box-verb-refuses-a-box-on-a-stopped-vm-wit
Nov 19, 2026
Merged

agent-137 merged 2 commits into
mainfrom
agent/3634-every-box-verb-refuses-a-box-on-a-stopped-vm-wit

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T61 — Every box verb refuses a box on a stopped VM with NET-058's answer

slice: S8
kind: task
covers: BCLI-002, BCLI-042
size: M
est: 160 code, 320 tests
executor: agent
difficulty: routine
model: standard
diagnostics: none new
observability: none new
layers:
- client:
- crates/minimal/src/cmd/boxes/address.rs: resolve_box_on_hosts reads the stopped VMs' records and refuses a box on a stopped VM with OnStoppedVm
- crates/minimal/src/cmd/session.rs: resolve_box_of_type reads the stopped VMs' records through the shared resolver
- crates/minimal/src/tests.rs: every_box_verb_refuses_box_on_stopped_vm, with min box exec, attach, rm, stop, wait, events, cp, rename, restart, logs, prune --parent and min session stop|rm|logs against a box on a stopped VM, each exit 4 with the start command
- docs/specs/28-spec-box-cli/28-spec-box-cli.md: the line 675 bullet says every min box verb gives NET-058's refusal
test: cargo nextest run -p minimal every_box_verb_refuses_box_on_stopped_vm
produces: none
consumes: none
proof: With a box on a stopped VM, min box exec <box> -- true, min box rm <box> and min box restart <box> each exit 4 with box '<box>' is on VM '<vm>', which is stopped. Start it with: min --vm <vm> session attach <box>.
depends on:
- blocked by #3589

Proof

With a box on a stopped VM, min box exec <box> -- true, min box rm <box> and min box restart <box> each exit 4 with box '<box>' is on VM '<vm>', which is stopped. Start it with: min --vm <vm> session attach <box>. The same refusal comes from min box attach --exec, stop, wait, events, cp, rename, logs and prune --parent, and from min session stop|rm|logs.

Notes from the agent: Out of layers: crates/minimal/src/cmd/boxes.rs. min session logs and min task logs resolved through a private copy of resolve_box_of_type there (resolve_typed_box_on_hosts). I removed that copy and made box_logs_on_hosts call session::resolve_box_of_type, because without it min session logs does not give the refusal the test requires. resolve_box_on_hosts keeps its signature. It gets the VM name from the host's socket path (providers/local-minvmd0 for the default VM, providers/local-minvmd0/ for a named VM), so no caller changed. resolve_box_on_local_hosts now delegates to it. A stopped VM's records carry no box type, so the typed resolver keeps them for every type noun. The test calls the on-hosts function of each verb. min box rename and min box prune --parent call ensure_daemon first, which cannot start minvmd in the test, so the test calls resolve_box_on_hosts with their verb names, which is the call those commands make. Plain min box attach <box> (without --exec) uses the session attach path, which T60 and earlier work already cover. The test covers attach --exec. The spec bullet moved from line 675 in the task text but is the same bullet. I removed T31 waits on T61 from it, because T61 is now done. just lint-prose did not run: vale is not installed on this box. cargo clippy -p minimal --all-targets is clean, and 25 related resolver tests (stopped_vm, typed, box_logs, ambiguous) pass.

Tests

line exit tail
cargo nextest run -p minimal every_box_verb_refuses_box_on_stopped_vm 0 warning: unknown fields in task runtime-implement-test-0: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot)

Verify

min task run agent-verify exited 100, so this PR is a draft.

minimal::bin/min tests::invalid_project_file_for_box_spec_says_spec_cannot_show
        PASS [   0.006s] (1182/1207) minimal::bin/min tests::invalid_project_file_prints_toml_error_once
        PASS [   0.005s] (1183/1207) minimal::bin/min tests::invalid_project_file_prints_toml_error_once_for_io
        PASS [   0.005s] (1184/1207) minimal::bin/min tests::local_host_not_found_exits_4
        PASS [   0.005s] (1185/1207) minimal::bin/min tests::loadout_not_found_exits_4
        PASS [   0.005s] (1186/1207) minimal::bin/min tests::machine_mode_answers_write_failures
        PASS [   0.006s] (1187/1207) minimal::bin/min tests::machine_mode_error_line_keeps_an_empty_hint
        PASS [   0.005s] (1188/1207) minimal::bin/min tests::machine_mode_error_object_is_one_stamped_line
        PASS [   0.006s] (1189/1207) minimal::bin/min tests::machine_mode_error_object_on_stderr
        PASS [   0.006s] (1190/1207) minimal::bin/min tests::machine_mode_names_the_grant_refusal_code
        PASS [   0.006s] (1191/1207) minimal::bin/min tests::machine_output_mode_keys_on_the_output_flag
        PASS [   0.005s] (1192/1207) minimal::bin/min tests::misplaced_run_flag_exits_2
        PASS [   0.005s] (1193/1207) minimal::bin/min tests::network_flag_refusal_exits_2
        PASS [   0.005s] (1194/1207) minimal::bin/min tests::project_file_not_found_exits_4
        PASS [   0.005s] (1195/1207) minimal::bin/min tests::prune_off_tty_needs_yes_exits_2
        PASS [   0.005s] (1196/1207) minimal::bin/min tests::resume_and_session_attach_refusals_map_to_exit_codes
        PASS [   0.005s] (1197/1207) minimal::bin/min tests::rm_running_box_refuses_naming_force_with_exit_2
        PASS [   0.005s] (1198/1207) minimal::bin/min tests::run_verbs_and_wait_timeout_return_124_with_code_timeout
        PASS [   0.005s] (1199/1207) minimal::bin/min tests::session_policy_json_is_a_stdout_contract
        PASS [   0.004s] (1200/1207) minimal::bin/min tests::session_run_is_a_stdout_contract
        PASS [   0.005s] (1201/1207) minimal::bin/min tests::start_entry_refusals_exit_with_their_codes
        PASS [   0.005s] (1202/1207) minimal::bin/min tests::task_file_invalid_exits_3
        PASS [   0.005s] (1203/1207) minimal::bin/min tests::task_not_found_exits_4
        PASS [   0.005s] (1204/1207) minimal::bin/min tests::task_run_is_a_stdout_contract
        PASS [   0.005s] (1205/1207) minimal::bin/min tests::type_refusals_exit_3_and_4
        PASS [   2.054s] (1206/1207) minimal::named_vm named_vm_reaches_autospawn
  stdout ───

    running 1 test
    test exec_run_attach_and_task_run_share_the_commands_trace ... FAILED

    failures:

    failures:
        exec_run_attach_and_task_run_share_the_commands_trace

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 5 filtered out; finished in 12.89s

  stderr ───

    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
error: test run failed

Out of scope

These files are outside the task's layers:, so this PR is a draft:

  • crates/minimal/src/cmd/boxes.rs

Closes #3634

resolve_box_on_hosts now reads a stopped VM's persisted box records, so
min box exec, attach --exec, rm, stop, wait, events, cp, rename,
restart, logs and prune --parent refuse such a box with the start
command and exit 4 (BCLI-002, NET-058). The VM comes from the host's
socket path, so no caller changes.

resolve_box_of_type uses the same resolver, so min session|task stop,
rm and logs refuse it too. The duplicate typed resolver in boxes.rs
now calls resolve_box_of_type.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot 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.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ebb44b2e-7097-4c28-87c6-edd39959fa28

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

Copy link
Copy Markdown
Contributor

Spec lint

docs/specs/28-spec-box-cli/28-spec-box-cli.md — 11 finding(s)

docs/specs/28-spec-box-cli/28-spec-box-cli.md:211: P004 BCLI-077 names test 'box_spec_renders_merged_vars_once_with_layer', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:226: P004 BCLI-078 names test 'expansion_refusals_exit3_on_spec_and_create_verbs', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:299: P004 BCLI-075 names test 'create_verbs_no_loadouts_empties_loadouts_layer', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:312: P004 BCLI-076 names test 'create_verbs_no_hooks_stores_no_hooks', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:328: P004 BCLI-026 names test 'box_verbs_exist_with_arch_flags', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:336: P004 BCLI-028 names test 'help_and_completions_from_one_model', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:423: P004 BCLI-034 names test 'exit_code_table', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:539: P004 BCLI-042 names test 'removed_session_verbs_fail_as_unknown_commands', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:543: P004 BCLI-043 names test 'setup_zed_unchanged', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:548: P004 BCLI-044 names test 'cli_reference_documents_box_grammar', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:572: P004 BCLI-049 names test 'host_stop_stops_boxes_then_daemon_and_vm', which was not found in the repository

Advisory. None of this blocks the merge; the review decides.

Advisory, and never a merge gate. Linter: gominimal/foundry@8acb0663, spec format: How Minimal Writes Specs.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite: the coder changed nothing. This round changes nothing. The failed fmt job failed in its checkout step: git fetch stopped with curl 56 GnuTLS recv error and early EOF. That is a network failure on the runner, not a formatting defect. cargo fmt --all -- --check exits 0 at the branch head. ci-success failed only because it aggregates the fmt job. A re-run of the check suite will clear both. The branch head has no conflict markers after the merge of origin/main.

@agent-137
agent-137 marked this pull request as ready for review November 19, 2026 17:11
@agent-137
agent-137 requested a review from a team as a code owner November 19, 2026 17:11
@agent-137

Copy link
Copy Markdown
Member

Undrafted. agent-verify's one failure is exec_run_attach_and_task_run_share_the_commands_trace, the known flake #3483 outside this diff. The edit to crates/minimal/src/cmd/boxes.rs outside the task's layers is in scope: it removes the private duplicate resolver, so min session logs gives NET-058's refusal through the one resolver. The red fmt job failed in its checkout (curl 56 GnuTLS recv error), a runner network failure, so I re-ran it.

@agent-137

Copy link
Copy Markdown
Member

/arch-review

@minimal-foundry

minimal-foundry Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Approved: no findings at 9892437d2aa2.

Nothing to do.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 19, 2026

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

This change conforms to the design. Every min box verb and every type-noun stop, rm and logs now resolves through one resolver, resolve_box_over. A box on a stopped VM gets NET-058's refusal with exit 4, as §Addressing (line 389) and the exit-code table (line 365) require. The type nouns stay aliases of the box verbs filtered to their type, as design principle 8 (line 338) requires. The change also removes two copies of the typed resolver. CI must still show that the otel_cli trace failure in agent-verify is not from this change.

Ruled at 9892437 against gominimal/arch@8b824707cde6 by claude-opus-5-5.

@agent-137
agent-137 added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit a05c9cb Nov 19, 2026
48 of 50 checks passed
@agent-137
agent-137 deleted the agent/3634-every-box-verb-refuses-a-box-on-a-stopped-vm-wit branch November 19, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T61 — Every box verb refuses a box on a stopped VM with NET-058's answer

2 participants