8000 refactor(minimald): rename the session modules for what they hold by mitodrummer · Pull Request #2228 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

refactor(minimald): rename the session modules for what they hold - #2228

Merged
mitodrummer merged 2 commits into
mainfrom
refactor/minimald-box-module-names
Oct 16, 2026
Merged

mitodrummer merged 2 commits into
mainfrom
refactor/minimald-box-module-names

Conversation

@mitodrummer
@mitodrummer mitodrummer commented Oct 15, 2026 •
Copy link
Copy Markdown
Member

What

R3 of the box naming plan (AGENTS.md, "Naming: box, Box Type, sandbox"), after R1 (#2106, sandbox2 → sandbox) and R2 (#2201, the sessions crate → boxes): the minimald modules whose subject is the box are named for what they hold, and so is minimal-client's autogen box-name module.

Old New Holds
minimald/src/sessions.rs + sessions/composables.rs box_manager.rs + box_manager/composables.rs the manager that owns every box
minimald/src/session.rs + session/{helpers,kind,tests}.rs box_actor.rs + box_actor/{helpers,kind,tests}.rs one box's actor
minimald/src/session_host.rs + session_host/{pty,tests}.rs box_runtime.rs + box_runtime/{pty,tests}.rs the running box's host, launchers, PTY
minimald/src/session_sop.rs box_ops.rs in-box check/build/materialize ops
minimald/src/session_delta.rs workspace_delta.rs the workspace delta
minimald/src/session_shell.rs attach_shell.rs the attach shell resolution
minimal-client/src/session_name.rs box_name.rs autogen box names

A pure rename, done the way R1 and R2 were: a recorded script, then a review of every hit.

  • git mv of each file with its submodule directory; the mod declarations in minimald/src/lib.rs (re-sorted, visibility unchanged: box_ops and box_runtime stay pub) and minimal-client/src/lib.rs.
  • Every module path in Rust: crate::<old>::, minimald::<old>:: (main.rs, tests/netns_root_integration.rs), minimal_client::session_name:: / crate::session_name::, the bare and grouped use 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_names reads ../minimald/src/box_actor.rs (it would otherwise fail to open the file).
  • File-path comments in minimald/Cargo.toml, minimald sources, 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_runtime 165, box_manager 123, box_actor 96, box_ops 12, workspace_delta 8, attach_shell 6, box_name 6. 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 in scripts/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. EnvFilter matches targets by string prefix, so the old directive also enabled session_host, session_sop, session_delta, session_shell and sessions at 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_LOG naming the old module paths needs the new names.

Deliberately unchanged

  • Types, traits, functions, fields. Session, SessionHandle, SessionKeyPredicate, sessions_manager(), the sessions: field, autogen_session_name, and so on. Those are R4/R5, pending decisions.
  • Serialised, wire, on-disk, CLI and env names. JSON keys, the session_name log field, state paths, MINIMAL_SESSION_ID, the min session verb.
  • crates/minimal/src/cmd/session.rs: the min session verb keeps its name, as does every super::session:: in cmd/ that points at it.
  • crates/minvmd/tests/minimald_session_integration.rs: not renamed. Two frozen workflows name it (comments in ci-linux-kvm.yml:357 and ci-macos.yml:414), as do crates/minvmd/README.md and the cargo test --test verify lines of spec 02. It also tests the SSH session through the bridge, so the name is not wrong.
  • Historical docs, as in R1/R2. The shipped specs keep their file paths: spec 03's architecture.md (sessions::Record, session.rs), spec 04 (crates/minimald/src/session_host.rs), spec 07 (session_host.rs:508 and others, sessions::Record). Line numbers in the comments that name a file (box_runtime.rs:2207 in netns_root_integration.rs, spec 10's box_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|/)' plus minimald::<old>, session_name:: and bare <old>.rs): only the shipped specs 04 and 07 listed above.

Verification

  • just fmt then just 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 clippy on this sandbox's rustc 1.98 (the repo pins 1.97): stops on the toolchain-only clippy::chunks_exact_to_as_chunks at minimald-rpc/src/trace.rs:199, a line this PR does not touch. CI runs the pinned toolchain.
  • Not run here: the full workspace just test, doctests, and the session e2e; CI covers them.
  • just lint-prose on 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):

Any open PR that adds a crate::session…:: path, a minimald::session… log filter, or a minimal_client::session_name import needs the new name too.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NSAwDroXL6KqsSxUzdbZGw

