Repository navigation
Description
Task
| slice | size | difficulty | model | who | estimated lines |
|---|---|---|---|---|---|
| Wait | S | routine | standard | an agent | 220 (90 code, 130 tests) |
min box wait <box> -o jsonprints onemin/v1/waitobject that says how the box ended.
Residual of BCLI T8 (#2896, PR #3195), arch ruling 1077 C5. Made a plan task on 2026-11-19 (priority:should-have). On main, cmd_box_wait (crates/minimal/src/cmd/boxes/wait.rs) prints nothing on stdout when the box ends, in every output mode. The design's min box wait paragraph says machine output lists how each box ended. BCLI-013 does not state it yet.
Scope: one box, as BCLI-013 waits on one box. Waiting on several boxes, --parent and --any stay Non-goals (spec 28 lines 598 and 599), so this task adds no test for them. The object holds a boxes list so that a later multi-box wait adds entries without changing the shape.
What to do:
- Spec 28: amend BCLI-013 with a sub-requirement: WHEN
min box wait <box>runs with-o jsonor-o jsonland the box ends THE SYSTEM SHALL write onemin/v1/waitobject to stdout. It lists the box with itsbox_id, itsname, itsstateandreason, theexit_codeorsignalit stores, andcode, the exit code the wait returns. Addwaitto BCLI-033's list of types. wait.rs: after the wait ends, in a machine output mode, write the object to stdout before the exit. Build it from theShowBoxResponserecord thatbox_wait_all_on_hostsalready holds (BoxWaited), so no second read is needed.codeis the value the command exits with: 125 when an export was not copied, 124 for the box's owntimeout, 128 + n, or 137 (ORPHANED_STOP_EXIT_CODE).- Text mode stays as it is: no new line.
--exec <id>is unchanged by this task. The machine-mode error paths (wait_timeout,timeout) are unchanged and still write the error object on stderr.docs/reference/cli-min.md: themin box waitsection names themin/v1/waitobject and its fields.
Covers:
- BCLI-013 (as amended: machine output says how the box ended)
- BCLI-033 (the
waittype)
Layers:
- spec:
- docs/specs/28-spec-box-cli/28-spec-box-cli.md: BCLI-013's new sub-requirement, and
waitin BCLI-033's list
- docs/specs/28-spec-box-cli/28-spec-box-cli.md: BCLI-013's new sub-requirement, and
- client:
- crates/minimal/src/cmd/boxes/wait.rs: write the
min/v1/waitobject in a machine output mode - crates/minimal/src/tests.rs:
box_wait_json_lists_how_the_box_ended, with one case for each of: exit 0, exit 3, the box's owntimeout(124), a stop by signal (128 + n), an orphaned stop (137), and an export that was not copied (125). Also: text mode prints nothing on stdout. - docs/reference/cli-min.md: the
min box waitsection names the object cargo nextest run -p minimal box_wait_json_lists_how_the_box_ended
- crates/minimal/src/cmd/boxes/wait.rs: write the
Original issue
Residual of BCLI T8 (#2896, PR #3195), arch ruling 1077 C5.
With -o json, min box wait prints nothing when the box ends (cmd_box_wait, crates/minimal/src/cmd/boxes/wait.rs). The architecture's min box wait paragraph (gominimal/arch 9495216) says machine output lists how each box ended: its exit code, 124 for its own timeout, 128 + n, or 137.
BCLI-013 does not state this yet, so this issue also owes a spec 28 amendment.
Do: amend BCLI-013 so that min box wait -o json emits one versioned object, listing each waited box with how it ended (BCLI-033's JSON conventions). Then implement it, with a test for all mode, for --any and for --parent.
Covers: BCLI-013 (machine output), BCLI-033.
This is a residual of epic #2879 (BCLI).
Plan block
### T64 — min box wait -o json says how the box ended
slice: S3
kind: task
covers: BCLI-013, BCLI-033
size: S
est: 90 code, 130 tests
executor: agent
difficulty: routine
model: standard
diagnostics: none new
observability: none new
layers:
- spec:
- docs/specs/28-spec-box-cli/28-spec-box-cli.md: BCLI-013's machine-output sub-requirement, and `wait` in BCLI-033's types
- client:
- crates/minimal/src/cli.rs: `-o`/`--output` on `min box wait`, refused with `--exec`
- crates/minimal/src/main.rs: `min box wait -o json` is a machine output mode, so a failure is one `min/v1/error` object
- crates/minimal/src/cmd/boxes/wait.rs: write one `min/v1/wait` object on stdout in a machine output mode when the box ends
- crates/minimal/src/tests.rs: `box_wait_json_lists_how_the_box_ended` (0, 3, 124, 128 + n, 137, 125; text mode prints nothing)
- docs/reference/cli-min.md: the `min box wait` section names the object and its fields
test: cargo nextest run -p minimal box_wait_json_lists_how_the_box_ended
produces:
- min/v1/wait
consumes: none
proof: `min task run <entry> --detach` of an entry that exits 3, then `min box wait <box> -o json`, prints `{"schema":"min/v1/wait","boxes":[{"box_id":…,"name":…,"state":"exited","reason":"exit","exit_code":3,"signal":null,"code":3}]}` and exits 3.
Activity
[-]BCLI: min box wait -o json lists how each box ended (T8 residual, arch C5)[/-][+]T64 — min box wait -o json says how the box ended[/+]agent-137 commentedon Nov 19, 2026
/implement
minimal-foundry commentedon Nov 19, 2026
Pull request #3666 is open as a draft for T64.
branch
agent/3199-min-box-wait-o-json-says-how-the-box-ended167a6659cargo nextest run -p minimal box_wait_json_lists_how_the_box_endedVerify
min task run agent-verify: exit 100 — FAIL [ 13.048s] (1241/1241) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace thread 'exec_run_attach_and_task_run_share_the_commands_trace' (6462) panicked at crates/minimal/tests/otel_cli.rs:807:13: exec: no daemon exec span under cmd 462b7ffb9eb3a5fd: [Outside the task's
layers:, so the PR is a draft:crates/minimal/src/cli.rscrates/minimal/src/main.rsUpdated 2026-11-20T03:08:55.155Z.
agent-137 commentedon Nov 19, 2026
/implement