8000 fix(minimal,minimald): a create that the daemon refuses at BOX-160 admission makes min exit 3, not 1 by minimal-foundry[bot] · Pull Request #3694 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal,minimald): a create that the daemon refuses at BOX-160 admission makes min exit 3, not 1 - #3694

Merged
mitodrummer merged 2 commits into
mainfrom
agent/3688-a-create-that-the-daemon-refuses-at-box-160-admi
Nov 20, 2026
Merged

mitodrummer merged 2 commits into
mainfrom
agent/3688-a-create-that-the-daemon-refuses-at-box-160-admi

Conversation

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

Follow-up

Fixes #3688

Task marker
### D3313 — A create that the daemon refuses at BOX-160 admission makes min exit 3, not 1
  kind: task
  size: S
  est: 30 code, 70 tests
  executor: agent
  origin: bug
  epic: 2236
  layers:
    - daemon:
      - crates/minimald/src/box_manager.rs: adds a pub(crate) admission_refusal helper that downcasts an io::Error to RootConstraintRefusal or UnknownRootRefusal and gives its exit code. Also removes the #3313 comments.
      - crates/minimald/src/rpc.rs: adds a serve_create_session arm before the InvalidInput arm: a BOX-160 refusal replies CreateSessionReply::Err with exit_code Some(3). Also adds an rpc test for this reply.
      test: cargo test -p minimald admission_refusal_reply_carries_exit_code
    - client:
      - crates/minimal/src/tests.rs: adds daemon_only_admission_refusal_exits_3: a session-verb create with io.pty_enabled false reaches create_refusal as a DaemonCreateRefusal with exit_code 3
      test: cargo test -p minimal daemon_o
8000
nly_admission_refusal_exits_3
  proof: A create whose spec breaks its built-in root's constraints and passes the client check ends min with exit code 3 and the daemon's refusal text.

Proof

A session create whose spec sets io.pty_enabled to false passes the client check, and the daemon refuses it at admission. The CreateSession reply now carries exit_code 3, so min ends with exit code 3 and prints the daemon's refusal text, which names io.pty_enabled and says no box was created.

Notes from the agent: admission_refusal returns Option, not i32, because CreateSessionReply::Err carries exit_code as Option. The new reply arm sits before the InvalidInput arm and sets code and hint to None. The refusal text is unchanged. cargo clippy -p minimald --all-targets is clean. I did not run clippy for the minimal crate.

Tests

line exit tail
cargo test -p minimald admission_refusal_reply_carries_exit_code 0 running 1 test test rpc::admission_refusal_tests::admission_refusal_reply_carries_exit_code ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1546 filtered out; finished in 0.04s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finish
cargo test -p minimal daemon_only_admission_refusal_exits_3 0 running 1 test test tests::daemon_only_admission_refusal_exits_3 ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1080 filtered out; finished in 0.04s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.00s running 0 tes

Verify

min task run agent-verify timed out after 1800s, so this PR is a draft.

