Repository navigation
fix(minimald): a box records a started event when its entrypoint first starts and when a resume - #3568
fix(minimald): a box records a started event when its entrypoint first starts and when a resume#3568minimal-foundry[bot] wants to merge 3 commits into
Conversation
A box wrote its started event only on a restart. The exec and attach launches now write it through one shared helper, and a resume writes it after its resumed event (BOX-040).
|
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-arch[bot] crates/minimald/src/box_actor/host.rs:1989, minimal-foundry[bot] crates/minimald/src/box_actor.rs:1482, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:1989. 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 seen. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The change writes started on the exec launch, the attach mint, the resume and the restart, in the correct owner. One start of the entrypoint still writes no event. An attach that keeps a hooks host releases its shell at the start gate, and nothing writes started. architecture.md lists started as a lifecycle event, and line 500 says running means the entrypoint started. The PR body calls this a known gap but names no issue. Make the edit in C1, or file the gap as a named residual as C1 says.
Outside the diff
crates/minimald/src/box_actor/attach.rs:388: C1 · The kept hooks host starts its shell at this attach (box_runtime.rsline 2499). Afterh.attachreturnsOk, callrecord_started("attach")once for this host, unless a resume is in flight (C1).
Ruled at 5f5272f against gominimal/arch@327e1b57d16b by claude-opus-5-5.
| // BOX-040: a new host started the box's entrypoint. On a resume, | ||
| // `finish_resume` writes `started` after `resumed`. | ||
| if !self.resume_in_flight { | ||
| self.record_started("attach").await; |
There was a problem hiding this comment.
C1 · This write covers only a host that mint_session_host launches. An attach that keeps a HostOrigin::Hooks host releases the shell at its start gate, and no started event is written. Write started once in the Some((h, _)) arm of attach_launch() in attach.rs, as C1 says.
There was a problem hiding this comment.
Disputed — not addressed: The gap is real, but it is outside this task's layers. A kept hook host starts its shell in the Some((h, _)) arm of attach_launch in crates/minimald/src/box_actor/attach.rs. This task names only box_actor.rs, host.rs and tests.rs, and its host.rs line excludes a hooks host. A follow-up task must cover that arm.
| // BOX-040: the resume started the entrypoint again, so `started` | ||
| // follows `resumed`. A launch that failed beside a host that was | ||
| // already there started nothing. | ||
| if launched.is_ok() { | ||
| self.record_started("resume").await; | ||
| } |
There was a problem hiding this comment.
LOW · correctness · confidence 0.50 · in finish_resume
finish_resume gates started on launched.is_ok(). But mint_session_host stores the new host and returns SessionBusy when the attach to it times out. On a resume that leaves a running host, so has_host is true and minted_host is false. The success path then records resumed with no started. The comment says a failed launch beside a host started nothing, and that is not true here. A first attach in the same case does record started (host.rs mint_session_host). Gate on whether the attach launch minted a host instead of on the launch result.
What the reviewer checked
box_actor.rs:
if launched.is_ok() { self.record_started("resume").await; }vs host.rs:Err(HostAttachError::Timeout) => Err(AttachError::SessionBusy)then the host is stored andrecord_started("attach")runs only when!resume_in_flight.
Hand this to an agent
Act on a code-review finding.
File: crates/minimald/src/box_actor.rs
Lines: 1467-1472
Category: correctness
Severity: low (reviewer confidence 0.50)
Finding:
`finish_resume` gates `started` on `launched.is_ok()`. But `mint_session_host` stores the new host and returns `SessionBusy` when the attach to it times out. On a resume that leaves a running host, so `has_host` is true and `minted_host` is false. The success path then records `resumed` with no `started`. The comment says a failed launch beside a host started nothing, and that is not true here. A first attach in the same case does record `started` (host.rs mint_session_host). Gate on whether the attach launch minted a host instead of on the launch result.
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 d8c233cd63d6: mint_session_host now sets resume_attach_minted during a resume, and finish_resume writes started when the launch succeeded or the attach minted a host. Added resumed_session_box_records_started_when_attach_wedges.
An attach that mints a host during a resume and then times out stores that host, so its entrypoint started. finish_resume now writes started after resumed in that case too (BOX-040).
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
min box events on a new task box shows created, started, exited. A resumed session box shows resumed and then started. This is also true when the resume's attach mints a host that then reports busy. Notes from the agent: Revise round 1. A resume now writes started when the attach mints a host, even when the attach to that host times out. Without the fix, the new test resumed_session_box_records_started_when_attach_wedges failed. The arch thread is a real gap: an attach that keeps a hook-launched host releases its start gate and writes no started event. The fix site is attach_launch in crates/minimald/src/box_actor/attach.rs. That file is outside this task's layers, and the task's host.rs line excludes a hooks host. A follow-up task must cover that case. I did not run just clippy-strict. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The compare fixes a different path: a resume whose attach wedges now records resumed and then started. That part conforms. C1 is still open. A first attach that keeps a hooks host starts the shell but writes no started event, and attach.rs has no change. Architecture line 500 says that running means the entrypoint started, and line 382 makes started the event for it. Make the C1 edit in attach_launch(). Or file an issue and name it in the PR body under Residuals.
Ruled at d8c233c against gominimal/arch@327e1b57d16b by claude-opus-5-5.
| if self.resume_in_flight { | ||
| self.resume_attach_minted = true; | ||
| } else { | ||
| self.record_started("attach").await; |
There was a problem hiding this comment.
C1 · This line writes started only for a host that mint_session_host creates. A hooks host that an attach keeps gets no started when attach_launch() releases its shell (attach.rs line 413). Architecture line 500 says running means the entrypoint started. Do the C1 edit in attach.rs. Or file the gap as an issue and name it under Residuals in the PR body.
|
/review |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 3 unresolved threads — minimal-arch[bot] crates/minimald/src/box_actor/host.rs:1989, minimal-foundry[bot] crates/minimald/src/box_actor.rs:1482, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:1989. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
Follow-up
Fixes #3552
crates/minimald/src/box_actor.rscrates/minimald/src/box_actor/host.rscrates/minimald/src/box_actor/tests.rsTask marker
Proof
min box events on a new task box now lists created, started, exited. On a session box, the first attach adds started after created. An attach that resumes a stopped session box adds resumed and then started, with no second started.
Notes from the agent: I ran each of the four test lines as written, and each one exited 0. I also ran the resume, event, until_complete and restart tests in the lib (81 passed). cargo clippy -p minimald --all-targets gave no warnings. A new actor field, resume_in_flight, is set by resume() and cleared by finish_resume(). It stops mint_session_host from writing started during a resume, so finish_resume writes started after resumed. finish_resume writes started only when the attach's launch succeeded. A failed started write is logged at warn with the op (exec, attach, resume, restart) and does not stop the box.
Tests
cargo test -p minimald created_task_box_records_startedcargo test -p minimald created_session_box_records_startedcargo test -p minimald resumed_session_box_records_startedcargo test -p minimald restart_records_exited_then_started_onlyVerify
min task run agent-verifytimed out after 1800s, so this PR is a draft.Residuals
startedevent. The fix is incrates/minimald/src/box_actor/attach.rs, outside this task's layers (arch_rulings 1401/1407 C1, residual branch).Closes #3426 (the original issue this task was triaged from).