8000 fix: T46 — The refusals that exit 1 end with the table's code by minimal-foundry[bot] · Pull Request #3436 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix: T46 — The refusals that exit 1 end with the table's code - #3436

Merged
mitodrummer merged 9 commits into
mainfrom
agent/3419-the-refusals-that-exit-1-end-with-the-table-s-co
Nov 15, 2026
Merged

mitodrummer merged 9 commits into
mainfrom
agent/3419-the-refusals-that-exit-1-end-with-the-table-s-co

Conversation

@minimal-foundry
@minimal-foundry minimal-foundry Bot commented Nov 14, 2026 •
Copy link
Copy Markdown
Contributor

T46 — The refusals that exit 1 end with the table's code

slice: S3
kind: task
covers: BCLI-034, BCLI-058, BCLI-078
size: M
est: 110 code, 150 tests
executor: agent
difficulty: routine
model: standard
diagnostics: each refusal keeps its text, except the rename refusal, which says invalid box name: in place of invalid session name:; the bad --allow-dns-hosts value is refused by clap, quoting the value; refusals_exit_with_the_table_code pins each code and each changed text
observability: the command's existing tracing span records the verb and the outcome; no new log line
layers:
- client:
- crates/minimal/src/task.rs: declared_task returns ProjectFileInvalid for a minimal.toml that does not load, and a typed not-found refusal (exit 4) when no minimal.toml exists
- crates/minimal/src/cmd/boxes/create.rs: the --ingress, --dynamic-ingress and --network none refusals are one typed usage refusal that exits 2, with their text unchanged
- crates/minimal/src/cmd/boxes/lifecycle.rs: BoxRenameRefusal::from_error also reads the daemon's invalid box name: refusal, so it exits 2
- crates/minimal/src/cmd/hosts.rs: named_host returns a typed not-found refusal that exits 4
- crates/minimal/src/loadouts.rs: a --loadout name with no loadout file returns a typed not-found refusal that exits 4
- crates/minimal/src/cli.rs: --allow-dns-hosts takes a value_parser over boxes::is_valid_dns_host, so a bad host fails as a usage error before anything runs
- crates/minimal/src/main.rs: failure_exit_code maps the new typed refusals to their codes
- crates/minimal/src/tests.rs: the in-process minimald test harness gains this layer's tests, one row per finding
test: cargo nextest run -p minimal refusals_exit_with_the_table_code
- daemon:
- crates/boxes/src/store.rs: validate_session_name refuses with invalid box name:, not invalid session name:
- crates/minimald/src/box_manager/tests.rs: the test that pins the old name refusal reads invalid box name
test: cargo nextest run -p boxes invalid_box_name_refusal_says_box
produces: none
consumes: none
proof: For each row of the table, the command named in that finding ends with the row's exit code and prints the row's text, and none of them ends with 1.

Proof

Each refusal in the table now ends with its own exit code, and none ends with 1. min task run or min box run with no minimal.toml exits 4, and with a minimal.toml that does not load it exits 3. --ingress, --dynamic-ingress/--dynamic-range off own_ip and egress on --network none exit 2. min box rename to an invalid name exits 2 and says invalid box name:. min host start|stop <unknown> exits 4. --loadout <missing> exits 4. A bad --allow-dns-hosts value is a clap usage error (exit 2) that quotes the value. refusals_exit_with_the_table_code pins each code and text.

Notes from the agent: Text changes beyond the rename: (1) A minimal.toml that does not load for min task run/min box run returns TaskFileInvalid. It exits 3 and keeps the old text, found a broken minimal.toml while resolving tasks: <error>. (2) The bad --allow-dns-hosts refusal is new clap text: invalid value 'bad host' for '--allow-dns-hosts <HOST>': not a valid DNS hostname. Wildcards are not supported. Write an internationalized name in its punycode xn-- form. The --network none egress refusal is built in task.rs (refuse_egress_on_none), not in create.rs, so the typed NetworkFlagRefusal lives in create.rs and task.rs uses it. named_host, BoxRenameRefusal::from_error and refuse_ingress_off_own_ip became pub(crate) so tests.rs can reach them. failure_exit_code is in the binary, so tests.rs mirrors its mapping in a local table_refusal_code helper, as exec_failure_code already does. An unknown task name returns TaskNotFound, and a loadout name with no file returns LoadoutNotFound, from --loadout and default_loadouts alike. Both exit 4 with their old text, which closes #3443. Th…[truncated]

Tests

