8000 fix(boxes,minimald,minimald-rpc): a creation under a taken derived name gets the smallest free by minimal-foundry[bot] · Pull Request #3787 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(boxes,minimald,minimald-rpc): a creation under a taken derived name gets the smallest free - #3787

Merged
mitodrummer merged 9 commits into
mainfrom
agent/3784-a-creation-under-a-taken-derived-name-gets-the-s
Nov 25, 2026
Merged

mitodrummer merged 9 commits into
mainfrom
agent/3784-a-creation-under-a-taken-derived-name-gets-the-s

Conversation

@minimal-foundry
@minimal-foundry minimal-foundry Bot commented Nov 25, 2026 •
Copy link
Copy Markdown
8000
Contributor

Follow-up

Fixes #3784
Closes #3753

Task marker
### D3753 — A creation under a taken derived name gets the smallest free <name>-<n> in the step that writes its pending record, and the reply says which name it did not get
  kind: task
  size: L
  est: 350 code, 300 tests
  executor: agent
  origin: bug
  epic: 2236
  layers:
    - store:
      - crates/boxes/src/lib.rs: box_name gains the candidate walk (fitted to 63 with the number kept), the box-id-form test and the reason a derived name is taken (held, reserved, box-id form)
      - crates/boxes/src/store.rs: DiskLoader gets one step that assigns a derived name against every record in any state, ASCII case folded, and writes the pending record. Rename and reap pass through it
      - crates/minimald/src/store.rs: StoreHandle and StoreMessage carry the derived-name create, and return the assigned name and the taken name with its holder
      test: cargo test -p boxes derived_name_takes_smallest_free_number
    - daemon:
      - crates/minimald/src/box_manager.rs: a derived name goes to the store step in place of retained_names and fresh_derived_name. It is never refused, and a failed create before first run deletes the record
      - crates/minimald/src/box_manager/tests.rs: tests for a taken, reserved and box-id-form derived name, a stopped holder, the 63-character fit and the freed name after a failed create
      - crates/minimald-rpc/src/lib.rs: CreateSessionResponse gains the assigned name and the name not taken, with the holder and its state or the reserved/box-id reason. Doc of fresh_instance updated
      - crates/minimald/src/rpc.rs: the create reply fills the new fields, and names the holder only where the caller may read that box
      test: cargo test -p minimald taken_derived_name_gets_smallest_free_number
      test: cargo test -p minimald create_reply_names_the_taken_derived_name
  proof: Two creates in one project with no --name give boxes web and web-1, the second is not refused, and the create reply names web as the name it did not get, with its holder (min's stderr line for it is #3758).

Proof

In one project, two creates with no --name now give boxes web and web-1. The second create is not refused. Its CreateSession reply carries name = web-1 and name_not_taken = web, with the holder's id, name and state when the caller created that box or the box records no creator. A taken name is one that any kept box has, in any state. A reserved name or a name in box-id form also counts as taken. The rpc test create_reply_names_the_taken_derived_name shows this over the wire with web-dev and web-dev-1. min does not print the new field yet. That is #3758.

Notes from the agent: Files outside the layers: (1) Two new fields on CreateSessionResponse break full struct literals in test code, so each literal gets name: None, name_not_taken: None. The literals are in crates/minimald-rpc/src/tests.rs, crates/minimal/src/task.rs and crates/minimal/src/cmd/boxes/policy.rs. (2) crates/minimald/src/box_actor/tests.rs has three tests that built two boxes of one name from two unnamed creates: a_restored_session_sharing_another_sessions_registry_name_is_refused_on_resume, resume_refuses_when_name_held_by_running_box and resume_concurrent_same_name_runs_exactly_one. This task makes that impossible, so the second create in each test now asks for the name with a request name after the first box stops. box_manager/tests.rs rename_of_unroutable_session_leaves_other_routes_alone got the same fix. Design: boxes::box_name gains RESERVED_NAMES (store.rs now uses it), is_box_id_form, DerivedName with its candidate walk, DerivedNameTaken (Held/Reserved/BoxIdForm), assign_derived_name and DerivedAssignment. DiskLoader::create_with_derived_name walks and files in one step. Rename, reap and every create go through the same store actor, so they cannot run between the walk and the write. No change to rename or reap was necessary. A fresh instance of a derived name also goes through this step and starts at -1. A requested name keeps the old rules, which include the held-name refu…[truncated]

Tests

line exit tail
cargo test -p boxes derived_name_takes_smallest_free_number 0 running 3 tests test tests::box_names::derived_name_takes_smallest_free_number_fitted_to_63 ... ok test store::tests::derived_name_takes_smallest_free_number_past_reserved_and_id_form ... ok test store::tests::derived_name_takes_smallest_free_number ... ok test result: ok. 3 passed; 0 failed; 0 ig
cargo test -p minimald taken_derived_name_gets_smallest_free_number 0 name_gets_smallest_free_number_freed_after_a_failed_create ... ok test box_manager::tests::taken_derived_name_gets_smallest_free_number_past_a_stopped_holder ... ok test box_manager::tests::taken_derived_name_gets_smallest_free_number_past_reserved_and_box_id_form ... ok test result: ok. 5 passed;
cargo test -p minimald create_reply_names_the_taken_derived_name 0 running 2 tests test rpc::create_naming_tests::create_reply_names_the_taken_derived_name_holder_only_to_its_reader ... ok test rpc::create_naming_tests::create_reply_names_the_taken_derived_name ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1583 filtered out; finished in 0.06s

Verify

min task run agent-verify exited 100, so this PR is a draft.

 box_actor::tests::a_box_holding_a_host_row_refuses_remint_after_its_host_loop_ends
        PASS [   2.357s] (1973/3646) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   0.012s] (1974/3646) minimald box_actor::tests::a_daemon_side_task_of_a_placed_box_without_its_leaf_is_refused
        PASS [   0.012s] (1975/3646) minimald box_actor::tests::a_daemon_side_task_runs_in_the_box_leaf
        PASS [   2.389s] (1976/3646) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.338s] (1977/3646) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.364s] (1978/3646) minimald box_actor::tests::a_declared_port_whose_bind_at_the_hand_fails_keeps_its_interim_forward
        PASS [   2.373s] (1979/3646) minimald box_actor::tests::a_destroy_under_a_pending_verdict_does_not_wait_and_publishes_the_interim
        PASS [   2.726s] (1980/3646) minimald box_actor::tests::a_destroy_queued_behind_a_waiting_finalize_runs_after_the_promotion
        PASS [   2.374s] (1981/3646) minimald box_actor::tests::a_detach_hook_host_of_a_registered_box_is_refused_to_the_next_attach
        PASS [   4.648s] (1982/3646) minimald box_actor::tests::a_destroyed_holders_shared_port_is_bound_for_the_running_box_that_takes_it
        PASS [   0.353s] (1983/3646) minimald box_actor::tests::a_failed_workspace_upload_does_not_leave_attaches_refused
        PASS [   2.378s] (1984/3646) minimald box_actor::tests::a_failed_activate_hook_s_publish_is_withdrawn_by_the_destroy
        PASS [   4.954s] (1985/3646) minimald box_actor::tests::a_destroyed_holders_shared_port_is_not_bound_for_a_box_that_is_not_running
        PASS [   0.356s] (1986/3646) minimald box_actor::tests::a_failing_activate_hook_blocks_the_session
        PASS [   0.348s] (1987/3646) minimald box_actor::tests::a_failing_destroy_hook_still_destroys_the_session
  stdout ───

    running 1 test
    test exec_run_attach_and_task_run_share_the_commands_trace ... FAILED

    failures:

    failures:
        exec_run_attach_and_task_run_share_the_commands_trace

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 5 filtered out; finished in 13.58s

  stderr ───

    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.382s] (1989/3646) minimald box_actor::tests::a_handed_box_pending_at_finalize_publishes_the_interim_when_the_verdict_lands_absent
        PASS [   4.669s] (1990/3646) minimald box_actor::tests::a_hand_over_bind_the_switch_refuses_leaves_the_election_standing
        PASS [   7.053s] (1991/3646) minimald box_actor::tests::a_handed_reserved_address_waits_for_the_verdict_before_it_publishes