Summary by CodeRabbit

  • Documentation
    • Updated technical references to use current terminology for boxes, runtimes, and workspace changes.
  • Refactor
    • Reorganized internal components and aligned related test references. Existing runtime behavior and end-user workflows remain unchanged; this update adds no new user-facing capabilities.

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
@coderabbitai
coderabbitai Bot commented Oct 15, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 17830b50-f9f2-49a6-83e1-5941c17f3eba
📥 Commits

Reviewing files that changed from the base of the PR and between 9602f10 and c184d62.

📒 Files selected for processing: 42
  • crates/boxes/docs/COMPOSITION.md
  • crates/minimal-client/src/ask_dialog.rs
  • crates/minimal-client/src/box_name.rs
  • crates/minimal-client/src/box_registration.rs
  • crates/minimal-client/src/lib.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimal/src/dash/rpc.rs
  • crates/minimal/src/tests.rs
  • crates/minimald/Cargo.toml
  • crates/minimald/src/attach_shell.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/helpers.rs
  • crates/minimald/src/box_actor/kind.rs
  • crates/minimald/src/box_actor/tests.rs
  • crates/minimald/src/box_manager.rs
  • crates/minimald/src/box_manager/composables.rs
  • crates/minimald/src/box_ops.rs
  • crates/minimald/src/box_runtime.rs
  • crates/minimald/src/box_runtime/pty.rs
  • crates/minimald/src/box_runtime/tests.rs
  • crates/minimald/src/connection.rs
  • crates/minimald/src/env.rs
  • crates/minimald/src/exec.rs
  • crates/minimald/src/guest.rs
  • crates/minimald/src/hooks.rs
  • crates/minimald/src/lib.rs
  • crates/minimald/src/main.rs
  • crates/minimald/src/maintenance.rs
  • crates/minimald/src/net/answerer.rs
  • crates/minimald/src/net/dns.rs
  • crates/minimald/src/net/gvproxy_network.rs
  • crates/minimald/src/net/listeners.rs
  • crates/minimald/src/nsenter.rs
  • crates/minimald/src/rpc.rs
  • crates/minimald/src/server.rs
  • crates/minimald/src/sftp.rs
  • crates/minimald/src/test_harness.rs
  • crates/minimald/src/workspace_delta.rs
  • crates/minimald/tests/netns_root_integration.rs
  • docs/specs/10-spec-diagnostics/10-spec-diagnostics.md
  • scripts/e2e-attach-pty.py
  • scripts/session-e2e.sh
💤 Files with no reviewable changes: 7
  • crates/minimal-client/src/box_name.rs
  • crates/minimald/src/workspace_delta.rs
  • crates/minimald/src/box_actor/helpers.rs
  • crates/minimald/src/box_manager/composables.rs
  • crates/minimald/src/attach_shell.rs
  • crates/minimald/src/box_actor/kind.rs
  • crates/minimald/src/box_runtime/pty.rs
🚧 Files skipped from review as they are similar to previous changes: 14
  • crates/boxes/docs/COMPOSITION.md
  • crates/minimal-client/src/ask_dialog.rs
  • crates/minimald/src/nsenter.rs
  • crates/minimald/src/guest.rs
  • crates/minimald/Cargo.toml
  • scripts/e2e-attach-pty.py
  • crates/minimald/src/net/dns.rs
  • crates/minimald/src/net/listeners.rs
  • crates/minimald/src/net/gvproxy_network.rs
  • docs/specs/10-spec-diagnostics/10-spec-diagnostics.md
  • crates/minimal/src/dash/rpc.rs
  • crates/minimald/src/sftp.rs
  • crates/minimald/src/box_manager.rs
  • crates/minimald/src/box_runtime.rs

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

📝 Walkthrough

The client and daemon replace session-oriented module paths with box-oriented modules. Callers, tests, documentation, and scripts use the relocated APIs. The summaries report that runtime behavior and test expectations remain unchanged.

Changes: Box Module Migration