line exit tail
cargo nextest run -p minimal refusals_exit_with_the_table_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: 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 (/workbe
cargo nextest run -p boxes invalid_box_name_refusal_says_box 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling args v0.0.1 (/workben

Verify

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

4,libsubtle-d4ee3adaa82dd067,libcmov-45bd4af2ffaf6bf5,libzeroize-839e2912eb255706,libtypenum-ba1598732f210209,libserde_json_lenient-d40e6f0e7b3e9eef,libitoa-9ca95701043ab126,libryu-0d9f6319717c2636,libglobset-d675b9d89ac69765,liblog-438092e92453965a,libbstr-e486a46c74a4ad7c,libregex_automata-78493a18fcc8828b,libregex_syntax-913a3a1c2b02ab63,libaho_corasick-c7544a0898654238,libmemchr-64a87164b387290e,libwalkdir-8278203427ac3159,libsame_file-0d4c610508a69e8c,libnutype-2060fd37b9d379f2,libclient_config-b967f21a883cbf40,libtoml-2aea33601fef026d,libtoml_writer-14581a9d8fee7cd3,libtoml_parser-9d71f9449b11f073,libwinnow-0b86322c90e7afd1,libserde_spanned-d96ed742cfb92972,libtoml_datetime-be2b7a398aebdb67,libtracing-83feaaf26e80a884,libpin_project_lite-965c2dcbe863fe30,libtracing_core-84f58f17c6893e81,libonce_cell-9a2fd160c1da4076,libportable_atomic-0dd514cc30f274c2,libpaths-38d338f2d2882e54,libdirs-460e2d244a8fc274,libdirs_sys-5e8776d10c678365,liboption_ext-b0ea52c3b95d09a1,libthiserror-d936554554fa5dac,libcamino-0c63145602122330,libuuid-2ad4c678aa627cb6,libgetrandom-3bfdefd1957f2b79,liblibc-4f2d736fc0e30dce,librand_core-d44f5774360f5730,libcfg_if-5af2d58a3df8aa54,libserde-a2d31a39ef0e3ca2,libserde_core-149b29d4f6c47ae0,libanyhow-c1ffd3cc4fbec0bd}.rlib" "<sysroot>/lib64/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/work/build-cache/cargo-home/build/debug/deps/rustc8H2e2O/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/work/build-cache/cargo-home/build/debug/build/zstd-sys-0d91391d9ed43bde/out" "-L" "/work/build-cache/cargo-home/build/debug/build/ring-43aedddb25fbb121/out" "-L" "/work/build-cache/cargo-home/build/debug/build/aws-lc-sys-467e076f78a0a3c4/out" "-L" "/work/build-cache/cargo-home/build/debug/build/tree-sitter-6abcf750100a3ada/out" "-L" "/work/build-cache/cargo-home/build/debug/build/tree-sitter-nickel-4d55240ed02e956b/out" "-L" "/work/build-cache/cargo-home/build/debug/build/blake3-493bdc0df5a171ff/out" "-L" "<sysroot>/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/work/build-cache/cargo-home/build/debug/deps/minimal-13509f9e9e9b3e17" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /usr/bin/ld: final link failed: No space left on device
          collect2: error: ld returned 1 exit status
          

error: could not compile `minimal` (lib test) due to 1 previous error
error: command `/usr/bin/cargo '--color=auto' test --no-run --message-format json-render-diagnostics --package boxes --package minimal --package minimald --locked` exited with code 101

Closes #3419
Closes #3443

The store's name check said session for the box. The refusal now says
box, and `min box rename` can read its lead to exit 2 (BCLI-058).
A missing minimal.toml, --loadout file or local host now exits 4. A
minimal.toml that does not load for a task exits 3. The --ingress,
--dynamic-ingress and --network none refusals, an invalid rename and a
bad --allow-dns-hosts value now exit 2 (BCLI-034, BCLI-058, BCLI-078).
@coderabbitai
coderabbitai Bot commented Nov 14, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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: 514a30d5-67ad-4cd1-a9d8-b26150fdf6c2

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

Use the checkbox below for a quick retry:

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

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite: the coder changed nothing. No change this round. Two checks failed: ci-linux-native-success and native-daemon-e2e. ci-linux-native-success is the lane aggregator, and it fails only because native-daemon-e2e failed. The e2e failure is in native_names_answer_on_time. 'min session activate --network own_ip' of e2e-nnat-a failed with 'Failed to connect to minimald: ssh connect: Connection reset by peer'. That activation runs just after 'mnl stop --force', so it auto-spawns a fresh daemon. It passes only --allow-subnets and --allow-protocols. This branch does not change daemon start-up, the SSH connect path, the answerer or minzoned. The daemon-side change is only the text of the name refusal in validate_session_name, and no e2e script or test outside this task pins 'invalid session name'. The --allow-dns-hosts value_parser accepts every host the e2e script passes. The failure looks like a start-up race or a runner flake, not a defect in this diff. A re-run of native-daemon-e2e is the next step. If it fai…[truncated]

…ls-that-exit-1-end-with-the-table-s-co

# Conflicts:
#	crates/minimal/src/cmd/boxes/create.rs
#	crates/minimal/src/tests.rs
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

A merge of main before round 2, not counted against the cap (1 of 3), pushed as 43732927ad02.

Resolved conflicts in: crates/minimal/src/cmd/boxes/create.rs, crates/minimal/src/tests.rs

line exit tail
cargo nextest run -p minimal refusals_exit_with_the_table_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: 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 (/workbe
cargo nextest run -p boxes invalid_box_name_refusal_says_box 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling args v0.0.1 (/workben

Verify min task run agent-verify exited 100.

imal task::tests::the_non_interactive_hook_refuses_before_anything_is_read
        PASS [   0.030s] (1286/3274) minimal task::tests::the_refusal_snippet_is_pasteable_toml
        PASS [   0.661s] (1287/3274) minimal resolver::tests::the_lists_two_queries_run_under_one_deadline
        PASS [   0.028s] (1288/3274) minimal task::tests::untrimmed_task_names_are_rejected
        PASS [   0.019s] (1289/3274) minimal tests::a_non_hex_or_short_input_is_not_an_id_prefix
        PASS [   0.033s] (1290/3274) minimal tests::a_name_resolves_case_insensitively
        PASS [   0.019s] (1291/3274) minimal tests::a_unique_id_prefix_resolves_to_its_session
        PASS [   0.029s] (1292/3274) minimal tests::activate_help_shows_network_flags
        PASS [   0.023s] (1293/3274) minimal tests::activate_prints_routing_cause_once
        PASS [   0.025s] (1294/3274) minimal tests::ambiguous_name_across_hosts_exit2_lists_candidates
        PASS [   0.023s] (1295/3274) minimal tests::an_ambiguous_id_prefix_cuts_at_the_first_differing_digit
        PASS [   0.033s] (1296/3274) minimal tests::an_ambiguous_id_prefix_names_the_candidates
        PASS [   0.023s] (1297/3274) minimal tests::an_exact_name_wins_and_an_ambiguous_fold_resolves_to_none
        PASS [   0.016s] (1298/3274) minimal tests::an_exact_name_wins_over_an_id_prefix
        PASS [   0.020s] (1299/3274) minimal tests::assess_at_risk_classifies_clean_dirty_and_unknowable
        PASS [   0.524s] (1300/3274) minimal tests::a_stopped_vm_does_not_hold_a_box_name_resolution
        PASS [   1.346s] (1301/3274) minimal tests::ambiguous_name_across_hosts_exit2_lists_candidates_for_stop_and_rm
        FAIL [   1.437s] (1302/3274) minimal tests::a_stopped_vm_does_not_hold_a_listing
  stdout ───

    running 1 test
    test tests::a_stopped_vm_does_not_hold_a_listing ... FAILED

    failures:

    failures:
        tests::a_stopped_vm_does_not_hold_a_listing

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

  stderr ───

    thread 'tests::a_stopped_vm_does_not_hold_a_listing' (6177) panicked at crates/minimal/src/tests.rs:5096:5:
    a stopped VM's stale socket must not charge the listing its connect-retry window (1.029960821s)
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   1.215s] (1303/3274) minimal tests::attach_connection_failure_exit7
        PASS [   1.212s] (1304/3274) minimal tests::attach_detach_or_entrypoint_exit_returns_0
        PASS [   3.548s] (1305/3274) minimal tests::attach_and_resume_verbs_resume_stopped_pty_box
────────────
     Summary [  22.300s] 1305/3274 tests run: 1304 passed, 1 failed, 29 skipped
        FAIL [   1.437s] (1302/3274) minimal tests::a_stopped_vm_does_not_hold_a_listing
warning: 1969/3274 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Converted to a draft: something above needs a person before review.

For each row of the table, the command named in that finding ends with the row's exit code and prints the row's text, and none of them ends with 1. The merge with main keeps this, and refusals_exit_with_the_table_code still passes.

Notes from the agent: Conflict round. I merged origin/main and resolved both conflicts by keeping both sides. In create.rs the branch's NetworkFlagRefusal type stays beside main's new refuse_file_ingress_off_own_ip, session_box_network, union_ingress and cli_network_mode. In tests.rs the branch's refusals_exit_with_the_table_code stays beside main's new session_entry_network_mode_and_ingress, and that test also passes. The merge commit is 4373292. The other files in the merge came from main without conflicts. Main's new refusal for a network.ingress in minimal.toml on a box without own_ip uses anyhow::bail, so it exits 1. No finding in this task covers it, so I left it unchanged.

@agent-137
agent-137 marked this pull request as ready for review November 14, 2026 08:45
@agent-137
agent-137 requested a review from a team as a code owner November 14, 2026 08:45
@minimal-foundry
minimal-foundry Bot commented Nov 14, 2026 •
Copy link
Copy Markdown
Contributor Author

Reviewed: 2 findings, none blocking at 3acabefa13c1.

Address the comments on the diff.

Clobber: none seen.

@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_WITH_CONDITIONS · 2 conditions · the full ruling

The change conforms to the exit-code table. Each refusal the task names now ends with code 2, 3 or 4, as architecture.md lines 363–365 assign. Two items remain. The proof checks a copy of the mapping in tests.rs, and not failure_exit_code itself. Add the direct tests in main.rs (C1). An unknown task name and a missing default_loadouts name still exit 1, and row 365 gives them 4. File an issue for them and link it from the PR body (C2).

Ruled at 4373292 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

Comment thread crates/minimal/src/tests.rs Outdated

/// The exit code `main`'s `failure_exit_code` gives the refusals that
/// `refusals_exit_with_the_table_code` checks, and 1 for anything else.
fn table_refusal_code(error: &anyhow::Error) -> u8 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · This helper is a copy of failure_exit_code. If an arm in main.rs is missing, this test still passes. Add tests in the main.rs tests module that call failure_exit_code on each new type, wrapped in .context(..).

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.

Addressed in 0eee23259a2a: Added refusals_exit_with_the_table_code_through_failure_exit_code in main.rs's tests. It calls the real failure_exit_code on each new type, bare and under .context(..). The tests.rs helper doc now points to it.

{
return minimal::task::RunFlagMisplaced::EXIT_CODE;
}
// BCLI-034: a network flag the box's network mode refuses is a usage
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · These four arms have no test that calls failure_exit_code. Add one test for each arm in this file's tests module: 2 for NetworkFlagRefusal and 4 for each not-found type.

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.

Addressed in 0eee23259a2a: The new main.rs test covers all four arms with literal codes: 2 for NetworkFlagRefusal, and 4 for ProjectFileNotFound, LoadoutNotFound and LocalHostNotFound.

Comment thread crates/minimal/src/task.rs Outdated
}
.into());
}
// BCLI-078: a project file that does not load exits 3.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · Two lines below, the unknown task name (None => bail!(unknown_task_message(..))) still exits 1. Architecture.md line 365 gives an entry that is not found exit 4. File an issue for it and link it from the PR body.

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.