────────────
warning: 1655/3646 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Out of scope

These files are outside the task's layers:, so this PR is a draft:

  • crates/minimal/src/cmd/boxes/policy.rs
  • crates/minimal/src/task.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor/tests.rs

Note for review (agent-137)

The box_actor tests now let a requested name take the name of a stopped box (twins, proj, pair). That is today's behaviour, and BOX-163's sub-bullet refuses a written name that any box on the host has, in any state. #3755 makes that refusal, and these tests flip with it. The other three files outside the layers only add name: None, name_not_taken: None at existing call sites.

DiskLoader::create_with_derived_name walks the candidates of a derived
name against every retained record in any state, under ASCII case, and
past reserved and box-id-form names, and files the record in the same
step. The answer names the name the create did not get, and why.
StoreHandle::create_derived sends the record, the handed id and the
derived name to the store, which names and files the record in one
step and answers the assigned name and the name not taken.
A create with no requested name gets the smallest free <name>-<n> from
the store step. The create reply carries the assigned name and the name
it did not get, with the holder only for a caller that can read it.
A derived name no longer reuses a kept box's name, so the tests that
built two boxes of one name from two unnamed creates now ask for the
name on the second create, after the first is stopped.
@coderabbitai
coderabbitai Bot commented Nov 25, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

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

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: Advanced
  • Run ID: f50a2f67-b1f8-4a89-9a8d-d6d3992a7826

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@agent-137
Copy link
Copy Markdown
Member

/arch-review

@agent-137
Copy link
Copy Markdown
Member

/review

@minimal-foundry
minimal-foundry Bot commented Nov 25, 2026 •
Copy link
Copy Markdown
Contributor Author

Reviewed: no findings; approval withheld, 7 threads unresolved at 6be851abe742.

APPROVE withheld: 7 unresolved threads — minimal-arch[bot] crates/minimald/src/box_manager.rs:4818, minimal-arch[bot] crates/minimald/src/box_manager.rs, minimal-arch[bot] crates/minimald/src/rpc.rs, minimal-arch[bot] crates/minimald/src/rpc.rs, minimal-arch[bot] crates/minimald/src/rpc.rs, …. Resolving the last thread releases the approval on this head.

Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required.

