Skip to content

T8 — Wait on a box and return its exit code - #3195

Merged
agent-137 merged 12 commits into
mainfrom
agent/2896-wait-on-a-box-and-return-its-exit-code
Nov 10, 2026
Merged

agent-137 merged 12 commits into
mainfrom
agent/2896-wait-on-a-box-and-return-its-exit-code

Conversation

@minimal-foundry

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

Copy link
Copy Markdown
Contributor

T8 — Wait on a box and return its exit code

slice: S2
kind: task
covers: BCLI-013, BCLI-014
size: M
est: 200 code, 240 tests
executor: agent
difficulty: routine
model: standard
diagnostics: when min box wait --timeout runs out, it prints "Stopped waiting after ; is still running." on stderr and exits 124, pinned by box_wait_timeout_flag_returns_124_box_runs_on
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/cmd/boxes/wait.rs (new): min box wait reads the stored exit, 128 plus the signal, 137 for an orphaned stop, and 124 at a timeout
- crates/minimal/src/cmd/boxes.rs: declares the wait module
- crates/minimal/src/main.rs: failure_exit_code maps this verb's refusals to their exit codes
- crates/minimal/src/tests.rs: the in-process minimald test harness gains this layer's tests
test: cargo nextest run -p minimal box_wait_returns_retained_exit_code_or_128_plus_signal
test: cargo nextest run -p minimal box_wait_orphaned_stopped_record_returns_137
test: cargo nextest run -p minimal box_wait_timeout_flag_returns_124_box_runs_on
test: cargo nextest run -p minimal run_verbs_and_wait_timeout_return_124_with_code_timeout
produces:
- crates/minimal/src/cmd/boxes/wait.rs
consumes: none
proof: min box wait returns a box's exit code, and a box ended by its own timeout returns 124 from the run and wait commands.
depends on:
- blocked by #2892

arch#160 closed 2026-11-09 when gominimal/arch#166 merged (9495216). The runtime treats an arch edge as open, so the owner had it removed on 2026-11-09.

Residuals

Proof

min box wait <box> now waits until the box ends and exits with the box's stored exit code. It exits with 128 plus the signal for a box that a signal stopped, and with 137 for a stopped record that has neither. A box that its own timeout ended makes min box wait exit 124 with the machine-mode timeout error. --timeout <d> stops the wait with 124 and the machine-mode wait_timeout error naming the box id, and leaves the box running. min task run and min box run also exit 124 with the machine-mode timeout error when the box's own timeout ends it (task::run_outcome). A run whose entrypoint itself exits 124 keeps TaskExit(124).

Notes (rewritten by the BCLI babysitter for arch ruling 1095 C2, owner rule 2026-11-10; the round-0 notes predated rounds 2–5): BCLI-013 and both halves of BCLI-014 are delivered. The run verbs live in crates/minimal/src/task.rs, outside the task's layers; arch condition C1 of ruling 1088 required the edit. #3154 added ExitEnding::Timeout in minimald, and ended_at_timeout reads it. Printed text: the wait-timeout message is "Stopped waiting after . () has not ended.", and the hint is "Run min box wait <id> to wait again, or min box stop <id> to stop it.". prints as 30s for whole seconds and in milliseconds otherwise. The wait re-reads the record every 250 ms through ShowBox, which carries the stored exit code, signal and reason. run_verbs_and_wait_timeout_return_124_with_code_timeout drives task::run_outcome for both run-verb cases and the wait mapping. cargo-nextest is missing from the runtime's sandbox, so CI runs the tests.

Tests