Disputed — not addressed: The gap is real: an unknown task name still exits 1. It is not one of this task's findings, so no change this round. This session cannot file issues, so the result notes ask a person to file one and link it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Filed as #3443 (an unknown task name and a default_loadouts name with no file exit 4), and linked from the PR body's Gaps section.

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.

Disputed — not addressed: Outside this task's findings. The unknown task name that still exits 1 is tracked in #3443.

Comment thread crates/minimal/src/loadouts.rs Outdated
.map(|(loadout, _layout)| loadout)
.map_err(|e| anyhow::anyhow!("{e}"))
.map_err(|e| match e {
boxes::client::disk::LoadError::NotFound { .. } if source == "--loadout" => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · Only the --loadout source gets exit 4. A default_loadouts name with no file still exits 1. Name it in the C2 issue, and give the table row it takes.

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.

Disputed — not addressed: The gap is real: a default_loadouts name with no file still exits 1. The task scopes exit 4 to --loadout, and the row for a configured default (3 or 4) is not settled. This session cannot file issues, so the result notes ask a person to file one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Filed as #3443 (an unknown task name and a default_loadouts name with no file exit 4), and linked from the PR body's Gaps section.

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.

Disputed — not addressed: Outside this task's findings. A default_loadouts name with no file that still exits 1 is tracked in #3443.

@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 — advisory review

Verdict COMMENT — 2 findings, 2 inline.

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

10BC8
Comment thread crates/minimal/src/task.rs Outdated
Comment on lines 680 to 681
Err(error) => return Err(crate::ProjectFileInvalid { error }.into()),
};
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.

LOW · correctness · confidence 0.55 · in declared_task

A broken minimal.toml now prints through ProjectFileInvalid. The text becomes 'Cannot start the box: the project's minimal.toml does not load: ...'. The old text was 'found a broken minimal.toml while resolving tasks: ...'. The PR says each refusal keeps its text. declared_task also serves min task run, which does not start a box, so the new prefix misleads.

What the reviewer checked

task.rs: Err(error) => return Err(crate::ProjectFileInvalid { error }.into()); create.rs:230 Display 'Cannot start the box: the project's {name} does not load: {error}'

Hand this to an agent
Act on a code-review finding.

File:       crates/minimal/src/task.rs
Lines:      680-681
Category:   correctness
Severity:   low (reviewer confidence 0.55)

Finding:
A broken minimal.toml now prints through `ProjectFileInvalid`. The text becomes 'Cannot start the box: the project's minimal.toml does not load: ...'. The old text was 'found a broken minimal.toml while resolving tasks: ...'. The PR says each refusal keeps its text. `declared_task` also serves `min task run`, which does not start a box, so the new prefix misleads.

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.

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.

Disputed — not addressed: The task's task.rs layer requires declared_task to return ProjectFileInvalid, which is the same refusal min box start prints for the same file. min task run creates a task box, so 'Cannot start the box' is true there.

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.

Addressed in ac272215a775: ac27221: declared_task returns task::TaskFileInvalid, which prints found a broken minimal.toml while resolving tasks: <error> and exits 3. Tests pin the text.

Comment thread crates/minimal/src/tests.rs Resolved
The tests.rs helper copies the mapping in main.rs, so a missing arm
there did not fail a test. A test in main.rs now calls the real
function for each new refusal type, with and without context.
@agent-137
Copy link
Copy Markdown
Member

/revise

Head 43732927. This round answers arch ruling C1 and C2 (PASS_WITH_CONDITIONS) and two minimal-review threads.

1. Arch C1, and finding PRRT_kwDOPdfcxM63bvWX: test failure_exit_code itself.
table_refusal_code in crates/minimal/src/tests.rs (around line 19949) copies the mapping in main.rs, so a missing arm in main.rs still passes. Delete table_refusal_code. In the tests module of crates/minimal/src/main.rs, add one test for each new arm. Each test calls failure_exit_code on the error wrapped in .context(..). NetworkFlagRefusal gives 2, and each not-found type gives 4. Reply on PRRT_kwDOPdfcxM63bu7H, PRRT_kwDOPdfcxM63bu7N and PRRT_kwDOPdfcxM63bvWX with the commit.

2. Arch C2: the two exit-1 cases are #3443.
Change no code for them. List #3443 under the PR body's gaps. Reply on PRRT_kwDOPdfcxM63bu7S and PRRT_kwDOPdfcxM63bu7V with #3443.

3. Finding PRRT_kwDOPdfcxM63bvWR: a broken minimal.toml in declared_task does not say "Cannot start the box".
declared_task (crates/minimal/src/task.rs, around line 681) also serves min task run, which does not start a box. Keep the old text there: found a broken minimal.toml while resolving tasks: <error>. Keep the exit code that ProjectFileInvalid gives. Pin the text in a test. Reply on the thread with the commit.

Change nothing else.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #3419. Your note is kept and goes into the next round here, which starts when that coder finishes.

Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on the runtime's review findings, pushed as 0eee23259a2a.

line exit tail
cargo nextest run -p minimal refusals_exit_with_the_table_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: 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 (/workbe
cargo nextest run -p boxes invalid_box_name_refusal_says_box 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling args v0.0.1 (/workben

Verify min task run agent-verify exited 100.

               "span_id": "b78001cb717322c0",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "728e486ddae48d98",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "bd7097c2483fd652",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "bd7097c2483fd652",
                "queued_behind": "0",
                "span_id": "ba79cb978977c109",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "bd7097c2483fd652",
                "queued_behind": "0",
                "span_id": "45135e91867ae6e1",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "45135e91867ae6e1",
                "span_id": "49e3afaa3ff66771",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "45135e91867ae6e1",
                "queued_behind": "0",
                "span_id": "0b6d4292dd1e585f",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.565s] (1812/3276) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.595s] (1813/3276) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.559s] (1814/3276) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