Clobber: none seen.

@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 — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimald/src/rpc.rs Resolved
@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: CONDITIONS · 2 conditions · the full ruling

The store step, the candidate walk and the 63-character fit conform to architecture lines 402, 403 and 408. Two parts do not. On a host_ip grant box, the client registers the bare derived name with minvmd, so minvmd refuses a second create of web. Line 402 says a derived-name create is never refused. C1 fixes this with a creation key for every derived-name grant box. The reply also names the holder when its creator is unknown or its record read fails. Line 399 names the holder only to a caller who may read it, and C2 makes that default-deny.

Ruled at fb50e31 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

// against every retained record and files the record in one step.
// Until then the box carries the first candidate.
let derived =
(source == NameSource::Derived).then(|| derived_name_of(&config, spec.as_ref()));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · This path sends a derived name to the store step. But the mint step before it (host_ip_mint_name, line 4940) still reads config.name, the first candidate. On a host_ip grant box the client registers that bare name with minvmd, and minvmd refuses a second live registration. Architecture line 402 says a derived-name create is never refused. Use a creation key for every derived-name grant box, as C1 says.

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.

Addressed in 9d2b79c59ec4: 9d2b79c: the client registers a derived-name grant box under ~. 20409d0: create_session passes the first derived candidate as the base host_ip_mint_name checks the key against. New test: two derived grant creates give web and web-1.

