Repository navigation
fix(minimald): a task box with its own network address and activate hooks runs its task and returns - #3566
Conversation
A task run on a box with its own network address and an on_activate hook now asks the VM host daemon whether the box's host-side row stands. When it stands, the run replaces the hook shell with the entrypoint and the launch rejoins the row, so the run relays the task's exit code. The refusal stays only for a row the daemon does not confirm, and its text now says that. Refs #3077.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Reviewed: no findings; approval withheld, 3 threads unresolved at APPROVE withheld: 3 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_actor/host.rs:577, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:565, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:575. 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: not checked with git log. If that was not intentional, restore the earlier change. |
| /// while the VM host daemon confirms the box's host-side row stands: the | ||
| /// run replaces the hook shell and its launch rejoins that row | ||
| /// (https://github.com/gominimal/minimal/issues/3077). This refusal is | ||
| /// left for a row that the host does not confirm, which fails closed. | ||
| #[derive(Debug)] |
There was a problem hiding this comment.
LOW · correctness · confidence 0.50
The doc comment links issues/3077, but 3077 is the task marker id (D3077). The PR fixes #3553. The same #3077 appears in host.rs (ensure_host and restart comments) and box_actor.rs. The link will point readers to the wrong issue. Use the real issue number.
Hand this to an agent
Act on a code-review finding.
File: crates/minimald/src/box_actor/host.rs
Lines: 573-577
Category: correctness
Severity: low (reviewer confidence 0.50)
Finding:
The doc comment links `issues/3077`, but 3077 is the task marker id (D3077). The PR fixes #3553. The same `#3077` appears in host.rs (ensure_host and restart comments) and box_actor.rs. The link will point readers to the wrong issue. Use the real issue number.
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.
arch-review: PASS · the full ruling
The change conforms. A task run on an own-address box with an on_activate hook now returns the task's exit code, as architecture line 494 requires. The shell is replaced only when the VM host daemon confirms the row, and the row is read again after the launch, so the path fails closed (§7.1). Two notes are outside the design. The restart refusal now prints the new text, which says the host did not confirm the row and that the task must replace the shell, but a restart asks nothing. Also check that the issues/3077 link names the right issue, because the PR fixes #3553. The verify run failed on an unnamed test. That failure is not part of this ruling.
Ruled at d8ebe9b against gominimal/arch@327e1b57d16b by claude-opus-5-5.
| The shell that ran the project's activate hooks holds that address, \ | ||
| and that shell does not end."; | ||
| The task must replace the shell that ran the project's activate hooks. \ | ||
| The box's host did not confirm that the box keeps the address when that shell ends."; |
There was a problem hiding this comment.
Note, not a condition: restart_launch also returns this refusal, and a restart prints this text. A restart does not ask the host, and it is not a task run. So on a restart, this text is not true. Give the restart refusal its own text.
There was a problem hiding this comment.
Addressed in 5f6d7cec9ebf: restart_launch now returns RestartBehindHookShell with its own text, which states that a restart cannot keep the address when the shell ends. The restart prints it without the spawn prefix, and the restart refusal test pins it.
| /// A box with its own network address and activate hooks runs its task | ||
| /// while the VM host daemon confirms the box's host-side row stands: the | ||
| /// run replaces the hook shell and its launch rejoins that row | ||
| /// (https://github.com/gominimal/minimal/issues/3077). This refusal is |
There was a problem hiding this comment.
Note, not a condition: D3077 is the task id, and this PR fixes #3553. Make sure that this link names the issue that tracks this work.
|
/revise Owner ruling (Karl, 2026-11-19): round 1 has shown "running" since 22:12Z with no update, so this is a fresh round. Do these:
|
…-with-its-own-network-address-and-acti
A restart does not ask the VM host daemon and is not a task run, so the task-run text was not true there. The restart now prints its own text, without the spawn-failure prefix, and the restart refusal test pins it.
|
Round 1 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
min task run on a box with its own network address and an on_activate hook runs the task and exits with the task's exit code. A restart of such a box now prints its own refusal, and that refusal does not use the task-run text. Notes from the agent: Revise round 1. The restart path now returns RestartBehindHookShell. Its text is RESTART_BEHIND_HOOK_SHELL: "The box has its own network address. Its command must replace the shell that ran the project's activate hooks. A restart cannot keep the address when that shell ends, so the command did not start." The restart prints it after "Session |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The new commit gives the restart its own refusal text and error type. The restart still refuses before it ends the hook shell, so the box keeps its host-side row. This is fail closed, as principle 7 at architecture.md line 336 requires. The gap against line 471 stays the residual #3231. The merge of main is clean and adds no change of its own to the PR's files. No condition is open.
Ruled at 5f6d7ce against gominimal/arch@327e1b57d16b by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 3 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_actor/host.rs:577, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:565, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:575. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
Approving. I checked the new ensure_host path against the code:
- It asks the VM host daemon whether the row stands while the hook shell still holds it, and only then kills the shell.
- It clears
slot_holds_rowand handsrelaunch_row_confirmedtolaunch_host.launch_hosttakes the flag first, reads the row again once the new host is up, and setsslot_holds_rowfrom that second read. - If the row is not confirmed, the old refusal still applies, so the box is never knowingly left rowless.
minvmd's RowStanding answers for the box's own non-task row, which matches what the read sends. The restart refusal now has its own type and text, and the test pins both. The #3077 links follow the owner's ruling.
I left three low, non-blocking notes: the refusal comment and the "box's host" wording, the restart text repeating itself, and a missing test for the case where the second read fails after the shell is killed.
Generated by Claude Code
| /// No command changes that answer, so the text states the situation and | ||
| /// stops. | ||
| pub(crate) const ENTRYPOINT_BEHIND_HOOK_SHELL: &str = "The box has its own network address. \ | ||
| The shell that ran the project's activate hooks holds that address, \ | ||
| and that shell does not end."; | ||
| The task must replace the shell that ran the project's activate hooks. \ | ||
| The box's host did not confirm that the box keeps the address when that shell ends."; |
There was a problem hiding this comment.
Low (non-blocking): this refusal now fires only on the ensure_host branch where the hook shell is still alive. That shell's launch holds the row attached, so minvmd's RowStanding lookup answers true for the box's own id. In practice the refusal means host_row_standing returned None, either because the report door did not answer within REPORT_DEADLINE or because the record has no box_id. The door case is transient: a second min task run can confirm the row and run the task. Two consequences:
- The doc comment's "No command changes that answer" is not quite true for that case. Rewording it to "the read may not have been answered" would match the code.
- "The box's host" in the printed text names the VM host daemon. The AGENTS.md glossary uses Box Host for the running
minimald, which is the daemon printing this line, so a reader may think the wrong component failed to confirm. Consider wording that does not depend on that term, e.g. "The machine that runs the box did not confirm ...", and update the pinning test with it.
Generated by Claude Code
There was a problem hiding this comment.
Tracked in #3640 (non-blocking; kept out of this PR so its approved head stands).
| /// https://github.com/gominimal/minimal/issues/3231. | ||
| pub(crate) const RESTART_BEHIND_HOOK_SHELL: &str = "The box has its own network address. \ | ||
| Its command must replace the shell that ran the project's activate hooks. \ | ||
| A restart cannot keep the address when that shell ends, so the command did not start."; |
There was a problem hiding this comment.
Low (non-blocking): the restart prints this after "Session <name> did not start again. It is stopped now.", so "so the command did not start" says the outcome a second time. It also joins two facts in one sentence, which the AGENTS.md "Give each fact its own sentence" rule asks us to avoid. Suggest ending with "A restart cannot keep the address when that shell ends." and updating the string pinned in restart_argv_box_behind_hook_shell_with_host_row_fails_stopped to match.
Generated by Claude Code
There was a problem hiding this comment.
Tracked in #3640 (non-blocking; kept out of this PR so its approved head stands).
| // Set after the kill: the slot no longer holds the binding | ||
| // launch's host, so the next launch is the one that rejoins. | ||
| self.slot_holds_row = false; | ||
| self.relaunch_row_confirmed = rejoins_row; |
There was a problem hiding this comment.
Low (non-blocking): this PR adds a new state, and no test covers it. The hook shell has already been killed here, so when the second read in launch_host gets row_standing: false (the row was withdrawn between the two reads), the run fails with BoxHostRowEnded and the box has no host. Before this change, the hook shell stayed in that case. The new test always answers true twice.
Please add a variant that answers true and then false. It should check three things:
- the run fails without the hook-shell refusal;
- the slot holds no host;
- a later attach goes through
host_row_lost, so that within the grace period it either rejoins or is refused, and never runs rowless.
Generated by Claude Code
There was a problem hiding this comment.
Tracked in #3640 (non-blocking; kept out of this PR so its approved head stands).
Follow-up
Fixes #3553
crates/minimald/src/box_actor/host.rscrates/minimald/src/box_actor.rscrates/minimald/src/exec/process.rscrates/minimald/src/box_actor/tests.rsTask marker
Proof
A task run (min task run) on a box with its own network address and an on_activate hook now replaces the hook shell with the task, rejoins the box's host-side row, and exits with the task's exit code (7 in the new test), not with the hook-shell refusal. The refusal is printed only when the VM host daemon does not confirm that the row stands.
Notes from the agent: Design: ensure_host asks the VM host daemon (host_row_stands) whether the box's host-side row stands BEFORE it kills the hook shell. If the row stands, it kills the shell, clears slot_holds_row and sets relaunch_row_confirmed. The launch that follows rejoins the row and reads it again once its host is up, as the existing relaunch path does. If the row does not stand (a native host with no report door, or no answer), the hook shell stays and the run is refused with EntrypointBehindHookShell as before, so the box is never left rowless. On a native host with no VM host daemon, the refusal therefore stays.
exec/process.rs needs no change: the new path returns a host through the normal path, which already relays the exit code, and the refusal mapping still applies to the remaining refusal path. So process.rs is unchanged.
The tests.rs layer said to replace the refusal test. I kept it, because it still covers the no-confirmation path (it passes unchanged), and I added the new test beside it. restart_launch still refuses (tracked by #3231). Only its comment changed.
Printed text changed: ENTRYPOINT_BEHIND_HOOK_SHELL now reads "The box has its own network address. The task must replace the shell that ran the project's activate hooks. The box's host did not confirm that the box keeps the address when that shell ends." The old text (the shell 'does not end') was no longer the reason for the refusal. The only pin is the existing refusal test, which uses the constant.
Also ran: cargo test -p minimald --lib hook_shell (4 passed), cargo test -p minimald --lib host_row (3 passed), cargo clippy -p minimald…[truncated]
Tests
cargo test -p minimald until_complete_ends_on_entrypoint_return_without_client_runs_a_task_behind_a_hook_shellVerify
min task run agent-verifytimed out after 1800s, so this PR is a draft.Closes #3077 (the original issue this task was triaged from).