Repository navigation
refactor: rename the session types for the box they model - #2229
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
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
|
@coderabbitai review |
|
/review |
|
Approved: no findings at Nothing to do. Clobber: none: the working tree is at the PR head commit and the diff is self-contained; |
✅ Action performedReview finished.
|
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
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).
What
R4 of the box naming plan (AGENTS.md, "Naming: box, Box Type, sandbox"), after R1 (#2106), R2 (#2201) and R3 (#2228): the types and traits whose subject is the box take box names. Stacked on #2228 (base
refactor/minimald-box-module-names, so this diff is R4 only); it retargets tomainonce #2228 merges.A pure rename, done as R1–R3 were: a recorded script (word-boundary, crate-scoped), then a review of every hit. No behaviour change, no moves, no serialised/wire/on-disk/CLI/env name changes.
SessionIdis not here (R5, after T45).Renamed
SessionStatusBoxStateSessionPolicyBoxPolicyEffectiveSessionPolicyEffectiveBoxPolicySessionObject(store trait)BoxObjectSessionKey(store trait)BoxKeySessionKeystruct is untouchedDiskSession/DiskSessionKeyDiskBox/DiskBoxKeySessionStep(SubmitVerdict reply)BoxStepSessionConfigBoxConfigCreateSessionRequest.configSessionRuntimeFactsBoxRuntimeFactsSessionBoxActorSessionHandle/WeakSessionHandleBoxHandle/WeakBoxHandleManager/ManagerHandle/WeakManagerHandleBoxManager/BoxManagerHandle/WeakBoxManagerHandlecheckouts::ManageruntouchedSessionConfig(actor spawn config)BoxActorConfigBoxConfigis now minimald-rpc'sSessionInner/SessionMessageBoxInner/BoxMessageSessionPaths/SessionInfo/SessionKeyPredicate/SessionControlBoxPaths/BoxInfo/BoxKeyPredicate/BoxControlBoxStateSessionsError(alias)BoxManagerErrorBoxesErrorwould read as the crate'sSessionProcess/SessionLauncher/SessionEnvironment/SessionGuardBoxProcess/BoxLauncher/BoxEnvironment/BoxGuardSessionExec/SessionProgramBoxExec/BoxProgramSessionRecordHandleBoxRecordHandleSessionCommands(+ test doubleDeadSession)BoxCommands(DeadBox)SessionGate(net switch)BoxGateSessionChannel(in-sandboxminchannel actor)BoxChannelCollision check:
git grep -nwfor every target found no existing type. Near misses, not collisions:minimald_rpc::BoxControlRequest/BoxControlReply(minvmd's control protocol) beside the newBoxControl; the enum variantaudit::DecidedBy::BoxPolicy(always path-qualified) beside the newBoxPolicytype.Deliberately unchanged
SessionId— R5.CreateSession*,FinalizeSession*,GetSessionRuntimeFacts*,SessionDelta*,GetSessionPolicy*, …) andCreateSessionMsg: they mirror the RPCNAMEstrings, which are wire.SessionComposer,SessionVar,SessionPatch,WireSessionVar,WireSessionPatch: they compose the session Box Type's[session]table (borderline; a follow-up if wanted).SessionKeys/SessionKeysConfig: the attach key chords of the interactive terminal session, per channel.RunningSessionAttrs: the session shell's terminal state (title, bells, last I/O).SftpSession,russh::server::Session,mfile::Session([session]table),sandbox::WdSetup::Session,mctx::{WdLayout,PatchHome}::Session, and theminimalCLI'sSession*types (SessionArgs,SessionCommand, dashSessionKey, …): CLI noun, SSH/SFTP session, or session Box Type.AttachError::SessionPending/SessionBusy,WireError::UnknownSessionId,NsenterError::NoSessionLeader— a POSIX session leader): R4 renames types only; the wire error variant is serialised.session_config(),sessions:field, …) and the historical spec 03architecture.mdmention ofSessionMessage.Wire and serialisation safety
#[serde(tag/content)]names a type, all renamed enums keep their variant names, and no#[serde(from/into/try_from/remote = "…")]string names a renamed type. The serialised types renamed (BoxState,BoxPolicy,EffectiveBoxPolicy,BoxStep,BoxConfig,BoxRuntimeFacts) produce identical JSON, so no#[serde(rename)]was needed and none was added.const NAMEstrings (constcat!(RPC_SUBSYSTEM_PREFIX, "GetSessionRuntimeFacts")etc.), untouched.std::any::type_name, no schemars/JSON schema in these crates.Display, panic) contains a renamed name. No log/record writes a whole renamed struct with{:?}(only fields such as?config.name).Debugof the renamed structs changes its type-name prefix, but nothing asserts or persists it.dash_snapshots20/20 pass unchanged).Counts
56 files; renamed tokens (script output):
SessionPolicy271,SessionKeyPredicate178,SessionStatus148,SessionGate99,SessionMessage89,SessionInner74,Session55,EffectiveSessionPolicy53,SessionConfig55 (45 →BoxConfig, 10 →BoxActorConfig),SessionHandle47,SessionStep43,ManagerHandle38,Manager29,SessionsError28,WeakSessionHandle24,DiskSessionKey23,SessionPaths20,SessionRecordHandle19,SessionProcess18,SessionChannel17,SessionLauncher12,SessionCommands11,SessionControl11,DiskSession10,WeakManagerHandle10,SessionEnvironment9,SessionGuard9,SessionObject9,SessionRuntimeFacts9,SessionProgram6,SessionKey5,SessionInfo4,SessionExec4,DeadSession4. rustfmt reflowed the lines whose length changed. Two prose comments ("Manager-initiated", "Manager is down") were kept as prose.crates/boxes/docs/COMPOSITION.mdfollows the names; two of its touched sentences were split for the prose lint.Verification
just fmtthenjust fmt-check: clean.cargo check --workspace --all-targets --locked: clean, zero warnings.just test-one '' -p boxes: 627/627.just test-one '' -p minimald-rpc: 71/71.just test-one '' -p minimald --lib: 1010/1010 (1 skipped).just test-one '' -p minimal --test dash_snapshots: 20/20.just clippynot used as a gate: this sandbox's rustc 1.98 (repo pins 1.97) stops on toolchain-only lints in untouched code, as on refactor(minimald): rename the session modules for what they hold #2228. CI runs the pinned toolchain.just test, doctests, e2e; CI covers them.just lint-prose crates/boxes/docs/COMPOSITION.md: no alerts on the changed lines.Leftover scan (
git grep -ohwE '[A-Za-z]*Session[A-Z][A-Za-z]*'over boxes, minimald, minimald-rpc): only the "Deliberately unchanged" names above, plus a pre-existing stale doc linkSessionSeed::hostnamesinbox_actor.rs(no such type before this PR either).Open-PR overlap
Diffs of every open PR scanned for the old names: only #2224 (bryan-minimal) uses them (
SessionKeyPredicate,SessionsError,Sessioninbox_manager.rs, ex-sessions.rs); it needs a mechanical rename after this merges. Any open PR adding a use of an old name needs the new one.🤖 Generated with Claude Code
https://claude.ai/code/session_01NSAwDroXL6KqsSxUzdbZGw
Summary by CodeRabbit