Comment thread crates/minimald/src/box_manager.rs Outdated
match self.store.find(RecordPredicate::Id(holder.id)).await {
Ok(Some(handle)) => match handle.record().await {
Ok(record) => record.username,
Err(_) => None,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · A failed holder read sets holder_username to None, and the reply then shows the holder to every caller. Architecture line 399 names the holder only to a caller who may read it. Record that the read failed, and hide the holder in that case (C2).

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.

Addressed in 9d2b79c59ec4: c8e23c6 made created_name record a gone holder or an Err from find or record() as HolderCreator::Unread. 44f7202 makes the reply hide the holder in that case and also for a record with no creator.

Comment thread crates/minimald/src/rpc.rs Outdated
let reason = match &not_taken.reason {
DerivedNameTaken::Held(holder) => {
let readable = match not_taken.holder_username.as_deref() {
None => true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · This arm shows the holder when its creator is unknown. That fails open. Show the holder only when its record was read and its username equals the caller's (C2, architecture line 399).

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.

Addressed in 9d2b79c59ec4: 44f7202: name_not_taken_reply sets readable only for HolderCreator::User(owner) where owner equals the caller. NoCreator and Unread both hide the holder.

Comment thread crates/minimald/src/rpc.rs Outdated
))
.expect("the creator reads the holder");
assert_eq!((shown.id, shown.state.as_str()), (holder.id, "running"));
assert!(named(super::name_not_taken_reply(&not_taken(None), Some("bob"))).is_some());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · This assertion proves the fail-open case. After C2, a holder with no creator, read by bob, gives holder: None. Change the assertion to is_none(), and add a case for a holder whose record was not read.

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.

Addressed in 9d2b79c59ec4: 44f7202: a record with no creator read by bob now gives holder None. The test also checks an unread holder record and a caller with no user.

A gone or unreadable holder record read as one with no creator, so the
create reply named the holder to any caller. Keep the two apart and
name the holder only for its creator or a record with no creator.
@agent-137
Copy link
Copy Markdown
Member

/revise

Arch ruling CONDITIONS on fb50e31 (2 conditions). Apply both as the ruling states them. C1 (1) is in crates/minimal/src/cmd/boxes/create.rs, outside the layers; make it in this PR rather than filing it.

  • C1: Make a host_ip grant box (HostNet, no box_addresses, credentialed_upstream set) with a derived name register with minvmd under a creation key, not under the bare derived name. Today the client registers the bare name, so minvmd BoxRegistry::register_host_ip_box_as (crates/minvmd/src/box_registry.rs) refuses a second live registration of web with NameAlreadyHeld. The create is then refused before it reaches create_derived. Two edits: (1) crates/minimal/src/cmd/boxes/create.rs host_ip_registration_key: issue a <base>~<hex> key when the create sends no written name, not only when request.fresh_instance is set. (2) crates/minimald/src/box_manager.rs create_session: when source == NameSource::Derived, pass the first derived candidate as the base that host_ip_mint_name checks the key against, as fresh_base does today. Add a test in box_manager/tests.rs or host_ip_mint_name_tests with two derived-name grant creates: both are created, as <name> and <name>-1. If (1) is outside this task's layers, file an issue for the lane and name it in the PR body as a residual.
  • C2: Make the holder in the reply default-deny. crates/minimald/src/box_manager.rs created_name: record if the holder's record was read (for example a holder_read: bool on NotTakenName). A gone holder, an Err from store.find, or an Err from handle.record() sets it to false. crates/minimald/src/rpc.rs name_not_taken_reply: set readable to true only when the holder's record was read and not_taken.holder_username.as_deref() == caller. Remove the None => true arm, which shows a box with no recorded creator to every caller. Update create_reply_names_the_taken_derived_name_holder_only_to_its_reader: a record with no creator, read by bob, gives holder: None, and add the case of a holder whose record was not read.

Also act on the minimal-review finding on this head, and reply to each arch and review thread with the commit that meets it. Keep Fixes #3784 and Closes #3753, and the 'Note for review' section of the body.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #3784. Your note is kept and goes into the next round here, which starts when that coder finishes.

Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as c8e23c62ff3f.

line exit tail
cargo test -p boxes derived_name_takes_smallest_free_number 0 running 3 tests test tests::box_names::derived_name_takes_smallest_free_number_fitted_to_63 ... ok test store::tests::derived_name_takes_smallest_free_number_past_reserved_and_id_form ... ok test store::tests::derived_name_takes_smallest_free_number ... ok test result: ok. 3 passed; 0 failed; 0 ig
cargo test -p minimald taken_derived_name_gets_smallest_free_number 0 _derived_name_gets_smallest_free_number_fitted_to_63 ... ok test box_manager::tests::taken_derived_name_gets_smallest_free_number_freed_after_a_failed_create ... ok test box_manager::tests::taken_derived_name_gets_smallest_free_number_past_reserved_and_box_id_form ... ok test result: ok. 5 passed;
cargo test -p minimald create_reply_names_the_taken_derived_name 0 running 2 tests test rpc::create_naming_tests::create_reply_names_the_taken_derived_name_holder_only_to_its_reader ... ok test rpc::create_naming_tests::create_reply_names_the_taken_derived_name ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1583 filtered out; finished in 0.08s

Verify min task run agent-verify exited 100.

 box_actor::tests::a_box_holding_a_host_row_refuses_remint_after_its_host_loop_ends
        PASS [   2.295s] (1973/3646) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.297s] (1974/3646) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   0.018s] (1975/3646) minimald box_actor::tests::a_daemon_side_task_of_a_placed_box_without_its_leaf_is_refused
        PASS [   0.019s] (1976/3646) minimald box_actor::tests::a_daemon_side_task_runs_in_the_box_leaf
        PASS [   2.290s] (1977/3646) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.329s] (1978/3646) minimald box_actor::tests::a_declared_port_whose_bind_at_the_hand_fails_keeps_its_interim_forward
        PASS [   2.354s] (1979/3646) minimald box_actor::tests::a_destroy_under_a_pending_verdict_does_not_wait_and_publishes_the_interim
        PASS [   2.678s] (1980/3646) minimald box_actor::tests::a_destroy_queued_behind_a_waiting_finalize_runs_after_the_promotion
        PASS [   2.359s] (1981/3646) minimald box_actor::tests::a_detach_hook_host_of_a_registered_box_is_refused_to_the_next_attach
        PASS [   4.633s] (1982/3646) minimald box_actor::tests::a_destroyed_holders_shared_port_is_bound_for_the_running_box_that_takes_it
        PASS [   0.324s] (1983/3646) minimald box_actor::tests::a_failed_workspace_upload_does_not_leave_attaches_refused
        PASS [   2.347s] (1984/3646) minimald box_actor::tests::a_failed_activate_hook_s_publish_is_withdrawn_by_the_destroy
        PASS [   4.891s] (1985/3646) minimald box_actor::tests::a_destroyed_holders_shared_port_is_not_bound_for_a_box_that_is_not_running
        PASS [   0.328s] (1986/3646) minimald box_actor::tests::a_failing_activate_hook_blocks_the_session
        PASS [   0.324s] (1987/3646) minimald box_actor::tests::a_failing_destroy_hook_still_destroys_the_session
  stdout ───

    running 1 test
    test exec_run_attach_and_task_run_share_the_commands_trace ... FAILED

    failures:

    failures:
        exec_run_attach_and_task_run_share_the_commands_trace

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 5 filtered out; finished in 13.42s

  stderr ───

    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.363s] (1989/3646) minimald box_actor::tests::a_handed_box_pending_at_finalize_publishes_the_interim_when_the_verdict_lands_absent
        PASS [   4.640s] (1990/3646) minimald box_actor::tests::a_hand_over_bind_the_switch_refuses_leaves_the_election_standing
        PASS [   6.935s] (1991/3646) minimald box_actor::tests::a_handed_reserved_address_waits_for_the_verdict_before_it_publishes
────────────
warning: 1655/3646 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes/policy.rs
  • crates/minimal/src/task.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor/tests.rs

Converted to a draft: verify exited 100.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/rpc.rs: created_name now returns HolderCreator::Unread for a gone or unreadable holder record, apart from NoCreator, and name_not_taken_reply hides the holder for Unread.

Two creates in one project with no --name give boxes web and web-1. The second create is not refused, and its reply names web as the name it did not get, with its holder. The reply shows the holder only to its creator, or when the holder record was read and has no creator.

