8000 T36 — Follow a box's logs and list exited tasks by minimal-foundry[bot] · Pull Request #3184 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T36 — Follow a box's logs and list exited tasks - #3184

Merged
agent-137 merged 4 commits into
mainfrom
agent/2897-follow-a-box-s-logs-and-list-exited-tasks
Nov 9, 2026
Merged

agent-137 merged 4 commits into
mainfrom
agent/2897-follow-a-box-s-logs-and-list-exited-tasks

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T36 — Follow a box's logs and list exited tasks

slice: S2
kind: task
covers: BCLI-012, BCLI-015
size: M
est: 160 code, 120 tests
executor: agent
difficulty: routine
model: standard
diagnostics: min task list shows an exited task with its exit code, as "exited (3)", until min box prune removes it, pinned by task_list_shows_exited_until_pruned
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.rs: the logs verb for every box and its -f follow
- crates/minimal/src/task.rs: min task list keeps exited tasks until a prune
- crates/minimal/src/tests.rs: the in-process minimald test harness gains this layer's tests
test: cargo nextest run -p minimal type_noun_logs_follow
test: cargo nextest run -p minimal task_list_shows_exited_until_pruned
produces: none
consumes: none
proof: A person follows a box's output with logs -f, and sees exited tasks in min task list until a prune.
depends on:
- blocked by #2892

Proof

A person runs min session logs <box> -f, min task logs <box> -f or min box logs <box> -f. Each command prints the box's output from its start, then each new output as the box writes it, and ends when the box is removed. Without -f, the command prints the output so far and ends. min task list shows each task box with its state. A task that exited shows as exited (3) until min box prune removes it. --all lists the tasks of every project.

Notes from the agent: The binary cargo-nextest is not on this box, so the two test: lines ran as cargo test -p minimal --lib <name>. The two commands use the same test filter. The verb did not exist before this change. All three nouns parse to one BoxLogsArgs and one handler, box_logs_on_hosts in cmd/boxes.rs. That handler calls the daemon's ReadLog stream through the public Client::stream_box_subsystem, so this change did not touch minimal-client. min task list did not exist before this change either, and the task's dependency #2892 is not in the tree. This change adds it in task.rs, with --all and a scope to the current project as min box list has. It shows the columns ID, NAME, STATE and HOST. The plan pins exited (3) as the task state. min box list prints the same box as exited (exit 3), so the two lists name the same state in two different ways. A reviewer can make one of them the same as the other. In the test, the task box is a stopped session box whose record.json the test changes to type task, status exited, exit code 3. The in-process harness has no direct way to create an exited task box. Two new messages: when the selected host does not answer, min task list prints Could not reach host <host>, so no task is listed. Run min doctor to check the daemon. When a log read ends early, the error tells the person to run min box logs <box>, also when the person typed min task logs or min session logs. Observability: the tracing info record has the verb, the resolved box id…[truncated]

Tests

line exit tail
cargo nextest run -p minimal type_noun_logs_follow 101 warning: unknown fields in [defaults] section of 8000 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 task_list_shows_exited_until_pruned 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

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 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)
    Checking common v0.0.1 (/workbench/crates/common)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
    Checking bep v0.0.1 (/workbench/crates/bep)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    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 14s
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 #2897

Add `min session logs`, `min task logs` and `min box logs`, one verb
with `-f`, which read the box's output log over ReadLog and follow it
until the box is removed (BCLI-012).

Add `min task list [--all]`, which lists the task boxes in any state.
An exited task shows as `exited (<code>)` until `min box prune`
removes it (BCLI-015).
@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: 4443b569-d3c5-4530-a1f3-60779c232c34

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 873805989c10.

@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 — 1 finding, 1 inline.

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

Comment thread crates/minimal/src/cmd/boxes.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 logs handler and its owner conform to the design. Two type-noun verbs do not act as aliases of the min box verb filtered to their type (architecture.md line 338). min session logs and min task logs resolve a box of any type, and the test follows a session box with min task logs. C1 adds the type filter. min task list is a second listing with its own table and the label exited (3). For the same record, min box list prints exited (exit 3). C2 routes min task list through the min box list path, filtered to task boxes.

