Skip to content

T38 — Split the box actor into files by concern - #2453

Merged
mitodrummer merged 2 commits into
mainfrom
agent/2377-split-the-box-actor-into-files-by-concern
Oct 20, 2026
Merged

mitodrummer merged 2 commits into
mainfrom
agent/2377-split-the-box-actor-into-files-by-concern

Conversation

@minimal-foundry

@minimal-foundry minimal-foundry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

T38 — Split the box actor 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:
- actor:
- crates/minimald/src/box_actor.rs: actor type and loop only
- crates/minimald/src/box_actor/naming.rs (new): moved
- crates/minimald/src/box_actor/ports.rs (new): moved
- crates/minimald/src/box_actor/setup.rs (new): moved
- crates/minimald/src/box_actor/attach.rs (new): moved
- crates/minimald/src/box_actor/host.rs (new): moved
- crates/minimald/src/box_actor/launcher.rs (new): moved
- crates/minimald/src/box_actor/handle.rs (new): moved
- crates/minimald/src/box_actor/tests.rs: imports from new modules
test: cargo nextest run -p minimald stopping_a_wedged_host_detaches_its_loop_instead_of_parking
produces: none
consumes: none
proof: The actor behaves as before, split by concern.

Proof

box_actor.rs now holds only the actor type, its messages, assemble/run/mainloop/handle_message/paths and the test seams (about 1450 lines, down from 6864). Hostname and loopback naming, port expose and ask handling, setup and finalize, attach, host launch and teardown, the session launcher, and BoxHandle/WeakBoxHandle each live in their own box_actor/ file. The actor behaves as before: every item moved verbatim, and the wedged-host test passes.

Notes from the agent: This is a pure move. Each moved item keeps its doc comments and attributes byte for byte. The only edits are visibility: moved private items and methods became pub(super), plus the PendingAsk fields and the BoxHandle/WeakBoxHandle tuple fields. box_actor.rs re-exports the new modules with globs, as it already did for helpers, so every crate::box_actor:: path still resolves. naming has no re-export because nothing outside it uses its free function. In tests.rs, the calls to promote_interim_to_hand now go through super::naming. clippy -p minimald --all-targets is clean for these files, and cargo fmt --check passes. The remaining warnings are in box_runtime.rs, net/switch.rs and minimald-rpc, and they were there before this change. Follow-up, outside this task's layers: the refusal guard in crates/minimal/src/tests.rs (around line 1844) reads only minimald/src/box_actor.rs. The attach and finalize refusal strings are now in box_actor/attach.rs and box_actor/setup.rs, so the guard no longer scans them. Today no string in the new files names a guarded RPC, but the guard needs to read box_actor/*.rs as well. Also, log targets now carry a submodule suffix such as minimald::box_actor::host. RUST_LOG filters on minimald::box_actor, as scripts/session-e2e.sh uses, still match them because the filter matches by prefix. I did not run the whole crate suite.

Tests

line exit tail
cargo nextest run -p minimald stopping_a_wedged_host_detaches_its_loop_instead_of_parking 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-1157... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) 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-672c...
    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 diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking common v0.0.1 (/workbench/crates/common)
    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)
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 #2377


Undrafted 2026-10-20: the edits outside the layers (crates/minimal/src/tests.rs) update source-scanning tests that name the moved files by path. The move needs them, and the plan missed them. A maintainer accepted them.

Move naming, ports, setup, attach, host, launcher and handle code out
of box_actor.rs into box_actor/ submodules. box_actor.rs keeps the
actor type, its messages and its loop. No behaviour changes.
@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: e41b3f5c-d9b6-4126-ae46-e10f3056b3ed

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: every review thread resolved at e8e7de5543ab.

@mitodrummer resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@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 moves code inside crates/minimald and does not change behaviour. The design of record does not specify the internal module layout of minimald, so this is a PASS by absence. A line comparison of the diff shows that only visibility, rustfmt wrapping and module scaffolding changed. The refusal guard at crates/minimal/src/tests.rs line 1844 no longer scans the moved refusal strings. That guard is not a design matter, but file an issue for it.

Ruled at 4c79ac7 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 — advisory review

Verdict COMMENT — 1 finding, 1 inline.

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