Notes from the agent: Revise round 1: NotTakenName.holder_username became holder_creator, an enum HolderCreator { User, NoCreator, Unread }. A gone or unreadable holder record is Unread, and the reply hides the holder for it. The rpc unit test now also checks the Unread case. cargo clippy -p minimald --all-targets is clean.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 25, 2026 02:43
@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: CONDITIONS · 2 conditions · the full ruling

Two conditions from the last ruling are still open. C1: a host_ip grant box with a derived name still registers the bare name with minvmd, so a second create is refused (architecture.md line 402). This commit does not touch that path. C2: the reply now hides a holder whose record was not read. It still shows a holder with no recorded creator to every caller. Gatehouse §7.3 grants BoxRead only when the box records the caller as its creator. Make the NoCreator arm deny, and fix its test.

Ruled at c8e23c6 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

Comment thread crates/minimald/src/rpc.rs Outdated
DerivedNameTaken::Held(holder) => {
let readable = match &not_taken.holder_creator {
HolderCreator::User(owner) => caller == Some(owner.as_str()),
HolderCreator::NoCreator => true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · This arm shows the holder to every caller when the record has no creator. Gatehouse §7.3 lines 979-981 grant BoxRead only when resource has createdBy && resource.createdBy == principal. Return false here.

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.

Addressed in 44f7202: HolderCreator::NoCreator now hides the holder like Unread, and the test asserts bob gets holder: None for a no-creator holder while the name stays in the reply. Arch PASS at 9d2b79c.

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.

Addressed in 6be851abe742: Fixed in 44f7202: a holder with no creator is hidden like an unread one, so the reply gives holde 10BC8 r None and keeps the name.

Comment thread crates/minimald/src/rpc.rs Outdated
Some("bob")
))
.is_some(),
"a record with no creator is readable"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · This assertion pins the behaviour that C2 removes. Assert that bob gets holder: None for a NoCreator holder. Keep the check that the name stays in the reply.

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.

Addressed in 44f7202: HolderCreator::NoCreator now hides the holder like Unread, and the test asserts bob gets holder: None for a no-creator holder while the name stays in the reply. Arch PASS at 9d2b79c.

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.

Addressed in 6be851abe742: Fixed in 44f7202: the test asserts bob gets holder None for a no-creator holder, and the name not taken stays in the reply.

