Skip to content

T7 — Run an entry with its stdio and its exit code - #3087

Merged
agent-137 merged 10 commits into
mainfrom
agent/2892-run-an-entry-with-its-stdio-and-its-exit-code
Nov 9, 2026
Merged

agent-137 merged 10 commits into
mainfrom
agent/2892-run-an-entry-with-its-stdio-and-its-exit-code

Conversation

@minimal-foundry

@minimal-foundry minimal-foundry Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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 run prints " 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_new
observability: 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 run and min box run share 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 run that 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 run and min box run pass 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 --new and min session start --new (BCLI-026 and the start --new half 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, the RunNeedsTerminal hint 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.sh is outside T7's layers:. This PR changes it because its "Muscle-memory catch" block asserted the hidden min run that BCLI-011 removes. The owner accepted the change.

Proof

min task run <task> and the new min 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 default and min 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 run is 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. No min box start exists, and min session start has 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

line exit tail
cargo nextest run -p minimal run_entry_wires_stdio_and_exit_code 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-7ad1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal run_detach_prints_id_closes_stdin 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-120d... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_pty_entry_exit2_hints_start_new 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-720d... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal task_run_provided_hidden_run_removed 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-6d8d... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_style_propagates_entrypoint_exit 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-8c40... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_and_start_new_request_fresh_instance 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-4566... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify

min task run agent-verify exited 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.

lds: {
                "parent_span_id": "e8e051187743ea77",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "ebb53237ef601edd",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "ebb53237ef601edd",
                "queued_behind": "0",
                "span_id": "639c7f7638abb461",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "e8e051187743ea77",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "fa596bdeb022a918",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "fa596bdeb022a918",
                "queued_behind": "0",
                "span_id": "ff72acfc36399bbe",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "fa596bdeb022a918",
                "queued_behind": "0",
                "span_id": "f01d2a6546e4a077",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "f01d2a6546e4a077",
                "span_id": "6ff7ddad8436b75a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "f01d2a6546e4a077",
                "queued_behind": "0",
                "span_id": "cc16ff99b5ee64fe",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  61.916s] 945 tests run: 944 passed, 1 failed, 1 skipped
        FAIL [   3.279s] (945/945) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Closes #2892

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.
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8f644d9c-4056-466b-8b28-3ce328fbd414

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-foundry

minimal-foundry Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: 1 finding, none blocking at c2a05360fe68.

Address the comments on the diff.

Clobber: none seen.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimal/src/task.rs Resolved

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/minimal/src/task.rs Resolved
Comment thread crates/minimal/src/task.rs Resolved
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.

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/minimal/src/task.rs Resolved

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimal/src/task.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 6731f1b9cbfe.

line exit tail
cargo nextest run -p minimal run_entry_wires_stdio_and_exit_code 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-b32f... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal run_detach_prints_id_closes_stdin 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-e75e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_pty_entry_exit2_hints_start_new 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-0e80... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal task_run_provided_hidden_run_removed 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-f2d5... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_style_propagates_entrypoint_exit 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-f02a... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_and_start_new_request_fresh_instance 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-974f... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify exited 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.

lds: {
                "parent_span_id": "c6aa4caa6e710293",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "5bc525ae83c4dfb7",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "5bc525ae83c4dfb7",
                "queued_behind": "0",
                "span_id": "b796b9a3a71878db",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "c6aa4caa6e710293",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "483546292281f9f4",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "483546292281f9f4",
                "queued_behind": "0",
                "span_id": "6d1132d798434278",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "483546292281f9f4",
                "queued_behind": "0",
                "span_id": "4033f627ce8e2979",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "4033f627ce8e2979",
                "span_id": "0d6e28954b2b4add",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "4033f627ce8e2979",
                "queued_behind": "0",
                "span_id": "e73d67610a314436",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  70.194s] 945 tests run: 944 passed, 1 failed, 1 skipped
        FAIL [   3.348s] (945/945) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/task.rs:1207: detach_run now prints the box id before it closes stdin and the channel. A failure of those two calls is logged as a warning and no longer fails the command.

min task run and min box run pass stdin and stdout through, print nothing else, and exit with the entrypoint's code. With --detach, the box id now prints before the client closes the channel, so a later channel failure cannot hide the id of a running box.

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.

@agent-137

Copy link
Copy Markdown
Member

/revise

Head 6731f1b9. Three items. Both required lane aggregators are red on item 1 alone.

1. The session e2e pins the old hidden min run error (red lanes: native-daemon-e2e → ci-linux-native-success, e2e → ci-macos-success).

Both jobs fail at the same line:

##[error]hidden 'min run' error does not name 'min task run'
error: unrecognized subcommand 'run'

This PR removes the hidden min run, as BCLI-011 requires ("remove the previous hidden min run that only errored"), and task_run_provided_hidden_run_removed pins that. The e2e block at scripts/session-e2e.sh:6316-6325 ("Muscle-memory catch") still asserts the removed behaviour: it expects min run e2e-echo to fail with an error that names min task run. Change that block in this PR to assert the new behaviour: min run e2e-echo fails, and its error says run is not a subcommand. Do not bring the hidden subcommand back.

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 6731f1b9; threads PRRT_kwDOPdfcxM60W8yD and PRRT_kwDOPdfcxM60XFhA).