────────────
     Summary [ 100.484s] 1814/3276 tests run: 1813 passed, 1 failed, 29 skipped
        FAIL [   3.920s] (1811/3276) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1462/3276 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/tests.rs:20006: Added refusals_exit_with_the_table_code_through_failure_exit_code in main.rs's tests. It calls the real failure_exit_code on each new type, bare and under .context(..). The tests.rs helper doc now points to it.
  • 👍 valid — crates/minimal/src/main.rs:293: The new main.rs test covers all four arms with literal codes: 2 for NetworkFlagRefusal, and 4 for ProjectFileNotFound, LoadoutNotFound and LocalHostNotFound.
  • 👎 invalid — crates/minimal/src/task.rs:679: The gap is real: an unknown task name still exits 1. It is not one of this task's findings, so no change this round. This session cannot file issues, so the result notes ask a person to file one and link it.
  • 👎 invalid — crates/minimal/src/loadouts.rs:300: The gap is real: a default_loadouts name with no file still exits 1. The task scopes exit 4 to --loadout, and the row for a configured default (3 or 4) is not settled. This session cannot file issues, so the result notes ask a person to file one.
  • 👎 invalid — crates/minimal/src/task.rs:681: The task's task.rs layer requires declared_task to return ProjectFileInvalid, which is the same refusal min box start prints for the same file. min task run creates a task box, so 'Cannot start the box' is true there.
  • 👍 valid — crates/minimal/src/tests.rs:20032: main.rs now has a test of the real failure_exit_code for each type. The tests.rs copy stays, because the library tests cannot call a function in the min binary.

