Repository navigation
fix(boxes,minimal,minimald): a newer box-state format is refused before any write, with a message - #3850
Conversation
DiskLoader::new now reads and checks sessions/index.json before it creates dirs, tightens modes, self-heals or flushes. The refusal is a typed NewerStateFormat error that names the state dir and the next step.
In the microVM the daemon sends STATE_REFUSED in place of READY and parks. A native daemon, detached or not, prints the refusal and exits non-zero.
Parse STATE_REFUSED beside MOUNT_FAILED, kill the guest, keep the data volume, and report the refusal with the volume path in place of the generic supervisor text.
min prints the refusal from minvmd or the native minimald as it is, with no retry advice. Spec 08 records the STATE_REFUSED beacon.
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
Approved: no findings at 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. |
|
/arch-review |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms. The box store, the guest and the host refuse a newer box-state format before any write to the box store. The refusal names both versions, as the version-skew line in architecture.md (line 589) requires for a peer outside the window. minvmd keeps the data volume on a state refusal. That is the safe side, and no check moves across the guest and host boundary. The summary lists two message points for the code review. CI must still run the min test that failed on a full disk.
Ruled at e3b0aa9 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
#3850 makes the daemon refuse a newer box-state format before it changes anything, and min prints the reason. Refs gominimal/inbox#1330. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CYvTvep9ZaSf5pJMB2hQA
Follow-up
Fixes #3843
crates/boxes/src/store.rscrates/minimald/src/guest.rscrates/minimald/src/main.rscrates/minvmd/src/cmd/mod.rscrates/minvmd/src/cmd/run.rscrates/minvmd/src/cmd/boot.rscrates/minimal/src/autospawn.rsdocs/specs/08-spec-vm-ext4-volume/08-spec-vm-ext4-volume.mdTask marker
Proof
When min meets sessions/index.json with format_version 2, it prints the refusal as its error and exits non-zero. The refusal reads: "A newer min wrote the box state in . That state has format version 2. This min reads format version 1 or older, and it changed nothing. Install the newer min, then run your command again." In the VM, the line ends with "That state is on the data volume ." The store reads and checks the index before it writes anything. A test confirms that the state tree keeps the same bytes, entries and modes after the refusal, including a 0755 dir that the open usually tightens and an orphan dir that self-heal usually indexes.
Notes from the agent: The task gave no exact refusal text. I wrote it, and boxes::store::tests::newer_state_format_refusal_text_is_pinned pins it. Its next step ("Install the newer min") names no command, because min has no upgrade command. The refusal is a typed boxes::store::NewerStateFormat error inside an io::Error, and NEWER_STATE_FORMAT_LEAD finds it in text. I replaced the old store test index_with_newer_format_version_is_refused_with_a_clear_error with store_refuses_a_newer_format_and_changes_nothing. minimald checks the state before it creates any dir. It also checks in the parent of
run --detach, because the detached child's stderr is /dev/null. A native daemon prints the text alone (not the Debug form of MainError) and exits 1. In the VM, the guest's refusal names /var/lib/minimal, and minvmd adds the data volume path on the host. minvmd keeps the volume on a state refusal in both boot paths. The detach_failure_message test (detach_failure_names_quarantine_unreadable) now also checks the state-refusal case. This box has no libkrun, so the minvmd_libkrun code in boot.rs and run.rs does not compile in a normal build. A cargo check with RUSTFLAGS=--cfg minvmd_libkrun in a separate target dir type-checks it with no errors. No VM e2e ran. just lint-prose did not run because vale is not installed here.Tests
cargo test -p boxes store_refuses_a_newer_format_and_changes_nothingcargo test -p boxes refusalcargo test -p minimald state_refused_beacon_is_two_lines_flattened_and_cappedcargo test -p minvmd read_ready_beacon_parses_state_refusedcargo test -p minimal boot_failure_error_for_a_state_refusalVerify
min task run agent-verifyexited 101 under rustc 1.100.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.