Ruled at 5afb0d3 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes.rs Resolved
Comment thread crates/minimal/src/cmd/mod.rs Resolved
Comment thread crates/minimal/src/tests.rs Resolved
Comment thread crates/minimal/src/task.rs Resolved
Comment thread crates/minimal/src/task.rs Resolved
Comment thread crates/minimal/src/tests.rs Resolved
The line carries box output, which can hold secrets.
@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 logs conforms to line 473 of the design. Two deviations from the baseline ruling stay open, and the compare does not touch them. min session logs and min task logs read a box of any type. Line 338 says each type-noun verb is the min box verb filtered to that type. C1 adds that filter. min task list is a second listing with its own columns and its own state label. Line 332 says list means the same thing under every noun. C2 makes it min box list filtered to tasks.

Ruled at 957f0b9 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

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

APPROVE withheld: 12 unresolved threads — minimal-foundry[bot] crates/minimal/src/cmd/boxes.rs, minimal-arch[bot] crates/minimal/src/cmd/boxes.rs:74, minimal-arch[bot] crates/minimal/src/cmd/mod.rs:391, minimal-arch[bot] crates/minimal/src/tests.rs:11373, minimal-arch[bot] crates/minimal/src/task.rs:799, ….

minimal-review — advisory review

Verdict COMMENT — No findings.

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


8000
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 957f0b99b07f.

line exit tail
cargo nextest run -p minimal type_noun_logs_follow 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 task_list_shows_exited_until_pruned 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

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.

ng compression-codecs v0.4.45
    Checking ring v0.17.14
    Checking ml-kem v0.3.2
    Checking ratatui-core v0.1.2
    Checking heapless v0.9.3
    Checking mlog v0.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 lcache v0.0.1 (/workbench/crates/lcache)
    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 bitflags v1.3.2
    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 rcache v0.0.1 (/workbench/crates/rcache)
    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 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 op v0.0.1 (/workbench/crates/op)
    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 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 minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking vsock v0.5.4
    Checking vte v0.15.0
    Checking wait-timeout v0.2.1
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking quick-error v1.2.3
    Checking bit-vec v0.10.1
    Checking mctx v0.0.1 (/workbench/crates/mctx)
    Checking bit-set v0.11.1
    Checking rusty-fork v0.3.1
    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 core_detect v1.0.0
    Checking unarray v0.1.4
    Checking similar v2.7.0
    Checking proptest v1.12.0
    Checking insta v1.49.0
    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.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes.rs: The decode warning in copy_log now records line_len = line.len() in place of the raw line, so box output does not reach the log.

A person follows a box's output with min box logs -f, and sees exited tasks in min task list, as "exited (3)", until min box prune removes them. When a log line fails to decode, the warning in the log no longer holds the box output.

Notes from the agent: cargo-nextest is not installed on this box, so I ran each test line with cargo test and the same package and test name. This round changed only the decode warning in copy_log: it records line_len in place of the raw line.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 9, 2026 17:15
min task logs and min session logs now resolve the box only among boxes
of their own type, so a type noun refuses a box of another type.
min task list now prints the min box list table, state label and empty
lines, filtered to task boxes, in place of a second listing.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a failed check suite, pushed as 873805989c10.

