8000 test(minimal): pin the refusal exit codes through failure_exit_code · gominimal/minimal@0eee232 · GitHub
[go: up one dir, main page]

Skip to content

test(minimal): pin the refusal exit codes through failure_exit_code

Minimal Arch / arch-review completed Nov 14, 2026

PASS_WITH_CONDITIONS

Baseline. This re-reviews 0eee2325 against the PASS_WITH_CONDITIONS on 43732927 (this PR), on the same arch 15b603e6. The checkout has no arch-map.md, so I found the sections by search, as the earlier rulings did. The ledger entry for 43732927 is cut off after 400 characters, so I could not read its conditions word for word. I re-checked all of pr.diff (equal to git diff a42a9d6d 0eee2325) and wrote the conditions again from the tree.

Compare. since.diff holds the merge of main (bfb700ed, which brings #3434's show.rs tty change, not this PR's work) and one PR commit, 0eee2325. That commit adds refusals_exit_with_the_table_code_through_failure_exit_code in main.rs. The test calls the real failure_exit_code for each new type, bare and under .context, with literal codes. Before it, the only proof was the table_refusal_code mirror in tests.rs, which cannot fail when an arm in main.rs is missing (rubric rule 3). The commit closes that gap.

Governs. architecture.md Design principle 5, line 335: min's own failures use reserved codes. Exit codes, lines 362-365: 1 unspecified, 2 usage error or a name the target does not admit (rename named), 3 invalid configuration (minimal.toml, loadout), 4 not found (entry, host).

Ruling. Each typed refusal takes the table's code. The network-flag refusals are 2. The refuse_egress_on_none path is 2 only when a flag is involved, because entry_egress runs mfile::network::canonicalize first and that refuses a file-only none with egress with 3 (BOX-080). A missing minimal.toml, a missing --loadout file and an unknown local host are 4. A minimal.toml that does not load is 3. A rename to an invalid name is 2. Placement is right: the client types live beside the code that refuses, the mapping is in failure_exit_code, and the store text change is in boxes. Two outcomes under BCLI-034 still exit 1, and the PR notes say so: an unknown task name (an entry not found, 4) and a default_loadouts name with no file. I cannot find an issue for either, so C1 and C2 ask for them to be filed and linked. Once that is done, they become residuals.

Departure. None.

Not checked. That the new pub types resolve at the paths main.rs names (minimal::NetworkFlagRefusal, minimal::task::ProjectFileNotFound, minimal::loadouts::LoadoutNotFound, minimal::hosts::LocalHostNotFound). That needs a build. The agent's verify run failed on a full disk at link time, not on a compile error. The task's issue #3419, because gh is not in the sandbox. A note with no condition: the client reads the daemon's invalid box name: text by prefix, so a client paired with an older daemon that says invalid session name: still exits 1. The design does not speak to version skew here.

Conditions

  • C1: File an issue: crates/minimal/src/task.rs declared_task arm None => bail!(unknown_task_message(&file, task)) becomes a typed not-found refusal that failure_exit_code maps to exit 4, with its text unchanged. Link that issue as a residual in the PR body. Alternatively, make that change in this PR and pin it in refusals_exit_with_the_table_code.
  • C2: File an issue: in crates/minimal/src/loadouts.rs resolve_active_loadouts, a default_loadouts name with no loadout file still falls to e => anyhow::anyhow!("{e}") and exits 1. The issue names the table row it takes: 3 (invalid configuration, loadout) because minimal.toml names it, or 4 (not found). Link that issue as a residual in the PR body.

Ruled at 0eee232 against gominimal/arch@15b603e6afb8 by claude-opus-5-5; arch_rulings 1295, job 43db45c5-a7e7-47e7-85da-49f5db96fee5.

0