Keep the RunNeedsTerminal hint text as it is: line 493 fixes the verb it names. Add a residual line to the PR body. It must link #2898 (T10, which lands min box start --new: BCLI-026 and the start --new half of BCLI-070) and state the interim and its flip condition: until #2898 merges, the hint names a command the user cannot run yet. The hint becomes runnable when #2898 merges. No new issue is needed.

3. Thread PRRT_kwDOPdfcxM60XFjE: min box run records its box as a task box.

run_entry (crates/minimal/src/task.rs:954) sets creating_verb = CreatingVerb::Task for both verbs, so the daemon resolves TASK_BOX_TYPE for a min box run too. Check what spec 29 and the architecture say about the Box Type of a box that min box run creates. If it must not be task, set the creating verb from args.verb (add the variant). If task is correct, answer the thread with the requirement that makes it so.

Threads PRRT_kwDOPdfcxM60W6WN (id printed before the fallible channel calls) and PRRT_kwDOPdfcxM60W8yA (exit 2 through RunNeedsTerminal::EXIT_CODE) are answered by 6731f1b9. Reply on each with the commit that answers it.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/minimal/src/task.rs Resolved
Comment thread crates/minimal/src/main.rs Resolved
Comment thread crates/minimal/src/task.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note, pushed as d26c81f1257a.

line exit tail
cargo nextest run -p minimal run_entry_wires_stdio_and_exit_code 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-58e8... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal run_detach_prints_id_closes_stdin 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-899a... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_pty_entry_exit2_hints_start_new 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-ed20... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal task_run_provided_hidden_run_removed 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-bf92... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_style_propagates_entrypoint_exit 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-f444... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_and_start_new_request_fresh_instance 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-af7e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify exited 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.

