8000 fix(minimal): T33 — exit codes follow the exit-code table · gominimal/minimal@4f2df13 · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal): T33 — exit codes follow the exit-code table

Minimal Arch / arch-review failed Nov 23, 2026

CONDITIONS

Inputs. First ruling on #3719 at 4f2df130, on arch 4f2eb87d. No since.diff, since-conditions.json, findings.json or arch-map.md is staged. I read pr.diff whole and found the section by search in architecture.md. BCLI-034 lives in docs/specs/28-spec-box-cli line 428: "end each command with the exit code the architecture's exit-code table assigns to its outcome", with the [proposed] rows outside it. No ruling in prior-rulings.json decides the host-unreachable exit or the --vm usage exit. #3694 rules on a create reply's exit code, which is a different path, so I cite no precedent.

Governs: architecture.md §Exit codes, lines 359-378. Row 2 (line 365) is a usage error. Row 7 (line 370) is "Provider/host unreachable". Row 1 (line 364) is only for an unspecified error.

Ruling. The edit in main.rs is correct and in the right owner. answer_vm_name maps a --vm value that paths::validate_vm_name refuses to 2 and keeps the text. publish_vm_name → minimal_client::set_vm_name has no other failure. exit_code_table drives failure_exit_code, machine_mode_answer and answer_failure for each typed kind in both output modes, so the proof tests the rule (rule 3). The [proposed] row 8 and the quota case of row 5 are correctly out of scope. The PR body names one more outcome that exits 1 against the table: crates/minimal/src/cmd/boxes/address.rs:714 box_host_client bails Host <name> is not running., untyped. I also found probe_other_host at line 758, which returns Could not reach host <name>. untyped. Both are row 7, and failure_exit_code already maps HostUnreachable to 7. A typed error at the source is where the design puts the code (rule 8). Mapping the text in main.rs is not that. The author left this gap with no issue, so it is not a filed residual (rule 6). C1 closes it. The alternative is to file an issue and name it in the PR body as a residual. With that issue, the ruling can become PASS_WITH_CONDITIONS.

Not checked. agent-verify exited 100 on exec_run_attach_and_task_run_share_the_commands_trace. The change does not touch that path, but I did not run it (no builds). I did not audit every bail! in crates/minimal for other untyped outcomes. C1 names only the two that I opened. HostAddressesExhausted → 8 in failure_exit_code predates this PR, and BCLI-034 excludes row 8.

Conditions

  • C1: crates/minimal/src/cmd/boxes/address.rs: in box_host_client(), replace bail!("Host {} is not running.", host.host) (line 714) with return Err(minimal_client::box_registration::HostUnreachable::error(format!("Host {} is not running.", host.host))). In probe_other_host(), wrap the ProbeRefusal::Unreachable(e) arm (line 758) as HostUnreachable::over(e, format!("Could not reach host {}.", host.host)). Both keep their text. failure_exit_code() in main.rs already maps HostUnreachable to 7, so both end with 7 in place of 1. Add a row for each to exit_code_table in crates/minimal/src/main.rs, or a test in crates/minimal/src/tests.rs that drives box_host_client on a stopped host and asserts exit 7.

Ruled at 4f2df13 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5; arch_rulings 1593, job f403fc7b-a73c-4977-b96a-dbd6aae46bb1.

0