Repository navigation
T39 — Split the box runtime into files by concern - #2455
Conversation
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.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
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 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.
|
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
left a comment
There was a problem hiding this comment.
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.
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 rancargo nextest run -p minimald box_runtime::one time: 84 passed. I did not run just ci or clippy-strict.Tests
cargo nextest run -p minimald a_signalled_container_is_named_not_silently_passed_off_as_an_exitVerify
min task run agent-verifyexited 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.Closes #2378