For each row of the table, the command in that finding ends with the row's exit code (2 for the network flags and the rename, 3 for a minimal.toml that does not load, 4 for no minimal.toml, no loadout file or no local host) and prints the row's text. A test in main.rs now checks the real failure_exit_code for each new type, so none of them can end with 1 without a failing test.

Notes from the agent: Round 2. Added a main.rs test that calls failure_exit_code on each new refusal type, bare and under .context(..), with literal codes. Its name starts with the test: filter, so the test: line runs it. Two gaps the reviewer found remain open and need an issue from a person, because this session has no credential to file one: (1) an unknown task name in declared_task (task.rs, None => bail!(unknown_task_message(..))) still exits 1; (2) a default_loadouts name with no loadout file (loadouts.rs, resolve_active_loadouts) still exits 1. Neither is a row of this task, and the table row for (2) is not settled (4 as not found, or 3 as a configuration that does not load). The diagnostics line says each refusal keeps its text, but the task.rs layer says declared_task returns ProjectFileInvalid, whose text differs. I followed the layer. clippy -p minimal --all-targets is clean.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 14, 2026 09:32
@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 — approval withheld

Verdict COMMENT — APPROVE withheld: 6 unresolved threads — minimal-arch[bot] crates/minimal/src/tests.rs:20006, minimal-arch[bot] crates/minimal/src/main.rs:293, minimal-arch[bot] crates/minimal/src/task.rs:679, minimal-arch[bot] crates/minimal/src/loadouts.rs:300, minimal-foundry[bot] crates/minimal/src/task.rs:681, …. No findings.

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

@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_WITH_CONDITIONS · 2 conditions · the full ruling

The new commit tests the real failure_exit_code, and that closes the proof gap in the tests.rs mirror. Each refusal that the change touches now ends with the code that the exit-code table gives (architecture.md lines 362-365). Two outcomes still end with exit 1: an unknown task name and a default_loadouts name with no file. The table gives 4 to an entry that is not found. File an issue for each and link it in the PR body (C1, C2). Then they are residuals, and the change can merge.

Ruled at 0eee232 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

