Repository navigation
T66 — End an until-complete box at its timeout, execs included, and say so from min task run - #3154
Conversation
Each launch that starts the entrypoint of an until_complete box with a timeout arms a deadline. Past it, the actor signals every process in the box as a stop does, SIGTERM then SIGKILL after STOP_GRACE, sets the record to exited with reason timeout and no exit code, and records the exited event (BOX-037). A stop, a destroy or the entrypoint's own return disarms it, and a resume arms it again in full.
When the run exits 124 and the box's record says exited with reason timeout, min task run prints why on stderr before the kept-box line. A task that exits 124 by itself prints no such line (BOX-037).
The timeout key under [defaults.session], [session] and [tasks.*]: its forms, the clock that starts at each start of the box, the SIGTERM and SIGKILL ending as exited with reason timeout, and the exit code 124 of min task run.
…il-complete-box-at-its-timeout-execs-i
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: no findings at Nothing to do. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 3 conditions · the full ruling
The timeout ending conforms on the healthy path. Two error paths fail open against architecture.md line 499. A failed record read in end_on_timeout drops the deadline, and the box then runs on past its timeout. C1 fixes this. A failed record write in time_out_box keeps no ending, so a resume can launch, and a later stop records stopped, not timeout. C2 fixes this, as unrecorded_stop does for a stop. C3 asks for a filed issue for the exec leg of the proof, which uses a stand-in process.
Ruled at f162bbe against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
Round 1 of 10 on the runtime's review findings: the coder changed nothing. Revise round 1. The one review thread asks to tie the client's TIMEOUT_EXIT_CODE (crates/minimal/src/task.rs) to the daemon's 124 (crates/minimald/src/exec/process.rs entrypoint_end_code, crates/minimald/src/exec/bridge.rs TIMEOUT_STATUS). The concern is real, but this task's layers cannot hold the fix. A shared constant needs a crate that both use (crates/minimald-rpc or crates/boxes) and edits to process.rs and bridge.rs. These files are all outside the layers. I tried an in-layer tie: a test in crates/minimal/src/tests.rs that runs a real 1 s timeout task against minimald::test_harness::TestServer and compares the exit code with TIMEOUT_EXIT_CODE. From the minimal crate the test daemon cannot spawn the entrypoint. It returns exit 1 with 'session spawn: no such package: base', because the box launch seams are cfg(test) in minimald only. To fix that, the test harness needs changes in crates/minimald/src/test_harness.rs, which is also outside the layers. I reverted the tria…[truncated] Review threads the coder judged:
|
|
/revise Arch conditions on head f162bbe, quoted in full from the arch-review check run below. Apply each one exactly, with the tests each names. Change nothing else.
Ruled at f162bbe against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5; arch_rulings 1062, job 5a1c0ca1-9db9-4e99-85aa-56e4687de3cf. |
A failed record read at the timeout no longer leaves the box running past it: a live host ends the box, else the timeout is tried again. A failed exited write keeps the timeout ending on the actor. A resume is refused until it is saved, and a later stop writes exited timeout.
…il-complete-box-at-its-timeout-execs-i
There was a problem hiding this comment.
APPROVE withheld: 4 unresolved threads — minimal-foundry[bot] crates/minimal/src/task.rs:1200, minimal-arch[bot] crates/minimald/src/box_actor.rs, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:2480, minimal-arch[bot] crates/minimald/src/box_actor/tests.rs:17305.
minimal-review — advisory review
Verdict COMMENT — No findings.
Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This head closes the two fail-open paths from the ruling on f162bbe0. A failed record read at the timeout now ends the box or tries the timeout again. A failed exited write is kept on the actor. A resume is refused, and a later stop writes exited with reason = timeout, as architecture.md line 499 says. The merge of #3031 is clean and touches no file of this change. BOX-037 conforms, and no condition is open.
Ruled at 4bc4644 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
Round 2 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:
A task past its timeout ends exited with reason timeout, and no process of the box outlives it. This now also holds when the timeout's record read fails: a live host ends the box, and otherwise the timeout is tried again. When the exited write fails, the actor keeps the timeout ending. A resume is refused, and a later min box stop leaves the record exited with reason timeout. min task run still says why and exits 124. This round did not change that part. Notes from the agent: C1 and C2 are done as the conditions say. In C2, a stop that finds the kept timeout ending writes the exited record and its exited event. It then answers an io error, and the StopBox arm ends the actor. BoxManager::stop_box_answer already maps that error to AlreadyExited through ended_while_stopping, so the stop answers AlreadyExited(Timeout). No change to box_manager.rs was necessary. A new #[cfg(test)] timeout_read_seam in box_actor.rs fails the timeout's record read, in the same way as exit_record_seam. C3 is NOT done: it needs a filed gominimal/minimal issue and an edit to the PR body. I have no credential for either. A person must file the issue for the VM or e2e leg, in which a real |
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @agent-137 closed the last one. The review of 4bc4644ebcb7 withheld this approval on the threads open then. Posted as a comment, as the review itself was; the check and the label carry it.
…il-complete-box-at-its-timeout-execs-i # Conflicts: # crates/minimal/src/tests.rs
There was a problem hiding this comment.
arch-review: PASS · the full ruling
This head adds one merge of main to the head that got a PASS. The merge does not change the timeout ending, the record, the exited event or the 124 line in min task run. The one conflict, in crates/minimal/src/tests.rs, keeps both sides, and the BOX-037 tests did not change. Line 499 of architecture.md still decides the ending, and the change conforms to it. The real-exec e2e leg stays open as #3160.
Ruled at 83fe3b4 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
A merge of main before round 3, not counted against the cap (1 of 3), pushed as Resolved conflicts in:
Verify Converted to a draft: something above needs a person before review. A task past its timeout ends exited with reason timeout, and no process of the box (exec or entrypoint) outlives it. min task run prints why on stderr and exits 124. The branch now merges cleanly with main and keeps this behaviour. Notes from the agent: This round resolves the merge conflict in crates/minimal/src/tests.rs. The conflict came from two sets of tests at the same place in the file. I kept both: this task's two BOX-037 tests, and main's BCLI-006 disk tests (show_and_prune_dry_run_report_disk and show_and_prune_dry_run_report_disk_unit_boundaries). The merge commit is 83fe3b4. The other files in the merge come from main. cargo-nextest is not installed on this box. Because of that, I ran each test line with cargo test -p --lib and the same test names, and all seven passed. |
|
/revise Merge #3087 (BCLI T7) merged and changed In |
…il-complete-box-at-its-timeout-execs-i
RunEntry carries the entry name in entry since #3087, not task.
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The compare is one clean merge of main and two small commits in crates/minimal/src/task.rs. The timeout line now uses args.entry, because #3087 renamed the field. min box run shares run_entry, so it prints the line too. Exit codes line 370 and line 377 give 124 to both verbs, so this conforms. The PASS on 83fe3b4f holds for the rest.
Ruled at 84a1c24 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
Round 3 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. A task past its timeout ends exited with reason timeout, no process of the box (exec or entrypoint) outlives it, and min task run prints why on stderr and exits 124. The branch now builds against main after the RunEntry change from #3087. Notes from the agent: The merge of main was already on the branch (0d34ee8). This round changes one line: timeout_line now takes &args.entry in place of &args.task, as the directive asked, plus a rustfmt line wrap in a second commit. cargo clippy -p minimal --all-targets is clean. cargo-nextest is not installed on this box, so I ran each test line with cargo test and the same filter. The exits are from those runs. A wider cargo test -p minimal task_run_ run also hit exec_run_attach_and_task_run_share_the_commands_trace in tests/otel_cli.rs. That test fails here because the |
T66 — End an until-complete box at its timeout, execs included, and say so from min task run
slice: S4
kind: task
covers: BOX-037
size: M
est: 160 code, 280 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: daemon log names the box, its timeout and the signals the timeout sent; min task run says the task ran past its timeout
observability: exited event carries reason timeout and no exit_code; box.timeout span records the signals and the ending
layers:
- daemon:
- crates/minimald/src/box_actor/host.rs: arm the deadline at each entrypoint start; timeout ending over stop_box_processes and STOP_GRACE, record exited timeout, exited event
- crates/minimald/src/box_actor.rs: deadline arm in mainloop, end_on_timeout, disarm on stop, destroy and entrypoint return
- crates/minimald/src/box_actor/tests.rs: tests
test: cargo nextest run -p minimald until_complete_timeout_terms_then_kills_box_and_execs_reason_timeout
test: cargo nextest run -p minimald until_stopped_box_runs_past_its_timeout
test: cargo nextest run -p minimald until_complete_timeout_task_run_exits_124
test: cargo nextest run -p minimald stop_before_timeout_records_stopped_not_timeout
test: cargo nextest run -p minimald resumed_box_gets_its_full_timeout_again
- cli:
- crates/minimal/src/task.rs: on exit 124 with the record exited timeout, print the timeout line on stderr before the kept-box line
- crates/minimal/src/tests.rs: tests
test: cargo nextest run -p minimal task_run_timeout_prints_why_and_exits_124
test: cargo nextest run -p minimal task_run_own_exit_124_prints_no_timeout_line
- docs:
- docs/reference/minimal-dot-toml.md: timeout key under [session] and [tasks.*], its forms and its ending
produces: none
consumes:
- crates/mfile/src/spec.rs
proof: A task past its timeout ends exited with reason timeout, no process of the box, exec or entrypoint, outlives it, and min task run says why and exits 124.
depends on:
- blocked by #2415
- blocked by #3110
Proof
An until_complete box (a task box or a session box) whose spec sets a timeout now ends when it runs past that timeout. Every process in the box gets SIGTERM, and after STOP_GRACE every process that still runs gets SIGKILL. The record ends exited with reason timeout and no exit code, and the exited event says the same. min task run exits 124 and prints 'Task ran past its timeout of , and its processes were ended. The run exits with code 124.' on stderr before the kept-box line. A stop before the timeout records stopped, and a resumed box gets its full timeout again.
Notes from the agent: The five daemon tests and the two CLI tests were run as one nextest call for the daemon and two calls for the CLI. All passed. I also ran the related existing minimald tests (filters until_complete, stop_, task_run): 57 passed. This was a check of the refactor that moved the exited-record write and its retry into write_exited_record and write_exited_event, which end_on_entrypoint_return now calls. The retry log messages now say 'the box ended' and not 'the entrypoint returned'. No test pinned the old text.
Execs in the test: the mock launcher runs an exec as a direct child of the daemon, outside the box's process tree. So until_complete_timeout_terms_then_kills_box_and_execs_reason_timeout uses a TERM-ignoring child process that the entrypoint starts as the stand-in for a running exec. In a real box an exec joins the box's PID namespace, and BoxProcesses (Namespace scope) signals it. The daemon-path proof that a real exec dies needs the VM or e2e lane.
The timeout ending reuses stop_box_processes with STOP_GRACE. A #[cfg(test)] timeout_grace_seam in box_actor.rs lets the tests shorten the grace. If the exited record cannot be written after its retries, the processes are gone and the actor keeps hosting the box, as a failed stop does. A later min box stop then records it stopped.
A message other than stop or destroy that arrives after the deadline ends the bo…[truncated]
Tests
cargo nextest run -p minimald until_complete_timeout_terms_then_kills_box_and_execs_reason_timeoutcargo nextest run -p minimald until_stopped_box_runs_past_its_timeoutcargo nextest run -p minimald until_complete_timeout_task_run_exits_124cargo nextest run -p minimald stop_before_timeout_records_stopped_not_timeoutcargo nextest run -p minimald resumed_box_gets_its_full_timeout_againcargo nextest run -p minimal task_run_timeout_prints_why_and_exits_124cargo nextest run -p minimal task_run_own_exit_124_prints_no_timeout_lineVerify
min task run agent-verifyexited 101 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.Base
The base branch moved while the coder worked; it was merged in before the tests ran.
Residuals
min box exec: test(e2e): a box's timeout ends a real min box exec, end to end #3160 (arch C3, arch_rulings 1062).Closes #3114