Repository navigation
fix(boxes,minimal,minimald): a box created from min dash with a blank name takes the same derived - #3763
Conversation
The name fits one 63-octet DNS label. The project is cut first, then the entry, and a fresh instance's number never.
A box's name is never read from its spec. A create with no name takes the name derived from the project root and the entry, for every creator. A spec that does not parse still gives a name.
create_registering no longer registers an unnamed box under the default entry's name. It registers it under the name the daemon derives from the project and the entry, and a box that does not register goes unnamed, so the daemon derives the same name.
…ted-from-min-dash-with-a-blank-name-ta
|
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.
|
|
/revise The previous round's job died on the runner ("Container connectivity was lost"), not on the code. Fix the failing e2e lanes (e2e, native-daemon-e2e via ci-linux-native-success, test-kvm via ci-linux-kvm-success, and the macOS lane). They fail with
|
…ted-from-min-dash-with-a-blank-name-ta
A task box with no requested name now takes <project>-<task>-<n>. The kept-box check derives the project label from the seed directory and still asserts the exact kept name, its listing and its removal.
|
Round 2 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: verify exited 101; outside the task's A session created in min dash with the name left blank shows the same name as a box from min box start in that project, and not (unnamed). The session e2e task leg now finds the kept task box under its derived name --. Notes from the agent: Revise round 2. This round changes only scripts/session-e2e.sh, which is outside the task's layers, as the directive expected. task_kept_check now derives the project label from the seed directory (basename of /tmp/mnlt.XXXXXX, lowercased, '.' and '_' as '-') and matches 'Kept box --' exactly. It still checks the 'min box rm ' hint, the min ls listing and the removal. The other task legs read the name that the command prints, so they need no change. I did not run the e2e script: this box has no KVM and no daemon e2e setup. The CI e2e lanes must confirm it. The directive asks for 'Closes #3530' in the pull request body. The runner writes the body, and my instructions forbid closing keywords in commits, so I did not add it. A comment in crates/minimal/src/task.rs near line 1608 still says the daemon names a task box '-'. That file is outside the layers, so I left it. |
|
The runtime will not revise this pull request again on its own: the diff is +591/-168 (759 lines), past 3x the plan's estimate of 250 lines (est: 90 code, 160 tests, as #3751 reads now), at round 2 (the last trigger was a /revise note). A person decides now. Remove |
|
/revise Two failures at b7e6456 (the verify exit 101 was the runner's build step; CI is the evidence):
Both check a run's box by name. A box with no requested name now takes
|
A task box with no requested name is <project>-<task>-<n> (BOX-211). The held-open stdin test now derives the expected name from the project directory with the boxes helper.
The bare e2e-port-run-<n> match took the tail of the new <project>-e2e-port-run-<n> name, so min box show read no box and the wait never saw the run's box end. The check now matches the whole derived name and keeps the NET-131 assertion.
…ted-from-min-dash-with-a-blank-name-ta
|
Round 3 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: verify exited 101; outside the task's A session created in min dash with the name left blank shows the same name as a box from min box start in that project, and not (unnamed). This round, the two checks that looked up a run's box by the old entry-only name now look it up by its derived -- name. Notes from the agent: Revise round 3. Both failures came from the tests, not from the code. (1) crates/minimal/tests/cli.rs task_run_exits_with_held_open_stdin_pipe expected 'in box e2e-echo-1'. It now computes the expected name with boxes::box_name::derived_box_name from the project tempdir, and it passes. (2) scripts/session-e2e.sh NET-131 check: grep -o 'e2e-port-run-[0-9]*' took only the tail of '-e2e-port-run-1'. So 'min box show' read no box, the state stayed empty, and the wait reported 'STILL listed'. The run's own box was never read, so this was not a regression. The check now derives the project label from PO_TASK_SEED_DIR, the same way as the kept-box check at line 7153, and matches the whole name. The NET-131 and BOX-038 assertions are unchanged. I did not run the session e2e here, because it needs a daemon or a VM lane. It checked only bash -n. Both files are outside the layers, as the directive expected. The directive listed no review threads. |
|
/arch-review |
|
/review |
|
Reviewed: no findings; approval withheld, 7 threads unresolved at APPROVE withheld: 7 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_manager.rs:483, minimal-arch[bot] crates/minimald/src/box_manager.rs:482, minimal-arch[bot] crates/minimal/src/dash/rpc.rs:795, minimal-arch[bot] crates/minimal/src/dash/rpc.rs:860, minimal-arch[bot] crates/boxes/src/lib.rs:1852, …. 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. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none found. |
| } | ||
| } | ||
|
|
||
| /// The name a create gives its box (BOX-211): the request's name exactly | ||
| /// as written, else the name derived from the project and the entry. A | ||
| /// box's name is never read from its spec, and every creator gets the | ||
| /// same rule. | ||
| fn creation_name( | ||
| requested: Option<&str>, | ||
| config: &minimald_rpc::BoxConfig, | ||
| spec: Option<&serde_json_lenient::Value>, | ||
| ) -> (Option<String>, NameSource) { | ||
| let spec = spec.and_then(|value| { | ||
| serde_json_lenient::from_value::<mfile::spec::BoxSpec>(value.clone()).ok() | ||
| }); | ||
| if let Some(name) = spec.as_ref().and_then(|spec| spec.name.clone()) { | ||
| return (Some(name), NameSource::SpecName); | ||
| } | ||
| if let Some(name) = requested { | ||
| return (Some(name.to_string()), NameSource::Request); | ||
| } | ||
| match spec { | ||
| // Only the entry is cleaned. A spec that sets `[box] name` returned | ||
| // above, unchanged, so the store still refuses an invalid one. | ||
| Some(spec) => ( | ||
| Some(boxes::box_name::entry_box_name(&spec.entry)), | ||
| NameSource::Entry, | ||
| ) -> (String, NameSource) { | ||
| match config.name.as_deref() { | ||
| Some(name) => (name.to_string(), NameSource::Request), | ||
| None => ( |
There was a problem hiding this comment.
MEDIUM · correctness · confidence 0.70 · in creation_name
The daemon now names an unnamed box <project>-<entry> and ignores the spec [box] name. The CLI was not updated. created_box_name in crates/minimal/src/cmd/boxes/create.rs (line 3684, called at 4639 and 6355) still returns the spec name, else the request name, else entry_box_name(entry). min box start registers the VM host row under that name and sends no config.name without --name. On an own-address box the row name and the box name then differ, and the egress decision and the hold lease no longer match the box. The fresh host_ip creation key uses the same old base. Update created_box_name to call boxes::box_name::derived_box_name, or send the derived name in config.name. Update the tests in crates/minimal/src/tests.rs that pin the old rule.
What the reviewer checked
create.rs:3688 if let Some(name) = spec.as_ref().and_then(|spec| spec.name.clone()) { return Some(name); } ... spec.map(|spec| boxes::box_name::entry_box_name(&spec.entry)); vs box_manager.rs creation_name: None => DerivedName::of(config, spec).name(None)
Hand this to an agent
Act on a code-review finding.
File: crates/minimald/src/box_manager.rs
Lines: 478-491
Category: correctness
Severity: medium (reviewer confidence 0.70)
Finding:
The daemon now names an unnamed box `<project>-<entry>` and ignores the spec `[box] name`. The CLI was not updated. `created_box_name` in crates/minimal/src/cmd/boxes/create.rs (line 3684, called at 4639 and 6355) still returns the spec name, else the request name, else `entry_box_name(entry)`. `min box start` registers the VM host row under that name and sends no `config.name` without `--name`. On an own-address box the row name and the box name then differ, and the egress decision and the `hold` lease no longer match the box. The fresh `host_ip` creation key uses the same old base. Update `created_box_name` to call `boxes::box_name::derived_box_name`, or send the derived name in `config.name`. Update the tests in crates/minimal/src/tests.rs that pin the old rule.
First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.
👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.
There was a problem hiding this comment.
Addressed in e63047b22621: created_box_name now returns the request name (which carries --name or [box] name), else boxes::box_name::create_derived_name, the function the daemon calls, so the VM host row, the host_ip creation key base and the box carry one name (315be84). Tests in crates/minimal/src/tests.rs updated (315be84, e63047b).
There was a problem hiding this comment.
arch-review: CONDITIONS · 3 conditions · the full ruling
The daemon rule for the name is correct, and the 63-character fit follows the design. But a [box] name in minimal.toml no longer names a box. The daemon stops reading it, and no client sends it, so architecture.md line 401 is broken (C1). The CLI's created_box_name() still gives the old name. So VM registrations and host_ip keys do not match the name that the Box Host assigns, which line 407 requires (C2). The project label drops non-ASCII bytes and does not give box for an empty result, which line 1250 forbids (C3).
Outside the diff
crates/minimal/src/cmd/boxes/create.rs:3684: C2 · This still gives[box] name, else the request name, else the entry. The daemon now assigns<project>[-<entry>], so the VM registration and thehost_ipkey base differ from the assigned name (architecture.md line 407). Return the request name, else the shared derived name.
Ruled at 774e64a against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
| NameSource::Entry, | ||
| ) -> (String, NameSource) { | ||
| match config.name.as_deref() { | ||
| Some(name) => (name.to_string(), NameSource::Request), |
There was a problem hiding this comment.
C1 · The daemon now takes only the request name. That is correct only if min sends [box] name as the request name. It does not, so a [box] name in minimal.toml names no box (architecture.md line 401). In stamp_session_spec_as(), task.rs and the dash create, send spec.name when no --name or form name is given.
There was a problem hiding this comment.
Addressed in e63047b22621: stamp_session_spec_as and put_task_spec copy the entry's expanded [box] name onto the spec and send it as the request name when no --name is given. The dash create does the same (315be84).
| let registers = config.network == NetworkMode::OwnIp && vm_host_control_sock(sock).is_some(); | ||
| if registers && config.name.is_none() { | ||
| config.name = Some(mfile::spec::DEFAULT_SESSION_ENTRY.to_string()); | ||
| config.name = Some(derived_name(&config, spec)); |
There was a problem hiding this comment.
C1 · A blank form name must take the entry's [box] name first, then the derived name. Use the spec's name here before derived_name(), and send it on the request when the box does not register too.
There was a problem hiding this comment.
Addressed in e63047b22621: create_registering takes the spec's box.name before derived_name() and sends it whether or not the box registers. The dash test adds an entry with [box] name = "api-box" (315be84).
| /// entry when the spec has none. `min box start` with no `--name` gets | ||
| /// this name from the daemon, so a box registered under it is the box the | ||
| /// daemon names. | ||
| fn derived_name(config: &BoxConfig, spec: Option<&serde_json_lenient::Value>) -> String { |
There was a problem hiding this comment.
C2 · This copies DerivedName::of() from box_manager.rs. Move the derivation into one function in boxes::box_name, and call it here, in the daemon, and in created_box_name() in cmd/boxes/create.rs.
| /// `text` as DNS label characters, uncapped: ASCII letters and digits | ||
| /// lowercased, `-`, `_` and `.` as `-`, other characters dropped, and | ||
| /// no `-` at either end. | ||
| fn label_chars(text: &str) -> String { |
There was a problem hiding this comment.
C3 · The project label must replace each run of non-alphanumeric bytes with one -, and give box when nothing is left (architecture.md line 1250). This drops non-ASCII characters and keeps runs like --. cafébar must give caf-bar.
There was a problem hiding this comment.
Addressed in e63047b22621: project_label turns each run of non-alphanumeric characters into one '-' and gives 'box' when nothing is left. cafébar gives caf-bar (ae9aed1).
| ); | ||
|
|
||
| // Parts that clean to nothing. | ||
| assert_eq!(derived_box_name("日本", Some("lint"), None), "lint"); |
There was a problem hiding this comment.
C3 · The design gives the project box for 日本, so this name is box-lint, not lint. Change the expected value, and add My_App.v2 gives my-app-v2 and cafébar gives caf-bar.
There was a problem hiding this comment.
Addressed in e63047b22621: The test expects box-lint for 日本 + lint, and adds My_App.v2 -> my-app-v2, cafébar -> caf-bar and a--b + x -> a-b-x (ae9aed1).
|
/revise Arch ruling CONDITIONS on 774e64a (3 conditions). Apply all three as the ruling states them: Reply to each arch thread with the commit that meets it. Keep |
|
/revise Arch ruling CONDITIONS on 774e64a (3 conditions). My previous /revise note posted without the conditions; this one carries them. Apply all three as the ruling states them:
Reply to each arch thread with the commit that meets it. Keep |
|
That 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. |
A project name now gives each run of other characters one '-', and 'box' when nothing is left. create_derived_name is the one derivation the daemon, min box start and min dash call.
min box start, min task run and min dash put an entry's [box] name on the create request, because the daemon names a box from the request alone. The VM host row takes the same name through boxes::box_name::create_derived_name.
|
Round 4 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: verify exited 1; outside the task's Review threads the coder judged:
A box created in min dash with the name left blank shows the same name as a box from min box start in that project: for the default entry, - for another entry, and the entry's [box] name when the entry declares one. It never shows (unnamed). The dash test now checks all three cases against a real min box start create. Notes from the agent: Revise round 4. The commits that meet the arch conditions: C3 is ae9aed1. The project label turns each run of other characters into one '-', and an empty label becomes 'box'. So cafébar gives caf-bar, My_App.v2 gives my-app-v2, and 日本 + lint gives box-lint. C2 is ae9aed1 and 1f1bf70. boxes::box_name::create_derived_name is now the one derivation, and the daemon (DerivedName), the dash (derived_name) and created_box_name in cmd/boxes/create.rs call it. C1 is 315be84. stamp_session_spec_as and put_task_spec copy the entry's expanded |
| if config.name != name { | ||
| tracing::info!( | ||
| name_given = ?config.name, | ||
| name = ?name, | ||
| source = source.word(), | ||
| "named the box from its spec" | ||
| "named the box from its project and entry" | ||
| ); |
There was a problem hiding this comment.
LOW · correctness · confidence 0.60 · in BoxManager::create
This log fires whenever config.name != name. That includes a --new create with a request name, where the name only gets a -<n> suffix and does not come from the project and entry. The text "named the box from its project and entry" then misleads, although source says request name. Word the message by source, or log only for NameSource::Derived.
What the reviewer checked
box_manager.rs:4694 if config.name != name { tracing::info!(... source = source.word(), "named the box from its project and entry") }
Hand this to an agent
Act on a code-review finding.
File: crates/minimald/src/box_manager.rs
Lines: 4694-4700
Category: correctness
Severity: low (reviewer confidence 0.60)
Finding:
This log fires whenever `config.name != name`. That includes a `--new` create with a request name, where the name only gets a `-<n>` suffix and does not come from the project and entry. The text "named the box from its project and entry" then misleads, although `source` says `request name`. Word the message by source, or log only for `NameSource::Derived`.
First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.
👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.
There was a problem hiding this comment.
Tracked in #3753: that task removes the fresh-instance (--new) path and assigns <name>-<n> in the record step, and it rewrites this create log line to say whether the name was requested, derived or numbered. It is a log record, not user-facing text, so it does not hold this PR.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The three conditions from the ruling on 774e64a7 are met at this head. The daemon, min box start and min dash now derive an unnamed box's name through one function, create_derived_name(). The client sends the entry's [box] name as the requested name, as architecture.md line 401 and BCLI-079 require. The project part follows the minimal.toml layout rule on line 1250. Two items in code outside the compare are in the summary for a follow-up issue: the interactive task name, and the fresh-instance number.
Ruled at e63047b against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
|
Round 5 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: verify exited 101; outside the task's A session created in min dash with the name left blank shows the same name as a box from min box start in that project: the project name for the default entry, - for a picked entry, and the entry's [box] name when it declares one. It never shows (unnamed). Notes from the agent: The commits of the previous round already meet all three conditions of the arch ruling. C1 is in ae9aed1..315be84: stamp_session_spec_as, put_task_spec (task.rs, called after request_fresh_instance) and create_registering send the spec's [box] name as the request name. C2: boxes::box_name::create_derived_name is the one derivation, and DerivedName::of, the dash derived_name and created_box_name call it. created_box_name no longer reads spec.name or calls entry_box_name, so host_ip_registration_key builds -~. C3 is in ae9aed1: project_label lower-cases, collapses each run of other characters to one '-', trims, and gives 'box'. The test expects box-lint, my-app-v2 and caf-bar. This round only changed the dash test so that the entry declares [box] name = "web", as C1 words it. Before, the test used "api-box". The same test checks that the own-address registration on a VM-backed host uses the box start name, and created_box_name_is_the_request_name_else_derived covers the min box start side. Commits: C1 315be84, C2 ae9aed1 + 1f1bf70 + 315be84, C3 ae9aed1, test 486aec2. crates/minimal/src/cmd/boxes/create.rs, crates/minimal/src/task.rs and crates/minimal/src/tests.rs are outside the task's layers, but the ruling names them. The earlier round touched them, and this round did not. I did not run just clippy-strict or the full crate suites. |
|
/arch-review |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change since the last ruling renames one test fixture value from api-box to web. The test still proves that a written [box] name names the box before the derived name. This matches the Addressing section of the architecture, line 401. The earlier ruling stands for the rest of the change. No conditions.
Ruled at 486aec2 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
|
/review |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 7 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_manager.rs:483, minimal-arch[bot] crates/minimald/src/box_manager.rs:482, minimal-arch[bot] crates/minimal/src/dash/rpc.rs:795, minimal-arch[bot] crates/minimal/src/dash/rpc.rs:860, minimal-arch[bot] crates/boxes/src/lib.rs:1852, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
Approved. Size accepted.
Follow-up
Fixes #3751
Closes #3530
crates/boxes/src/lib.rscrates/minimald/src/box_manager.rscrates/minimald/src/box_manager/tests.rscrates/minimald/src/rpc.rscrates/minimald/src/box_actor/tests.rscrates/minimal/src/dash/rpc.rsTask marker
Proof
A session created in min dash with the name left blank now gets the same name as a box from min box start in that project: the project directory name for the session entry, or - for a picked entry. It is not (unnamed). The test dash_create_blank_name_takes_box_start_name sends both creates to real harness daemons and reads the same name back from each. It also checks that an own-address box on a VM-backed host registers under that name.
Notes from the agent: Design: minimald's creation_name now uses the request's name exactly as written, else boxes::box_name::derived_box_name(project, entry, n). The project is the last component of project_root (else project_path), and the entry is the spec's
entrykey. The default entry gives the project alone. A[box] namein the spec no longer names the box. A spec that does not parse as v0, or no spec, takes the default entry. A fresh instance takes --, and the project is cut first, then the entry, so the number always fits in 63 octets. In min dash, create_registering takes the spec and registers an unnamed own-address box under the same derived name, in place ofdefault.Outside the layers (not touched; a follow-up task must do this):
Running task e2e-echo in box e2e-echo-1, and the box is now<tmpdir>-e2e-echo-1. One full run ofcargo nextest run -p minimalgave 1262 passed and 2 failed: this test and the inventory test in item 3. I fixed the inventory test and ran it again alone. I did not run the full suite again.cargo nextest run -p minimaldpassed in full (1594), and so did-p boxes(657).[box] name, else the request, else the entry). The CLI registers own-address VM boxes under that name, and host_ip_registration_key uses it as the base of the fresh-instance…[truncated]Tests
cargo nextest run -p boxes derived_name_fits_63_cutting_project_then_entry_never_numbercargo nextest run -p minimald create_names_box_written_exactly_else_derivedcargo nextest run -p minimald derived_name_is_project_for_default_else_project_dash_entrycargo nextest run -p minimald create_naming_testscargo nextest run -p minimal dash_create_blank_name_takes_box_start_nameVerify
min task run agent-verifyexited 101, so this PR is a draft.Base
The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:
crates/minimald/src/box_manager.rscrates/minimald/src/box_manager/tests.rs