line exit tail
cargo nextest run -p minimal type_noun_logs_follow 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 task_list_shows_exited_until_pruned 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

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)
    Checking common v0.0.1 (/workbench/crates/common)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
    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 2m 01s
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.rs: box_logs_on_hosts takes a Box Type filter and drops records of other types before it resolves the address.
  • 👍 valid — crates/minimal/src/cmd/mod.rs: Dispatch passes Some(SESSION_BOX_TYPE) for session logs, Some(TASK_BOX_TYPE) for task logs, and None for box logs.
  • 👍 valid — crates/minimal/src/tests.rs: The test follows a task box with min task logs job, and asserts that min task logs web on the session box is refused and writes nothing.
  • 👍 valid — crates/minimal/src/task.rs:799: The second table and its message set are removed. task list renders through render_box_list, filtered to TASK_BOX_TYPE. The host loop stays because list.rs is outside the layers.
  • 👍 valid — crates/minimal/src/task.rs: task_state_label is removed. The task list uses box_state_label, so it prints exited (exit 3).
  • 👍 valid — crates/minimal/src/tests.rs: The test asserts exited (exit 3), and its empty-list assertions use EMPTY_PROJECT_LIST and EMPTY_HOST_LIST.
  • 👍 valid — crates/minimal/src/cmd/boxes.rs: The type nouns resolve the address only among boxes of their own Box Type, through resolve_typed_box_on_hosts.
  • 👍 valid — crates/minimal/src/tests.rs: The task leg reads the task box job. min task logs web and min session logs job are asserted to fail and to write nothing.
  • 👍 valid — crates/minimal/src/task.rs:819: The task-only table, empty lines and host error are removed. The list uses the min box list renderer and errors, filtered to TASK_BOX_TYPE.
  • 👍 valid — crates/minimal/src/task.rs: task_state_label is removed and box_state_label is used. The plan's diagnostics line is outside what this round can edit, so the notes flag it.
  • 👍 valid — crates/minimal/src/tests.rs: The assertion now checks exited (exit 3).

A person runs min box logs <box> -f, min session logs <session> -f or min task logs <task> -f and sees the box's output from its start, then new output until the box is removed. Each type noun reads only boxes of its own type. min task list shows an exited task as exited (exit 3) in the min box list table until min box prune removes it.

Notes from the agent: The failed checks were infrastructure faults. The unit job got repeated curl: (56) ... error: 500 while it installed tools, and ci-macos-success failed because of it. No code change addresses them, so a re-run is the next step. cargo nextest is not installed here, so both test lines ran through cargo test -p minimal --lib <name>. For C1, the type filter lives in a new resolve_typed_box_on_hosts in cmd/boxes.rs. That function repeats the host loop of resolve_box_on_hosts, because cmd/boxes/address.rs is outside the layers. It logs outcome = "refused" because BoxAddressRefusal::outcome is private to address.rs. A follow-up can move the filter into resolve_box_on_hosts and remove the copy. For C2, min task list now uses the shared render_box_list, box_state_label, ListedBox, EMPTY_PROJECT_LIST/EMPTY_HOST_LIST and unreachable_host_line. The selected-host failure now returns the raw error as min box list does. The per-host read loop stays in task.rs, because a type filter in cmd_box_list needs a change to cmd/boxes/list.rs, which is outside the layers. The plan's diagnostics line still says "exited (3)". The shipped label is "exited (exit 3)", so the plan needs that edit. The min task list help text in cli.rs now says exited (exit 3).

@agent-137
agent-137 marked this pull request as ready for review November 9, 2026 19:17
@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: 12 unresolved threads — minimal-foundry[bot] crates/minimal/src/cmd/boxes.rs, minimal-arch[bot] crates/minimal/src/cmd/boxes.rs, minimal-arch[bot] crates/minimal/src/cmd/mod.rs, minimal-arch[bot] crates/minimal/src/tests.rs, minimal-arch[bot] crates/minimal/src/task.rs:799, ….

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 2 of 3 personas ran (correctness, security); did not complete: 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 · the full ruling

The change now conforms to the design. min session logs and min task logs read only boxes of their own type, as design principle 8 (line 338) requires. min task list prints the min box list table and state labels, filtered to tasks, so list means one thing under every noun (line 332). One note is outside the design: under min task list, the empty-project line says the project has no boxes. That is not true when the project has sessions. Change the plan's exited (3) to exited (exit 3) in the issue.

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

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