Comment thread crates/minimald/src/box_manager.rs Outdated
@@ -4726,16 +4747,16 @@ impl BoxManager {
// BEP-082: only a fresh instance registered under a creation key,
// and only a key for its own base. See `host_ip_mint_name`.
let fresh_base = fresh.then(|| base.clone());
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · A derived-name create gets no base here, so host_ip_mint_name ignores any creation key. Pass the first derived candidate as the base when source == NameSource::Derived. Also change host_ip_registration_key in crates/minimal/src/cmd/boxes/create.rs, line 3898, to issue a key for a create with no written name.

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.

Addressed in 20409d0 (create_session passes the first derived candidate as the base for host_ip_mint_name) and 9d2b79c (host_ip_registration_key issues a key for a create with no written name), with a test of two derived-name grant creates giving web and web-1. Arch PASS at 9d2b79c.

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.

Addressed in 6be851abe742: Fixed in 20409d0 and 9d2b79c: key_base is the first derived candidate for host_ip_mint_name, and min issues a creation key for a create with no written name. The merge keeps key_base.

@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 — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

A read record with no creator showed its box to every caller. The reply
now names the holder only when its record was read and its creator is
the caller, and hides it in every other case.
The store can give a derived name <base>-<n> after the mint, so the mint
now accepts a <base>~<hex> key for the first derived candidate, as it
does for a fresh instance's base.
The daemon can give a derived name <base>-<n>, so a host_ip grant box
with no written name registers under <base>~<hex>. A second create of
one project is then not refused for a held name.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note, pushed as 9d2b79c59ec4.

line exit tail
cargo test -p boxes derived_name_takes_smallest_free_number 0 running 3 tests test tests::box_names::derived_name_takes_smallest_free_number_fitted_to_63 ... ok test store::tests::derived_name_takes_smallest_free_number_past_reserved_and_id_form ... ok test store::tests::derived_name_takes_smallest_free_number ... ok test result: ok. 3 passed; 0 failed; 0 ig
cargo test -p minimald taken_derived_name_gets_smallest_free_number 0 name_gets_smallest_free_number_freed_after_a_failed_create ... ok test box_manager::tests::taken_derived_name_gets_smallest_free_number_past_a_stopped_holder ... ok test box_manager::tests::taken_derived_name_gets_smallest_free_number_past_reserved_and_box_id_form ... ok test result: ok. 6 passed;
cargo test -p minimald create_reply_names_the_taken_derived_name 0 running 2 tests test rpc::create_naming_tests::create_reply_names_the_taken_derived_name_holder_only_to_its_reader ... ok test rpc::create_naming_tests::create_reply_names_the_taken_derived_name ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1584 filtered out; finished in 0.14s

Verify min task run agent-verify timed out after 1800s.

1.0
  Downloaded curve25519-dalek v4.1.3
  Downloaded fragile v2.1.0
  Downloaded hmac v0.12.1
  Downloaded ip_network_table-deps-treebitmap v0.5.0
  Downloaded inout v0.1.4
  Downloaded ip_network v0.4.1
  Downloaded ip_network_table v0.2.0
  Downloaded matchit v0.8.4
  Downloaded mockall_derive v0.15.0
  Downloaded multimap v0.10.1
  Downloaded mockall v0.15.0
  Downloaded opaque-debug v0.3.1
  Downloaded predicates-core v1.0.10
  Downloaded poly1305 v0.8.0
  Downloaded predicates v3.1.4
  Downloaded prettyplease v0.2.37
  Downloaded predicates-tree v1.0.13
  Downloaded pulldown-cmark-to-cmark v22.0.0
  Downloaded pulldown-cmark v0.13.6
  Downloaded prost-build v0.14.4
  Downloaded termtree v0.5.1
  Downloaded tonic-build v0.14.6
  Downloaded tonic-prost-build v0.14.6
  Downloaded universal-hash v0.5.1
  Downloaded x25519-dalek v2.0.1
   Compiling opentelemetry v0.33.1
   Compiling paths v0.0.1 (/workbench/crates/paths)
   Compiling args v0.0.1 (/workbench/crates/args)
   Compiling ot v0.0.1 (/workbench/crates/ot)
   Compiling opentelemetry_sdk v0.33.1
   Compiling tracing-opentelemetry v0.34.0
   Compiling client-config v0.0.1 (/workbench/crates/client-config)
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling opentelemetry-http v0.33.1
   Compiling opentelemetry-appender-tracing v0.33.1
   Compiling bep v0.0.1 (/workbench/crates/bep)
   Compiling google-cloud-gax-internal v0.7.20
   Compiling opentelemetry-proto v0.33.0
   Compiling switch v0.0.1 (/workbench/crates/switch)
   Compiling diagnostics v0.0.1 (/workbench/crates/diagnostics)
   Compiling opentelemetry-otlp v0.33.0
   Compiling google-cloud-longrunning v1.14.0
   Compiling google-cloud-iam-v1 v1.13.0
   Compiling mlog v0.0.1 (/workbench/crates/mlog)
   Compiling async-dialog v0.0.1 (/workbench/crates/async-dialog)
   Compiling google-cloud-lro v1.11.0
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling serial_test v4.0.1
   Compiling google-cloud-storage v1.20.0
   Compiling common v0.0.1 (/workbench/crates/common)
   Compiling boxes v0.0.1 (/workbench/crates/boxes)
   Compiling sandbox v0.0.1 (/workbench/crates/sandbox)
   Compiling mfile v0.0.1 (/workbench/crates/mfile)
   Compiling minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
   Compiling minimal-client v0.8.0 (/workbench/crates/minimal-client)
   Compiling checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling decode v0.0.1 (/workbench/crates/decode)
   Compiling graph v0.0.1 (/workbench/crates/graph)
   Compiling lcache v0.0.1 (/workbench/crates/lcache)
   Compiling rcache v0.0.1 (/workbench/crates/rcache)
   Compiling op v0.0.1 (/workbench/crates/op)
   Compiling check v0.0.1 (/workbench/crates/check)
   Compiling orchestrator v0.0.1 (/workbench/crates/orchestrator)
   Compiling mctx v0.0.1 (/workbench/crates/mctx)
   Compiling minimald v0.8.0 (/workbench/crates/minimald)
   Compiling minimal v0.8.0 (/workbench/crates/minimal)

Outside the task's layers::

  • crates/minimal/src/cmd/boxes/create.rs
  • crates/minimal/src/cmd/boxes/policy.rs
  • crates/minimal/src/task.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor/tests.rs

Converted to a draft: verify timed out after 1800s; outside the task's layers:: crates/minimal/src/cmd/boxes/create.rs.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_manager.rs:4756: 9d2b79c: the client registers a derived-name grant box under ~. 20409d0: create_session passes the first derived candidate as the base host_ip_mint_name checks the key against. New test: two derived grant creates give web and web-1.
  • 👍 valid — crates/minimald/src/box_manager.rs: c8e23c6 made created_name record a gone holder or an Err from find or record() as HolderCreator::Unread. 44f7202 makes the reply hide the holder in that case and also for a record with no creator.
  • 👍 valid — crates/minimald/src/rpc.rs: 44f7202: name_not_taken_reply sets readable only for HolderCreator::User(owner) where owner equals the caller. NoCreator and Unread both hide the holder.
  • 👍 valid — crates/minimald/src/rpc.rs: 44f7202: a record with no creator read by bob now gives holder None. The test also checks an unread holder record and a caller with no user.

Two creates in one project with no --name give boxes web and web-1, and the second is not refused. This now holds for a host_ip grant box too, because each create registers under its own ~ key. The create reply names web as the name it did not get. It names the holder only to the caller that its read record names as the creator.

Notes from the agent: C1 part (1) is in crates/minimal/src/cmd/boxes/create.rs, which is outside the task's layers. The /revise note asked for this change in this PR. host_ip_registration_key now issues a key when the create sends no written name, and the existing test checks the derived-name case. C2: the HolderCreator enum from c8e23c6 already records whether the holder record was read (User, NoCreator, Unread). This round removes the fail-open NoCreator arm. The reply names the holder only for User(owner) with owner equal to the caller. The minimal-review finding (PRRT_kwDOPdfcxM67sOch) is the same fail-open case, and 44f7202 closes it. Commits: 44f7202 (C2), 20409d0 (C1 daemon and test), 9d2b79c (C1 client). I did not run just ci, just clippy-strict or a whole-crate run.

@agent-137
agent-137 marked this pull request as ready for review November 25, 2026 04:07
@agent-137
Copy link
Copy Markdown
Member

/arch-review

@agent-137
Copy link
Copy Markdown
Member

/review

@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

Both conditions from the ruling at c8e23c6 are met. A derived-name host_ip grant box now registers under a creation key, and the daemon accepts the key for the first derived candidate (C1, line 402 and 407). The create reply names the holder only to the creator that its record names, so a record with no creator hides the holder (C2, line 399 and Gatehouse §7.3). The rest of the change keeps its earlier status. The two named residuals are #3758 and #3755.

Ruled at 9d2b79c against gominimal/arch@4f2eb87d5d12 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 — approval withheld

Verdict COMMENT — APPROVE withheld: 8 unresolved threads — minimal-foundry[bot] crates/minimald/src/rpc.rs, minimal-arch[bot] crates/minimald/src/box_manager.rs:4756, minimal-arch[bot] crates/minimald/src/box_manager.rs, minimal-arch[bot] crates/minimald/src/rpc.rs, minimal-arch[bot] crates/minimald/src/rpc.rs, …. No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@agent-137
Copy link
Copy Markdown
Member

/revise

Merge current main into this branch and resolve the conflicts. #3788 (D3754) merged into main as 334a714 and touches the same creation step. Change no behaviour beyond the merge.

The conflicts:

  • crates/minimald/src/box_manager.rs, in create_session where the naming is set up. Keep both sides. Main adds let naming = RecordNaming::of(&config, spec.as_ref(), source); and later naming.stamp(&mut record);. This branch replaces main's fresh_base with key_base (fresh || source == NameSource::Derived) and adds derived. Use key_base where main uses fresh_base, including in host_ip_mint_name. Make sure naming.stamp runs on the record before the store's derived-name step files it, so a derived-name box's record keeps name_origin = derived, project_name and entry (BOX-228).
  • crates/minimald/src/box_manager/tests.rs: both sides add tests at the same place. Keep all of them. Where this branch's tests build a boxes::Record or a BoxListingEntry literal, set the fields main added.

Add a test, or extend taken_derived_name_gets_smallest_free_number, so that web-1's record reads name_origin derived with the project name and entry.

Keep Fixes #3784, Closes #3753 and the "Note for review" section of the body.

Keeps main's record naming stamp (BOX-228) on a derived-name create,
before the store's derived-name step files the record, and checks that
web-1 keeps name_origin, project_name and entry.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as 6be851abe742.

Resolved conflicts in: crates/minimald/src/box_manager.rs, crates/minimald/src/box_manager/tests.rs

line exit tail
cargo test -p boxes derived_name_takes_smallest_free_number 0 running 3 tests test tests::box_names::derived_name_takes_smallest_free_number_fitted_to_63 ... ok test store::tests::derived_name_takes_smallest_free_number_past_reserved_and_id_form ... ok test store::tests::derived_name_takes_smallest_free_number ... ok test result: ok. 3 passed; 0 failed; 0 ig
cargo test -p minimald taken_derived_name_gets_smallest_free_number 0 name_gets_smallest_free_number_freed_after_a_failed_create ... ok test box_manager::tests::taken_derived_name_gets_smallest_free_number_past_a_stopped_holder ... ok test box_manager::tests::taken_derived_name_gets_smallest_free_number_past_reserved_and_box_id_form ... ok test result: ok. 6 passed;
cargo test -p minimald create_reply_names_the_taken_derived_name 0 running 2 tests test rpc::create_naming_tests::create_reply_names_the_taken_derived_name_holder_only_to_its_reader ... ok test rpc::create_naming_tests::create_reply_names_the_taken_derived_name ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 1588 filtered out; finished in 0.06s

Verify min task run agent-verify exited 100.

 box_actor::tests::a_box_holding_a_host_row_refuses_remint_after_its_host_loop_ends
        PASS [   2.287s] (1975/3653) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   0.014s] (1976/3653) minimald box_actor::tests::a_daemon_side_task_of_a_placed_box_without_its_leaf_is_refused
        PASS [   0.016s] (1977/3653) minimald box_actor::tests::a_daemon_side_task_runs_in_the_box_leaf
        PASS [   2.304s] (1978/3653) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.295s] (1979/3653) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.315s] (1980/3653) minimald box_actor::tests::a_declared_port_whose_bind_at_the_hand_fails_keeps_its_interim_forward
        PASS [   2.344s] (1981/3653) minimald box_actor::tests::a_destroy_under_a_pending_verdict_does_not_wait_and_publishes_the_interim
        PASS [   2.623s] (1982/3653) minimald box_actor::tests::a_destroy_queued_behind_a_waiting_finalize_runs_after_the_promotion
        PASS [   2.316s] (1983/3653) minimald box_actor::tests::a_detach_hook_host_of_a_registered_box_is_refused_to_the_next_attach
        PASS [   4.550s] (1984/3653) minimald box_actor::tests::a_destroyed_holders_shared_port_is_bound_for_the_running_box_that_takes_it
        PASS [   0.265s] (1985/3653) minimald box_actor::tests::a_failed_workspace_upload_does_not_leave_attaches_refused
        PASS [   2.279s] (1986/3653) minimald box_actor::tests::a_failed_activate_hook_s_publish_is_withdrawn_by_the_destroy
        PASS [   0.289s] (1987/3653) minimald box_actor::tests::a_failing_activate_hook_blocks_the_session
        PASS [   4.818s] (1988/3653) minimald box_actor::tests::a_destroyed_holders_shared_port_is_not_bound_for_a_box_that_is_not_running
        PASS [   0.301s] (1989/3653) minimald box_actor::tests::a_failing_destroy_hook_still_destroys_the_session
  stdout ───

    running 1 test
    test exec_run_attach_and_task_run_share_the_commands_trace ... FAILED

    failures:

    failures:
        exec_run_attach_and_task_run_share_the_commands_trace

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 5 filtered out; finished in 13.36s

  stderr ───

    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.305s] (1991/3653) minimald box_actor::tests::a_handed_box_pending_at_finalize_publishes_the_interim_when_the_verdict_lands_absent
        PASS [   4.523s] (1992/3653) minimald box_actor::tests::a_hand_over_bind_the_switch_refuses_leaves_the_election_standing
        PASS [   6.783s] (1993/3653) minimald box_actor::tests::a_handed_reserved_address_waits_for_the_verdict_before_it_publishes