Comment thread crates/minimald/src/box_actor.rs Resolved
The box actor split moved the refusal strings into box_actor/ files,
so the guard read only box_actor.rs and stopped checking them. Scan
box_actor.rs and each box_actor/*.rs file except kind.rs and tests.rs,
and update the kind.rs comment to match.

@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 compare since the PASS on 4c79ac7 changes only the refusal guard test and one comment. The guard now scans every box_actor/ file except kind.rs and tests.rs, and it fails if the directory moves. The design does not govern this layout, so this is a PASS by absence. The earlier PASS stands for the moved code.

Ruled at e8e7de5 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 — approval withheld

Verdict COMMENT — APPROVE withheld: 1 unresolved thread — minimal-foundry[bot] crates/minimald/src/box_actor.rs:50. No findings.

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

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as e8e7de5543ab.

line exit tail
cargo nextest run -p minimald stopping_a_wedged_host_detaches_its_loop_instead_of_parking 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-5b85... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) 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.

proto v0.26.3
    Checking sysinfo v0.39.6
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking hashbrown v0.14.5
    Checking vsock v0.5.4
    Checking vte v0.15.0
    Checking serde_bytes v0.11.19
    Checking dashmap v6.2.1
    Checking vt100 v0.16.2 (https://github.com/gominimal/vt100-rust.git?rev=9b8cce5a6798daf061948259ebcb073bb1ea54a6#9b8cce5a)
    Checking tokio-vsock v0.7.2
    Checking russh-sftp v2.4.0
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking castaway v0.2.4
    Checking strum v0.28.0
    Checking compact_str v0.9.1
    Checking signal-hook v0.3.18
    Checking unicode-truncate v2.0.1
    Checking kasuari v0.4.12
    Checking lru v0.18.2
    Checking signal-hook-mio v0.2.5
    Checking derive_more v2.1.1
    Checking ratatui-core v0.1.2
    Checking line-clipping v0.3.8
    Checking crossterm v0.29.0
    Checking getrandom v0.2.17
    Checking ratatui-widgets v0.3.2
    Checking ring v0.17.14
    Checking yasna v0.6.0
    Checking pem v4.0.0
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking ratatui-macros v0.7.2
    Checking rcgen v0.14.10
    Checking ratatui-crossterm v0.1.2
    Checking fuzzy-matcher v0.3.7
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking ratatui v0.30.2
    Checking inquire v0.9.4
    Checking wait-timeout v0.2.1
    Checking bit-vec v0.8.0
    Checking similar v2.7.0
    Checking quick-error v1.2.3
    Checking bit-set v0.8.0
    Checking insta v1.48.0
    Checking rusty-fork v0.3.1
    Checking rand_xorshift v0.4.0
   Compiling serial_test_derive v4.0.1
    Checking unarray v0.1.4
    Checking proptest v1.11.0
    Checking serial_test v4.0.1
    Checking common v0.0.1 (/workbench/crates/common)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
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...

Outside the task's layers::

  • crates/minimal/src/tests.rs

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_actor.rs:50: The guard in crates/minimal/src/tests.rs now scans box_actor.rs and each box_actor/*.rs file except kind.rs (span names) and tests.rs. The kind.rs comment in box_actor.rs now matches.

The box actor behaves as before and is split by concern into box_actor/ files. The daemon refusal guard again checks the moved refusal strings, because it now scans box_actor.rs and every box_actor/*.rs file except kind.rs and tests.rs.

Notes from the agent: This round touched crates/minimal/src/tests.rs, which is outside the task's layers. The split moved the attach and finalize refusal strings out of box_actor.rs, so the guard test daemon_refusals_print_without_rpc_names no longer read them. The task did not name the guard file, but the move broke the guard, so the fix belongs with the move. A temporary string literal "CreateSession" in box_actor/attach.rs made the updated guard fail, which confirms it reads the new files. That mutation was reverted before the commit.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 20, 2026 14:27
@minimal-foundry minimal-foundry Bot added the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Oct 20, 2026
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: the diff is +5535/-5452 (10987 lines), past 3x the plan's estimate of 360 lines (est: 300 code, 60 tests), at round 1 (the last trigger was the runtime's review findings). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #2377 by hand.

@mitodrummer mitodrummer removed the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Oct 20, 2026
@mitodrummer

Copy link
Copy Markdown
Member

/revise

@mitodrummer
mitodrummer marked this pull request as ready for review October 20, 2026 15:47
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a /revise note: the coder changed nothing. Revise round 1 had no note, no unresolved threads and no failing checks. The merge of origin/main (9528bbcd) did not touch any box_actor file and left no conflict markers. The answered thread PRRT_kwDOPdfcxM6uXWCp was fixed in e8e7de5, so its verdict did not change. This round adds no commit.

@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 e8e7de5 against T38's plan block. This is a pure split: box_actor.rs -5412 into attach, handle, host, launcher, naming, ports and setup. After stripping whitespace, the added lines match the removed lines except for mod and use lines, pub(super) where the split needs it, super::naming:: paths in box_actor/tests.rs, and rustfmt rewrapping. The one edit outside the layers (crates/minimal/src/tests.rs) widens the refusal guard to the new module files. A maintainer accepted it.

@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 — every review thread is resolved; @mitodrummer closed the last one. The review of e8e7de5543ab withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 20, 2026
@mitodrummer
mitodrummer added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit dcefe36 Oct 20, 2026
42 of 44 checks passed
@mitodrummer
mitodrummer deleted the agent/2377-split-the-box-actor-into-files-by-concern branch October 20, 2026 18:03
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.

T38 — Split the box actor into files by concern

1 participant