Skip to content

fix(minvmd): move a renamed own_ip box's host row to its new name - #3175

Merged
bryan-minimal merged 7 commits into
mainfrom
fix/841b-rename-rekeys-host
Nov 10, 2026
Merged

bryan-minimal merged 7 commits into
mainfrom
fix/841b-rename-rekeys-host

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Refs gominimal/inbox#1116 (the rename half; #3172 is the teardown half).

This PR follows #3172 and includes its commits. c48d70f66, 98c2838a5 and 3a1312c79 are #3172's three commits (3a1312c79 is the same diff as #3172's 1cbcf5f92, on this branch's parent). This PR's own change is 857232c3b, 032245842 and 284c3f50a (the last keeps the deny-all DNS drop line's namespace field quoted now that a row's name is read as an Arc<str>; the host-side gate test that greps the line caught the Display form). Once #3172 merges, this branch is rebased onto main and keeps only those three.

min session rename reached only the in-VM daemon. The VM host kept the box's row, its creation (box-registry.json) and its published address under the name the box was registered by, so the old name kept answering the box's address and the new one was NXDOMAIN until the destroy (gominimal/inbox#1116).

A new host-door verb, rename_box, carries the old and new names, the pair and the box id. minvmd re-keys the row (and its task rows) in place, re-keys the creation found by the id, persists, and pings the table: the zone answers under the new name, the answerer's book moves the address on the re-publish, and the gate's name rules read the new name. Another box's id or pair is refused; a name another row holds is refused; a dormant creation under it is superseded.

The change

Wire (minimald-rpc): BoxControlRequest::RenameBox(RenameBoxRequest { name, new_name, switch_address, loopback_address, box_id }), tag rename_box. box_id is required, because the id is the proof. It answers BoxControlReply::Addresses echoing the pair, or Error. An older minvmd refuses the line at the parse, and the client warns.

Host (minvmd):

  • BoxRecord::name is now RwLock<Arc<str>>, renamed in place on the same Arc, so liveness, attribution, runtime ports, relays' Weak marks and the proxy attachment keep their identity.
  • BoxRegistry::rename_client_box works under one write of the row lock. It refuses another box's row at the pair (NotTheBoxId), another loopback, a creation of the id at another pair (NotTheHandedPair), and a new name another non-task row holds in any folded spelling (NameHeld). It finds the creation by id, re-inserts it under the new canonical key, supersedes a dormant creation of another box there (a standing one is refused), renames the row and its task rows, persists, and pings. It returns the old held name, or None when the host holds neither a row nor a creation of the id (nothing moves; the reply is still the echo).
  • control.rs dispatches (RenameBox, Host) under order.apply, like hold/withdraw, and logs both names.
  • The answerer needs no new verb: the ping re-publishes the table, and AddressBook::claim_at overwrites the holder record with the new name, so the destroy's release by the new name frees the address.
  • The native answerer-only socket refuses RenameBox (minimald/src/rpc.rs).

Client (minimal): rename_box_with_vm_host moves the zone hold as before when the record holds_name; otherwise it sends RenameBox only when the record carries both box_addresses and box_id, so native hosts and other modes stay silent. It is warn-only and bounded by BOX_CONTROL_TIMEOUT. min session rename, min box rename and the dashboard's rename all go through it.

Tests

  • box_registry::a_rename_re_keys_the_row_and_its_creation_by_box_id (refusals; the move; the follow-on withdraw and the old name's reuse) and box_registry::a_rename_re_keys_a_dormant_creation_by_box_id.
  • control::a_rename_moves_the_row_and_the_destroy_releases_the_new_name.
  • answerer::a_publish_under_a_new_name_moves_the_address_to_it.
  • vm_host::an_own_ip_rename_moves_its_host_row_by_pair_and_box_id.
  • minimald-rpc::rename_box_tests::rename_box_request_round_trips_and_requires_the_box_id.

Scope and follow-up

  • Proof: scenario 841b covers the own_ip rename only. The host_ip/none path (the hold move), and a host_ip box whose record carries box_addresses and box_id (which now takes the RenameBox branch), are unit-tested only.
  • The answerer moves the address on the next re-publish, so a destroy that lands first frees nothing until the VM's answerer connection ends. Closing that needs a new answerer message; not in this PR.
  • If minvmd refuses the rename (name held, older minvmd), the session is renamed in the VM and not on the host; the CLI warns and the rename still exits 0.
  • 857232c3b's body writes a bare "(fix: document powershell in completions and add a session policy reference #1116)"; it means gominimal/inbox#1116 (032245842 says so). The squash message should spell it in full.

Verification

  • prepush (CI's exact commands): green at 284c3f5
  • Lab: scenario 841b renames an own_ip box with a published port and, right after the rename, asks the VM host's answerer for both names and reads its persisted registry; after the destroy it asks for the new name again. x2 per distro (FAIL on the release, PASS on this branch). 841 (the destroy half) stays PASS, 727 is the control, and 790d and 723 show no change:

OK: 841b-rename-rekey-284c3f50: 4 expectation(s) on ubuntu-24.04, fedora: 841b-rename-moves-own-ip-name:fail->pass 841-rename-destroy-own-ip-row:pass 727-host-ip-egress-fail-open:pass 723-vm-host-ip-name-502:same

min-regress batch 841b-rename-rekey-284c3f50: base rel-6a01d5ae vs the candidate cand-841b-rename-rekey-284c3f50-d0e280ed, per distro:

  • ubuntu-24.04: 841b {'fail': 2} -> {'pass': 2}; 841 {'fail': 1} -> {'pass': 1}; 727 {'pass': 1} -> {'pass': 1}; 723 {'pass': 1} -> {'pass': 1}
  • fedora: 841b {'fail': 2} -> {'pass': 2}; 841 {'fail': 1} -> {'pass': 1}; 727 {'pass': 1} -> {'pass': 1}; 723 {'pass': 1} -> {'pass': 1}

Lab evidence (min-regress batch 841b-rename-rekey-284c3f50 on the lab box, fedora, ubuntu-24.04)

Head: 284c3f50a35ddf7a83fcc46cd2dfedd389c8cff7 at 284c3f5 (lab name cand-841b-rename-rekey-284c3f50-d0e280ed). Base: rel-6a01d5ae (rel-6a01d5ae).

scenario distro base head
723-vm-host-ip-name-502: 0.7 sweep P1: in the VM, a host_ip session's name through the proxy gave 502 for a dev server on 127.0.0.1; since T138 (NET-071) that is a 403 naming the fix, and a 0.0.0.0 server must answer fedora pass pass
723-vm-host-ip-name-502: 0.7 sweep P1: in the VM, a host_ip session's name through the proxy gave 502 for a dev server on 127.0.0.1; since T138 (NET-071) that is a 403 naming the fix, and a 0.0.0.0 server must answer ubuntu-24.04 pass pass
727-host-ip-egress-fail-open: 0.7 sweep P1: on a host_ip box, declared egress is shown by session policy but never enforced (fail-open) fedora pass pass
727-host-ip-egress-fail-open: 0.7 sweep P1: on a host_ip box, declared egress is shown by session policy but never enforced (fail-open) ubuntu-24.04 pass pass
790d-own-ip-ingress-diagnose-vm: JK 072-bug.md Q11 / W1 (P1) diagnostic: on the Linux VM path every own_ip box's ingress returns empty replies fedora fail fail
790d-own-ip-ingress-diagnose-vm: JK 072-bug.md Q11 / W1 (P1) diagnostic: on the Linux VM path every own_ip box's ingress returns empty replies ubuntu-24.04 env-fail env-fail
841-rename-destroy-own-ip-row: gominimal/inbox#1116: renaming an own_ip box and destroying it leaves its VM host row, ingress forward and old name behind fedora fail pass
841-rename-destroy-own-ip-row: gominimal/inbox#1116: renaming an own_ip box and destroying it leaves its VM host row, ingress forward and old name behind ubuntu-24.04 fail pass
841b-rename-moves-own-ip-name: gominimal/inbox#1116: a renamed own_ip box keeps answering under its old name; the new name is NXDOMAIN until destroy fedora fail, fail pass, pass
841b-rename-moves-own-ip-name: gominimal/inbox#1116: a renamed own_ip box keeps answering under its old name; the new name is NXDOMAIN until destroy ubuntu-24.04 fail, fail pass, pass

Fixed since base: 4. Still reproducing on both: 1. Regressed: 0. Passing on both: 4. Inconclusive cells (an environment or setup failure on a side, not counted): 1. A scenario that fails on both sides is the environment or main, not this candidate: read its evidence lines before reading it as the candidate's. A verdict links to the run's trace in Cloud Trace (project access needed); the scenario link is its source with the # issue: it reproduces.

Why each failed run failed: what the scenario measured, then what its trace recorded (error spans and warnings, most frequent first):

  • 841b-rename-moves-own-ip-name on ubuntu-24.04 (base, trace 505582cc): scenario: answer_before=127.0.64.3 old_after_rename=127.0.64.3 new_after_rename=nxdomain registry_old=1 registry_new=0 new_after_destroy=nxdomain port_after_destroy=1 destroy_rc=0; trace: no error span and no warning in the trace
  • 841b-rename-moves-own-ip-name on ubuntu-24.04 (base, trace 055413ad): scenario: answer_before=127.0.64.3 old_after_rename=127.0.64.3 new_after_rename=nxdomain registry_old=1 registry_new=0 new_after_destroy=nxdomain port_after_destroy=1 destroy_rc=0; trace: no error span and no warning in the trace
  • 841-rename-destroy-own-ip-row on ubuntu-24.04 (base, trace c5322233): scenario: destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1; trace: 2x minimal-cli span error cmd; 1x minimal-cli span error activation_step
  • 841b-rename-moves-own-ip-name on fedora (base, trace c4ba768d): scenario: answer_before=127.0.64.3 old_after_rename=127.0.64.3 new_after_rename=nxdomain registry_old=1 registry_new=0 new_after_destroy=nxdomain port_after_destroy=1 destroy_rc=0; trace: no error span and no warning in the trace
  • 841b-rename-moves-own-ip-name on fedora (base, trace e8705b62): scenario: answer_before=127.0.64.3 old_after_rename=127.0.64.3 new_after_rename=nxdomain registry_old=1 registry_new=0 new_after_destroy=nxdomain port_after_destroy=1 destroy_rc=0; trace: no error span and no warning in the trace
  • 841-rename-destroy-own-ip-row on fedora (base, trace 47506963): scenario: destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1; trace: 2x minimal-cli span error cmd; 1x minimal-cli span error activation_step
  • 790d-own-ip-ingress-diagnose-vm on fedora (base, trace 9338cb14): scenario: body_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0; trace: 3x minimald WARN exec: ended while its command was starting; the start is ended when it returns; 1x minimald WARN the box's classifier cover fell back to an empty read-only tmpfs: the kernel refused the design's cgroup<n> mount of the box's namespace roo; 1x minimald WARN exec: ssh client disconnected; killing child
  • 790d-own-ip-ingress-diagnose-vm on fedora (head, trace b34ea9aa): scenario: body_bytes=1000 curl_rc=0 cli_addr_bytes=0 cli_name_bytes=0 inbox_bytes=1060 web_ip=100.64.127.255 tcpdump=no syn=0 synack=0 rst=0; trace: 3x minimald WARN exec: ended while its command was starting; the start is ended when it returns; 1x minimald WARN the box's classifier cover fell back to an empty read-only tmpfs: the kernel refused the design's cgroup<n> mount of the box's namespace roo; 1x minimald WARN exec: ssh client disconnected; killing child
Each cited run's verdict and evidence

Each cited run's last VERDICT or ENV line and its EVIDENCE line (the results.jsonl rows of batch 841b-rename-rekey-284c3f50):

  • 841b-rename-moves-own-ip-name ubuntu-24.04 base fail: VERDICT: after rename a841y20973 -> b841y20973: old-name-answers-127.0.64.3 new-name-nxdomain-not-127.0.64.3 registry-keeps-a841y20973 registry-lacks-b841y20973 ingress-port-20973-after-destroy; EVIDENCE: answer_before=127.0.64.3 old_after_rename=127.0.64.3 new_after_rename=nxdomain registry_old=1 registry_new=0 new_after_destroy=nxdomain port_after_destroy=1 destroy_rc=0
  • 841b-rename-moves-own-ip-name ubuntu-24.04 base fail: VERDICT: after rename a841y25534 -> b841y25534: old-name-answers-127.0.64.3 new-name-nxdomain-not-127.0.64.3 registry-keeps-a841y25534 registry-lacks-b841y25534 ingress-port-25534-after-destroy; EVIDENCE: answer_before=127.0.64.3 old_after_rename=127.0.64.3 new_after_rename=nxdomain registry_old=1 registry_new=0 new_after_destroy=nxdomain port_after_destroy=1 destroy_rc=0
  • 841b-rename-moves-own-ip-name ubuntu-24.04 head pass: VERDICT: rename moved the name: b841y19446 answers 127.0.64.3, a841y19446 answers nxdomain, the registry names b841y19446; after the destroy b841y19446 answers nxdomain; EVIDENCE: answer_before=127.0.64.3 old_after_rename=nxdomain new_after_rename=127.0.64.3 registry_old=0 registry_new=1 new_after_destroy=nxdomain port_after_destroy=0 destroy_rc=0
  • 841b-rename-moves-own-ip-name ubuntu-24.04 head pass: VERDICT: rename moved the name: b841y17878 answers 127.0.64.3, a841y17878 answers nxdomain, the registry names b841y17878; after the destroy b841y17878 answers nxdomain; EVIDENCE: answer_before=127.0.64.3 old_after_rename=nxdomain new_after_rename=127.0.64.3 registry_old=0 registry_new=1 new_after_destroy=nxdomain port_after_destroy=0 destroy_rc=0
  • 841b-rename-moves-own-ip-name fedora base fail: VERDICT: after rename a841y23751 -> b841y23751: old-name-answers-127.0.64.3 new-name-nxdomain-not-127.0.64.3 registry-keeps-a841y23751 registry-lacks-b841y23751 ingress-port-23751-after-destroy; EVIDENCE: answer_before=127.0.64.3 old_after_rename=127.0.64.3 new_after_rename=nxdomain registry_old=1 registry_new=0 new_after_destroy=nxdomain port_after_destroy=1 destroy_rc=0
  • 841b-rename-moves-own-ip-name fedora base fail: VERDICT: after rename a841y29727 -> b841y29727: old-name-answers-127.0.64.3 new-name-nxdomain-not-127.0.64.3 registry-keeps-a841y29727 registry-lacks-b841y29727 ingress-port-29727-after-destroy; EVIDENCE: answer_before=127.0.64.3 old_after_rename=127.0.64.3 new_after_rename=nxdomain registry_old=1 registry_new=0 new_after_destroy=nxdomain port_after_destroy=1 destroy_rc=0
  • 841b-rename-moves-own-ip-name fedora head pass: VERDICT: rename moved the name: b841y32798 answers 127.0.64.3, a841y32798 answers nxdomain, the registry names b841y32798; after the destroy b841y32798 answers nxdomain; EVIDENCE: answer_before=127.0.64.3 old_after_rename=nxdomain new_after_rename=127.0.64.3 registry_old=0 registry_new=1 new_after_destroy=nxdomain port_after_destroy=0 destroy_rc=0
  • 841b-rename-moves-own-ip-name fedora head pass: VERDICT: rename moved the name: b841y28680 answers 127.0.64.3, a841y28680 answers nxdomain, the registry names b841y28680; after the destroy b841y28680 answers nxdomain; EVIDENCE: answer_before=127.0.64.3 old_after_rename=nxdomain new_after_rename=127.0.64.3 registry_old=0 registry_new=1 new_after_destroy=nxdomain port_after_destroy=0 destroy_rc=0
  • 841-rename-destroy-own-ip-row ubuntu-24.04 base fail: VERDICT: after rename a841x22632 -> b841x22632 and destroy, left behind: ingress-port-22632 old-name-answers-127.0.64.3 reactivation-refused (destroy warned: 1); EVIDENCE: destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1
  • 841-rename-destroy-own-ip-row ubuntu-24.04 head pass: VERDICT: rename then destroy left nothing behind: port 38101 closed, a841x18101 answers nxdomain, re-activation under a841x18101 succeeded; EVIDENCE: destroy_warn=0 port_listening=0 old_name_answer=nxdomain reactivate_rc=0 already_exists=0 destroy_rc=0 registry_names_old=0 answer_before=127.0.64.3 port_before=1
  • 841-rename-destroy-own-ip-row fedora base fail: VERDICT: after rename a841x10812 -> b841x10812 and destroy, left behind: ingress-port-30812 old-name-answers-127.0.64.3 reactivation-refused (destroy warned: 1); EVIDENCE: destroy_warn=1 port_listening=1 old_name_answer=127.0.64.3 reactivate_rc=2 already_exists=1 destroy_rc=0 registry_names_old=1 answer_before=127.0.64.3 port_before=1
  • 841-rename-destroy-own-ip-row fedora head pass: VERDICT: rename then destroy left nothing behind: port 32466 closed, a841x12466 answers nxdomain, re-activation under a841x12466 succeeded; EVIDENCE: destroy_warn=0 port_listening=0 old_name_answer=nxdomain reactivate_rc=0 already_exists=0 destroy_rc=0 registry_names_old=0 answer_before=127.0.64.3 port_before=1
  • 727-host-ip-egress-fail-open ubuntu-24.04 base pass: VERDICT: host_ip: allow-list refused up front; deny-all egress is enforced (1.1.1.1:443 blocked); no EVIDENCE line
  • 727-host-ip-egress-fail-open ubuntu-24.04 head pass: VERDICT: host_ip: allow-list refused up front; deny-all egress is enforced (1.1.1.1:443 blocked); no EVIDENCE line
  • 727-host-ip-egress-fail-open fedora base pass: VERDICT: host_ip: allow-list refused up front; deny-all egress is enforced (1.1.1.1:443 blocked); no EVIDENCE line
  • 727-host-ip-egress-fail-open fedora head pass: VERDICT: host_ip: allow-list refused up front; deny-all egress is enforced (1.1.1.1:443 blocked); no EVIDENCE line
  • 723-vm-host-ip-name-502 ubuntu-24.04 base pass: VERDICT: the session name reaches its 0.0.0.0 dev server through the proxy and a 127.0.0.1-only port is refused naming the fix (ok: local.min.internal min.internal); EVIDENCE: min.internal loopback-only :P -> GET 403 The box listens on this port at 127.0.0.1 only. Bind it to 0.0.0.0 to reach it by name. | 0.0.0.0 :Q -> GET 200 WILD-33897
  • 723-vm-host-ip-name-502 ubuntu-24.04 head pass: VERDICT: the session name reaches its 0.0.0.0 dev server through the proxy and a 127.0.0.1-only port is refused naming the fix (ok: local.min.internal min.internal); EVIDENCE: min.internal loopback-only :P -> GET 403 The box listens on this port at 127.0.0.1 only. Bind it to 0.0.0.0 to reach it by name. | 0.0.0.0 :Q -> GET 200 WILD-36363
  • 723-vm-host-ip-name-502 fedora base pass: VERDICT: the session name reaches its 0.0.0.0 dev server through the proxy and a 127.0.0.1-only port is refused naming the fix (ok: local.min.internal min.internal); EVIDENCE: min.internal loopback-only :P -> GET 403 The box listens on this port at 127.0.0.1 only. Bind it to 0.0.0.0 to reach it by name. | 0.0.0.0 :Q -> GET 200 WILD-18405
  • 723-vm-host-ip-name-502 fedora head pass: VERDICT: the session name reaches its 0.0.0.0 dev server through the proxy and a 127.0.0.1-only port is refused naming the fix (ok: local.min.internal min.internal); EVIDENCE: min.internal loopback-only :P -> GET 403 The box listens on this port at 127.0.0.1 only. Bind it to 0.0.0.0 to reach it by name. | 0.0.0.0 :Q -> GET 200 WILD-12169

The 790d control (own_ip ingress, unchanged by this PR) is left out of the expectation above: its runs on one distro ended ENV on both sides before any probe, which is no evidence either way; the other distro read FAIL on both sides, as expected.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Renamed boxes now keep their existing network addresses and become reachable under the new name.
  • Bug Fixes
    • Box cleanup now identifies the specific registration, helping prevent a renamed box or a newer registration with the same name and address from being affected incorrectly.
    • Box renames and removals now use the name currently held by the host, helping ensure associated network resources are released correctly.

bryan-minimal and others added 6 commits November 7, 2026 10:28
A session rename changes only the in-VM record: the VM host keeps the box's row, its creation and
its published address under the name the box was registered by. The destroy then withdrew under
the new name with no box id, the host refused it as another box's row, and the ingress forward,
the old name's answer and the name itself stayed held for good (gominimal/inbox#1116).

The destroy, `min box rm`, `min box prune` and the dashboard's destroy now present the record's
box id beside the pair. The host accepts the row's own id in place of its name, finds a dormant
creation by the id first (as a resume does), and releases the published address under the name
the host held the box by. A withdrawal without the id is still held to the name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An attach that ends with the session gone (the shell-exit Delete, ends_with_run, or a destroy
from another shell) withdrew the row with the pair alone, under the session's current name. After
a rename that is refused with NotTheCreatorsRow, and the row, its ingress forward and the old name
stay (#1116). The CLI's attach and the dashboard's now read the box id off the record beside the
pair, before the attach, and present it; the id still goes only with a pair.

minvmd's withdrawal hands back the name the host held the box under, and the guest-audit flush
after it is labelled with that name rather than the one the request presented.

New tests pin box_addresses.and(box_id) on destroy_box: a pair and an id send the id; an id with
no pair sends no withdrawal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`min session rename` reached only the in-VM daemon. The VM host kept the box's row, its creation
(box-registry.json) and its published address under the name the box was registered by, so the
old name kept answering the box's address and the new one was NXDOMAIN until the destroy (#1116).

A new host-door verb, rename_box, carries the old and new names, the pair and the box id. minvmd
re-keys the row (and its task rows) in place, re-keys the creation found by the id, persists,
and pings the table: the zone answers under the new name, the answerer's book moves the address
on the re-publish, and the gate's name rules read the new name. Another box's id or pair is
refused; a name another row holds is refused; a dormant creation under it is superseded.

The row's name is now behind its own lock and `BoxRecord::name` returns an `Arc<str>`, so the
callers that took `&str` borrow it. `min session rename`, `min box rename` and the dashboard's
rename all send the verb for an own_ip box; `host_ip` and `none` boxes keep the hold move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… by value

The two rename tests checked `.is_err()`, which clippy's assertions_on_result_states flags. The
pair refusal now matches `RenameError::NotTheHandedPair`, and the id-less parse uses `expect_err`.

The previous commit's "(#1116)" means gominimal/inbox#1116, not a minimal issue.

Refs: gominimal/inbox#1116

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…daemon connections

The lab prepush (job 05240) failed only on every_daemon_connection_is_classified: the new vm_host
test fixture connects to the daemon and belongs in the inventory as ungated, like box_record_by.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… rename re-key

Reading a row's name as it is now (an Arc<str>) turned the deny-all DNS drop
line's `namespace` field into a Display field, so it logged `namespace=sealed`
where it had logged `namespace="sealed"`. The host-side gate test that greps
the line caught it; Debug keeps the quoted form every other string field has.
The rename test's `matches!(.., Ok(_))` is `.is_ok()`, as clippy asks.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 9, 2026 15:53
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

  • Run on-demand review

This review includes 10 billable files and costs up to $2.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 57 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 3 included reviews currently available. Your 48 included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 74c5be07-06b7-4e75-8b5b-fea47862dcdc
Commits

Reviewing files that changed from the base of the PR and between 284c3f5 and 64d3ef4.

Files selected for processing: 10

  • crates/minimal/src/cmd/boxes/lifecycle.rs
  • crates/minimal/src/cmd/boxes/vm_host.rs
  • crates/minimal/src/cmd/session.rs
  • crates/minimal/src/dash/rpc.rs
  • crates/minimald-rpc/src/lib.rs
  • crates/minimald/src/rpc.rs
  • crates/minvmd/src/box_registry.rs
  • crates/minvmd/src/control.rs
  • crates/minvmd/src/net/answerer.rs
  • crates/minvmd/src/net/egress_gate.rs

No actionable comments were generated in the recent review.

Walkthrough

The change adds VM-host support for renaming boxes by registration ID. It carries box IDs alongside address pairs through rename, attach cleanup, destroy, removal, and withdrawal paths. The registry updates live rows and dormant creations, while the control path uses the held name for address release.

Changes: Box rename and lifecycle

Layer / File(s) Summary
Rename request contract
crates/minimald-rpc/src/lib.rs, crates/minimald/src/rpc.rs
Adds the RenameBox request with old and new names, addresses, and a required box ID. The native daemon routes this host-only request to its wrong-door response.
Registry rename and withdrawal
crates/minvmd/src/box_registry.rs, crates/minvmd/src/net/answerer.rs, crates/minvmd/src/net/egress_gate.rs
The registry renames live rows and dormant creations, validates identity and address data, and uses the held name for withdrawal. Name access and related tests are updated; a network test checks address publication after rename.
Host control operations
crates/minvmd/src/control.rs
The host control path dispatches rename requests to the registry. Withdrawal releases addresses and flushes guest-audit state using the registry-held name.
Client rename and ID-bearing cleanup
crates/minimal/src/cmd/boxes/*, crates/minimal/src/cmd/session.rs, crates/minimal/src/dash/*, crates/minimal-client/src/*, crates/minimal/src/tests.rs
CLI and dashboard flows retain box IDs with address pairs and pass them through rename, attach cleanup, destroy, removal, and pruning. Tests cover ID-bearing withdrawals and rename requests.

Estimated code review effort: 4 (Complex) | ~50 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Minimal as minimal cmd_rename
  participant VMHost as rename_box_with_vm_host
  participant Control as minvmd control
  participant Registry as BoxRegistry
  Minimal->>VMHost: record and new name
  VMHost->>Control: RenameBox with names, addresses, and box ID
  Control->>Registry: rename_client_box
  Registry-->>Control: rename result
  Control-->>VMHost: reply with address pair or error
Loading

Possibly related issues

Possibly related PRs

  • gominimal/minimal#2114: Both PRs change session rename and attach cleanup paths, and the dashboard caller relies on the updated attach-cleanup contract.

Suggested reviewers: norrietaylor

Merge Risk: Minimal · previous review 284c3

This change lets a renamed own-IP box keep its host row and published address under the new name. No merge-blocking issue was found, and the author reports that the relevant scenarios and prepush passed. Normal checks apply before merging.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "fix(minvmd): move a renamed own_ip box's host row to its new name" matches the main change. The diff adds a host-door rename_box request that re-keys the minvmd row and creation to the ne…
Docstring Coverage Passed Docstring coverage is 92.31% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
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.
Description check Passed The description follows the repository template. It has a Summary section that states the problem, the fix, and linked issues (gominimal/inbox#1116 and #3172). It also has a detailed Testing section w…
Full details: Title check

Explanation

The title "fix(minvmd): move a renamed own_ip box's host row to its new name" matches the main change. The diff adds a host-door rename_box request that re-keys the minvmd row and creation to the new name after a session rename. It follows the Conventional Commit form the template asks for. Lowercase, imperative, no trailing period.

Full details: Docstring Coverage

Explanation

Docstring coverage is 92.31% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 26 functions across 12 files. (3 skipped: 3 too large.)

Full details: Description check

Explanation

The description follows the repository template. It has a Summary section that states the problem, the fix, and linked issues (gominimal/inbox#1116 and #3172). It also has a detailed Testing section with unit test names, lab scenario results, and prepush status. It also has a Checklist section, but the boxes are not ticked and the BREAKING CHANGE footer question is not addressed. The PR title is not part of the description provided, so its Conventional Commit format cannot be checked here. The description is thorough and mostly complete, so the check passes. The unchecked checklist items and the missing confirmation about docs and breaking changes are minor gaps.

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

A rabbit checks the names in rows,
And keeps each box ID close by.
Old labels hop to labels new,
While addresses stay in view.
The cleanup trail knows where to go.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 8f20a59f-62f1-41f2-bcf5-44567af1c850
Commits

Reviewing files that changed from the base of the PR and between 620a1ce and 284c3f5.

Files selected for processing: 15

  • crates/minimal-client/src/attach.rs
  • crates/minimal-client/src/box_registration.rs
  • crates/minimal/src/cmd/boxes/attach.rs
  • crates/minimal/src/cmd/boxes/lifecycle.rs
  • crates/minimal/src/cmd/boxes/vm_host.rs
  • crates/minimal/src/cmd/session.rs
  • crates/minimal/src/dash/app.rs
  • crates/minimal/src/dash/rpc.rs
  • crates/minimal/src/tests.rs
  • crates/minimald-rpc/src/lib.rs
  • crates/minimald/src/rpc.rs
  • crates/minvmd/src/box_registry.rs
  • crates/minvmd/src/control.rs
  • crates/minvmd/src/net/answerer.rs
  • crates/minvmd/src/net/egress_gate.rs

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

@minimal-foundry

minimal-foundry Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Approved: no findings at 64d3ef404246.

Nothing to do.

Clobber: not checked in depth. If that was not intentional, restore the earlier change.

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

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 Nov 9, 2026

@agent-137 agent-137 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.

Review on Karl's behalf, at 284c3f50a. This is a comment, not an approval. Nothing was built for it: every point comes from reading the code, and each finding says how it was checked.

  • CI at head 284c3f50a: all green. Every lane aggregator passed (ci-success, ci-linux-native-success, ci-linux-kvm-success, ci-macos-success, ci-shell-installer-success), and so did ci-kani-success.
  • Existing reviews: minimal-review APPROVE at head, with all 3 of 3 personas run. CodeRabbit APPROVED at head, and a real review exists on that commit. No humans have reviewed.

Should-fix: none.

Nit

  1. crates/minimal/src/cmd/boxes/vm_host.rs:264: this doc comment, and the PR body, say the dashboard's rename "go[es] through this, so the three cannot drift". It does not. crates/minimal/src/dash/rpc.rs:446-459 copies the holds_name branch inline: it calls hold_box_name twice for the hold case and rename_box_row_with_vm_host directly for the row case. The behaviour matches today, but a future change to rename_box_with_vm_host will skip the dashboard. Either call rename_box_with_vm_host from the dashboard or fix the comment. (Read both call sites.)
  2. crates/minvmd/src/control.rs:1738: the resume_reply doc comment still says the creation's own name is one "which a rename does not change". This PR's rename_client_box now changes it (it re-inserts the creation under new_key with creation.name = new_name). The comment came over unchanged from main. (Grepped main, #3172 and #3175.)
  3. crates/minvmd/src/net/egress_gate.rs:7403: the commit changed namespace = refusal.record.name() to namespace = ?refusal.record.name(). In the fmt file log that prints the same quoted string as before. minvmd also runs tracing-opentelemetry (crates/minvmd/Cargo.toml:107), though, and there a ? field arrives through record_debug. The OTel namespace attribute is now "web" with the quotes inside the value, where before it was web. namespace = &*refusal.record.name() keeps the str path for both layers. (Read the diff. I did not check what the exporter emits.)
  4. crates/minimal/src/cmd/boxes/vm_host.rs:323-330: on a timeout (Err(_)) or a transport error after the request was written, the warning says "the box answers under its old name until it is destroyed". In those cases minvmd may already have applied the rename in its turn. AGENTS.md says "Say only what the code can prove". For those branches, say that the move may not have happened.

Checked and found fine:

  • rename_client_box (box_registry.rs): the id and pair proof, NameHeld against non-task rows, a standing creation under the new name being refused, a dormant one being superseded, the re-key of a creation found by id or among the superseded, the task-row rename, persist and ping.
  • Register and rename both run under order.apply, so a registration's name check and its insert cannot interleave with a rename.
  • BoxRecord::name as RwLock<Arc<str>>: every call site I grepped was updated, and the attachment's copied name is only read by diagnostics and tests.
  • The client sends RenameBox only when the record carries both box_addresses and box_id.
  • minimald/src/rpc.rs refuses the verb on the answerer-only socket.
  • The answerer race (a destroy before the re-publish) is a known gap the PR body already declares.

Verdict: ready to approve, with the nits optional. Merge it after #3172, or merge it in place of #3172 and close #3172.

@agent-137 agent-137 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.

Approving at 284c3f50a. The earlier comment review found nothing that needs fixing, and its nits are optional.

Resolves crates/minvmd/src/box_registry.rs and control.rs: #3172 landed on
main with `Record::name` returning `&str`, so this branch's rename path and
its tests take a name as main does, with no borrow of the returned slice.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bryan-minimal

Copy link
Copy Markdown
Member Author

Merged main into the branch (64d3ef4), resolved by hand: this branch makes a row's name() hand out the current name (an Arc<str> behind the rename lock) where main returns &str, so main's new call sites of it (the BoxName drop line, the withdraw and grant tests, take_guest_audit) now borrow it the way the branch's own sites do; no behaviour change in the resolution. The lab re-ran the pre-push at the merged tip and 841b twice, 841 and 727 once per distro on Ubuntu 24.04 and Fedora against a release build of main: 841b fail -> pass, the rest pass.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit b23e859 Nov 10, 2026
36 checks passed
@bryan-minimal
bryan-minimal deleted the fix/841b-rename-rekeys-host branch November 10, 2026 18:07
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