Babysitter review at 87380598. No blocking findings. The approval is left to the owner, because agent-137 would be approving its own walk's PR.

  • min box logs / min session logs / min task logs share one path. Each type noun resolves the address only among boxes of its own Box Type (resolve_typed_box_on_hosts), so min task logs <session-box> is refused and writes nothing.
  • min task list renders through render_box_list filtered to tasks, with the min box list wording (exited (exit 3)). An exited task stays listed until a prune.
  • A log line that fails to decode is logged by length only (line_len), so box output never reaches the log.
  • Arch passes this head, minimal-review has no findings, and all 12 threads are resolved after I checked the code.

One leftover for the plan: T36's diagnostics line still says exited (3). The code now prints exited (exit 3).

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

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

Thank you for this change. It adds min session logs, min task logs and min box logs with -f, and min task list. The arch rounds left it in good shape: the type nouns now resolve only among boxes of their own type, the task list reuses the min box list table and labels, and the decode warning no longer logs box output. I reviewed head 8738059. The client side is careful about bytes, ordering and the daemon's log cap. My main concern is how a follow ends. A follow of a task ends only when the box is removed, not when the task exits, and a follow does not notice when its reader goes away. Together those can leave min task logs <id> -f running forever in a script.

Findings

1. Medium. A follow of a task never ends when the task exits. crates/minimal/src/cmd/boxes.rs:88 sends follow: args.follow to ReadLog, and the daemon ends a followed read only at reap. That matches the ReadLog contract and the help text at crates/minimal/src/cli.rs:993. But a task box keeps its record after it exits (BOX-038), until a prune or min box rm. So the common script id=$(min task run --detach build); min task logs "$id" -f prints the task's output and then hangs after the task exits, until someone prunes the box. docker logs -f and kubectl logs -f end when the container ends, so people will expect the same. I suggest ending the follow when the box leaves running. After the stream catches up, poll the box's state or watch its exited event, then drain the log once more without following and return. If BCLI-012 really means "until reaped" for tasks too, please raise it with the spec owner and file a follow-up, so this is a decision rather than a surprise.

2. Medium. A follow does not notice a closed reader, and a closed pipe prints an error. copy_log writes with out.write_all(&data)? at crates/minimal/src/cmd/boxes.rs:196. When the reader closes, as in min box logs web | head -1, the command prints error: Broken pipe (os error 32) and exits 1, because crates/minimal/src/main.rs:221 quiets a broken pipe only for min version. With -f, the command writes only when new output arrives. So min task logs job -f | head -1 on an exited task, or on a quiet one, never learns that head left and runs until the box is removed. crates/minimal/src/cmd/box_audit.rs:492 already solves this for min box audit --follow with a reader_gone poll. I would treat a BrokenPipe from the write as a clean end, and in follow mode check reader_gone on stdout between updates, for example on a timer next to next_line.

3. Low. The early-end hint can point at a different box. crates/minimal/src/cmd/boxes.rs:172-173 always suggests min box logs {address}, as your notes say. Under a type noun the address was resolved among boxes of one type, while min box logs resolves it among all types. BOX-004 lets an exited task named job and a running session named job coexist, and name resolution prefers the running box. In that case the hint reads the session's output, not the task's. Passing verb into the message and printing min {verb} {address}, or printing the resolved box id, fixes it. The same message will run again under -f after a daemon restart, which is the main way a follow ends early.

4. Low. A truncated last line reads as a version mismatch. SubsystemLines::next_line returns an unterminated tail as a line once the channel closes (crates/minimal-client/src/lib.rs:1375-1380). A ReadLog line can be up to about 128 KiB of hex, more than one SSH packet. If the daemon stops while it writes such a line, copy_log fails to decode it and says "The output of box … is in a form this version of min cannot read" at crates/minimal/src/cmd/boxes.rs:191. That misleads the person after a daemon restart. I would report a decode failure on the last line before the end as the early-end error from finding 3, or word the decode error so it covers both causes.

5. Low. The empty task list talks about boxes. crates/minimal/src/task.rs:862 reuses render_box_list, so a project with sessions but no tasks prints "This project has no boxes. Run min box list --all…". The first sentence is false there, and the hint names the box verb. I know the arch review asked for the min box list lines. A noun parameter for the empty line, giving "This project has no tasks. Run min task list --all…", keeps one renderer and stays true. I would leave this to you and the arch reviewer.