line exit tail
cargo nextest run -p minimal box_wait_returns_retained_exit_code_or_128_plus_signal 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 box_wait_orphaned_stopped_record_returns_137 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-1 in box runtime-implement-test-1-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal box_wait_timeout_flag_returns_124_box_runs_on 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 run_verbs_and_wait_timeout_return_124_with_code_timeout 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

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: session,task
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 bep v0.0.1 (/workbench/crates/bep)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking switch v0.0.1 (/workbench/crates/switch)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    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 minimal-client v0.8.0 (/workbench/crates/minimal-client)
    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 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 minimal v0.8.0 (/workbench/crates/minimal)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Finished `dev` profile [unoptimized] target(s) in 1m 20s
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`

Closes #2896
Closes #3198

`min box wait <box>` reads the box's record until it ends. It returns
the stored exit code, 128 plus the stored signal, or 137 for a stopped
record with neither. A box that its own timeout ended, and a wait whose
--timeout runs out, end with 124 and the machine-mode `timeout` error.
The --timeout wait leaves the box running.
@coderabbitai

coderabbitai Bot commented Nov 9, 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: f005377c-fd3c-4261-922f-2e89308b4b58

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 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Approved: every review thread resolved at 99bc2661c8a9.

@agent-137 resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@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 — No findings.

Panel: 2 of 3 personas ran (security, supply-chain); did not complete: correctness.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 9, 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: CONDITIONS · 5 conditions · the full ruling

The wait's own --timeout answers machine-mode code = "timeout". Since arch #166, architecture.md lines 370 and 506 give it wait_timeout, naming the box by its id. Make the change in C1 and C2, and amend BCLI-013 in the spec to match in C3. The PR body states the run-verb half of BCLI-014 as undone but names no issue. File it in C4, and file the design's success machine output for min box wait in C5. The exit-code reading conforms to the design.

Ruled at ce37cd1 against gominimal/arch@949521619eea by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/wait.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/wait.rs Resolved
Comment thread crates/minimal/src/main.rs Resolved
Comment thread crates/minimal/src/tests.rs Resolved
Comment thread crates/minimal/src/tests.rs Resolved
@agent-137

Copy link
Copy Markdown
Member

/revise

Head ce37cd1d. Arch ruling 1077 has five conditions. Do C1 and C2 in code, and C3 to C5 in the PR body only.

C1: the wait's own timeout carries code = "wait_timeout".
In crates/minimal/src/cmd/boxes/wait.rs, add a code field to BoxTimedOut: BoxTimedOut::ended sets "timeout" and BoxTimedOut::waited sets "wait_timeout". Replace the BoxTimedOut::CODE const with a code(&self) -> &'static str accessor. In crates/minimal/src/main.rs machine_mode_answer, pass timed_out.code() to MachineModeFailure::new. Both cases keep exit 124 in failure_exit_code. Update the tests:

  • box_wait_timeout_flag_returns_124_box_runs_on asserts "wait_timeout".
  • run_verbs_and_wait_timeout_return_124_with_code_timeout asserts "timeout" for ended and "wait_timeout" for waited.

C2: the wait_timeout error names the box by the id the wait resolved.
In box_wait_on_hosts, pass the resolved id to BoxTimedOut::waited, and put that id in the message and the hint, so a script can stop the box by its id (architecture: "a script stops the box itself, by id"). Pin the new text in box_wait_timeout_flag_returns_124_box_runs_on.

C3: the spec 28 amendment is in #3194. Do not edit the spec here.
PR #3194 already amends BCLI-013 to code = "wait_timeout" naming the box that has not ended, and removes the resolved open question. docs/specs/ is outside this task's layers:. Add a residual line in the PR body: "BCLI-013's wait_timeout text: #3194".

C4 and C5: residuals. Add to the PR body's gaps:

Reply on each arch thread with the commit, or with the issue that answers it.

A box that its own timeout ended keeps code timeout. A min box wait
--timeout that runs out now answers wait_timeout, and its message and
hint name the box by the id the wait resolved. Both keep exit 124.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimal box_wait_returns_retained_exit_code_or_128_plus_signal 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-0 in box runtime-implement-test-0-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal box_wait_orphaned_stopped_record_returns_137 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 box_wait_timeout_flag_returns_124_box_runs_on 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-2 in box runtime-implement-test-2-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal run_verbs_and_wait_timeout_return_124_with_code_timeout 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-3 in box runtime-implement-test-3-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 args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    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 boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking switch v0.0.1 (/workbench/crates/switch)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    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 minimal-client v0.8.0 (/workbench/crates/minimal-client)
    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 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 minimal v0.8.0 (/workbench/crates/minimal)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Finished `dev` profile [unoptimized] target(s) in 1m 21s
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`

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

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/wait.rs: 7343639: replaced BoxTimedOut::CODE with a code field. ended sets "timeout" and waited sets "wait_timeout", read through code().
  • 👍 valid — crates/minimal/src/cmd/boxes/wait.rs: 7343639: box_wait_on_hosts passes the resolved id to waited. The message and the hint name the id, and the hint gives min box stop <id>.
  • 👍 valid — crates/minimal/src/main.rs: 7343639: machine_mode_answer passes timed_out.code(). Both cases keep exit 124 in failure_exit_code.
  • 👍 valid — crates/minimal/src/tests.rs:11434: 7343639: the test asserts "wait_timeout" and pins the message and the hint that name the resolved box id.
  • 👍 valid — crates/minimal/src/tests.rs:11494: The test checks only the shared error and wait_exit. The run-verb proof is in task.rs, outside this task's layers, and it is tracked in BCLI: min task run and min box run end with code = "timeout" when the box's timeout ends it (T8 residual, arch C4) #3198. This round adds the wait_timeout assertion for waited.

min box wait returns a box's exit code. A box that its own timeout ended makes the wait exit 124 with code timeout. A min box wait --timeout that runs out exits 124 with code wait_timeout, and its message and hint name the box by its id.

Notes from the agent: Revise round 1, commit 7343639. C1: BoxTimedOut has a code field and a code() accessor, and the CODE const is gone. machine_mode_answer passes timed_out.code(). C2: box_wait_on_hosts passes the resolved id to BoxTimedOut::waited. The message is now "Stopped waiting after ; () is still running." This adds the id to the diagnostics wording of the task. The hint is "Run min box wait <id> to wait again, or min box stop <id> to stop it." Both are pinned in box_wait_timeout_flag_returns_124_box_runs_on. C3 to C5 are PR-body residuals, and the runner writes the body: BCLI-013's wait_timeout text: #3194. #3198: the run-verb half of BCLI-014 (min task run / min box run ending with code = "timeout") lives in crates/minimal/src/task.rs, outside this task's layers. #3199: min box wait -o json lists how each box ended. cargo-nextest is not installed on this box. I ran each test line as cargo test -p minimal <name>, and every one passed. I did not run just clippy-strict.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 9, 2026 20:29

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