────────────
warning: 1660/3653 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes/create.rs
  • crates/minimal/src/cmd/boxes/policy.rs
  • crates/minimal/src/task.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor/tests.rs

Converted to a draft: verify exited 100; outside the task's layers:: crates/minimald-rpc/src/tests.rs, crates/minimald/src/box_actor/tests.rs.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/rpc.rs: Fixed in 44f7202: a holder with no creator is hidden like an unread one, so the reply gives holder None and keeps the name.
  • 👍 valid — crates/minimald/src/rpc.rs: Fixed in 44f7202: the test asserts bob gets holder None for a no-creator holder, and the name not taken stays in the reply.
  • 👍 valid — crates/minimald/src/box_manager.rs: Fixed in 20409d0 and 9d2b79c: key_base is the first derived candidate for host_ip_mint_name, and min issues a creation key for a create with no written name. The merge keeps key_base.

Two creates in one project with no --name give boxes web and web-1. The second create is not refused, and its reply names web as the name it did not get, with its holder. After the merge with main, the record of web-1 also keeps name_origin derived, project_name web and entry default.

Notes from the agent: Merge round only. The merge of origin/main (334a714, D3754) conflicted in box_manager.rs and box_manager/tests.rs. In create_session, both sides are kept: main's RecordNaming::of and this branch's key_base and derived. key_base replaces main's fresh_base, also in host_ip_mint_name. naming.stamp(&mut record) runs before store.create_derived, so the store files the stamped record. Main's RecordNaming::of used main's local DerivedName type, which this branch replaced with boxes::box_name::DerivedName. That type keeps its project field private, so a new helper request_project in box_manager.rs computes the project name for both RecordNaming::of and derived_name_of, with no change in behaviour. In tests.rs, all tests from both sides are kept. taken_derived_name_gets_smallest_free_number now asserts that web-1's record has name_origin Derived, project_name web and entry default. Main's record_keeps_name_origin_written_or_derived passes too. Clippy for minimald, minimal, minimal-client, boxes and minimald-rpc (all targets) is clean. No literal on this branch needed new fields, because the auto-merged literals already carry them. The three listed threads were already fixed in earlier rounds (44f7202, 20409d0, 9d2b79c). This round changes nothing for them.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 25, 2026 05:30
@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 new head merges main's #3788 into this branch. The resolution keeps the name origin, project name and entry on a derived-name create. naming.stamp runs before the store's derived-name step, and that step changes only the name. This agrees with architecture.md Addressing, lines 395, 402 and 408. The earlier PASS holds for the rest of the change.

Ruled at 6be851a against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

@agent-137
agent-137 marked this pull request as ready for review November 25, 2026 05:37
@agent-137
Copy link
Copy Markdown
Member

/arch-review

@agent-137
Copy link
Copy Markdown
Member

/review

@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 change conforms to the Box names rules in architecture.md Addressing. A derived name is never refused. The store walks to the smallest free <name>-<n>, fitted to 63, in the same step that writes the pending record (lines 402, 403 and 408). The reply names the holder only to a caller who created that box, and hides it in every other case (line 399). The written-name refusal for a stopped holder (#3755) and the min stderr line (#3758) stay open as residuals. The verify run failure in otel_cli.rs is not a design question. Fix it or show that it is a flake before you mark the PR ready.

Ruled at 6be851a against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

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

Approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants

0