Skip to content

T37 — Move the daemon's RPC and server tests out, and build daemon-side create requests through one constructor - #2472

Merged
mitodrummer merged 3 commits into
mainfrom
agent/2381-move-the-daemon-s-rpc-and-server-tests-out-and-b
Oct 21, 2026
Merged

mitodrummer merged 3 commits into
mainfrom
agent/2381-move-the-daemon-s-rpc-and-server-tests-out-and-b

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T37 — Move the daemon's RPC and server tests out, and build daemon-side create requests through one constructor

slice: S0
kind: enablement
covers: none
size: L
est: 12200 code, 340 tests
executor: agent
difficulty: routine
model: standard
diagnostics: none: moves and test literals only
observability: none: moves and test literals only
layers:
- rpc:
- crates/minimald/src/rpc.rs: mod tests
- crates/minimald/src/rpc/tests.rs (new): handler tests moved; constructor
test: cargo nextest run -p minimald clean_cache_with_nothing_to_do_still_terminates
- server:
- crates/minimald/src/server.rs: mod tests
- crates/minimald/src/server/tests.rs (new): moved
test: cargo nextest run -p minimald log_release_runs_exactly_once
- wire:
- crates/minimald-rpc/src/lib.rs: create request constructor
- crates/minimald-rpc/src/tests.rs: constructor
test: cargo nextest run -p minimald-rpc create_request_constructor_round_trips
- daemon:
- crates/minimald/src/box_actor/tests.rs: constructor
- crates/minimald/src/test_harness.rs: constructor
test: cargo nextest run -p minimald harness_create_request_uses_the_constructor
- vm-host:
- crates/minvmd/examples/exec.rs: constructor
test (deferred: vm): cargo nextest run -p minvmd minimald_exec_over_bridge
produces: none
consumes: none
proof: Tests pass from their own files, via one constructor.
depends on:
- blocked by #2376
- blocked by #2377

Proof

The rpc and server unit tests now live in crates/minimald/src/rpc/tests.rs and crates/minimald/src/server/tests.rs and pass from there. The daemon test harness, the box actor tests, the rpc tests and the minvmd exec example build their create requests through one constructor, CreateSessionRequest::new.

Notes from the agent: Deferred (lane: vm): cargo nextest run -p minvmd minimald_exec_over_bridge was not run. That test lives in crates/minvmd/tests/minimald_session_integration.rs, which is outside the layers, so it still builds its request as a literal. Only the exec example in the vm-host layer uses the constructor. The other create literals outside the layers also stay as they are: the other minvmd integration tests, and the minimal CLI and its tests. The moves change only indentation. Before the move, a check found no multi-line string literal without a line continuation, so the dedent changes no string content. trace_tests in rpc.rs stays inline because the task names only mod tests. The rpc/tests.rs file arrives in the move commit and already calls the constructor in four places, so that commit is not a pure move. Extra checks: cargo clippy -p minimald --all-targets and cargo clippy -p minvmd --example exec are clean apart from warnings that were already there in files this task does not touch. cargo nextest run -p minimald rpc::tests:: server::tests:: own_ip dyn_ ran 125 tests and all passed. just clippy-strict was not run.

Tests

line exit tail
cargo nextest run -p minimald clean_cache_with_nothing_to_do_still_terminates 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-bd37... 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
cargo nextest run -p minimald log_release_runs_exactly_once 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-d88d... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimald-rpc create_request_constructor_round_trips 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-4173... 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 common v0.0.1 (/workbench
cargo nextest run -p minimald harness_create_request_uses_the_constructor 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-7c9b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

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-16d2...
    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 version v0.8.0 (/workbench/crates/version)
    Checking switch v0.0.1 (/workbench/crates/switch)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking common v0.0.1 (/workbench/crates/common)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking mctx v0.0.1 (/workbench/crates/mctx)
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...
error: could not compile `minimald-rpc` (lib test) due to 1 previous error

Deferred

The plan marked these test lines deferred: the executor lacks the lane, so nothing here ran them and they still owe evidence.

line lane
cargo nextest run -p minvmd minimald_exec_over_bridge vm

Closes #2381

CreateSessionRequest::new fills every field a plain create does not set, so daemon-side callers stop spelling the whole literal.
A move: each tests module body leaves rpc.rs and server.rs unchanged, apart from the dedent.
…ctor

The harness, the box actor tests, the rpc tests and the minvmd exec example now call CreateSessionRequest::new.
@coderabbitai

coderabbitai Bot commented Oct 21, 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: bf07d2bf-e08c-46d5-90ea-fe98c17bcaa4

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 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Approved: no findings at 6daef993ec9e.

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.

@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 design of record does not govern unit-test layout or the construction of a create request in tests. This is a PASS by absence, the same as #2451 and #2452. The moved tests are the same as the old mod tests bodies after rustfmt reflow. The new CreateSessionRequest::new fills each field with the value that every replaced literal had. So no create request changes. The constructor takes the network mode and the policy from the caller and adds no default for them.

Ruled at 6daef99 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 — 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 21, 2026

@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 6daef99 against T37's plan block. The moves are pure: rpc.rs -4430 into rpc/tests.rs, and server.rs -3107 into server/tests.rs. After stripping whitespace, the only unmatched lines are rustfmt rejoining calls after the dedent and the mod tests wrappers. CreateSessionRequest::new sets the same fields every call site set by hand (default_hooks_enabled() is true). Each rewritten site in box_actor/tests.rs, test_harness.rs and minvmd/examples/exec.rs passes the same name, path, network and policy as before, and harness_create_request_uses_the_constructor pins the harness to it. commitlint flags one commit body line over 100 characters. It is not a required check.

@mitodrummer
mitodrummer added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 1c770db Oct 21, 2026
37 of 44 checks passed
@mitodrummer
mitodrummer deleted the agent/2381-move-the-daemon-s-rpc-and-server-tests-out-and-b branch October 21, 2026 14:05
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.

T37 — Move the daemon's RPC and server tests out, and build daemon-side create requests through one constructor

1 participant