APPROVE withheld: 5 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/wait.rs, minimal-arch[bot] crates/minimal/src/cmd/boxes/wait.rs, minimal-arch[bot] crates/minimal/src/main.rs, minimal-arch[bot] crates/minimal/src/tests.rs:11434, minimal-arch[bot] crates/minimal/src/tests.rs:11494.

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 1 of 3 personas ran (security); did not complete: correctness, supply-chain.

@minimal-foundry minimal-foundry Bot removed the review:approved minimal-review approved the current head label Nov 9, 2026

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

Review on Karl's behalf, at 1f683ec42. This is a comment, not an approval. Nothing was built for it: every point comes from reading the code, and each finding says how it was checked.

  • Head: 1f683ec4. This is revise commit 73436396 (C1/C2 from the agent-137 /revise) plus a main merge. All reviews so far are on the older head ce37cd1d.
  • CI at head: still running when fetched. tests, unit, clippy, artifacts, native-daemon-e2e, minimald-root-integration, zoned and dogfood were IN_PROGRESS. fmt, commitlint, cargo-deny and minimal-check were green. arch-review and minimal-review had not run on this head yet.
  • Existing reviews:
    • minimal-arch: CHANGES_REQUESTED at ce37cd1 with 5 conditions.
    • minimal-review: "no findings", with only 2 of 3 personas run (correctness missing).
    • CodeRabbit: skipped ("Bot user detected"). There is no CodeRabbit review.
    • agent-137: /revise for C1–C5.

Plan task: covers BCLI-013 and BCLI-014.

Requirement check

Req Implemented Test Notes
BCLI-013 main: stored exit_code, or 128+signal yes. wait.rs:83-104 reads exit_code/signal/reason from the record via ShowBox, not from the exited event (the body says so) box_wait_returns_retained_exit_code_or_128_plus_signal (tests.rs) ok
BCLI-013 sub: orphaned stop gives 137 yes box_wait_orphaned_stopped_record_returns_137 ok
BCLI-013 sub: --timeout gives 124 and the box keeps running yes, with code = "wait_timeout" and the box id (C1/C2 done in 7343639) box_wait_timeout_flag_returns_124_box_runs_on, against a harness daemon the code follows arch. The spec is stale (see below)
BCLI-014: a box timeout gives 124 / timeout from task run, box run and wait wait half only. The run verbs are not done (task.rs is outside the layers) run_verbs_and_wait_timeout_return_124_with_code_timeout, in two places (main.rs and tests.rs). Both test the mapping only No minimald code sets EndReason::Timeout yet (BOX-037), so no real box reaches this path. The residual is #3198

