Skip to content

T39 — Split the box runtime into files by concern - #2455

Merged
mitodrummer merged 1 commit into
mainfrom
agent/2378-split-the-box-runtime-into-files-by-concern
Oct 20, 2026
Merged

mitodrummer merged 1 commit into
mainfrom
agent/2378-split-the-box-runtime-into-files-by-concern

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T39 — Split the box runtime into files by concern

slice: S0
kind: enablement
covers: none
size: M
est: 300 code, 60 tests
executor: agent
difficulty: routine
model: standard
diagnostics: none: a pure move, no behaviour
observability: none: a pure move, no signal
layers:
- runtime:
- crates/minimald/src/box_runtime.rs: host type only
- crates/minimald/src/box_runtime/binding.rs (new): moved
- crates/minimald/src/box_runtime/handle.rs (new): moved
- crates/minimald/src/box_runtime/hooks.rs (new): moved
- crates/minimald/src/box_runtime/backend.rs (new): moved
- crates/minimald/src/box_runtime/enforcement.rs (new): moved
- crates/minimald/src/box_runtime/launcher.rs (new): moved
- crates/minimald/src/box_runtime/mock.rs (new): moved
- crates/minimald/src/box_runtime/tests.rs: imports from new modules
test: cargo nextest run -p minimald a_signalled_container_is_named_not_silently_passed_off_as_an_exit
produces: none
consumes: none
proof: The runtime behaves as before, split by concern.

Proof

crates/minimald/src/box_runtime.rs now holds the Host type, HostParams and NameMarker (about 1570 lines, down from 6375). The binding, handle, hooks, backend, enforcement, launcher and mock code is in its own file under crates/minimald/src/box_runtime/. The behaviour does not change: a line-by-line comparison against HEAD shows only rustfmt re-wraps and pub(super) on items and fields that now cross a module edge. All 84 box_runtime tests pass.

Notes from the agent: tests.rs did not need a change. The parent re-exports each new module (pub use for the modules with pub items, pub(crate) use or use for the others), so use super::* in tests.rs and every crate::box_runtime::X path still resolve. Visibility: private top-level items in the moved code became pub(super). Some fields and methods also became pub(super) because box_runtime.rs, tests.rs or a sibling module uses them: Launched, HostHandle.sender, TeardownCause, StdinMsg, SandboxBackend, MockBackend, ExitReport, HookPlan, ParserEventHandler, and a few methods. Clippy warns result_unit_err on three HostHandle methods (now in handle.rs). That warning is also present at HEAD, so this change does not add it. Besides the test line, I ran cargo nextest run -p minimald box_runtime:: one time: 84 passed. I did not run just ci or clippy-strict.

Tests

line exit tail
cargo nextest run -p minimald a_signalled_container_is_named_not_silently_passed_off_as_an_exit 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-c13b... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc

Verify

min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-91ba...
    Checking args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking mctx v0.0.1 (/workbench/crates/mctx)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Closes #2378

box_runtime.rs keeps the Host type. The binding, the host handle, the
hooks, the process backends, host-address enforcement, the launchers
and the test doubles move to their own files under box_runtime/.

A pure move: items and fields that now cross a module edge become
pub(super), and the parent re-exports each module, so callers and
tests.rs keep their paths.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

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

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b41bce40-9a80-4fb3-b5b7-ef347a7412b7

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

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry

minimal-foundry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Approved: no findings at f5a37787e1ec.

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

The design does not govern how minimald lays out its modules, so this is a PASS by absence. I compared the base file with the eight files at the head. The only differences are rustfmt re-wraps, pub(super), re-exports and module header comments. The enforcement code moves with no change in logic, and no check crosses a boundary. This ruling follows #2454, #2453 and #2452.

Ruled at f5a3778 against gominimal/arch@109541a48c31 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 — No findings.

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

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 20, 2026
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite: the coder changed nothing. Revise round 1: no change. The two failed checks are CI infrastructure, not this diff. The macOS e2e job failed in its 'Install nextest' step (taiki-e/install-action, exit 100) on the self-hosted runner, before any test ran. The jobs that build the guest initramfs and the darwin testbed succeeded, because e2e downloaded their artifacts. ci-macos-success is the lane aggregator and fails only because e2e failed. A re-run of the job is the next step. Local checks at the branch head: the test line passes, and cargo clippy -p minimald --all-targets compiles. Its three result_unit_err warnings in box_runtime/handle.rs also occur at the parent commit in box_runtime.rs (lines 1908, 2052, 2064), so the move did not add them.

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

Babysit review on f5a3778 against T39's plan block. This is a pure move: box_runtime.rs -4977 into backend, binding, enforcement, handle, hooks, launcher and mock (the last is cfg(test)). After stripping whitespace, the added lines match the removed lines except for mod and use lines, pub(super) on the items the split needs to reach, and rustfmt rewrapping of signatures. No logic changed. The macOS e2e is a runner rerun that affects every PR in the walk.

@mitodrummer
mitodrummer added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 87d74a7 Oct 20, 2026
42 of 44 checks passed
@mitodrummer
mitodrummer deleted the agent/2378-split-the-box-runtime-into-files-by-concern branch October 20, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T39 — Split the box runtime into files by concern

1 participant