Repository navigation
T7 — Run an entry with its stdio and its exit code - #3087
Conversation
min task run and min box run now share one run path. It creates a fresh instance of the entry's box, passes this command's stdin, stdout and stderr through, and exits with the entrypoint's code. --detach closes the box's stdin, prints only the box id and returns. An entry with a terminal is refused with exit 2 before anything is created, with a hint naming min box start --new. The hidden min run that only errored is removed.
The run path's create stays in run_entry, so the create-site and version round-trip inventories read it there. The stand-in entrypoint the run tests use is listed as an ungated test connection.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Reviewed: 1 finding, none blocking at Address the comments on the diff. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The shared run path conforms to architecture line 493 for stdio, exit code, fresh instance and the pty_enabled refusal. The new --detach refusal for an interactive task exits 1. Line 363 makes a usage refusal exit 2. C1 fixes this. The hint names min box start --new, and that verb does not exist on this branch. No issue owns it. C2 names that issue in the PR body.
Ruled at fee74b7 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
A failure to close stdin or the channel after the entrypoint starts no longer hides the id of a running box. Those failures are now logged.
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The run path conforms to architecture.md line 493 and line 334. The detach reorder in this push keeps stdin closed from the start of the box. One item stays open. The exit-2 hint names min box start --new, as line 493 requires, but that verb does not exist on this head. No issue in the PR body owns it, or the start --new half of BCLI-070. Add that residual with its issue and its flip condition, as C1 says. Do not change the hint text.
Ruled at 6731f1b against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
Notes from the agent: Revise round 1: detach_run writes the id first. A failure of channel.eof() or channel.close() after that goes to a tracing warning and is not fatal. A failure to write the id itself still returns an error, because stdout is then not writable and no id can reach the user. cargo clippy -p minimal --all-targets reported no warnings. |
|
/revise Head 1. The session e2e pins the old hidden Both jobs fail at the same line: This PR removes the hidden Logs: https://github.com/gominimal/minimal/actions/runs/42153074447/job/127680745933 and https://github.com/gominimal/minimal/actions/runs/42153074442/job/127683294276 2. arch C1 (ruling on Keep the 3. Thread PRRT_kwDOPdfcxM60XFjE:
Threads PRRT_kwDOPdfcxM60W6WN (id printed before the fallible channel calls) and PRRT_kwDOPdfcxM60W8yA (exit 2 through |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 5 unresolved threads — minimal-foundry[bot] crates/minimal/src/task.rs:1210, minimal-arch[bot] crates/minimal/src/task.rs:836, minimal-arch[bot] crates/minimal/src/task.rs:170, minimal-arch[bot] crates/minimal/src/task.rs:170, minimal-foundry[bot] crates/minimal/src/task.rs:957. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The shared run path conforms to line 493: stdio passes through, stdout carries only the payload, and the exit code propagates. Two items remain. C1: run_entry refuses --detach on an interactive task with a plain error, so the command exits 1. Line 363 makes that refusal exit 2, as #2999 ruled. C2: the start --new half of BCLI-070 is not built, and the hint names a verb that does not exist yet. File it as a residual with an issue in the PR body.
Ruled at d26c81f against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
Round 2 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
Notes from the agent: Item 1: scripts/session-e2e.sh is outside the task's layers. The directive asked for this change. The block now checks that |
|
/revise Head 1. arch C1:
2. arch C2: the PR body has no residual that links the Note 2 in the body says the verb is missing but names no issue. Add a residual line that links #2898 (T10). T10 lands 3. PR body: say why The runtime drafted the PR because that file is outside the task's |
The refusal was a plain bail, so the command exited 1. A usage refusal exits 2. RunDetachRefusal keeps the text, and failure_exit_code maps it beside RunNeedsTerminal. Tests pin exit 2 for both run verbs, and that the refused runs create no box.
|
Round 3 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
Notes from the agent: Directive item 1 is done. The new typed refusal task::RunDetachRefusal (EXIT_CODE = 2) replaces the bail! in run_entry and keeps the present text. failure_exit_code in main.rs maps it beside RunNeedsTerminal. Two new tests pin it. tests.rs run_detach_prints_id_closes_stdin_refuses_interactive_task runs both verbs against the in-process minimald, checks the refusal type and text, and checks that ListSessions is empty. main.rs run_detach_prints_id_closes_stdin_refusal_exits_2 pins exit 2 and the stderr text through failure_exit_code and answer_failure. Both names fall under the run_detach_prints_id_closes_stdin test line. Directive items 2 and 3 are PR body changes. I cannot edit the PR body, so the runner must add these lines. (2) Residual: #2898 (T10) lands |
|
Marked ready by the BCLI babysitter, with the owner's approval. The runtime drafted this PR because |
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 8 unresolved threads — minimal-foundry[bot] crates/minimal/src/task.rs:1241, minimal-arch[bot] crates/minimal/src/task.rs:872, minimal-arch[bot] crates/minimal/src/task.rs:170, minimal-arch[bot] crates/minimal/src/task.rs:170, minimal-foundry[bot] crates/minimal/src/task.rs:988, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The change conforms to architecture.md line 493 and the exit-code table. The compare makes --detach on an interactive task a usage refusal with exit 2, as line 363 requires. One item is open. BCLI-070's min box start --new half is not in this change, and the terminal-entry hint names that verb before it exists. Name the issue that owns it in the PR body, as C1 says.
Ruled at 1a7c588 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
/revise Head 1. arch C1: the The rendered body cuts "Notes from the agent" off after note 3, so arch cannot see a residual that comes later. Put the residual first, as note 1, or in its own short section before the notes. It must say:
In the same place, add one line: 2. Reply on each open thread with the commit that answers it. minimal-review holds its approval until the threads are closed. Reply on each one, and do not change code for any of them:
|
|
Round 4 of 10 on a /revise note: the coder changed nothing. RESIDUAL (arch C1). Round 4 changes no code and adds no commit, as the /revise note asks. The six test lines pass at head 1a7c588. Commits that answer the earlier threads (their verdicts do not change, so the runtime does not post them again): |
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 1a7c588bfe79 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
|
/revise Head 1.
2. The trace id of a Logs: https://github.com/gominimal/minimal/actions/runs/42445269528/job/128622789477 |
…ry-with-its-stdio-and-its-exit-code
mfile now refuses a task that sets interactive = true when it loads the project's minimal.toml (BOX-054), so run_entry never sees an interactive task. RunDetachRefusal, its exit-code mapping and its two tests go. RunNeedsTerminal still refuses an entry with a terminal.
…ry-with-its-stdio-and-its-exit-code
|
Round 5 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review.
Notes from the agent: Revise round 5. Merged the new origin/main (#2962, #3141) in a merge commit. The merge was clean. Item 1: current main refuses an interactive task when it loads the project's minimal.toml (BOX-054, mfile TaskCheck::Refuse in from_dir_recursive), so run_entry never gets an interactive task. I removed RunDetachRefusal, the |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The compare removes the --detach refusal for an interactive task. This removal conforms to the design. The project load already refuses a task with interactive = true (BOX-054), so the refusal never ran. Line 39 makes a task non-interactive, and line 493 gives --detach no refusal of its own. The two merges of main do not change the PR's own lines. C1 stays open as residual #2898, because min box start --new does not exist yet.
Ruled at c2a0536 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.
|
Round 6 of 10 on the runtime's review findings: the coder changed nothing. Revise round 6: no code change. The one thread is invalid. A daemon-level test for the case already exists. minimald's EntrypointProcess::start_kill (crates/minimald/src/exec/process.rs) releases the run and keeps the box running when the client leaves (BOX-015). daemon_never_stops_for_idle_or_client_loss_of_a_task_run in crates/minimald/src/box_actor/tests.rs proves it against a real TestServer. It starts a task box run, drops the client's channel and connection, and asserts that the host is alive, that the entrypoint launched once and that the record is Running. I ran it on this branch and it passed. Also, a new minimald test is outside this task's layers. cargo-nextest is not installed on this box, so I used cargo test. I did not re-run this task's test: lines, because this round changes no file. Review threads the coder judged:
|
agent-137
left a comment
There was a problem hiding this comment.
Babysitter review at c2a05360. No blocking findings. The approval is left to the owner, because agent-137 wrote this PR's /revise directives.
Since the approved f344fd20 (the merge queue removed it at 04:16Z for two test failures against main):
mainmerged in.RunDetachRefusaland its test are gone (84226bc).mainnow refuses an interactive task when it readsminimal.toml(BOX-054), so no declared task can reach that refusal.RunNeedsTerminal(exit 2) still refuses an entry with a terminal, before anything is created.otel_cli exec_run_attach_and_task_run_share_the_commands_tracepasses on this head: every CI lane is green.- The thread on a daemon-level
--detachtest was disputed correctly.minimald'sdaemon_never_stops_for_idle_or_client_loss_of_a_task_runstarts a task box run on a realTestServerand drops the client. - Arch's only condition is the
start --newresidual linked to #2898. I commented the test it asks for on #2898.
RunEntry carries the entry name in entry since #3087, not task.
Resolves crates/minimal/src/task.rs: main renamed the task-run argument to `entry` (T7, #3087) while this branch moved the task-env gate into `gate_task_env`; the gate is now called with `args.entry`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ay so from min task run (gominimal#3154) * feat(minimald): end an until-complete box at its timeout 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. * feat(minimal): say when min task run ended at the task's timeout 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). * docs(reference): describe the timeout key and how a box ends at it 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. * fix(minimald): keep a timeout's ending when its record is not saved 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. * fix(minimal): name the entry in the task timeout line RunEntry carries the entry name in entry since gominimal#3087, not task. * style(minimal): rustfmt the timeout line call --------- Co-authored-by: minimal-foundry[bot] <327719912+minimal-foundry[bot]@users.noreply.github.com>
T7 — Run an entry with its stdio and its exit code
slice: S2
kind: task
covers: BCLI-010, BCLI-011, BCLI-035, BCLI-070
size: L
est: 300 code, 360 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: when the entry has a terminal,
min box runprints " runs with a terminal. Start it with min box start --new ." on stderr and exits 2 before it creates anything, pinned by run_pty_entry_exit2_hints_start_newobservability: the command's existing tracing span records the verb, the box id it resolved and the outcome
layers:
- client:
- crates/minimal/src/cli.rs: the verb's arguments and help in the one command model
- crates/minimal/src/cmd/mod.rs: dispatches the verb
- crates/minimal/src/task.rs:
min task runandmin box runshare one run path that wires stdio and returns the entrypoint's code- crates/minimal/src/cmd/boxes/create.rs: requests a fresh instance for every run
- crates/minimal/src/main.rs: removes the hidden
min runthat only errored- crates/minimal/src/tests.rs: the in-process minimald test harness gains this layer's tests
test: cargo nextest run -p minimal run_entry_wires_stdio_and_exit_code
test: cargo nextest run -p minimal run_detach_prints_id_closes_stdin
test: cargo nextest run -p minimal run_pty_entry_exit2_hints_start_new
test: cargo nextest run -p minimal task_run_provided_hidden_run_removed
test: cargo nextest run -p minimal run_style_propagates_entrypoint_exit
test: cargo nextest run -p minimal run_and_start_new_request_fresh_instance
produces: none
consumes: none
proof:
min task runandmin box runpass stdin and stdout through, print nothing else, and exit with the entrypoint's code.depends on:
- blocked by #2405
- blocked by #3048
Residuals
min box start --newandmin session start --new(BCLI-026 and thestart --newhalf of BCLI-070) are not in this PR. T10 — Start a box from its entry #2898 (T10) lands them. Until T10 — Start a box from its entry #2898 merges, theRunNeedsTerminalhint names a command the user cannot run yet. The hint becomes runnable when T10 — Start a box from its entry #2898 merges. Its text stays as architecture line 493 fixes it.scripts/session-e2e.shis outside T7'slayers:. This PR changes it because its "Muscle-memory catch" block asserted the hiddenmin runthat BCLI-011 removes. The owner accepted the change.Proof
min task run <task>and the newmin box run <entry>go through one run path. Each creates a fresh instance of the box. It passes this command's stdin to the entrypoint, also from a terminal. Stdout carries only the entrypoint's stdout, and the command exits with the entrypoint's code. With--detach, the box's stdin is closed, stdout carries only the box id, and the command returns.min box run defaultandmin task run default(an entry with a terminal) exit 2 with "default runs with a terminal. Start it with min box start --new default." before anything is created.min runis no longer a command.Notes from the agent: 1. The daemon half of a run was not tested from minimal. The in-process minimald (minimald::test_harness::TestServer) uses the real launcher, and that launcher fails with "no such package: base". The mock launcher is cfg(test)-only inside minimald. So run_entry_wires_stdio_and_exit_code, run_detach_prints_id_closes_stdin and run_style_propagates_entrypoint_exit test the client half (bridge_channel, detach_run, exit_outcome) against a small russh server in tests.rs that stands in for the entrypoint. minimald's T43 tests (until_complete_ends_on_entrypoint_return_without_client_*) already cover the daemon half. The detached run depends on T43's behaviour that a run whose client leaves keeps its entrypoint running. No real-daemon test proves this for --detach yet.
2. The fixed hint names
min box start --new <entry>, and that command does not exist on this branch. Nomin box startexists, andmin session starthas no--new. I shipped the wording as the task gives it. It fails the printed-text rule "an instruction names a command the person can run as written" until that verb lands. For the same reason, BCLI-070's start --new half is not implemented here. run_and_start_new_request_fresh_instance covers only the two run verbs.3. The stdin behaviour changed. A terminal stdin is now passed through (BCLI-010). Before, the run ha…[truncated]
Tests
cargo nextest run -p minimal run_entry_wires_stdio_and_exit_codecargo nextest run -p minimal run_detach_prints_id_closes_stdincargo nextest run -p minimal run_pty_entry_exit2_hints_start_newcargo nextest run -p minimal task_run_provided_hidden_run_removedcargo nextest run -p minimal run_style_propagates_entrypoint_exitcargo nextest run -p minimal run_and_start_new_request_fresh_instanceVerify
min task run agent-verifyexited 100 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.Closes #2892