Repository navigation
refactor(minimald): rename the session modules for what they hold - #2228
Conversation
R3 of the box naming plan, after R1 (#2106) and R2 (#2201). The minimald modules whose subject is the box take box names, and so does minimal-client's autogen name module: - sessions -> box_manager (with sessions/composables.rs) - session -> box_actor (with session/{helpers,kind,tests}.rs) - session_host -> box_runtime (with session_host/{pty,tests}.rs) - session_sop -> box_ops - session_delta -> workspace_delta - session_shell -> attach_shell - minimal-client session_name -> box_name A pure rename: git mv, the mod declarations, every module path (crate::, minimald::, minimal_client::, bare and grouped imports), module mentions in doc comments, the source path the minimal test scans, the RUST_LOG filters in the session e2e, and current docs that name the files. Types, functions, fields, serialised names and the min session verb are unchanged. rustfmt applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSAwDroXL6KqsSxUzdbZGw
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
@coderabbitai review |
|
/review |
✅ Action performedReview finished.
|
|
Approved: no findings at Nothing to do. Clobber: none: |
There was a problem hiding this comment.
correctness
minimal-review — approved
Verdict APPROVE — No findings.
security
minimal-review — approved
Verdict APPROVE — No findings.
supply-chain
minimal-review — approved
Verdict APPROVE — No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
R4 of the BOX naming plan, rebuilt on main after R3 (#2228) squash-merged: the same rename as ff18bf7, applied to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSAwDroXL6KqsSxUzdbZGw
* refactor(minimald): rename the session modules for what they hold R3 of the box naming plan, after R1 (#2106) and R2 (#2201). The minimald modules whose subject is the box take box names, and so does minimal-client's autogen name module: - sessions -> box_manager (with sessions/composables.rs) - session -> box_actor (with session/{helpers,kind,tests}.rs) - session_host -> box_runtime (with session_host/{pty,tests}.rs) - session_sop -> box_ops - session_delta -> workspace_delta - session_shell -> attach_shell - minimal-client session_name -> box_name A pure rename: git mv, the mod declarations, every module path (crate::, minimald::, minimal_client::, bare and grouped imports), module mentions in doc comments, the source path the minimal test scans, the RUST_LOG filters in the session e2e, and current docs that name the files. Types, functions, fields, serialised names and the min session verb are unchanged. rustfmt applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSAwDroXL6KqsSxUzdbZGw * refactor: rename the session types for the box they model R4 of the box naming plan: the types and traits whose subject is the box take box names. SessionStatus becomes BoxState, the minimald actor and manager become BoxActor and BoxManager with their handles, and the runtime traits, store traits, exec types and network gate follow. minimald_rpc::SessionConfig becomes BoxConfig, so the actor's spawn config is BoxActorConfig. SessionId is left for R5. A pure rename: no serialised, wire, on-disk, CLI or env name changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSAwDroXL6KqsSxUzdbZGw * refactor: rename the session types for the box they model R4 of the BOX naming plan, rebuilt on main after R3 (#2228) squash-merged: the same rename as ff18bf7, applied to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSAwDroXL6KqsSxUzdbZGw --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
What
R3 of the box naming plan (AGENTS.md, "Naming: box, Box Type, sandbox"), after R1 (#2106,
sandbox2→sandbox) and R2 (#2201, thesessionscrate →boxes): theminimaldmodules whose subject is the box are named for what they hold, and so isminimal-client's autogen box-name module.minimald/src/sessions.rs+sessions/composables.rsbox_manager.rs+box_manager/composables.rsminimald/src/session.rs+session/{helpers,kind,tests}.rsbox_actor.rs+box_actor/{helpers,kind,tests}.rsminimald/src/session_host.rs+session_host/{pty,tests}.rsbox_runtime.rs+box_runtime/{pty,tests}.rsminimald/src/session_sop.rsbox_ops.rsminimald/src/session_delta.rsworkspace_delta.rsminimald/src/session_shell.rsattach_shell.rsminimal-client/src/session_name.rsbox_name.rsA pure rename, done the way R1 and R2 were: a recorded script, then a review of every hit.
git mvof each file with its submodule directory; themoddeclarations inminimald/src/lib.rs(re-sorted, visibility unchanged:box_opsandbox_runtimestaypub) andminimal-client/src/lib.rs.crate::<old>::,minimald::<old>::(main.rs,tests/netns_root_integration.rs),minimal_client::session_name::/crate::session_name::, the bare and groupeduse crate::{…}imports (sessions::SessionKeyPredicate,session_host::{self, …},session_delta::{self, …}), and module mentions in doc comments.crates/minimal/src/tests.rs:daemon_refusals_print_without_rpc_namesreads../minimald/src/box_actor.rs(it would otherwise fail to open the file).minimald/Cargo.toml,minimaldsources,scripts/e2e-attach-pty.py,scripts/session-e2e.sh,crates/boxes/docs/COMPOSITION.md, and the planned spec 10's affected-areas list.Counts: 42 files changed, 13 of them moves; module tokens rewritten:
box_runtime165,box_manager123,box_actor96,box_ops12,workspace_delta8,attach_shell6,box_name6. rustfmt re-sorted the imports and reflowed the lines whose length changed.Log filters (module path is the tracing target)
The target of every record these modules log changes with the module path (
minimald::session_host→minimald::box_runtime, and so on). No documented user-facing filter names these targets; the only filters are inscripts/session-e2e.sh:minimald::session_host=debug|info(3 filters) →minimald::box_runtime=….minimald::session=info(2 filters, the loopback-lease case and the expose-record case) →minimald::box_actor=info.EnvFiltermatches targets by string prefix, so the old directive also enabledsession_host,session_sop,session_delta,session_shellandsessionsat info. Both cases read only box-actor records (loopback-lease,loopback-release,answer_expose), so the new filter keeps everything they assert on; the daemon log in those two cases is quieter than before.Anyone with a local
RUST_LOGnaming the old module paths needs the new names.Deliberately unchanged
Session,SessionHandle,SessionKeyPredicate,sessions_manager(), thesessions:field,autogen_session_name, and so on. Those are R4/R5, pending decisions.session_namelog field, state paths,MINIMAL_SESSION_ID, themin sessionverb.crates/minimal/src/cmd/session.rs: themin sessionverb keeps its name, as does everysuper::session::incmd/that points at it.crates/minvmd/tests/minimald_session_integration.rs: not renamed. Two frozen workflows name it (comments inci-linux-kvm.yml:357andci-macos.yml:414), as docrates/minvmd/README.mdand thecargo test --testverify lines of spec 02. It also tests the SSH session through the bridge, so the name is not wrong.architecture.md(sessions::Record,session.rs), spec 04 (crates/minimald/src/session_host.rs), spec 07 (session_host.rs:508and others,sessions::Record). Line numbers in the comments that name a file (box_runtime.rs:2207innetns_root_integration.rs, spec 10'sbox_runtime.rs:368-372) were stale before and are kept as they were..github/workflows/: no workflow names a renamed file. Nothing to edit.Leftover scan (
git grep -nE 'crate::(sessions|session|session_host|session_sop|session_delta|session_shell)::|minimald/src/(sessions|session|session_host|session_sop|session_delta|session_shell)(\.rs|/)'plusminimald::<old>,session_name::and bare<old>.rs): only the shipped specs 04 and 07 listed above.Verification
just fmtthenjust fmt-check: clean.cargo check --workspace --all-targets --locked: clean, zero warnings.just test-one '' -p minimald --lib: 1010/1010 passed (1 skipped).just test-one daemon_refusals_print_without_rpc_names -p minimal: passed (the moved source path).just clippyon this sandbox's rustc 1.98 (the repo pins 1.97): stops on the toolchain-onlyclippy::chunks_exact_to_as_chunksatminimald-rpc/src/trace.rs:199, a line this PR does not touch. CI runs the pinned toolchain.just test, doctests, and the session e2e; CI covers them.just lint-proseon the two changed markdown files: no alerts on the changed lines.Open-PR overlap
These open PRs edit the old files and need a mechanical rebase (git follows the renames):
crates/minimald/src/sessions.rs→box_manager.rs.crates/minimald/src/session_host.rs→box_runtime.rs.Any open PR that adds a
crate::session…::path, aminimald::session…log filter, or aminimal_client::session_nameimport needs the new name too.🤖 Generated with Claude Code
https://claude.ai/code/session_01NSAwDroXL6KqsSxUzdbZGw
Summary by CodeRabbit