6. Low. The tests leave three claims unpinned.

  • In type_noun_logs_follow, the drive stops and removes each box in one step (crates/minimal/src/tests.rs:11435-11440). A follow that wrongly ended at stop would pass too. Asserting that the follows are still pending after the stop, with a short timeout that must elapse, pins "until removed". It will also pin whatever you decide for finding 1.
  • In task_list_shows_exited_until_pruned, the scoped listing is asserted only for another project (crates/minimal/src/tests.rs:11585). Please add list(Some(project)) and assert that it shows the task. That is the default min task list path.
  • "The exited task stays until a prune removes it" (crates/minimal/src/tests.rs:11589-11590) repeats the listing right after the first one, so it adds nothing. The forged record at line 11551 is a fair stand-in, as your notes explain.

7. Nits.

  • The min box logs help at crates/minimal/src/cli.rs:497 says the output stays "until min box rm removes it". min box prune removes it too.
  • min box list takes -o json and min task list does not. If list means the same under every noun, the task list would take it as well. This could be a follow-up.
  • This is outside this diff, but it bears on BCLI-015. An interactive task, one with no spec, runs through the owns-box exec at crates/minimal/src/task.rs:1355, and the daemon destroys its box at exit. Such a task never appears as exited in min task list. If that is intended under NET-131, a sentence in the help would avoid the question.

Checked and fine

  • Type filtering. resolve_typed_box_on_hosts drops other types before resolution and narrows a qualified address to its host, the same way resolve_box_on_hosts does. The refusal tests cover both directions.
  • Bytes. Output is written as raw bytes and flushed per chunk, so partial UTF-8 and partial terminal lines pass through unchanged.
  • Bounded buffers and back-pressure. The daemon sends at most 64 KiB of log per line, and the SSH window holds the daemon back when the client is slow. The daemon-error buffer is bounded.
  • Log cap and drops. One LogReader per stream on the daemon side means no byte is sent twice across a drop, and the drop line marks the gap.
  • Client interrupt. Ctrl-C drops the channel, and the daemon's follow loop ends on the channel's close.
  • Daemon restart. The channel closes without a terminal update, which is reported as an early end with a non-zero exit.
  • RPC compatibility. The change is client-only. ReadLog shipped in #2852, and the selected host is gated by ensure_version_match, so an older daemon is refused before any read. The request uses fields with serde defaults.
  • Task list. The project filter is the same equality the daemon's list_boxes uses. Rows come in box-id order per host, which is creation order for UUIDv7 ids. A spec'd task's record is retained after exit, and a prune removes it. An unreachable non-selected host is named on stderr, and the selected host's failure ends the command, as in min box list.
  • Observability. Each path records the verb, the resolved box id and the outcome, and the decode warning logs only the line length.
  • CI. CI is green on this head, except unit and artifacts, which were still pending when I looked.

Verdict

Approve with nits. Findings 1 and 2 together can hang a script, so I would like them fixed here or tracked in an issue against BCLI-012 before merge. Findings 3 to 7 can land here or in a follow-up, whichever you prefer.


Reviewed with lab tooling on the branch head; the lab round, where one ran, is cited in the text. Questions welcome.

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

Approving with nits (in the review above). Before merge I'd track the two mediums: -f ends only at reap, so following a detached task hangs after it exits; and a closed reader is never noticed (box audit --follow has the in-crate pattern).

minimal-foundry Bot added a commit that referenced this pull request Nov 9, 2026
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 #3184 and #3195 add, so this
change merges after both.
Merged via the queue into main with commit 93952a9 Nov 9, 2026
41 checks passed
@agent-137
agent-137 deleted the agent/2897-follow-a-box-s-logs-and-list-exited-tasks branch November 9, 2026 22:57
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

Development

Successfully merging this pull request may close these issues.

T36 — Follow a box's logs and list exited tasks

3 participants

0