Err(error) => return Err(crate::ProjectFileInvalid { error }.into()),
};
match file.task(task) {
Some(t) => Ok(t),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · The next arm, None => bail!(unknown_task_message(..)), still ends with exit 1. The exit-code table gives 4 to an entry that is not found (architecture.md line 365). File an issue that makes it a typed not-found refusal, and link it in the PR body.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Filed as #3443 (an unknown task name and a default_loadouts name with no file exit 4), and linked from the PR body's Gaps section.

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.

Addressed in 71a9a50a946a: declared_task now returns a typed TaskNotFound (same text) for an unknown task name, and failure_exit_code maps it to exit 4. Pinned in refusals_exit_with_the_table_code and task_not_found_exits_4.

message: e.to_string(),
})
}
e => anyhow::anyhow!("{e}"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · A default_loadouts name with no loadout file comes to this arm and ends with exit 1. Exit 1 is unspecified (architecture.md line 362). File an issue that names the row, 3 or 4, and link it in the PR body.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Filed as #3443 (an unknown task name and a default_loadouts name with no file exit 4), and linked from the PR body's Gaps section.

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.

Addressed in 71a9a50a946a: A default_loadouts name with no loadout file now returns LoadoutNotFound and exits 4 (the not-found row). A test row pins it.

`declared_task` also serves `min task run`, which starts no box, so a
broken minimal.toml says "found a broken minimal.toml while resolving
tasks:" again. The new TaskFileInvalid type still exits 3.

The tests.rs copy of the exit-code mapping is gone. main.rs tests call
failure_exit_code once for each new arm, through context.
@agent-137
agent-137 marked this pull request as ready for review November 14, 2026 10:16
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as ac272215a775.

line exit tail
cargo nextest run -p minimal refusals_exit_with_the_table_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: 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 (/workbe
cargo nextest run -p boxes invalid_box_name_refusal_says_box 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling args v0.0.1 (/workben

Verify min task run agent-verify exited 101.

e/cargo-home/build/debug/deps/libserial_test-8e7a105cb1948559.rlib --extern sha2=/work/build-cache/cargo-home/build/debug/deps/libsha2-c9bcb32104c3d8ae.rlib --extern size=/work/build-cache/cargo-home/build/debug/deps/libsize-0a8a7350b7e7e72e.rlib --extern stdlib=/work/build-cache/cargo-home/build/debug/deps/libstdlib-9905d85919a12313.rlib --extern switch=/work/build-cache/cargo-home/build/debug/deps/libswitch-6c812704e5da955c.rlib --extern sysinfo=/work/build-cache/cargo-home/build/debug/deps/libsysinfo-c713cd278cf33e00.rlib --extern tar=/work/build-cache/cargo-home/build/debug/deps/libtar-bb27b0a5d6ba0193.rlib --extern tempfile=/work/build-cache/cargo-home/build/debug/deps/libtempfile-a0e916d9301e1bc8.rlib --extern thiserror=/work/build-cache/cargo-home/build/debug/deps/libthiserror-d936554554fa5dac.rlib --extern tokio=/work/build-cache/cargo-home/build/debug/deps/libtokio-13fd64194b408f82.rlib --extern tokio_util=/work/build-cache/cargo-home/build/debug/deps/libtokio_util-55bfa9e349d7b2c1.rlib --extern tokio_vsock=/work/build-cache/cargo-home/build/debug/deps/libtokio_vsock-721a779abb11ee8a.rlib --extern tracing=/work/build-cache/cargo-home/build/debug/deps/libtracing-83feaaf26e80a884.rlib --extern tracing_appender=/work/build-cache/cargo-home/build/debug/deps/libtracing_appender-4049512b24d27abd.rlib --extern tracing_opentelemetry=/work/build-cache/cargo-home/build/debug/deps/libtracing_opentelemetry-4bc00377a5611f16.rlib --extern tracing_subscriber=/work/build-cache/cargo-home/build/debug/deps/libtracing_subscriber-b9d261067ec6d0c0.rlib --extern uuid=/work/build-cache/cargo-home/build/debug/deps/libuuid-2ad4c678aa627cb6.rlib --extern version=/work/build-cache/cargo-home/build/debug/deps/libversion-26aec4f378b53f65.rlib --extern vsock=/work/build-cache/cargo-home/build/debug/deps/libvsock-28a991460262852d.rlib --extern vt100=/work/build-cache/cargo-home/build/debug/deps/libvt100-cfaab5484d385f52.rlib --extern walkdir=/work/build-cache/cargo-home/build/debug/deps/libwalkdir-8278203427ac3159.rlib --extern zstd=/work/build-cache/cargo-home/build/debug/deps/libzstd-587a39a8eee416fb.rlib -L native=/work/build-cache/cargo-home/build/debug/build/tree-sitter-6abcf750100a3ada/out -L native=/work/build-cache/cargo-home/build/debug/build/tree-sitter-nickel-4d55240ed02e956b/out -L native=/work/build-cache/cargo-home/build/debug/build/zstd-sys-0d91391d9ed43bde/out -L native=/work/build-cache/cargo-home/build/debug/build/ring-43aedddb25fbb121/out -L native=/work/build-cache/cargo-home/build/debug/build/aws-lc-sys-467e076f78a0a3c4/out -L native=/work/build-cache/cargo-home/build/debug/build/blake3-493bdc0df5a171ff/out -L native=/work/build-cache/cargo-home/build/debug/build/blake3-493bdc0df5a171ff/out` (exit status: 2)
warning: build failed, waiting for other jobs to finish...
error: command `/usr/bin/cargo '--color=auto' test --no-run --message-format json-render-diagnostics --package boxes --package minimal --package minimald --locked` exited with code 101

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

3 threads were already answered in earlier rounds, with nothing new on them since.

For each row of the table, the command named in that finding ends with the row's exit code and prints the row's text, and none of them ends with 1. min task run with a broken minimal.toml prints found a broken minimal.toml while resolving tasks: <error> again and ends with exit 3. Tests in main.rs call the real failure_exit_code for each new refusal type through context.

Notes from the agent: Revise round 3. Item 1: deleted table_refusal_code from tests.rs. The table test now asserts the refusal type and its EXIT_CODE. The combined main.rs test from the earlier commit is replaced by one test for each arm: network_flag_refusal_exits_2, project_file_not_found_exits_4, loadout_not_found_exits_4, local_host_not_found_exits_4, task_file_invalid_exits_3. Item 2: no code change. The unknown task name and the default_loadouts name with no file still exit 1, and #3443 tracks them. The runner must list #3443 under the PR body's gaps. Item 3: declared_task now returns a new task::TaskFileInvalid with the old text, and failure_exit_code maps it to 3, the same code ProjectFileInvalid gives. This adds one arm in main.rs. Commit ac27221. just clippy-strict was not run.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 14, 2026 10:18
@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_WITH_CONDITIONS · 2 conditions · the full ruling

This head conforms to the exit-code table for BCLI-034, BCLI-058 and BCLI-078. A minimal.toml that does not load now returns TaskFileInvalid. It exits 3, as line 364 gives, and keeps its old text. The tests now assert each refusal's type, and main.rs pins each type's code through failure_exit_code. Two not-found paths still exit 1 where line 365 gives 4: an unknown task name (C1) and a default_loadouts name with no file (C2). Both are filed in #3443 and can stay open at merge.

Outside the diff

  • crates/minimal/src/task.rs:715: C1 · An unknown task name still exits 1 here. Line 365 of the exit-code table gives 4 to an entry that is not found. Return a typed not-found refusal with the same text, and map it to 4 in failure_exit_code. This is filed in #3443.

Ruled at ac27221 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

Comment thread crates/minimal/src/loadouts.rs Outdated
.map(|(loadout, _layout)| loadout)
.map_err(|e| anyhow::anyhow!("{e}"))
.map_err(|e| match e {
boxes::client::disk::LoadError::NotFound { .. } if source == "--loadout" => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · The source == "--loadout" guard leaves a default_loadouts name with no file at exit 1. Line 365 gives 4 to a thing not found. Remove the guard so both sources return LoadoutNotFound. This is filed in #3443.

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.

Addressed in 71a9a50a946a: Removed the source == "--loadout" guard, so both sources return LoadoutNotFound. Added a default_loadouts row to refusals_exit_with_the_table_code.

@agent-137
agent-137 marked this pull request as ready for review November 14, 2026 11:15
@agent-137
Copy link
Copy Markdown
Member

/review

@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 — advisory review

Verdict COMMENT — 2 findings, 2 inline.

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

Comment thread crates/minimal/src/cli.rs Resolved
Comment on lines +646 to +674
impl std::error::Error for ProjectFileNotFound {}

/// `min task run` or `min box run` with a `minimal.toml` that does not
/// load. The run ends with exit 3 (`main.rs`), the code the architecture
/// gives an invalid project file, as for `crate::ProjectFileInvalid`.
#[derive(Debug)]
pub struct TaskFileInvalid {
/// Why the file did not load.
pub error: mfile::Error,
}

impl TaskFileInvalid {
/// The architecture's exit code for an invalid project file.
pub const EXIT_CODE: u8 = 3;
}

impl std::fmt::Display for TaskFileInvalid {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
// The cause is in this text and `source()` returns none, so the
// printer's `{:#}` shows it once.
write!(
f,
"found a broken {name} while resolving tasks: {error}",
name = mfile::MFILE_NAME,
error = self.error,
)
}
}

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.

LOW · correctness · confidence 0.60 · in TaskFileInvalid

TaskFileInvalid is a second type for an invalid minimal.toml with exit 3. crate::ProjectFileInvalid (cmd/boxes/create.rs) already exists and box_spec.rs uses it. The PR body says this path now prints the Cannot start the box: ... text, but the code and the test keep found a broken minimal.toml while resolving tasks:. Reuse ProjectFileInvalid, or fix the PR text. Otherwise the same file error prints two different texts by command.

What the reviewer checked

task.rs: 'Err(error) => return Err(TaskFileInvalid { error }.into())'; main.rs test asserts !printed.contains("Cannot start the box").

Hand this to an agent
Act on a code-review finding.

File:       crates/minimal/src/task.rs
Lines:      646-674
Category:   correctness
Severity:   low (reviewer confidence 0.60)

Finding:
`TaskFileInvalid` is a second type for an invalid minimal.toml with exit 3. `crate::ProjectFileInvalid` (cmd/boxes/create.rs) already exists and `box_spec.rs` uses it. The PR body says this path now prints the `Cannot start the box: ...` text, but the code and the test keep `found a broken minimal.toml while resolving tasks:`. Reuse `ProjectFileInvalid`, or fix the PR text. Otherwise the same file error prints two different texts by command.

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.

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.

Addressed in 71a9a50a946a: The PR text was wrong. The code keeps TaskFileInvalid on purpose so that min task run keeps its found a broken minimal.toml while resolving tasks: text, as the task's diagnostics line requires. This round's notes correct the PR text.

Drop the --loadout guard so both loadout sources return LoadoutNotFound,
and move parse_dns_host above the --network doc comment.
declared_task returns a typed TaskNotFound with the same text, and
failure_exit_code maps it to the not-found code.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on the runtime's review findings, pushed as 71a9a50a946a.

line exit tail
cargo nextest run -p minimal refusals_exit_with_the_table_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: 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 (/workbe
cargo nextest run -p boxes invalid_box_name_refusal_says_box 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling args v0.0.1 (/workben

Verify min task run agent-verify exited 100.

               "span_id": "c091a3d6a027b001",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "66a5a465ca663e58",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "97ab096cb02fe029",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "97ab096cb02fe029",
                "queued_behind": "0",
                "span_id": "44888e377d2f92e7",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "97ab096cb02fe029",
                "queued_behind": "0",
                "span_id": "f51cc6409826f80c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "f51cc6409826f80c",
                "span_id": "456260ca6e3eea6a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "f51cc6409826f80c",
                "queued_behind": "0",
                "span_id": "e70c53992056c66e",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.298s] (1817/3281) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.314s] (1818/3281) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.262s] (1819/3281) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
────────────
     Summary [  70.023s] 1819/3281 tests run: 1818 passed, 1 failed, 29 skipped
        FAIL [   2.951s] (1816/3281) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1462/3281 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/task.rs:736: declared_task now returns a typed TaskNotFound (same text) for an unknown task name, and failure_exit_code maps it to exit 4. Pinned in refusals_exit_with_the_table_code and task_not_found_exits_4.
  • 👍 valid — crates/minimal/src/loadouts.rs:306: A default_loadouts name with no loadout file now returns LoadoutNotFound and exits 4 (the not-found row). A test row pins it.
  • 👍 valid — crates/minimal/src/loadouts.rs: Removed the source == "--loadout" guard, so both sources return LoadoutNotFound. Added a default_loadouts row to refusals_exit_with_the_table_code.
  • 👍 valid — crates/minimal/src/cli.rs:1974: Moved parse_dns_host above the --network doc comment, so the doc attaches to parse_network_mode again.
  • 👍 valid — crates/minimal/src/task.rs:696: The PR text was wrong. The code keeps TaskFileInvalid on purpose so that min task run keeps its found a broken minimal.toml while resolving tasks: text, as the task's diagnostics line requires. This round's notes correct the PR text.

For each row of the table, the command in that finding ends with the row's exit code and prints the row's text, and none ends with 1. This round adds two rows: min task run of a task name that minimal.toml does not declare now ends with exit 4, and a default_loadouts name with no loadout file now ends with exit 4, as --loadout does. Each keeps its text.

Notes from the agent: Correction to the earlier PR text: a minimal.toml that does not load, on the min task run path, ends with exit 3 and keeps its text found a broken minimal.toml while resolving tasks: .... It does not print Cannot start the box: .... The separate type TaskFileInvalid carries that text on purpose, because the task's diagnostics line says each refusal keeps its text. The layer note names ProjectFileInvalid, whose text says Cannot start the box. This round also closes the two gaps filed in #3443: the unknown task name (new TaskNotFound, exit 4) and the default_loadouts name with no file (guard removed, LoadoutNotFound, exit 4). main.rs gains task_not_found_exits_4. clippy -p minimal --all-targets is clean. The related test sealed_box_ignores_broken_default_loadout and the 68 task tests in -p minimal pass.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 14, 2026 11:48
@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 head closes the two open conditions from the earlier rulings. An unknown task name now exits 4 through TaskNotFound. A default_loadouts name with no file now exits 4 through LoadoutNotFound. The exit-code table gives 4 to a thing not found (architecture.md line 365). No condition is open. The PR body still lists #3443 as a gap. Update the body, and close #3443 with this PR.

Ruled at 71a9a50 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

@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 — advisory review

Verdict COMMENT — 2 findings, 2 inline.

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

Comment on lines +737 to 743
// BCLI-034: a task name the file does not declare is a thing not
// found (exit 4). The text is the same as before.
None => Err(TaskNotFound {
message: unknown_task_message(&file, task),
}
.into()),
}
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.

