Repository navigation
fix(minimal,minimald,minimald-rpc): a broker refusal that only minimald makes reaches min with its - #3670
Conversation
The reply gains optional code, exit_code and hint fields on the refusal. A plain error reply with no code still decodes (#3276).
The BOX-081 reply now fills the refusal's code, exit code and next step, so the client can exit 5 and not 1 (#3276). The minimald tests that match a CreateSession reply follow the new reply type.
min keeps the code, exit code and hint of a coded CreateSession refusal, so a non-GitHub broker grant that only minimald refuses exits 5 with gatehouse_unenrolled_node, not 1 (#3276). Tests that match a CreateSession reply follow the new reply type.
…efusal-that-only-minimald-makes-reache
|
Important Review skippedBot 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.
|
|
Approved: no findings at Nothing to do. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to the design. A broker refusal that only minimald makes now carries its code, its next step and its exit code. So min exits 5 with gatehouse_unenrolled_node, as the exit code table (line 366) and Gatehouse section 6.2 require. The wire change adds only optional fields, and old replies still decode in both directions. The verify run exited 101 on cargo test --no-run. That is a build matter, and this ruling does not decide it.
Ruled at e75cce7 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
|
/revise This PR conflicts with In the PR body's Verify notes, say that the earlier Keep the PR body's line |
Keep both new tests in crates/minimal/src/tests.rs. Callers that main added compile against the CreateSessionReply refusal variant.
|
Round 1 of 10 on a /revise note, pushed as Resolved conflicts in:
Verify Outside the task's
Converted to a draft: verify exited 101; outside the task's On an unenrolled node that a proxy serves, min with a non-GitHub broker grant that only minimald refuses exits 5 and reports gatehouse_unenrolled_node, not 1. The branch now merges origin/main cleanly and keeps this behaviour. Notes from the agent: Merged origin/main into the branch. The only conflict was crates/minimal/src/tests.rs: both sides added a test at the same place, and the merge keeps both (daemon_only_broker_refusal_exits_5 and main's row_not_back tests). cargo clippy -p minimal -p minimald -p minimald-rpc --all-targets passed with no errors, so the callers that main added or changed already compile against the CreateSessionReply refusal variant. No caller needed an edit. The other changed files in the merge commit, .github/workflows/release.yml among them, come from origin/main and not from this task. For the PR body Verify notes: the earlier agent-verify exit 101 came from the build environment, not from this change. It stopped at cargo test --no-run, and CI's build and test lanes passed at the same head. At this head all three test lines compile and pass locally. Keep the PR body line 'Closes #3276 (the original issue this task was triaged from).' The merge commit message was shortened to fit 72 characters before any push. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The new head only merges main into the branch. The PR's own changes are the same as at e75cce73. The one conflict in crates/minimal/src/tests.rs keeps both tests. The earlier ruling stands: the coded refusal brings the gatehouse_unenrolled_node defined error from Gatehouse spec §6.2 to min.
Ruled at e565ed7 against gominimal/arch@8b824707cde6 by claude-opus-5-5.
Follow-up
Fixes #3665
crates/minimald-rpc/src/lib.rscrates/minimald-rpc/src/tests.rscrates/minimald/src/rpc.rscrates/minimal/src/cmd/boxes/create.rscrates/minimal/src/task.rscrates/minimal/src/dash/rpc.rscrates/minimal/src/main.rscrates/minimal/src/tests.rsTask marker
Proof
On an unenrolled host that a proxy serves, a create with a non-GitHub broker grant (aws:s3) passes the min-side check and minimald refuses it. The CreateSession reply now carries code gatehouse_unenrolled_node, exit_code 5 and the next step. min turns it into a DaemonCreateRefusal, so the command exits 5, and -o json answers with code gatehouse_unenrolled_node, not exit 1 and unspecified.
Notes from the agent: Design: CreateSession now replies with a new minimald_rpc::CreateSessionReply enum. It has the same untagged wire form as Errorable, plus optional code, exit_code and hint fields on Err. A plain {"error":...} reply still decodes, and an older client reads a coded reply as a plain Errorable error (both pinned in the wire test). I did not add fields to Errorable itself, because hundreds of
Errorable::Err { error }patterns across the workspace match it. I addedhintbeside code and exit_code because the -o json answer needs a hint, and the daemon has the next step. Out-of-scope files: the Response type change breaks every test that pattern-matches a CreateSession reply as Errorable. Those files need a mechanical update to compile: crates/minimald/src/rpc/tests.rs, crates/minimald/src/box_manager/tests.rs, crates/minimald/src/connection.rs (test module), crates/minimal/tests/cli.rs, crates/minvmd/tests/minimald_session_integration.rs. Each one only swaps Errorable for CreateSessionReply (Err { error, .. }). The daemon test is an inline #[cfg(test)] module at the end of crates/minimald/src/rpc.rs, over the socket, with a root certificate so the host counts as proxy-served. The minimal test line also matches a second test in main.rs, because failure_exit_code and machine_mode_answer live in the bin target and the lib tests cannot reach them. The machine-mode answer maps the daemon code to the codes this build defines (gatehouse_unenrolled_node, github_sign_in_required), because MachineModeFailure::new takes a &'static str (cli.rs is out of scope)…[truncated]Tests
cargo test -p minimald-rpc create_session_refusal_carries_its_codecargo test -p minimald unenrolled_refusal_reply_carries_exit_codecargo test -p minimal daemon_only_broker_refusal_exits_5Verify
min task run agent-verifyexited 101, so this PR is a draft.Base
The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:
crates/minimal/src/cmd/boxes/create.rscrates/minimal/src/tests.rsOut of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimal/tests/cli.rscrates/minimald/src/box_manager/tests.rscrates/minimald/src/connection.rscrates/minimald/src/rpc/tests.rscrates/minvmd/tests/minimald_session_integration.rsCloses #3276 (the original issue this task was triaged from).