lds: {
                "parent_span_id": "a633ea2ed8c302f4",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "4a80076ff1e78660",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "4a80076ff1e78660",
                "queued_behind": "0",
                "span_id": "b933f91b31c6919c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "a633ea2ed8c302f4",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "14eea2ec851283aa",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "14eea2ec851283aa",
                "queued_behind": "0",
                "span_id": "9eee663d44de5817",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "14eea2ec851283aa",
                "queued_behind": "0",
                "span_id": "78c24a4ec888e497",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "78c24a4ec888e497",
                "span_id": "43a3e3745512c770",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "78c24a4ec888e497",
                "queued_behind": "0",
                "span_id": "d9ccdd0db389970a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  76.283s] 945 tests run: 944 passed, 1 failed, 1 skipped
        FAIL [   4.941s] (945/945) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Outside the task's layers::

  • scripts/session-e2e.sh

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/task.rs:836: Commit 6731f1b answers this. The refusal is now the typed RunNeedsTerminal with EXIT_CODE = 2, and failure_exit_code in main.rs maps it. run_pty_entry_exit2_hints_start_new pins exit 2.
  • 👍 valid — crates/minimal/src/task.rs:170: The hint text stays as line 493 requires. The PR body gets a residual line that links T10 — Start a box from its entry #2898, which lands min box start --new. Until T10 — Start a box from its entry #2898 merges, the hint names a command that the user cannot run yet.
  • 👍 valid — crates/minimal/src/task.rs:170: The text is unchanged. The PR body gets a residual line that links T10 — Start a box from its entry #2898 (T10). The line gives the flip condition: the hint becomes runnable when T10 — Start a box from its entry #2898 merges.
  • 👎 invalid — crates/minimal/src/task.rs:957: task is correct. BOX-001 records the type that the expanded spec names. Both verbs resolve the entry with declared_task and send task_box_spec (BoxSpec::for_task), which names TASK_BOX_TYPE. So a min box run box is a task box. I corrected only the comment above creating_verb, to cite BOX-001 and say

min task run and min box run pass stdin and stdout through, print nothing else, and exit with the entrypoint's code. The session e2e now expects min run e2e-echo to fail as an unrecognized subcommand, so the e2e lanes no longer test the hidden min run that this PR removes.

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 min run e2e-echo fails and that stderr has "unrecognized subcommand 'run'". I checked only the syntax (bash -n). The e2e lanes did not run on this box. Item 2: I cannot edit the PR body. Please add this residual line to it: "Residual: the min task run / min box run refusal for an entry that needs a terminal names min box start --new <entry>. That verb lands in #2898 (T10: BCLI-026 and the start --new half of BCLI-070). Until #2898 merges, the hint names a command that the user cannot run yet. The hint becomes runnable when #2898 merges." Item 3: task is correct. See the thread verdict. I changed only the comment above creating_verb. Test lines: I ran all six test names in one cargo nextest run -p minimal command, not as six separate commands. All six passed.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 6, 2026 03:53
@agent-137

Copy link
Copy Markdown
Member

/revise

Head d26c81f1. The e2e change worked: native-daemon-e2e is green. arch-review (ruling 1006 on d26c81f1) has two conditions left.

1. arch C1: --detach on an interactive task is a usage refusal, exit 2.

crates/minimal/src/task.rs run_entry() refuses args.detach && declared.interactive with a plain bail!, so the command exits 1. Architecture line 363 makes a usage refusal exit 2 (the same rule as #2999 C1). Replace the bail! with a typed refusal, for example RunDetachRefusal { entry, verb } with EXIT_CODE: u8 = 2, and keep the present text. Map it in crates/minimal/src/main.rs failure_exit_code() beside RunNeedsTerminal. Add a test that pins exit 2 for min task run <interactive-task> --detach and min box run <interactive-task> --detach, and that nothing is created.

2. arch C2: the PR body has no residual that links the start --new owner.

Note 2 in the body says the verb is missing but names no issue. Add a residual line that links #2898 (T10). T10 lands min box start --new and min session start --new (BCLI-026 and the start --new half of BCLI-070). State the interim and the flip condition: until #2898 merges, the RunNeedsTerminal hint names a command the user cannot run. It becomes runnable when #2898 merges. Keep the hint text.

3. PR body: say why scripts/session-e2e.sh changed.

The runtime drafted the PR because that file is outside the task's layers:. Add one line to the body: the e2e "Muscle-memory catch" block asserted the hidden min run that BCLI-011 removes, so this PR must change it. Do not touch other files outside layers:.

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.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as 1a7c588bfe79.

line exit tail
cargo nextest run -p minimal run_entry_wires_stdio_and_exit_code 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-e251... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal run_detach_prints_id_closes_stdin 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-09ba... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_pty_entry_exit2_hints_start_new 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-1a1c... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal task_run_provided_hidden_run_removed 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-a6c9... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_style_propagates_entrypoint_exit 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-2835... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal run_and_start_new_request_fresh_instance 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-aaf6... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.

Verify min task run agent-verify exited 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.

lds: {
                "parent_span_id": "1675520e5574e09d",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "499040ceba507627",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "499040ceba507627",
                "queued_behind": "0",
                "span_id": "1cc3d8e82f8a782c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "1675520e5574e09d",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "ea335c5e3cdb40b9",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "ea335c5e3cdb40b9",
                "queued_behind": "0",
                "span_id": "b283369a6e014ddf",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "ea335c5e3cdb40b9",
                "queued_behind": "0",
                "span_id": "7cd7d66d1644e7e2",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "7cd7d66d1644e7e2",
                "span_id": "cb56018f6957687d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "7cd7d66d1644e7e2",
                "queued_behind": "0",
                "span_id": "908faa3fb5ed8fc1",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  58.873s] 947 tests run: 946 passed, 1 failed, 1 skipped
        FAIL [   2.975s] (947/947) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Outside the task's layers::

  • scripts/session-e2e.sh

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/task.rs:872: run_entry now returns the typed task::RunDetachRefusal (EXIT_CODE = 2) in place of the bail!, with the same text. A test pins it for both run verbs and checks that no box is created.
  • 👍 valid — crates/minimal/src/main.rs:261: failure_exit_code maps RunDetachRefusal to exit 2 beside RunNeedsTerminal. run_detach_prints_id_closes_stdin_refusal_exits_2 pins the code and the stderr text.
  • 👍 valid — crates/minimal/src/task.rs:170: The hint text stays. The PR body needs a residual that links T10 — Start a box from its entry #2898 (T10), which lands min box start --new. The hint becomes runnable when T10 — Start a box from its entry #2898 merges. I cannot edit the body, so result.json notes carries the line.

min task run and min box run pass stdin and stdout through, print nothing else, and exit with the entrypoint's code. min task run <interactive-task> --detach and min box run <interactive-task> --detach now exit 2 with the same refusal text, and create no box.

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 min box start --new and min session start --new (BCLI-026 and the start --new half of BCLI-070). Until #2898 merges, the RunNeedsTerminal hint names a command the user cannot run. The command becomes runnable when #2898 merges. The hint text stays. (3) scripts/session-e2e.sh changed because its "Muscle-memory catch" block asserted the hidden min run that BCLI-011 removes, so this PR must change it. clippy -p minimal --all-targets is clean. I did not run just clippy-strict.

@agent-137
agent-137 marked this pull request as ready for review November 6, 2026 05:45
@agent-137

Copy link
Copy Markdown
Member

Marked ready by the BCLI babysitter, with the owner's approval. The runtime drafted this PR because scripts/session-e2e.sh is outside T7's layers:. That edit is required: BCLI-011 removes the hidden min run, and the e2e "Muscle-memory catch" block still asserted it. The owner accepted the edit. arch-review and minimal-review do not run on a draft, so the draft also held this head's reviews. Merging still waits for every gate on the current head.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/minimal/src/task.rs Resolved
@agent-137

Copy link
Copy Markdown
Member

/revise

Head 1a7c588b. The code is done: arch-review rules PASS_WITH_CONDITIONS, and minimal-review has 0 findings. Do not change any code. Two bookkeeping items remain.

1. arch C1: the start --new residual must be visible in the PR body.

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: scripts/session-e2e.sh changed because its "Muscle-memory catch" block asserted the hidden min run that BCLI-011 removes.

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:

  • PRRT_kwDOPdfcxM60W6WN (detach_run order): 6731f1b9 prints the id before the fallible channel calls.
  • PRRT_kwDOPdfcxM60W8yA, PRRT_kwDOPdfcxM60XnFI, PRRT_kwDOPdfcxM60XnFP (exit 2): RunNeedsTerminal::EXIT_CODE and RunDetachRefusal::EXIT_CODE (1a7c588b), mapped in failure_exit_code.
  • PRRT_kwDOPdfcxM60W8yD, PRRT_kwDOPdfcxM60XFhA, PRRT_kwDOPdfcxM60XnFT (start --new hint): the residual from item 1 that links T10 — Start a box from its entry #2898.
  • PRRT_kwDOPdfcxM60XFjE (creating_verb for min box run): answer with what round 2 decided, and name the requirement.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on a /revise note: the coder changed nothing. RESIDUAL (arch C1). min box start --new and min session start --new (BCLI-026 and the start --new half of BCLI-070) are not in this PR. #2898 (T10) lands them. Until #2898 merges, the RunNeedsTerminal hint names a command the user cannot run yet. It becomes runnable when #2898 merges. The hint text stays as line 493 fixes it.
scripts/session-e2e.sh changed because its "Muscle-memory catch" block asserted the hidden min run that BCLI-011 removes.

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):

  • PRRT_kwDOPdfcxM60W6WN (detach_run order): 6731f1b prints the id before the fallible channel calls.
  • PRRT_kwDOPdfcxM60W8yA, PRRT_kwDOPdfcxM60XnFI, PRRT_kwDOPdfcxM60XnFP (exit 2): 1a7c588 adds RunNeedsTerminal::EXIT_CODE and RunDetachRefusal::EXIT_CODE, mapped in failure_exit_code.
  • PRR…[truncated]

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@agent-137
agent-137 marked this pull request as ready for review November 7, 2026 00:52
@agent-137
agent-137 added this pull request to the merge queue Nov 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 8, 2026
@agent-137

Copy link
Copy Markdown
Member

/revise

Head f344fd20. The merge queue removed this PR (failed checks, 2026-11-08T04:16Z). Its merge-group run against current main failed CI (Linux native) → tests on two tests. Merge main into the branch first, then fix both.

1. tests::run_detach_prints_id_closes_stdin_refuses_interactive_task (crates/minimal/src/tests.rs:2098).

found a broken minimal.toml while resolving tasks: `[tasks.shell]` in minimal.toml sets `interactive = true`, and a task cannot be interactive. Declare the entry as `[sessions.shell]` instead.

main now refuses an interactive task when it reads the file (#3105, BOX T17, and the entry-table move in #3125). The test's fixture declares one, so it cannot reach run_entry. Re-check what RunDetachRefusal (--detach on an interactive task, exit 2) still covers on current main:

  • If no declared task can be interactive any more, drop that refusal path and its test, and say so in the PR body's Residuals section. RunNeedsTerminal still covers an entry with a terminal (exit 2, hint min box start --new).
  • If some path can still reach it, rebuild the test fixture in a shape that main accepts.

2. otel_cli exec_run_attach_and_task_run_share_the_commands_trace (crates/minimal/tests/otel_cli.rs:750).

left: "0254e67e5d7c0a4c"
right: "b7ad6b7169203331"

The trace id of a min task run no longer matches the command's trace. T7's verify run hit the same failure earlier, and arch noted it. The other two merge groups (#2962, #3141 on the same main) pass this test without #3087, so this PR's shared run path breaks it. Keep run_entry's spans under the command's root trace, as min box exec does, so that the test passes as written. Do not change the test's expectation.

Logs: https://github.com/gominimal/minimal/actions/runs/42445269528/job/128622789477

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.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 5 of 10 on a /revise note, pushed as c2a05360fe68.

line exit tail
cargo nextest run -p minimal run_entry_wires_stdio_and_exit_code 101 warning: unknown fields in [defaults] section of minimal.toml: task,session help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal run_detach_prints_id_closes_stdin 101 warning: unknown fields in [defaults] section of minimal.toml: task,session help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal run_pty_entry_exit2_hints_start_new 101 warning: unknown fields in [defaults] section of minimal.toml: task,session help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal task_run_provided_hidden_run_removed 101 warning: unknown fields in [defaults] section of minimal.toml: session,task help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-3 in box runtime-implement-test-3-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal run_style_propagates_entrypoint_exit 101 warning: unknown fields in [defaults] section of minimal.toml: session,task help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-4 in box runtime-implement-test-4-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal run_and_start_new_request_fresh_instance 101 warning: unknown fields in [defaults] section of minimal.toml: session,task help: do you need to update to a newer version of minimal? Applying loadouts: default Running task runtime-implement-test-5 in box runtime-implement-test-5-1... error: no such command: 'nextest' help: a command with a simil

Verify min task run agent-verify exited 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.

the sandbox ran rustc (1.99.0), the repository pins 1.99.1 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
warning: unknown fields in [defaults] section of minimal.toml: task,session
help: do you need to update to a newer version of minimal?
Applying loadouts: default
Running task runtime-implement-verify in box runtime-implement-verify-1...
    Checking paths v0.0.1 (/workbench/crates/paths)
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking args v0.0.1 (/workbench/crates/args)
    Checking client-config v0.0.1 (/workbench/crates/client-config)
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking mctx v0.0.1 (/workbench/crates/mctx)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Checking minimal v0.8.0 (/workbench/crates/minimal)
    Finished `dev` profile [unoptimized] target(s) in 1m 16s
error: no such command: `nextest`

help: a command with a similar name exists: `test`

help: view all installed commands with `cargo --list`
help: find a package to install `nextest` with `cargo search cargo-nextest`

Outside the task's layers::

  • crates/minimal/src/cmd/boxes/lifecycle.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/boxes/show.rs
  • crates/minimal/src/cmd/project.rs
  • scripts/session-e2e.sh

Converted to a draft: something above needs a person before review.

min task run and min box run share one run path. It passes stdin and stdout through to the entrypoint, prints nothing else, and exits with the entrypoint's code. An entry with a terminal is refused with exit 2 and a hint to use min box start --new.

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 --detach check in run_entry, its exit-code mapping in main.rs, and its two tests (tests.rs run_detach_prints_id_closes_stdin_refuses_interactive_task, main.rs run_detach_prints_id_closes_stdin_refusal_exits_2). RunNeedsTerminal still covers an entry with a terminal. The PR body's Residuals section must say this. I cannot edit the body. Item 2: I did not reproduce the otel_cli failure, and I made no code change for it. With the merged tree, exec_run_attach_and_task_run_share_the_commands_trace passed every run: 3 alone, 5 runs of the whole otel_cli binary, and 3 rounds of 6 concurrent copies. A spool dump of the min task run process shows one cmd span with parent b7ad6b7169203331 (the test's PARENT), and the task_run span and all client.rpc spans sit under that cmd. So run_entry's spans are already under the command's root trace. The CI failure (cmd parent 0254e67e5d7c0a4c, same trace) points to a second cmd span in that verb's spool, from a process that inherited MINIMAL_OTEL_SPOOL_DIR and a TRACEPARENT naming a span of the trace. I found no such child in the min run path: the update-check child is muted and drops TRACEPARENT, and autospawn starts minvmd, not min. The CI log returned 403 here, so I could not see which verb failed. A rerun of CI (Linux native) on this head will show if the failure persists. cargo nextest and util-linux script are not ins…[truncated]

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 8, 2026 05:07

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimal/src/task.rs Resolved
@minimal-foundry minimal-foundry Bot removed the review:approved minimal-review approved the current head label Nov 8, 2026

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/minimal/src/task.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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:

  • 👎 invalid — crates/minimal/src/task.rs:1217: A real-daemon test already proves this. When the client leaves, minimald's EntrypointProcess::start_kill (exec/process.rs) stops only the relay and the box runs on (BOX-015). daemon_never_stops_for_idle_or_client_loss_of_a_task_run (minimald box_actor/tests.rs) starts a task box run on a TestServer

@agent-137
agent-137 marked this pull request as ready for review November 8, 2026 05:45

@agent-137 agent-137 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

  • main merged in.
  • RunDetachRefusal and its test are gone (84226bc). main now refuses an interactive task when it reads minimal.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_trace passes on this head: every CI lane is green.
  • The thread on a daemon-level --detach test was disputed correctly. minimald's daemon_never_stops_for_idle_or_client_loss_of_a_task_run starts a task box run on a real TestServer and drops the client.
  • Arch's only condition is the start --new residual linked to #2898. I commented the test it asks for on #2898.

@mitodrummer mitodrummer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@agent-137
agent-137 added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit a1f3b52 Nov 9, 2026
36 checks passed
@agent-137
agent-137 deleted the agent/2892-run-an-entry-with-its-stdio-and-its-exit-code branch November 9, 2026 16:39
minimal-foundry Bot added a commit that referenced this pull request Nov 9, 2026
RunEntry carries the entry name in entry since #3087, not task.
bryan-minimal added a commit that referenced this pull request Nov 9, 2026
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>
yermakoffivan pushed a commit to yermakoffivan/minimal that referenced this pull request Nov 10, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T7 — Run an entry with its stdio and its exit code

2 participants