8000 T64 — min box wait -o json says how the box ended · Issue #3199 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T64 — min box wait -o json says how the box ended #3199

Closed

Description

@agent-137

Task

slice size difficulty model who estimated lines
Wait S routine standard an agent 220 (90 code, 130 tests)

min box wait <box> -o json prints one min/v1/wait object 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 json or -o jsonl and the box ends THE SYSTEM SHALL write one min/v1/wait object to stdout. It lists the box with its box_id, its name, its state and reason, the exit_code or signal it stores, and code, the exit code the wait returns. Add wait to 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 the ShowBoxResponse record that box_wait_all_on_hosts already holds (BoxWaited), so no second read is needed. code is the value the command exits with: 125 when an export was not copied, 124 for the box's own timeout, 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: the min box wait section names the min/v1/wait object and its fields.

Covers:

  • BCLI-013 (as amended: machine output says how the box ended)
  • BCLI-033 (the wait type)

Layers:

  • spec:
    • docs/specs/28-spec-box-cli/28-spec-box-cli.md: BCLI-013's new sub-requirement, and wait in BCLI-033's list
  • client:
    • crates/minimal/src/cmd/boxes/wait.rs: write the min/v1/wait object 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 own timeout (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 wait section names the object
    • cargo nextest run -p minimal box_wait_json_lists_how_the_box_ended
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

  1. changed the title [-]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[/+] on Nov 19, 2026
  2. agent-137 commented on Nov 19, 2026

    @agent-137
    MemberAuthor

    /implement

  3. minimal-foundry commented on Nov 19, 2026

    @minimal-foundry
    Contributor

    Pull request #3666 is open as a draft for T64.

    branch agent/3199-min-box-wait-o-json-says-how-the-box-ended

    round outcome job
    1 pushed 167a6659
    test exit tail
    cargo nextest run -p minimal box_wait_json_lists_how_the_box_ended 0 warning: unknown fields in task runtime-implement-test-0: network help: do you need to update to a newer version of minimal? Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot)

    Verify 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.rs
    • crates/minimal/src/main.rs

    Updated 2026-11-20T03:08:55.155Z.

  4. agent-137 commented on Nov 19, 2026

    @agent-137
    MemberAuthor

    /implement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:should-haveShould be done. Applied by the inbox-route classifier or a human.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0