Repository navigation
fix(minimal): in a machine output mode, a box address refusal prints the error kind that its exit - #3386
Conversation
A box address refusal in a machine output mode answered with code unspecified unless it was not found. Ambiguous names now answer usage (exit 2), and an unreachable host answers host_unreachable (exit 7).
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: no findings at 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. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to the design. A box address refusal in a machine mode now answers with the error kind that its exit code stands for: not_found for 4, host_unreachable for 7 and usage for 2 (architecture.md lines 363, 365, 368 and 383). The kind lives on BoxAddressRefusal beside exit_code(), and machine_mode_answer stays the one mapper. The design names no code for exit 2, so usage is acceptable until the design names one. One note outside the design: min box list --all widens to every project, not every host. Correct the not-found hint text.
Ruled at 584dd25 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
…ne-output-mode-a-box-address-refusal-p
The --all flag lists the boxes of every project, not of every host.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
A min box verb with -o json for a box that does not exist exits 4 and writes a min/v1/error object with code not_found. Its hint now says Notes from the agent: Only the hint() text changed this round. The NotFound Display text (address.rs:198) still says 'to see the boxes on every host'. The same sentence is in list.rs, show.rs and tests.rs. That text was there before this task, and list.rs, show.rs and tests.rs are outside the layers, so a follow-up must change all of them together. The 'usage' code for exit 2 stays as it is. No other code name exists for a usage error, and the docs/reference/cli-min.md error-code list is outside the layers. A follow-up must document it there. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to the design, and the earlier PASS on 584dd25f stands. The new commit changes only the NotFound hint. The hint now says that min box list --all shows the boxes of every project, and list.rs agrees. Each address refusal still gives one min/v1/error object with a code that matches its exit code (Output conventions, line 383, and Exit codes, lines 363 to 368).
Ruled at c8dc73d against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
There was a problem hiding this comment.
APPROVE withheld: 2 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/address.rs, minimal-foundry[bot] crates/minimal/src/cmd/boxes/address.rs:125.
minimal-review — advisory review
Verdict COMMENT — No findings.
Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.
norrietaylor
left a comment
There was a problem hiding this comment.
Reviewed against D3010 at c8dc73d5. A box address refusal in a machine output mode now answers with its kind: not_found (exit 4), host_unreachable (exit 7), usage (exit 2), with the refusal text and a per-variant hint. The NotFound hint says --all lists every project's boxes, as the arch note asked. The usage name follows the plan. Documenting the codes is #3402. Arch: PASS on head.
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of c8dc73d522ce withheld this approval on the threads open then. Posted as a comment, as the review itself was; the check and the label carry it.
bryan-minimal
left a comment
There was a problem hiding this comment.
Read at c8dc73d against the CLI error vocabulary and the exit-code tests. The change is right: every
address refusal in machine mode now yields the shared min/v1/error object (code, message, hint), the
exit code comes from the same exit_code() the text path uses, stdout stays empty, and the new test covers
all four variants and all three codes. One change before it merges, since scripts match on the string:
- Name the failure, not the exit class:
ambiguous, notusage(crates/minimal/src/cmd/boxes/address.rs:122).
Every other code says what went wrong:not_found,host_unreachable,timeout,wait_timeout,
insufficient_resources,github_sign_in_required,daemon_unreachable,policy_unavailable,
output_failed. Exit 2 has many causes (a misplaced flag,rmwithout--force, a held rename), and
those still answerunspecified, sousagewould mean "ambiguous address" today and something blurrier
the first time another exit-2 refusal reuses it. The tree already calls this failureambiguous: it is the
tracing outcome for the same variants in address.rs:141, session.rs:982 and attach.rs:668. A script that
seesambiguousalso knows the fix (qualify the address). Return"ambiguous"and update the two test
rows in crates/minimal/src/main.rs (lines 1325 and 1332).
Two nits, no ask:
- For
NotFoundthe message says--allshows the boxes "on every host" while the hint says "of every
project" (address.rs:196-199 vs :131). The arch read ruled "every project" right; the message text is shared
with list.rs, show.rs and the tests, so it wants its own small follow-up rather than this PR. - The new hints are capitalised sentences with periods; the older ones are lowercase fragments
("runmin auth login, then create the box again"). Unspecified either way; worth matching the neighbours.
Checked and fine: the object shape and schema line match every other machine error; the message carries the
full chain; -o yaml and the jsonl commands enter the same branch; the refusal arm sits after the
registration-time host-unreachable arm and both give host_unreachable/7, so the overlap is harmless;
docs/reference/cli-min.md lists only part of the vocabulary and #3402 already tracks that.
|
/revise Head Name the failure, not the exit class: His two nits need no change in this PR. Reply on the review with the commit. |
…ne-output-mode-a-box-address-refusal-p
Exit 2 has many causes, so the code names the failure, not the exit class. The tree already calls this outcome ambiguous in its tracing.
|
Round 3 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. A min box verb with -o json for a box that does not exist exits 4 with code not_found in its min/v1/error object. An unreachable host gives host_unreachable with exit 7. An ambiguous box address now gives code ambiguous with exit 2, in place of usage. Notes from the agent: Revise round 3. Commit b3e655e changes the code for the Ambiguous and AmbiguousIdStart refusals from usage to ambiguous in BoxAddressRefusal::code(). It updates the two test rows in main.rs to match. The commit also changes the doc comment on code() and the comment above the machine_mode_answer arm, because both named usage. The directive listed no review threads. The two nits need no change, so this round changes nothing for them. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms. The exit-2 refusals now answer with code ambiguous, and the exit code stays 2. The design names machine-mode codes only by example, so ambiguous contradicts no line. The rest of the PASS on c8dc73d5 stands.
Ruled at b3e655e against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
The -o json error object carries the refusal text and the hint. Both now say min box list --all lists the boxes of every project, as the flag does.
|
Round 4 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:
A min box verb with -o json for a box that does not exist exits 4, and its min/v1/error object has code not_found. Its message and its hint now both say that min box list --all shows the boxes of every project. A host that does not answer gives code host_unreachable with exit 7. Notes from the agent: Round 4. The NotFound Display text changed from 'on every host' to 'of every project' to match the hint and the --all flag help in cli.rs. crates/minimal/src/tests.rs is outside the layers: its test unknown_box_address_exit4_names_address pins the old text, so its expected string changed in the same commit. Two other not-found messages still say 'to see the boxes on every host': cmd/boxes/show.rs:328 and cmd/boxes/list.rs:541. They are outside this task's layers and were not changed. A follow-up can align them. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The new commit changes one refusal text and its test. The text now says that min box list --all shows the boxes of every project. That matches the flag's own help text and the hint of the same refusal. The design names --all but does not define its scope. The error codes and exit codes do not change, so the earlier PASS stands.
Ruled at c30ff8d against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
|
@bryan-minimal your requested change is in. Ambiguous-address refusals now answer |
Stale: the requested change (ambiguous, not usage) is in at c30ff8d.
Defect
Fixes #3345
crates/minimal/src/main.rscrates/minimal/src/cmd/boxes/address.rsTask marker
Proof
With -o json, a min box verb for a box that does not exist exits 4, and its min/v1/error object has code not_found. A box on a host that does not answer gives code host_unreachable with exit 7. An ambiguous name or id start gives code usage with exit 2.
Notes from the agent: The repository names no error kind for a usage error, so the code for exit 2 is
usage. Change it in BoxAddressRefusal::code() if the error model names it otherwise. The hint for each variant repeats the next step of its message. The not-found hint changed from "min box listlists the boxes there are" to "Runmin box list --allto see the boxes on every host." No test pinned the old hint for this refusal. The wholeminbinary unit test suite (35 tests) passes, andcargo clippy -p minimal --all-targetsis clean.Tests
cargo test -p minimal box_address_refusals_answer_with_their_error_kindsVerify
min task run agent-verifyexited 100, so this PR is a draft.