Arch #166 vs spec vs PR

  • Arch L370/L506 say a wait that hits its own --timeout returns code = "wait_timeout" and names each box that has not ended. The PR follows this. Spec 28 is out of date:
    • BCLI-013's sub-bullet (spec L123) still says code = "timeout". PR #3194 amends it.
    • The open question at spec L604 (arch#160) is now settled and should be removed. #3194 removes it.
  • Spec gap against arch: arch L485/L506 give min box wait <box>… with several boxes, an all mode (the first non-zero exit by end time) and --any. Machine output lists how each box ended. Spec 28 has only a single <box>, and its non-goals cover only --parent. Running several boxes without --parent is not nesting, so spec 28 has no requirement for it. #3199 covers only the machine output. This is a spec gap, not a PR defect.

Should-fix

  1. PR body: residuals C3–C5 are missing. The body as fetched does not mention #3194, #3198 or #3199, and its notes section ends in "…[truncated]". Without them, BCLI-014's partial delivery has no linked issue. Verified: checked the fetched body for each issue number. Still open from agent-137 /revise (C3–C5), and the runner says it cannot edit the body.
  2. wait.rs:50: the message joins two facts with a semicolon. "Stopped waiting after 30s; web (0190…) is still running." AGENTS.md says "Give each fact its own sentence". The agent flagged this in the PR notes and shipped it as written because the plan's diagnostics: line dictates the text. Fix the plan text and the code together, for example "Stopped waiting after 30s. The box web () has not ended." The test that pins the text is box_wait_timeout_flag_returns_124_box_runs_on, and both string asserts in it would need updating. Verified: read the code and the pinned test.

Nit

  1. wait.rs:94 and :50: "is still running" can be false. wait_exit returns None for every state that is not stopped or exited, including pending and materializing (BoxState, boxes/src/lib.rs:958). A wait on a box still composing prints "is still running". Arch L506 says "naming each box that has not ended, whatever its state". "Has not ended" is what the code can prove. Also, the test passes the states "created" and "starting", which BoxState does not have. Verified: read the code.
  2. wait.rs:50: the id prints twice when the user typed it. min box wait 0190… prints "0190… (0190…)". Verified: read the code.
  3. main.rs:224: the hint never shows in text mode. Text mode prints only error: {e:#}. A person at a terminal never sees "Run min box wait <id> … or min box stop <id>". Only machine mode carries the hint. This matches what BoxExecTimedOut already does, so it may be intended. Verified: read answer_failure.
  4. attach.rs:679 (existing text): the hint names a flag that does not exist yet. It says "or its exit code with min box wait {address} --exec {exec_id}." Once this PR lands, min box wait exists but has no --exec, which belongs to BCLI-057, a different task. Clap will reject the command that hint names. This is outside this PR's diff, but this PR is what makes the verb real. Verified: git grep "box wait" at the head.

Verdict: needs changes, all minor: the body residuals and one message's wording. The code conforms to arch #166 at the new head. arch-review needs to re-rule on 1f683ec, and CI must go green.

@agent-137
agent-137 marked this pull request as ready for review November 9, 2026 21:10
@agent-137

Copy link
Copy Markdown
Member

/revise

Head 1f683ec4. Two items from minimal-review's pass. Change nothing else.

1. One fact per sentence in the timeout message.
BoxTimedOut::waited (crates/minimal/src/cmd/boxes/wait.rs, about line 50) joins two facts with a semicolon: "Stopped waiting after {after}; {target} ({id}) is still running." Make it two sentences: "Stopped waiting after {after}. {target} ({id}) is still running." (AGENTS.md, user-facing text: give each fact its own sentence). Update the pinned text in box_wait_timeout_flag_returns_124_box_runs_on. The task's diagnostics: line still shows the semicolon form. The babysitter is asking the owner to update it, and the code should not wait on that.

2. The PR body links its residuals.
The rendered body is truncated, so the residuals don't show. Put a short ## Residuals list before the notes, with these three:

Reply on any open thread that these answer.

@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 — 2 findings, 2 inline.

Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

Comment thread crates/minimal/src/cmd/boxes/wait.rs Resolved
Comment thread crates/minimal/src/main.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

min box wait conforms to the design. It returns the stored code, 128 plus the signal, 137 for an orphaned stop, and 124 with wait_timeout (architecture.md lines 370 and 506). Spec 28 BCLI-013 line 123 still says code = "timeout" for a wait timeout. Amend the spec, not the code (C1). The run-verb half of BCLI-014 is not done. min task run and min box run emit no machine-mode timeout error, and no issue owns that work. File the issue and name it in the PR body, or make the edit in task.rs (C2). Also correct the PR body: since #3154, the run path returns 124.

Ruled at e217577 against gominimal/arch@9e2ff817adba by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/wait.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/wait.rs Resolved
Comment thread crates/minimal/src/main.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimal box_wait_returns_retained_exit_code_or_128_plus_signal 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 box_wait_orphaned_stopped_record_returns_137 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 box_wait_timeout_flag_returns_124_box_runs_on 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-2 in box runtime-implement-test-2-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal run_verbs_and_wait_timeout_return_124_with_code_timeout 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

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.

.0.1 (/workbench/crates/mlog)
    Checking ssh-key v0.7.0-rc.11
    Checking signal-hook-mio v0.2.5
    Checking generic-array v1.4.4
    Checking derive_more v2.1.1
    Checking russh-cryptovec v0.62.0
    Checking num-bigint v0.5.1
    Checking pem v4.0.0
    Checking yasna v0.6.0
    Checking russh-util v0.52.0
    Checking tagptr v0.2.0
    Checking constcat v0.6.1
    Checking managed v0.8.0
    Checking hex-literal v1.1.0
    Checking hashbrown v0.14.5
    Checking bitflags v1.3.2
    Checking russh v0.65.0
    Checking dashmap v6.2.1
    Checking smoltcp v0.14.0
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking moka v0.12.16
    Checking rcgen v0.14.10
    Checking crossterm v0.29.0
    Checking async-compression v0.4.50
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking async-tar v0.6.1
    Checking line-clipping v0.3.8
    Checking object v0.40.0
    Checking serde_bytes v0.11.19
    Checking is_executable v1.0.6
    Checking russh-sftp v2.4.0
    Checking clap_complete v4.6.11
    Checking ratatui-widgets v0.3.2
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking sysinfo v0.39.6
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking ratatui-macros v0.7.2
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking ratatui-crossterm v0.1.2
    Checking fuzzy-matcher v0.3.7
    Checking ratatui v0.30.2
    Checking inquire v0.9.4
    Checking vsock v0.5.4
    Checking vte v0.15.0
    Checking wait-timeout v0.2.1
    Checking quick-error v1.2.3
    Checking bit-vec v0.10.1
    Checking rusty-fork v0.3.1
    Checking bit-set v0.11.1
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking vt100 v0.16.2 (https://github.com/gominimal/vt100-rust.git?rev=9b8cce5a6798daf061948259ebcb073bb1ea54a6#9b8cce5a)
    Checking tokio-vsock v0.7.2
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking rand_xorshift v0.5.0
    Checking minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking core_detect v1.0.0
    Checking unarray v0.1.4
    Checking similar v2.7.0
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking insta v1.49.0
    Checking proptest v1.12.0
    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 2m 22s
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`

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

min box wait returns a box's exit code. A box that its own timeout ends returns 124 from the run and wait commands. When min box wait --timeout runs out, it prints "Stopped waiting after . () is still running." and exits 124.

Notes from the agent: ## Residuals

Revise round 2. Item 1: the timeout message in BoxTimedOut::waited is now two sentences: "Stopped waiting after {after}. {target} ({id}) is still running." The pinned text in box_wait_timeout_flag_returns_124_box_runs_on changed with it. The task's diagnostics: line still shows the semicolon form, and the owner must update it. Item 2: I cannot edit the PR body. The Residuals list above is for the runner to carry into it. No thread is open this round, so threads is empty. cargo-nextest is not installed on this box, so I ran each test line through cargo test -p minimal <name> with the same filter.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 9, 2026 22:36
@agent-137
agent-137 marked this pull request as ready for review November 9, 2026 23:47
@agent-137

Copy link
Copy Markdown
Member

Undrafted by the BCLI babysitter. The draft comes only from the runtime's own test lines, which fail with no such command: nextest because its sandbox has no cargo-nextest. Every file is inside the task's layers:, and CI runs the tests. That is the owner's standing rule for BCLI (2026-11-09).

@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 · 3 conditions · the full ruling

min box wait conforms to the design. The exit codes, the wait_timeout error and the running box after --timeout match line 370 and line 506. BCLI-014 is not complete. min task run and min box run exit 124 on a box timeout, but they do not emit the machine-mode code = "timeout" that line 370 requires. The run path already reads the timeout reason through ended_at_timeout, so C1 is a small edit in task.rs. C2 makes the run-verb test exercise a run verb. C3 amends the spec, which still says timeout for a wait timeout where the design says wait_timeout.

Ruled at fa60462 against gominimal/arch@9e2ff817adba by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/wait.rs Resolved
Comment thread crates/minimal/src/tests.rs Resolved
Comment thread crates/minimal/src/main.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/wait.rs Resolved
@agent-137

Copy link
Copy Markdown
Member

/revise

Head fa604624. Arch ruling 1088 makes the run-verb half of BCLI-014 a condition, not a residual. Do it in this PR. task.rs is outside layers:, but the change needs it.

1. C1: a run that ends at the box's own timeout answers code = "timeout".
In crates/minimal/src/task.rs run_entry: when ended_at_timeout(exit, ..) is true (about line 1306), end the run with Err(minimal::BoxTimedOut::ended(&args.entry).into()) in place of exit_outcome(outcome?) (about line 1355). Then min task run and min box run exit 124, and machine mode emits {"code":"timeout"}. A run whose entrypoint exits 124 with reason exit keeps TaskExit(124). In human mode the timeout fact prints once: keep timeout_line, and do not also print the BoxTimedOut message.

2. C2: the test drives the run verbs.
Extract that decision into a function in task.rs that the test can call without a VM. Extend run_verbs_and_wait_timeout_return_124_with_code_timeout with two cases:

  • exit 124 on an Exited(ExitEnding::Timeout) record gives BoxTimedOut, with code() == "timeout" and failure_exit_code 124;
  • exit 124 on a record with reason exit gives TaskExit(124).

3. C3 is the spec, in #3194. Change no spec text here.
#3194 already sets BCLI-013 to code = "wait_timeout" and drops the arch#160 NEEDS CLARIFICATION.

4. PR body.
Remove the partial-delivery note: the run-verb half is now done here. Add Closes #3198, which this change delivers. Keep #3194 and #3199 under Residuals.

Reply on the arch threads with the commit. Change nothing else.

min task run and min box run now return BoxTimedOut when the box's own
timeout ended it, so they exit 124 and machine mode answers
code = "timeout" (BCLI-014). Human mode prints the timeout line once.
An entrypoint that exits 124 by itself keeps TaskExit(124).
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimal box_wait_returns_retained_exit_code_or_128_plus_signal 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-0 in box runtime-implement-test-0-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal box_wait_orphaned_stopped_record_returns_137 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 box_wait_timeout_flag_returns_124_box_runs_on 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-2 in box runtime-implement-test-2-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal run_verbs_and_wait_timeout_return_124_with_code_timeout 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-3 in box runtime-implement-test-3-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 args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    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 boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    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 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 minimal-client v0.8.0 (/workbench/crates/minimal-client)
    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 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 minimal v0.8.0 (/workbench/crates/minimal)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Finished `dev` profile [unoptimized] target(s) in 1m 26s
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/task.rs

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

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/wait.rs:37: run_entry now ends a box run with BoxTimedOut::ended (via task::run_outcome) when ended_at_timeout is true, so min task run and min box run exit 124 with code timeout in machine mode.
  • 👍 valid — crates/minimal/src/tests.rs: The test now drives ended_at_timeout plus task::run_outcome: a 124 on an Exited(Timeout) record gives BoxTimedOut with code timeout, and a 124 with reason exit gives TaskExit(124).
  • 👍 valid — crates/minimal/src/main.rs:1197: Kept the mapping cases and added the run-path case: run_outcome's timeout error maps to exit 124 and code timeout, prints nothing more in human mode, and an own 124 stays TaskExit(124).
  • 👎 invalid — crates/minimal/src/cmd/boxes/wait.rs:52: The code already answers wait_timeout. The spec amendment is in docs(specs): reconcile spec 28 with arch#166 and the #2877/#2878 rulings #3194, and the directive for this round says to change no spec text in this PR.

min box wait returns the box's exit code. When a box's own timeout ends a min task run or min box run, the command now exits 124 too. In machine mode it emits the error object with code "timeout". In human mode it prints only the existing timeout line. An entrypoint that exits 124 by itself still relays 124 with no error object.

Notes from the agent: Revise round 4. The directive asked for a change in crates/minimal/src/task.rs, which is outside layers:. The new pub fn task::run_outcome(exit, timed_out, entry) holds the decision, and run_entry's box-run path calls it in place of exit_outcome. BoxTimedOut gains a printed flag, set by already_printed(). answer_failure in main.rs relays 124 with no error: line for a printed timeout in human mode. Machine mode still emits the object. Both run_verbs_and_wait_timeout_return_124_with_code_timeout tests (tests.rs and main.rs) now drive run_outcome: a 124 on an Exited(Timeout) record gives BoxTimedOut with code timeout and exit 124, and a 124 with reason exit gives TaskExit(124). The session-path run (the non-box branch of run_entry) is unchanged, as the directive named only the ended_at_timeout site. No spec text changed (C3 is #3194). The pull request body items (remove the partial-delivery note, add Closes #3198) are the runner's, not commits. cargo-nextest is not installed on this box, so each test: line ran as cargo test -p minimal . just clippy-strict was not run.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 10, 2026 00:28

@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: 14 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/wait.rs, minimal-arch[bot] crates/minimal/src/cmd/boxes/wait.rs, minimal-arch[bot] crates/minimal/src/main.rs, minimal-arch[bot] crates/minimal/src/tests.rs:11435, minimal-arch[bot] crates/minimal/src/tests.rs, …. No findings.

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

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

Read at 2fb0db8. The verb does what BCLI-013 asks: wait_exit reads the record the daemon stored, an exit code is that code, a signal is 128 plus it, a stopped record with neither is 137 (BOX-154), and a timeout reason is the shared BoxTimedOut with 124. The --timeout leg returns 124 with code = "wait_timeout" and the resolved box id in the message and the hint, which is what the architecture's lines 370 and 506 want. 2fb0db8 closes the run-verb half of BCLI-014 too: run_outcome turns a 124 that ended_at_timeout confirmed into BoxTimedOut::ended, marked as already printed, so min task run and min box run exit 124 with the timeout object in machine mode and no second line in human mode, while an entrypoint's own 124 stays TaskExit(124). The Remove arm cannot hide a timeout: it fires only when the entrypoint never started (a pending or materializing record), so a box that ran past its timeout is always in the Keep arm where the record is read.

Findings

  1. Medium: the PR body contradicts the newest commit. The Proof says "the run verbs do not return 124 for a box timeout yet" and the notes say task.rs was not changed; 2fb0db8 changes it and the test's second half drives run_outcome through ended_at_timeout for both the timeout and the exit record. Please rewrite the Proof and drop the notes, and name wait_timeout beside timeout there. Most of minimal-arch's C1 and C2 threads were written against the earlier heads and are answered by the code now; a reply on each saying which commit answers it would let the next reader stop re-deriving that.

  2. Low: the wait-timeout message claims the box is running. BoxTimedOut::waited says "{target} ({id}) is still running", but wait_exit returns None for every state that is not stopped or exited, so a pending or materializing box gets the same message. #3194's BCLI-013 wording is "names each box that has not ended, whatever its state". "has not ended" is both true and the spec's phrase. minimal-foundry's open thread says the same.

  3. Low: spec 28 on main still says the wait timeout is code = "timeout". BCLI-013's sub-bullet at line 122 and the NEEDS CLARIFICATION at line 604 are amended in #3194 to wait_timeout and the two-code split. This PR implements #3194's text, not main's, which is right, but the body should say it depends on #3194 for the spec line so that the linter's verify entries and the code agree once both land.

Checked and fine

  • ended_at_timeout reads the record only for a 124, and the test pins both halves: a timeout record gives BoxTimedOut with is_printed, an exit record with code 124 gives TaskExit(124).
  • answer_failure skips the error: line only for a printed BoxTimedOut; the machine-mode path still answers the object, and failure_exit_code keeps 124 for both codes.
  • --timeout goes through mfile::duration::parse_timeout_secs, which refuses zero, so the deadline arithmetic never sees an empty duration; the poll shortens to the remaining time so the deadline is honoured to within the poll.
  • A box removed between the address resolving and the first ShowBox is a NotFound refusal with its exit code, not a hang.
  • The harness tests stop a real box and compare the wait's code with the record the daemon wrote, so the two readings cannot drift apart silently.

Verdict

Approve with nits. Nothing blocks the code; the body needs the rewrite in finding 1 before merge so the Proof matches what ships, and finding 2 is a one-word change. With this in, #3185's min box wait hint names a verb that exists.

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

Copy link
Copy Markdown
Member

Undrafted by the BCLI babysitter after round 4. The draft comes only from task.rs, which arch condition C1 required, and from the runtime's test lines failing with no such command: nextest. Both are covered by the owner's standing rules for BCLI. CI is the gate.

@agent-137

Copy link
Copy Markdown
Member

/revise

Head 2fb0db87. One wording item, from thread PRRT_kwDOPdfcxM61ePfZ. Change nothing else.

The wait-timeout message says "has not ended", not "is still running".
The wait stops on any box that has not ended, including a pending or materializing one, which is not running yet. Spec 28's BCLI-013 (in #3194) says the error "names each box that has not ended, whatever its state".

  • In BoxTimedOut::waited (crates/minimal/src/cmd/boxes/wait.rs, about line 54), make the message "Stopped waiting after {after}. {target} ({id}) has not ended."
  • Keep the hint as it is.
  • Update the pinned text in box_wait_timeout_flag_returns_124_box_runs_on and anywhere else it is pinned.

Reply on the thread with the commit.

The wait also stops on a pending or materializing box, which is not
running yet. The message now says the box has not ended.

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

APPROVE withheld: 1 unresolved thread — minimal-foundry[bot] crates/minimal/src/cmd/boxes/wait.rs.

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 2 of 3 personas ran (correctness, supply-chain); did not complete: security.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimal box_wait_returns_retained_exit_code_or_128_plus_signal 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-0 in box runtime-implement-test-0-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal box_wait_orphaned_stopped_record_returns_137 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-1 in box runtime-implement-test-1-1... error: no such command: 'nextest' help: a command with a simil
cargo nextest run -p minimal box_wait_timeout_flag_returns_124_box_runs_on 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 run_verbs_and_wait_timeout_return_124_with_code_timeout 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

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.

.0.1 (/workbench/crates/mlog)
    Checking ssh-key v0.7.0-rc.11
    Checking signal-hook-mio v0.2.5
    Checking generic-array v1.4.4
    Checking derive_more v2.1.1
    Checking russh-cryptovec v0.62.0
    Checking num-bigint v0.5.1
    Checking yasna v0.6.0
    Checking pem v4.0.0
    Checking russh-util v0.52.0
    Checking constcat v0.6.1
    Checking managed v0.8.0
    Checking hex-literal v1.1.0
    Checking hashbrown v0.14.5
    Checking bitflags v1.3.2
    Checking tagptr v0.2.0
    Checking dashmap v6.2.1
    Checking smoltcp v0.14.0
    Checking moka v0.12.16
    Checking russh v0.65.0
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking rcgen v0.14.10
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking crossterm v0.29.0
    Checking async-compression v0.4.50
    Checking async-tar v0.6.1
    Checking line-clipping v0.3.8
    Checking object v0.40.0
    Checking serde_bytes v0.11.19
    Checking is_executable v1.0.6
    Checking clap_complete v4.6.11
    Checking russh-sftp v2.4.0
    Checking ratatui-widgets v0.3.2
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking sysinfo v0.39.6
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
    Checking ratatui-macros v0.7.2
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking ratatui-crossterm v0.1.2
    Checking fuzzy-matcher v0.3.7
    Checking ratatui v0.30.2
    Checking inquire v0.9.4
    Checking vsock v0.5.4
    Checking vte v0.15.0
    Checking wait-timeout v0.2.1
    Checking quick-error v1.2.3
    Checking bit-vec v0.10.1
    Checking rusty-fork v0.3.1
    Checking bit-set v0.11.1
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking vt100 v0.16.2 (https://github.com/gominimal/vt100-rust.git?rev=9b8cce5a6798daf061948259ebcb073bb1ea54a6#9b8cce5a)
    Checking tokio-vsock v0.7.2
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking rand_xorshift v0.5.0
    Checking unarray v0.1.4
    Checking minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking similar v2.7.0
    Checking core_detect v1.0.0
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking proptest v1.12.0
    Checking insta v1.49.0
    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 2m 08s
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/task.rs

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

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/wait.rs: In c6a6437 the wait-timeout message says "Stopped waiting after . () has not ended." because the wait also stops on a pending or materializing box. The hint is unchanged and the test pins carry the new text.

min box wait returns a box's exit code, and a box ended by its own timeout returns 124 from the run and wait commands. When min box wait --timeout runs out, stderr now says "Stopped waiting after . () has not ended." and the hint is unchanged.

Notes from the agent: Revise round 5: commit c6a6437 changes the wait-timeout message in BoxTimedOut::waited from "is still running" to "has not ended", as the /revise note and thread PRRT_kwDOPdfcxM61ePfZ (comment 4518772598) ask. The verdict on that thread changes from invalid to valid. The doc comment on the same function now says "before the box ended". Both pins in box_wait_timeout_flag_returns_124_box_runs_on are updated. No other file pins the text. cargo-nextest is not installed on this box, so I ran each test line with cargo test -p minimal --lib and the same test name. The task's diagnostics line still quotes the old wording (" is still running"). The plan text needs the same update.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 10, 2026 01:31

@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 · 2 conditions · the full ruling

The compare closes the code gaps. min task run and min box run now return 124 with code = "timeout" when the box's own timeout ends it (lines 370 and 494). The wait-timeout message now says the box has not ended (line 506). Spec 28 BCLI-013 still says that a wait timeout answers code = "timeout". The design says wait_timeout, so amend the spec as C1 says. The PR body still says that the run verbs do not return 124 yet. Remove that claim as C2 says.

Outside the diff

  • docs/specs/28-spec-box-cli/28-spec-box-cli.md:123: C1 · This bullet says code = "timeout" for a wait timeout. The design 124 row (line 370) and min box wait (line 506) say code = "wait_timeout". The code follows the design. Change the spec to wait_timeout, and remove the arch#160 clarification at line 604.

Ruled at 99bc266 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

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

Copy link
Copy Markdown
Member

Undrafted by the BCLI babysitter after round 5, under the owner's standing rules: task.rs was required by arch C1, and the runtime's test lines fail with no such command: nextest. CI is the gate.

@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 99bc2661c8a9 withheld this approval on the threads open then. Posted as a comment, as the review itself was; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 10, 2026
@agent-137
agent-137 added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 9d0aae5 Nov 10, 2026
36 checks passed
@agent-137
agent-137 deleted the agent/2896-wait-on-a-box-and-return-its-exit-code branch November 10, 2026 03:26
yermakoffivan pushed a commit to yermakoffivan/minimal that referenced this pull request Nov 10, 2026
* feat(minimal): add min box start and min session start

Both verbs create a box from an entry of the project. With no entry,
min box start picks the default entry of any type, else the only one,
and min session start picks the default session entry, else the only
one. The implicit default entry counts. A session box attaches this
terminal unless --detach is given. Off a terminal, without --detach,
the start exits 2 before it creates anything. A task entry starts
detached, with its stdin closed, and one hint names min box run,
min box logs and min box wait.

--name sets the box's [box] name, and --new asks for a fresh instance.
A held name exits 2, names the holder and names --new and --name.

* test(minimal): list the start name test's requests in the create inventory

* fix(minimal): refuse --name for a task entry in min box start

The run path names a task box itself and takes no name, so the start
dropped --name without a word. It now refuses the flag with exit 2
before it creates anything. --new already holds for a task box: its
generated name is never held.

* docs(minimal): link the start interims to gominimal#3196 and gominimal#3197

Name the issues that track the task-entry --name refusal and the
unsupported-type refusal, and correct the run-path comment: a
task-entry start is always a fresh instance named <entry>-<n>.

* fix(minimal): read the typed session entry's egress on start

min session start <entry> reads the egress of that entry, not of
default. A typed entry needs no default to start. Link the entry body
residual of stamp_session_spec_as to gominimal#3204.

* fix(minimal): print a port in use the same on min box start

Both start verbs share start_refusal, so the port-in-use rewrite moves
there. min box start now names the port and its holder, as min session
start does.

* docs(minimal): name the --name run gap and the logs/wait merge order

BCLI-069 gives --name to min box run and min task run too. Say where
that waits: RunEntry takes no box name yet. The unattached start hint
names min box logs and min box wait, which gominimal#3184 and gominimal#3195 add, so this
change merges after both.

* fix(minimal): refuse unresolved types and [boxes] tasks on start

start_candidates refuses an entry whose type has no built-in root
(gominimal#3140) before the session filter, so a project Box Type never gets the
implicit default. plan_start refuses a [boxes] task entry (gominimal#3213).
StartEntryRefusal::exit_code gives 4 for an entry the start does not
find. run_entry returns the box id, so the detached start names it in
its hint and records it on the span.

* docs(minimal): document min session start

Give its arguments, how it picks the entry, and its refusals with their
exit codes: 4 for an entry it does not find, 2 for the others.

* fix(minimal): refuse unresolved types only when start counts entries

Move the TypeUnresolved refusal after the explicit-entry lookups in
pick_box_start_entry and pick_session_start_entry, in the order that
pick_session_entry uses. A typed project entry or an explicit default
entry now starts beside an entry of a project Box Type.

* fix(minimal): escape entry names in every start refusal

NotSession, UnsupportedType, StartNeedsTerminal and the entry lists in
Several and Unknown printed names from minimal.toml raw. Pass each name
through printable, as the sibling arms do, and pin it in a test.

* fix(minimal): refuse a typed session entry other than default

The box of a typed session entry gets the entry's name in its spec, but
its body still comes from the [session] table. Until gominimal#3204 applies the
entry's own body, both start verbs refuse such a start with exit 2,
before anything is created. A typed default and a bare start of the
only session entry still start.

The tests now plan the two starts that 43b4a42 broke: a bare start
beside an unresolved project type, and min box start build.

* test(minimal): start the only session entry bare in the off-tty test

A typed dev is now refused until gominimal#3204, so the off-terminal test
reaches the terminal refusal through a bare start of the sole entry.

* fix(minimal): escape the names in the held-name start refusal

StartNameHeld printed the entry, the held name and the holder's name
raw. A name with control characters can no longer move the cursor.

* chore(minimal): drop the start hint's merge-order comment

min box wait is on main now, so the comment's claim that this branch
lacks it is false.

* fix(minimal): set run network fields in box start of a task

The merge of main added network and egress to RunEntry. The task start
of min box start takes no network flags, so it passes none.

---------

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

review:approved minimal-review approved the current head

Projects

None yet

3 participants