h/crates/minimald)
    Checking minimal v0.8.0 (/workbench/crates/minimal)
    Finished `dev` profile [unoptimized] target(s) in 1m 58s
 Downloading crates ...
  Downloaded downcast v0.11.0
  Downloaded axum-core v0.5.6
  Downloaded fragile v2.1.0
  Downloaded chacha20 v0.9.1
  Downloaded aead v0.5.2
  Downloaded blake2 v0.10.6
  Downloaded chacha20poly1305 v0.10.1
  Downloaded curve25519-dalek v4.1.3
  Downloaded cipher v0.4.4
  Downloaded inout v0.1.4
  Downloaded ip_network_table-deps-treebitmap v0.5.0
  Downloaded arbitrary v1.5.0
  Downloaded boringtun v0.7.1
  Downloaded ip_network v0.4.1
  Downloaded axum v0.8.9
  Downloaded ip_network_table v0.2.0
  Downloaded hmac v0.12.1
  Downloaded multimap v0.10.1
  Downloaded mockall v0.15.0
  Downloaded opaque-debug v0.3.1
  Downloaded matchit v0.8.4
  Downloaded mockall_derive v0.15.0
  Downloaded predicates v3.1.4
  Downloaded poly1305 v0.8.0
  Downloaded predicates-tree v1.0.13
  Downloaded predicates-core v1.0.10
  Downloaded pulldown-cmark-to-cmark v22.0.0
  Downloaded prost-build v0.14.4
  Downloaded prettyplease v0.2.37
  Downloaded termtree v0.5.1
  Downloaded pulldown-cmark v0.13.6
  Downloaded tonic-build v0.14.6
  Downloaded tonic-prost-build v0.14.6
  Downloaded universal-hash v0.5.1
  Downloaded x25519-dalek v2.0.1
   Compiling opentelemetry v0.33.1
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling serial_test v4.0.1
   Compiling opentelemetry_sdk v0.33.1
   Compiling tracing-opentelemetry v0.34.0
   Compiling opentelemetry-http v0.33.1
   Compiling opentelemetry-appender-tracing v0.33.1
   Compiling google-cloud-gax-internal v0.7.20
   Compiling opentelemetry-proto v0.33.0
   Compiling opentelemetry-otlp v0.33.0
   Compiling google-cloud-longrunning v1.14.0
   Compiling google-cloud-iam-v1 v1.13.0
   Compiling mlog v0.0.1 (/workbench/crates/mlog)
   Compiling google-cloud-lro v1.11.0
   Compiling google-cloud-storage v1.20.0
   Compiling common v0.0.1 (/workbench/crates/common)
   Compiling boxes v0.0.1 (/workbench/crates/boxes)
   Compiling sandbox v0.0.1 (/workbench/crates/sandbox)
   Compiling mfile v0.0.1 (/workbench/crates/mfile)
   Compiling minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
   Compiling minimal-client v0.8.0 (/workbench/crates/minimal-client)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling decode v0.0.1 (/workbench/crates/decode)
   Compiling checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling graph v0.0.1 (/workbench/crates/graph)
   Compiling lcache v0.0.1 (/workbench/crates/lcache)
   Compiling rcache v0.0.1 (/workbench/crates/rcache)
   Compiling op v0.0.1 (/workbench/crates/op)
   Compiling check v0.0.1 (/workbench/crates/check)
   Compiling orchestrator v0.0.1 (/workbench/crates/orchestrator)
   Compiling mctx v0.0.1 (/workbench/crates/mctx)
   Compiling minimald v0.8.0 (/workbench/crates/minimald)
   Compiling minimal v0.8.0 (/workbench/crates/minimal)

Closes #3313 (the original issue this task was triaged from).

The CreateSession reply carried the refusal's text but not its code, so
min exited 1 for a spec its built-in root excludes. A new
admission_refusal helper gives the code, and the reply carries it.
@coderabbitai
coderabbitai Bot commented Nov 20, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot 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.

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: 5ec97a57-eede-43e9-9e7d-0976ab0a08c6

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

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

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

Approved: 1 finding, none above this repo's threshold at 6fa05bbdd54b.

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.

@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 change conforms to the design. A create that the daemon refuses at admission now ends min with exit 3. The Exit codes table in architecture.md gives exit 3 to an invalid Box Spec. The helper sits beside the refusal types in box_manager.rs, and the reply arm comes before the InvalidInput arm. The refusal still fails closed, and its text and log record do not change.

Ruled at 6fa05bb against gominimal/arch@4f2eb87d5d12 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 — approved

Verdict APPROVE — 1 finding, 1 inline.

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

Comment on lines +675 to +682
Err(e) if crate::box_manager::admission_refusal(&e).is_some() => {
CreateSessionReply::Err {
error: e.to_string(),
code: None,
exit_code: crate::box_manager::admission_refusal(&e),
hint: None,
}
}
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.

NIT · correctness · confidence 0.50 · in serve_create_session

The guard and the body both call admission_refusal(&e). Bind the code once, or use the unenrolled_refusal shape with expect. This is only duplicated work.

What the reviewer checked

Err(e) if admission_refusal(&e).is_some() => { ... exit_code: admission_refusal(&e) ...

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

File:       crates/minimald/src/rpc.rs
Lines:      675-682
Category:   correctness
Severity:   nit (reviewer confidence 0.50)

Finding:
The guard and the body both call `admission_refusal(&e)`. Bind the code once, or use the `unenrolled_refusal` shape with `expect`. This is only duplicated work.

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.

Disputed as non-blocking: calling admission_refusal(&e) twice is a cheap downcast on the refusal path only, and binding it would mean restructuring the match guard. Left as is for this fix.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 20, 2026
@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 20, 2026
Merged via the queue into main with commit 57c3497 Nov 20, 2026
41 checks passed
@mitodrummer
mitodrummer deleted the agent/3688-a-create-that-the-daemon-refuses-at-box-160-admi branch November 20, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Label 5820 s

review:approved minimal-review approved the current head

Projects

None yet

2 participants

0