LOW · correctness · confidence 0.60 · in declared_task

An unknown task name now exits 4 through TaskNotFound. The PR body says it still exits 1 and lists it as gap #3443. A test in tests.rs pins exit 4. Either remove TaskNotFound to match the body, or fix the body and close the gap.

What the reviewer checked

task.rs:739 None => Err(TaskNotFound { message: unknown_task_message(&file, task) }); tests.rs ~20041 assert_eq!(task::TaskNotFound::EXIT_CODE, 4)

Hand this to an agent
Act on a code-review finding.

File:       crates/minimal/src/task.rs
Lines:      737-743
Category:   correctness
Severity:   low (reviewer confidence 0.60)

Finding:
An unknown task name now exits 4 through `TaskNotFound`. The PR body says it still exits 1 and lists it as gap #3443. A test in tests.rs pins exit 4. Either remove `TaskNotFound` to match the body, or fix the body and close the gap.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code is right, and the body was stale. The PR body no longer lists #3443 as a gap. It now says an unknown task name exits 4 through TaskNotFound, and it closes #3443.

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.

Disputed — not addressed: The code is correct as it is. An unknown task name exits 4 through TaskNotFound, and the test pins it. The PR body was stale and now says exit 4 and closes #3443. No code change.

Comment on lines +295 to +307
// BCLI-034: a loadout name with no loadout file is not found
// (exit 4), from `--loadout` and `default_loadouts` alike. The
// text is the same as before.
boxes::client::disk::load_loadout(loadouts_dir.as_utf8_path().as_std_path(), &name)
.map(|(loadout, _layout)| loadout)
.map_err(|e| anyhow::anyhow!("{e}"))
.map_err(|e| match e {
boxes::client::disk::LoadError::NotFound { .. } => {
anyhow::Error::new(LoadoutNotFound {
message: e.to_string(),
})
}
e => anyhow::anyhow!("{e}"),
})
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.