Layer / File(s) Summary
Client box-name module
crates/minimal-client/src/*, crates/minimal/src/cmd/mod.rs, crates/minimal/src/dash/rpc.rs
The client exports box_name instead of session_name. Registration and callers use its name-generation and retry utilities.
Daemon module ownership and runtime types
crates/minimald/src/lib.rs, crates/minimald/src/box_actor.rs, crates/minimald/src/box_manager.rs, crates/minimald/src/box_ops.rs, crates/minimald/src/box_runtime.rs
The daemon declares box-oriented modules and removes the former session-oriented module declarations. Actor, manager, runtime, operation, and workspace-delta references use the relocated paths.
Manager and daemon call-site wiring
crates/minimald/src/{connection,env,exec,main,maintenance,rpc,server}.rs, crates/minimald/src/net/*, crates/minimald/src/{guest,hooks,nsenter,sftp,test_harness}.rs
Daemon call sites and types now use the box-oriented modules. The server’s manager field, initialization, and accessor use box_manager.
Tests and source references
crates/minimald/src/*, crates/minimald/tests/*, crates/minimal-client/src/*, crates/boxes/docs/*, docs/specs/*, scripts/*
Tests, comments, documentation, source references, and log filters point to the relocated modules. The summaries report unchanged test expectations and proof control flow.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Suggested reviewers: norrietaylor

Merge Risk: ⚪ Minimal · up to c184d

No actionable merge blocker is identified; the rename is ready for normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: renaming the session modules based on what they hold. It follows the required Conventional Commit format.
Description check Passed The description is complete and relevant. It explains the rename scope, deliberate non-changes, log-filter impact, verification results, limitations, and rebase considerations. It does not use the tem…
Docstring Coverage Passed Docstring coverage is 87.27% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 110 functions across 30 files. (5 skipped: …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and relevant. It explains the rename scope, deliberate non-changes, log-filter impact, verification results, limitations, and rebase considerations. It does not use the template headings exactly and omits the checklist, but the required information is mostly present.

Full detai 8000 ls: Docstring Coverage

Explanation

Docstring coverage is 87.27% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 110 functions across 30 files. (5 skipped: 3 unsupported, 2 too large.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Vale (3.23.0)

{
"Line": 0,
"Path": "",
"Text": "E100 [loadStyles] Runtime error\n\nstyle 'ste' does not exist on StylesPath\n\nExecution stopped with code 1.",
"Code": "E100",
"Span": 0
}

A rabbit checks each renamed trail
Through box-name paths and runtime mail
The modules hop from old to new
While tests keep every promise true
Then carrots mark the merge as through

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

@github-actions
Copy link
Copy Markdown
Contributor

Spec lint

docs/specs/10-spec-diagnostics/10-spec-diagnostics.md — 3 finding(s)

docs/specs/10-spec-diagnostics/10-spec-diagnostics.md:1: F004 frontmatter is missing `owner:`, `epic:`, `arch:`, `updated:`
docs/specs/10-spec-diagnostics/10-spec-diagnostics.md:1: S002 missing 6 required section(s): `## Users and stories`, `## Requirements`, `## Non-goals`, `## Design reasoning`, `## Security considerations`, `## Open questions`
docs/specs/10-spec-diagnostics/10-spec-diagnostics.md:49: S003 12 section(s) are not part of the spec format: `## Introduction/Overview`, `## Goals`, `## User Stories`, `## Porting baseline — reconciling the reference tree with current `main``, `## Demoable Units of Work`, `## Non-Goals`, `## Design Considerations`, `## Repository Standards`, `## Open Questions`, `## Technical Considerations`, `## Security Considerations`, `## Verification`

Advisory. None of this blocks the merge; the review decides.

Advisory, and never a merge gate. Linter: gominimal/foundry@3194063a, spec format: How Minimal Writes Specs.

@mitodrummer
Copy link
Copy Markdown
Member Author

@coderabbitai review

@mitodrummer
Copy link
Copy Markdown
Member Author

/review

@coderabbitai
coderabbitai Bot commented Oct 15, 2026 •
Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@minimal-foundry
minimal-foundry Bot commented Oct 15, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at c184d62ae9f2.

Nothing to do.

Clobber: none: git log shows the head is the rename itself over the prior sessions→boxes crate rename; no reverts.

@mitodrummer
mitodrummer marked this pull request as ready for review October 15, 2026 18:09
@mitodrummer
mitodrummer requested a review from a team as a code owner October 15, 2026 18:09
@mitodrummer
mitodrummer requested a review from msample October 15, 2026 18:10
@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 15, 2026
@norrietaylor norrietaylor 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 enabled auto-merge (squash) October 16, 2026 15:52
@mitodrummer
mitodrummer merged commit c22640e into main Oct 16, 2026
42 of 44 checks passed
@mitodrummer
mitodrummer deleted the refactor/minimald-box-module-names branch October 16, 2026 17:50
mitodrummer added a commit that referenced this pull request Oct 16, 2026
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
mitodrummer added a commit that referenced this pull request Oct 16, 2026
* 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>
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.

2 participants

0