LOW · correctness · confidence 0.60 · in resolve_active_loadouts

The not-found mapping applies to every loadout name, so a missing default_loadouts file also exits 4. The PR body says it still exits 1 and that it only covers --loadout. The code comment says both. The behaviour and the PR body disagree.

What the reviewer checked

loadouts.rs:295 comment 'from --loadout and default_loadouts alike'; the closure does not use source

Hand this to an agent
Act on a code-review finding.

File:       crates/minimal/src/loadouts.rs
Lines:      295-307
Category:   correctness
Severity:   low (reviewer confidence 0.60)

Finding:
The not-found mapping applies to every loadout name, so a missing `default_loadouts` file also exits 4. The PR body says it still exits 1 and that it only covers `--loadout`. The code comment says both. The behaviour and the PR body disagree.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code is right, and the body was stale. The PR body now says a loadout name with no file exits 4 from --loadout and default_loadouts alike, and it closes #3443.

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.

Disputed — not addressed: The code is correct as it is. An earlier review asked for exit 4 from --loadout and default_loadouts alike. The PR body was stale and now says this and closes #3443. No code change.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 5 of 10 on the runtime's review findings: the coder changed nothing. Revise round 5. No code change this round. Both findings report that the pull request body is stale, and the code is correct. The body must now say this: an unknown task name exits 4 through TaskNotFound, and a missing loadout file exits 4 through LoadoutNotFound for both --loadout and default_loadouts. Earlier rounds closed these gaps, which #3443 tracked, so the body must not list them as remaining exit-1 paths. The commits fdf5248 and 71a9a50 made those changes. main.rs tests pin each arm of failure_exit_code.

@agent-137
agent-137 marked this pull request as ready for review November 14, 2026 12:45
@mitodrummer mitodrummer left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved.

@mitodrummer
mitodrummer added this pull request to the merge queue Nov 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 14, 2026
…ls-that-exit-1-end-with-the-table-s-co

# Conflicts:
#	crates/minimal/src/tests.rs
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

A merge of main before round 6, not counted against the cap (2 of 3), pushed as 3acabefa13c1.

Resolved conflicts in: crates/minimal/src/tests.rs

line exit tail
cargo nextest run -p minimal refusals_exit_with_the_table_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: 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 (/workbe
cargo nextest run -p boxes invalid_box_name_refusal_says_box 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling args v0.0.1 (/workben

Verify min task run agent-verify exited 100.

               "span_id": "182a7f1c1b65212e",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "2dee9317bfba25a5",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "c59ecdff8f8d9486",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "c59ecdff8f8d9486",
                "queued_behind": "0",
                "span_id": "e0e519b503d93dea",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "c59ecdff8f8d9486",
                "queued_behind": "0",
                "span_id": "0b08a564942ec890",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "0b08a564942ec890",
                "span_id": "e81fb146fbe83d03",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "0b08a564942ec890",
                "queued_behind": "0",
                "span_id": "6ede42d3e241491f",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.556s] (1818/3284) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.613s] (1819/3284) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.719s] (1820/3284) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
────────────
     Summary [ 114.102s] 1820/3284 tests run: 1819 passed, 1 failed, 29 skipped
        FAIL [   4.171s] (1817/3284) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1464/3284 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

For each row of the table, the command named in that finding ends with the row's exit code and prints the row's text. None of them ends with 1. refusals_exit_with_the_table_code pins this at the branch head after the merge with main.

Notes from the agent: This round resolved the merge conflict in crates/minimal/src/tests.rs. Both sides added a test at the same place: this branch added refusals_exit_with_the_table_code, and main added box_messages_name_the_box_and_the_next_step. The resolution keeps both tests. box_messages_name_the_box_and_the_next_step also passes (1 passed). There is no other code change this round.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 14, 2026 23:06
@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

The new head only merges main into the head that this review passed before. The PR's own diff is the same. T50 on main changes the rename success line, not the rename refusal, so the exit codes still follow the table in the design at lines 362-365. The PASS on 71a9a50a stands.

Ruled at 3acabef against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

@agent-137
agent-137 marked this pull request as ready for review November 15, 2026 00:50
@mitodrummer mitodrummer left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved.

@mitodrummer
mitodrummer added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 54096ec Nov 15, 2026
39 checks passed
@mitodrummer
mitodrummer deleted the agent/3419-the-refusals-that-exit-1-end-with-the-table-s-co branch November 15, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants

0