8000 T12 — Attach to a box's terminal, with or without an address by minimal-foundry[bot] · Pull Request #3018 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T12 — Attach to a box's terminal, with or without an address - #3018

Merged
agent-137 merged 21 commits into
mainfrom
agent/2904-attach-to-a-box-s-terminal-with-or-without-an-ad
Nov 5, 2026
Merged

agent-137 merged 21 commits into
mainfrom
agent/2904-attach-to-a-box-s-terminal-with-or-without-an-ad

Conversation

@minimal-foundry
@minimal-foundry minimal-foundry Bot commented Nov 4, 2026 •
Copy link
Copy Markdown
Contributor

T12 — Attach to a box's terminal, with or without an address

slice: S3
kind: task
covers: BCLI-068
size: L
est: 140 code, 640 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: when the daemon ends an attach, the terminal shows one line such as "Detached: was stopped." and the command exits 254; with no candidate box it prints "No box with a terminal in this project. Start one with min box start." and exits 4, pinned by attach_ended_from_other_side_notice_exit254 and box_attach_without_address_none_exit4_hints_start
observability: the command's existing tracing span records the verb, the box id it resolved and the outcome
layers:
- daemon:
- crates/minimald-rpc/src/lib.rs: BoxListingEntry and ShowBoxResponse carry the stored spec's pty_enabled (serde default false, so an older daemon reads as no terminal)
- crates/minimald/src/box_manager.rs: box_listing_entry and the show reply fill pty_enabled from the box's stored spec
- crates/minimald/src/box_manager/tests.rs: the listing and show tests for the field
test: cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled
- client:
- crates/minimal/src/cli.rs: the verb's arguments and help in the one command model
- crates/minimal/src/cmd/boxes/attach.rs: min box attach [<box>]: the bare form, and the 0, 2, 4, 7 and 254 endings
- crates/minimal/src/attach.rs: the terminal attach reports why the daemon ended it
- 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_attach_reattaches_pty_box
test: cargo nextest run -p minimal box_attach_without_tty_exit2
test: cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs
test: cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained
test: cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists
test: cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start
test: cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7
test: cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0
test: cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254
test: cargo nextest run -p minimal attach_connection_failure_exit7
produces: none
consumes:
- crates/minimal/src/cmd/boxes/address.rs
proof: min box attach reattaches a terminal box, finds the project's box with no address, and exits with a code a script can read.
depends on:
- blocked by #2895

Proof

A person can run min box attach <box> to hand their terminal to a box that has one. They can run a bare min box attach in a project to reach its running terminal box, or its only stopped or exited one. A script can read the exit code: 0 for a detach or an entrypoint exit, 2 for no terminal (client or box) or two candidates, 4 for no candidate, 7 for an unreachable host or a lost connection, and 254 after one line such as "Detached: web was stopped." when the host ends the attach.

Notes from the agent: Files outside the layers, each a small change: crates/minimal/src/cmd/mod.rs (dispatch and verb name for box attach), crates/minimal/src/cmd/boxes.rs (pub use attach::BoxAttachRefusal so main.rs can downcast it), and crates/minimald-rpc/src/tests.rs plus crates/minimal/src/cmd/boxes/list.rs (test struct literals gain pty_enabled). crates/minimal/src/attach.rs needed no change: the code that reads why the attach ended is in cmd/boxes/attach.rs (attach_ending, box_after_attach). ShowBoxResponse carries pty_enabled through its record: BoxListingEntry and gains no field of its own. A box filed with no stored spec reads as a terminal box when its type is session, the same as the resume check in box_actor. A reaped entry reports pty_enabled: false.

The tests run the command up to the ssh hand-off against in-process harness daemons, and the hand-off is a closure that returns ssh's exit code. No test drives a real ssh or PTY attach. The daemon does not say why it ended an attach, so the client works out the cause: after 0, 254 or 255 it reads the box once from its host. 254 + stopped is 'was stopped'. 254 + gone is 'was removed'. 254 + running is 'another terminal attached'. 254 + silent host is 'host shut down'. 0 + stopped with no exit code is also 254 'was stopped', because a stop from another client can reach the client as 0. 255 + silent host is exit 7. A 255 from a host that still answers (the daemon's slow-terminal shed) stays 255. 0 …[truncated]

Tests

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-d723... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-9e95... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-d5dd... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-6e0d... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-220b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-9abc... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-97da... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-bc67... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-a551... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-e068... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-541a... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify

min task run agent-verify timed out after 1800s, so this PR is a draft.

Checking google-cloud-longrunning v1.14.0
    Checking google-cloud-iam-v1 v1.13.0
    Checking mlog v0.0.1 (/workbench/crates/mlog)
   Compiling serial_test_derive v4.0.1
    Checking google-cloud-lro v1.11.0
    Checking google-cloud-storage v1.20.0
    Checking serial_test v4.0.1
    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 mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking 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-client v0.8.0 (/workbench/crates/minimal-client)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Checking minimal v0.8.0 (/workbench/crates/minimal)
    Finished `dev` profile [unoptimized] target(s) in 1m 47s
   Compiling opentelemetry v0.33.1
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling serial_test v4.0.1
   Compiling opentelemetry_sdk v0.33.1
   Compiling tracing-opentelemetry v0.34.0
   Compiling opentelemetry-http v0.33.1
   Compiling opentelemetry-appender-tracing v0.33.1
   Compiling google-cloud-gax-internal v0.7.20
   Compiling opentelemetry-proto v0.33.0
   Compiling opentelemetry-otlp v0.33.0
   Compiling mlog v0.0.1 (/workbench/crates/mlog)
   Compiling google-cloud-longrunning v1.14.0
   Compiling google-cloud-iam-v1 v1.13.0
   Compiling google-cloud-lro v1.11.0
   Compiling google-cloud-storage v1.20.0
   Compiling common v0.0.1 (/workbench/crates/common)
   Compiling boxes v0.0.1 (/workbench/crates/boxes)
   Compiling sandbox v0.0.1 (/workbench/crates/sandbox)
   Compiling mfile v0.0.1 (/workbench/crates/mfile)
   Compiling minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
   Compiling decode v0.0.1 (/workbench/crates/decode)
   Compiling checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling graph v0.0.1 (/workbench/crates/graph)
   Compiling lcache v0.0.1 (/workbench/crates/lcache)
   Compiling rcache v0.0.1 (/workbench/crates/rcache)
   Compiling op v0.0.1 (/workbench/crates/op)
   Compiling check v0.0.1 (/workbench/crates/check)
   Compiling orchestrator v0.0.1 (/workbench/crates/orchestrator)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling minimal-client v0.8.0 (/workbench/crates/minimal-client)
   Compiling mctx v0.0.1 (/workbench/crates/mctx)
   Compiling minimald v0.8.0 (/workbench/crates/minimald)
   Compiling minimal v0.8.0 (/workbench/crates/minimal)

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

Out of scope

These files are outside the task's layers:, so this PR is a draft:

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs

Residuals

Closes #2904

The listing and the read of a box now say whether its stored spec sets
io.pty_enabled, so min box attach can tell a terminal box from one with
none. A daemon that predates the field reads as no terminal.
min box attach <box> hands the terminal to a box that has one. With no
box named it picks the project's running terminal box, else its only
retained one. Refusals exit 2, 4 or 7. An attach the host ends prints
one line that names why and exits 254.
@coderabbitai
coderabbitai Bot commented Nov 4, 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: 3e672b6e-f2ee-4821-94c7-60e2989074f5

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

…a-box-s-terminal-with-or-without-an-ad

# Conflicts:
#	crates/minimal/src/tests.rs
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

A merge of main before round 1, not counted against the cap (1 of 3), pushed as 56f99b7a02eb.

Resolved conflicts in: crates/minimal/src/tests.rs

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-8344... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-d58a... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-565e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-5aa6... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-d558... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-ff44... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-baff... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-6708... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-c5be... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-fc85... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-2be9... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

f0b",
                "span_id": "103ea5f34fadf1df",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "67f1040945c60f0b",
                "span_id": "03d7046db5778fc0",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "67f1040945c60f0b",
                "queued_behind": "0",
                "span_id": "62299d018f112287",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "67f1040945c60f0b",
                "queued_behind": "0",
                "span_id": "cb3c8e1a3060cbbd",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "cb3c8e1a3060cbbd",
                "span_id": "3261e2973ba1e076",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "cb3c8e1a3060cbbd",
                "queued_behind": "0",
                "span_id": "5866ec30193305af",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.453s] ( 918/2334) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.617s] ( 919/2334) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.798s] ( 920/2334) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
────────────
     Summary [  61.763s] 920/2334 tests run: 919 passed, 1 failed, 26 skipped
        FAIL [   4.059s] ( 917/2334) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1414/2334 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs

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

With main merged in, min box attach still reattaches a terminal box, finds the project's box when no address is given, and exits with a code a script can read. All eleven test lines pass at the branch head.

Notes from the agent: Conflict round. In crates/minimal/src/tests.rs, both sides added tests at the end of the file. The branch added the attach tests, and main added hold_record and none_box_hold_is_released_by_destroy_and_moved_by_rename. The resolution keeps both, with no other edits. The other files in the merge commit come from main without conflicts. cargo clippy -p minimal --all-targets is clean. main's merged test none_box_hold_is_released_by_destroy_and_moved_by_rename also passes.

@agent-137
Copy link
Copy Markdown
Member

/revise Review at head 56f99b7. The four files outside the layers (cmd/boxes.rs, cmd/boxes/list.rs, cmd/mod.rs, minimald-rpc/src/tests.rs) are accepted as wiring. Fix these:

  1. Blocking: the ending of an attach races the stop's record write (BCLI-068: a stop ends the attach with 254 and one line naming the cause). crates/minimal/src/cmd/boxes/attach.rs ~799 reads ShowBox once, right after ssh exits, and ~1018-1036 decides the ending from that state. But the daemon signals the box's processes first, and writes StopEnding only after it reaps the entrypoint (crates/minimald/src/box_actor/host.rs ~1700-1735). So the channel can close while the record still reads running:

    • (0, running) exits 0 with no line, which is wrong for a stop.
    • (254, running) prints "Detached: another terminal attached to web.", which is the wrong cause.
    • A stop whose entrypoint exits on SIGTERM records ExitedFirst { exit_code }, and the exit_code.is_none() guard ~1034 turns its reported 0 into a plain 0.

    The test attach_ended_from_other_side_notice_exit254 waits for the stop before it returns a code, so it never sees the race. Do the planned crates/minimal/src/attach.rs layer ("the terminal attach reports why the daemon ended it"): the client learns the cause from the daemon's end of the attach, not from a later read. If the cause cannot travel on the current wire, poll ShowBox with a bound until the state leaves running, and only then decide. Add a test that drives the real ordering, where the channel closes before the record leaves running.

  2. The cause prints twice. The daemon writes its own line into the PTY before it ends the attach ("Disconnecting - the session is gone", "Disconnecting - session attached to from a different connection", "Disconnecting - minimald is shutting down": crates/minimald/src/box_runtime/binding.rs ~458, ~1036, ~1167-1180). Then the client adds "Detached: …" on stderr. BCLI-068 asks for one line. Keep the client's line and stop the daemon's line for a min box attach. Editing binding.rs for that is accepted. If the daemon's line must stay for older clients, say why in the PR body.

  3. Smaller:

    • "Detached: host X shut down." (~1032) prints for every HostSilent case: not running, unreachable and probe timeout. Say what can happen, or tell the cases apart.
    • "Detached: web is exited (exit 3)." reads badly. Use "web exited with code 3".
    • Make box_actor.rs ~1333-1339 call record_has_pty (box_manager.rs ~1018) instead of keeping a second copy of the check.

Change nothing else.

The resume's PTY check and the listing's record_has_pty were two copies
of one rule. The resume now calls record_has_pty.
The daemon closes the attach's channel before it writes the stopped
record, so one read after ssh exits could see the box still running.
The read now polls under a bound until the box leaves running. A stopped
box ends with 254 whatever exit code its entrypoint recorded. The host
and exited lines now say what can happen in plain words.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-02dc... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-ce54... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-57d8... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-3c56... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-8dd4... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling mlog v0.0.1 (/workbench/crates/mlog) Compiling minimal-clie
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-7e64... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-9c88... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-bf73... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-c788... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-16da... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-1227... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

6d1",
                "span_id": "4ee7f048d6549290",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "3395e7a3dea256d1",
                "span_id": "f6ad988895150110",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "3395e7a3dea256d1",
                "queued_behind": "0",
                "span_id": "79bd038297934624",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "3395e7a3dea256d1",
                "queued_behind": "0",
                "span_id": "7128ceec5dd433af",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "7128ceec5dd433af",
                "span_id": "11a62320dcc649af",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "7128ceec5dd433af",
                "queued_behind": "0",
                "span_id": "deec15827293b4e2",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.383s] ( 930/2351) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.387s] ( 931/2351) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.433s] ( 932/2351) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
────────────
     Summary [  53.478s] 932/2351 tests run: 931 passed, 1 failed, 26 skipped
        FAIL [   3.768s] ( 929/2351) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1419/2351 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor.rs

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

min box attach reattaches a terminal box and finds the project's box when no address is given. It exits 0 on a detach or entrypoint exit, 2, 4 or 7 on a refusal, and 254 with one line naming the cause when the daemon ends the attach. A stop now ends with 254 and "Detached: web was stopped." even when the channel closes before the daemon writes the stopped record.

Notes from the agent: Revise round 1.

Item 1 (blocking): I used the fallback that the note allows. The cause cannot travel on the current wire. The attach runs through an OpenSSH subprocess, so the client sees only ssh's exit status. The daemon's binding also does not know whether a stop or a removal ended the host. After ssh exits with 0 or 254, the client now polls ShowBox every 50 ms while the box reads running. The bound is 2 s for 254 and 500 ms for 0. A box still running at the 254 bound lost its terminal to another attach. The (0, stopped) case no longer checks exit_code.is_none(), so a stop whose entrypoint exits on SIGTERM ends with 254. I removed the old kept case from attach_detach_or_entrypoint_exit_returns_0. It claimed that the shell-exit prompt's Keep records stopped, but only a stop writes that state (box_manager.rs set_state(Stopped)). The new test attach_ended_from_other_side_notice_exit254_before_the_record closes the channel first and stops the box 100 ms later. With both bounds set to zero it fails with "another terminal attached to web". I checked that, and then restored the bounds. Trade-off: every detach now waits up to 500 ms before min box attach exits, because a detach and an in-flight stop look the same to the client.

Item 2: NOT done. The daemon's binding cannot tell a min box attach from a min session attach or min dash. The channel carries no marker for it, and binding.rs alone cannot get one. Carrying a marker needs a SendEnv var in the client and the flag threaded through connection.rs, box_actor/attach.rs, box_actor/host.rs, box_runtime/hand…[truncated]

…a-box-s-terminal-with-or-without-an-ad

# Conflicts:
#	crates/minimal/src/tests.rs
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

A merge of main before round 2, not counted against the cap (2 of 3), pushed as e6ac801b0805.

Resolved conflicts in: crates/minimal/src/tests.rs

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-d4cc... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-7b46... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-e3c1... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-754d... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-7f35... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-eac4... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-9a65... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-9878... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crate 8BD0 s/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-1dab... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-e5f3... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-84c4... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

810",
                "span_id": "0603b92508ffdce5",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "9ec8bf472bb44810",
                "span_id": "c3bf4094c877e63c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "9ec8bf472bb44810",
                "queued_behind": "0",
                "span_id": "c53d60c6836aa5fc",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "9ec8bf472bb44810",
                "queued_behind": "0",
                "span_id": "ac51753b2ab8ab58",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "ac51753b2ab8ab58",
                "span_id": "00e84f9693628ed3",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "ac51753b2ab8ab58",
                "queued_behind": "0",
                "span_id": "d3c94f0549a3e60f",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.350s] ( 931/2360) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.390s] ( 932/2360) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.409s] ( 933/2360) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
────────────
     Summary [  56.812s] 933/2360 tests run: 932 passed, 1 failed, 26 skipped
        FAIL [   3.254s] ( 930/2360) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1427/2360 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor.rs

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

min box attach reattaches a terminal box, finds the project's box with no address, and exits with a code a script can read. The branch now merges cleanly with main and all of the task's tests pass.

Notes from the agent: Conflict round. The only conflict was in crates/minimal/src/tests.rs: this branch added the attach tests and helpers, and main added run_address_step and the address end-to-end test, at the same place. Both sides are independent, so the resolution keeps both blocks unchanged. The merge commit is e6ac801. The merge also brought in main's changes to crates/minimald/src/box_runtime/enforcement.rs and launcher.rs, which are not this task's edits. The 10 minimal test lines ran in one nextest invocation with their filters combined, not one by one.

…a-box-s-terminal-with-or-without-an-ad

# Conflicts:
#	crates/minimal/src/cli.rs
#	crates/minimal/src/cmd/mod.rs
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

A merge of main before round 2, not counted against the cap (3 of 3), pushed as bc5aac72730c.

Resolved conflicts in: crates/minimal/src/cli.rs, crates/minimal/src/cmd/mod.rs

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-2c88... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-3dda... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-313c... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-93d2... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-08ee... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-8502... Compiling stdlib v0.0.22 (/ 10000 workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-8af4... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-f77e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-601c... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-ce08... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-b289... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

         "span_id": "c09c07984a5fddca",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "95858af94f0d4ce5",
                "span_id": "beff44e183b74981",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "95858af94f0d4ce5",
                "queued_behind": "0",
                "span_id": "6a49549891b54e6c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "95858af94f0d4ce5",
                "queued_behind": "0",
                "span_id": "27c5c9858b3f8dfb",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "27c5c9858b3f8dfb",
                "span_id": "25e4dc5355d82ade",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "27c5c9858b3f8dfb",
                "queued_behind": "0",
                "span_id": "90eee1d79ce5131c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.366s] ( 933/2374) minimald box_actor::tests::a_box_destroyed_inside_the_landing_window_is_not_resurrected
        PASS [   2.453s] ( 934/2374) minimald box_actor::tests::a_box_destroyed_between_enumeration_and_grant_is_released_once
        PASS [   2.425s] ( 935/2374) minimald box_actor::tests::a_box_holding_a_host_row_refuses_remint_after_its_host_loop_ends
────────────
     Summary [  50.457s] 935/2374 tests run: 934 passed, 1 failed, 26 skipped
        FAIL [   3.048s] ( 932/2374) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1439/2374 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor.rs

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

min box attach reattaches a terminal box, finds the project's box with no address, and exits with a code a script can read. The verb now sits beside main's new min box rename and min box prune.

Notes from the agent: Conflict round only. Both conflicts were the BoxCommand enum in cli.rs and its two match arms in cmd/mod.rs (verb name and dispatch). main added Rename and Prune where this branch added Attach. I kept all three variants and arms. The other merged files came from main without conflict. cargo clippy -p minimal --all-targets is clean, and all 11 test lines pass at the merge commit.

@agent-137
Copy link
Copy Markdown
Member

/revise Two follow-ups at head bc5aac7. The poll fix is right for the common case.

  1. The bound after a 254 is shorter than a stop's grace period (crates/minimal/src/cmd/boxes/attach.rs ~997-1003). A stop sends SIGTERM, then waits until the entrypoint has ended and no process is left, or until the 10 s STOP_GRACE (box_actor/host.rs ~1580, ~1660-1690). Only then does it write StopEnding. When a background process in the box ignores SIGTERM, the attach closes and the record reads running for up to STOP_GRACE plus HOST_PROBE_TIMEOUT. So after 2 s the client prints "Detached: another terminal attached to web." for what was a stop. After a 254, poll until STOP_GRACE plus HOST_PROBE_TIMEOUT (use the shared constants), still stopping as soon as the state leaves running. Keep the 500 ms bound after a 0, and note that trade-off in the PR body. Add a test where the record leaves running later than 2 s after a 254.
  2. The OOM line never prints (attach.rs ~1096-1098). An OOM record stores exit_code = 137 (OOM_EXIT_CODE, record.rs), so the (Some(code), _) arm matches first and prints "Detached: web exited with code 137.". Match the OOM reason before the exit-code arm, and add a test.

The duplicate cause line is residual #3035 now (named in the PR body), so leave binding.rs alone. Change nothing else.

…over

After a 254 the read now polls for STOP_GRACE plus HOST_PROBE_TIMEOUT,
shared from minimald-rpc, so a stop that waits on a process ignoring
SIGTERM still prints the stop line. An OOM record carries exit code 137,
so its reason is matched before the exit code.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-e5ae... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-3a7b... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-468a... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-3db8... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-4dc5... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-48ca... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-281b... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-64fa... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-c4c9... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-083d... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-0ae0... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

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.

-home/build/debug/deps/libserial_test-616c86b3b044ed08.rlib --extern sha2=/work/build-cache/cargo-home/build/debug/deps/libsha2-405f5187d962ed1a.rlib --extern size=/work/build-cache/cargo-home/build/debug/deps/libsize-e57ebc05cac6ccb3.rlib --extern stdlib=/work/build-cache/cargo-home/build/debug/deps/libstdlib-f3b17164c250397c.rlib --extern switch=/work/build-cache/cargo-home/build/debug/deps/libswitch-0af40ca30538ccd4.rlib --extern sysinfo=/work/build-cache/cargo-home/build/debug/deps/libsysinfo-82e2106fbfb32fa0.rlib --extern tar=/work/build-cache/cargo-home/build/debug/deps/libtar-d8cf8e5bef99c1a6.rlib --extern tempfile=/work/build-cache/cargo-home/build/debug/deps/libtempfile-64539d81e127ad8f.rlib --extern thiserror=/work/build-cache/cargo-home/build/debug/deps/libthiserror-31ad7b029b93b712.rlib --extern tokio=/work/build-cache/cargo-home/build/debug/deps/libtokio-a9eca338333a2325.rlib --extern tokio_util=/work/build-ca
10BC8
che/cargo-home/build/debug/deps/libtokio_util-c623093db2043123.rlib --extern tokio_vsock=/work/build-cache/cargo-home/build/debug/deps/libtokio_vsock-1b22471493ad6549.rlib --extern tracing=/work/build-cache/cargo-home/build/debug/deps/libtracing-be36af57e81cc6b6.rlib --extern tracing_appender=/work/build-cache/cargo-home/build/debug/deps/libtracing_appender-a781743e4fae0de5.rlib --extern tracing_opentelemetry=/work/build-cache/cargo-home/build/debug/deps/libtracing_opentelemetry-75005db83331e3e9.rlib --extern tracing_subscriber=/work/build-cache/cargo-home/build/debug/deps/libtracing_subscriber-ac6841183ad66e15.rlib --extern uuid=/work/build-cache/cargo-home/build/debug/deps/libuuid-19bd2dbddf178337.rlib --extern version=/work/build-cache/cargo-home/build/debug/deps/libversion-ee2066c0d67b2e56.rlib --extern vsock=/work/build-cache/cargo-home/build/debug/deps/libvsock-c2be0d0dc103bb93.rlib --extern vt100=/work/build-cache/cargo-home/build/debug/deps/libvt100-060d3379d50b0dbc.rlib --extern walkdir=/work/build-cache/cargo-home/build/debug/deps/libwalkdir-78bf723f3e841c1f.rlib --extern zstd=/work/build-cache/cargo-home/build/debug/deps/libzstd-b7c20e74c54f6308.rlib -L native=/work/build-cache/cargo-home/build/debug/build/tree-sitter-64b47a9d246aab62/out -L native=/work/build-cache/cargo-home/build/debug/build/tree-sitter-nickel-50eec70fb8e68069/out -L native=/work/build-cache/cargo-home/build/debug/build/zstd-sys-3df630743cf715ff/out -L native=/work/build-cache/cargo-home/build/debug/build/ring-3c60c1595d114743/out -L native=/work/build-cache/cargo-home/build/debug/build/aws-lc-sys-4c33c964f163c571/out -L native=/work/build-cache/cargo-home/build/debug/build/blake3-12a86e91b52050e7/out -L native=/work/build-cache/cargo-home/build/debug/build/blake3-12a86e91b52050e7/out` (exit status: 2)
warning: build failed, waiting for other jobs to finish...
error: command `/usr/bin/cargo '--color=auto' test --no-run --message-format json-render-diagnostics --package minimal --package minimald --package minimald-rpc --locked` exited with code 101

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/host.rs

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

min box attach reattaches a terminal box, finds the project's box with no address, and exits with a code a script can read. After a 254, a stop that the daemon records up to STOP_GRACE plus HOST_PROBE_TIMEOUT later now prints "Detached: web was stopped.". An OOM end now prints "Detached: web ran out of memory and ended.".

Notes from the agent: Round 2. Item 1: DAEMON_END_SETTLE is now STOP_GRACE + HOST_PROBE_TIMEOUT (12 s). The poll still stops as soon as the state leaves running. The 500 ms bound after a 0 is unchanged. Trade-off for the PR body: a real takeover (another terminal attached) now waits the full 12 s before its line prints, and a detach that the daemon reports as 0 still waits up to 500 ms. A stop whose record lands later than 500 ms after a 0 still reads as a plain exit 0. To share the constants, I moved STOP_GRACE and HOST_PROBE_TIMEOUT to pub consts in crates/minimald-rpc/src/lib.rs. crates/minimald/src/box_actor/host.rs is outside the layers: its two pub(crate) consts now alias the minimald-rpc values (two lines, same values). The client does not depend on minimald at runtime, so this was the only way to use one definition. New test: a 254 case in attach_ended_from_other_side_notice_exit254_before_the_record where the stop lands 2.5 s after the channel closes. Item 2: ended_box_line matches reason oom before the exit-code arm. attach_ended_from_other_side_notice_exit254 now pins the OOM line for a record with exit_code 137. binding.rs is untouched. I did not run just clippy-strict.

…a-box-s-terminal-with-or-without-an-ad

# Conflicts:
#	crates/minimal/src/cli.rs
#	crates/minimal/src/cmd/mod.rs
#	crates/minimal/src/main.rs
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a conflict with the base branch, pushed as abf760a33d84.

Resolved conflicts in: crates/minimal/src/cli.rs, crates/minimal/src/cmd/mod.rs, crates/minimal/src/main.rs

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-a145... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-ffb9... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-4885... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-7d57... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-3444... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-f7d7... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-a285... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-5033... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-8fa7... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-c7e5... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-e9af... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

10b",
                "span_id": "68db33379d17b4f3",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "0f32e649baf3010b",
                "span_id": "1aaec0a92c884f97",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "0f32e649baf3010b",
                "queued_behind": "0",
                "span_id": "df335a4df4764e8c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "0f32e649baf3010b",
                "queued_behind": "0",
                "span_id": "bbe4077b3e4b5169",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "bbe4077b3e4b5169",
                "span_id": "baad3e3fc9c55bcd",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "bbe4077b3e4b5169",
                "queued_behind": "0",
                "span_id": "ac0667546b1ad259",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.353s] ( 941/2379) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.376s] ( 942/2379) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.396s] ( 943/2379) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
────────────
     Summary [  53.574s] 943/2379 tests run: 942 passed, 1 failed, 26 skipped
        FAIL [   3.181s] ( 940/2379) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1436/2379 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/host.rs

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

min box attach reattaches a terminal box, finds the project's box with no address, and exits with a code a script can read. After the merge of main, min box events, min box cp and min box attach all exist side by side.

Notes from the agent: This round resolved the merge conflict with main and changed nothing else. The three conflicts in cli.rs, cmd/mod.rs and main.rs kept both sides. The Attach variant, its name and its dispatch sit beside the new Events and Cp variants from main. failure_exit_code checks BoxAttachRefusal and then BoxFileRefusal. cargo clippy -p minimal --all-targets is clean after the merge.

@agent-137
agent-137 marked this pull request as ready for review November 5, 2026 04:22
@agent-137
agent-137 requested a review from a team as a code owner November 5, 2026 04:22
@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.

Reviewed at abf760a against #2904 (BCLI-068), with the daemon layer. The listing and show replies carry the stored spec's pty_enabled (serde default false). min box attach reattaches a terminal box, refuses a running non-PTY box with exit 2 naming min box logs, and in the bare form picks the project's terminal boxes. After the attach ends it polls the record while it reads running, up to 500 ms after a 0 and STOP_GRACE + HOST_PROBE_TIMEOUT after a 254 (shared constants), then names one cause; an OOM end is read before its 137. The daemon's duplicate PTY line is residual #3035.

@agent-137
agent-137 commented 10BC8 Nov 5, 2026
Copy link
Copy Markdown
Member

/review

@minimal-foundry
minimal-foundry Bot commented Nov 5, 2026 •
Copy link
Copy Markdown
Contributor Author

Reviewed: 1 finding, none blocking at 3d4c26bc6ebd.

Address the comments on the diff.

Clobber: none seen.

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

The lookup, the refusals and the placement conform to architecture.md line 491. The exit codes do not. Line 491 and line 376 give an attach only 0, 7 and 254, and 254 only for a stop, a removal or a takeover. attach_ending lets ssh's 255 out as the exit code (C1). It exits 254 for a box that ended by itself (C2). It exits 254 with no stderr line when the read after the attach fails (C3). The --exec legs of BCLI-068 are not built, and the PR names no issue that owns them (C4).

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

Comment thread crates/minimal/src/cmd/boxes/attach.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/attach.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/attach.rs Resolved
Comment thread crates/minimal/src/cli.rs Resolved
A 254 against a box that still runs waits the stop's grace period to
read why. After one quiet second, the terminal now says the attach
ended and how long the check can take.
…a-box-s-terminal-with-or-without-an-ad

# Conflicts:
#	crates/minimal/src/cli.rs
#	crates/minimal/src/cmd/mod.rs
#	crates/minimal/src/main.rs
@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 5 unresolved threads — minimal-foundry[bot] crates/minimal/src/cmd/boxes/attach.rs:1022, minimal-arch[bot] crates/minimal/src/cmd/boxes/attach.rs:1119, minimal-arch[bot] crates/minimal/src/cmd/boxes/attach.rs:1104, minimal-arch[bot] crates/minimal/src/cmd/boxes/attach.rs:1119, minimal-arch[bot] crates/minimal/src/cli.rs:621. No findings.

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

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arch-review: CONDITIONS · 1 condition · the full ruling

Commit 1385327c adds a second stderr line before a 254 exit. A takeover, or a slow stop, now prints Detached from <box>. Checking why. ... and then the Detached: ... notice. architecture.md line 491 says attach exits 254 after a one-line notice on stderr. BCLI-068 says the same. Make the change in C1: remove the wait line and keep the one bounded read. The rest of the change conforms, and the merge resolution keeps both attach and exec.

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

Comment thread crates/minimal/src/cmd/boxes/attach.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/attach.rs Resolved
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on the runtime's review findings, pushed as 3fb19805ca59.

Resolved conflicts in: crates/minimal/src/cli.rs, crates/minimal/src/cmd/mod.rs, crates/minimal/src/main.rs

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-eba1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-cdd8... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-f4e5... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-c49f... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-1c9f... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-b530... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-f242... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-10d8... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-380e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-239a... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-71f6... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

5bf",
                "span_id": "8060df5d4120d4cb",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "6e5487379737b5bf",
                "span_id": "c81f95705615d535",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "6e5487379737b5bf",
                "queued_behind": "0",
                "span_id": "b95515b5edbe0de7",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "6e5487379737b5bf",
                "queued_behind": "0",
                "span_id": "e6ed8deebc052897",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "e6ed8deebc052897",
                "span_id": "09caaec9036444c0",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "e6ed8deebc052897",
                "queued_behind": "0",
                "span_id": "00f78b14236e5d7b",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.456s] ( 950/2389) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.425s] ( 951/2389) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.558s] ( 952/2389) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
────────────
     Summary [  61.024s] 952/2389 tests run: 951 passed, 1 failed, 26 skipped
        FAIL [   3.348s] ( 949/2389) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1437/2389 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/host.rs

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

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/attach.rs:1022: After a 254, the settle now waits 1 s quietly. If the box still reads running, stderr prints "Detached from . Checking why. This can take up to 11 seconds." before the rest of the wait. A shorter bound is not possible here: the daemon gives no signal that separates a takeover from a stop in pro

min box attach reattaches a terminal box and finds the project's box when no address is given. It exits with a code a script can read: 0, 2, 4, 7 or 254. After a takeover, the terminal now says within one second that the attach ended and that the check can take up to 11 seconds.

Notes from the agent: Round 4 change: when the daemon ends an attach (254) and the box still reads running after 1 s, stderr now prints "Detached from . Checking why. This can take up to 11 seconds." Then the rest of the settle bound runs. Unit test daemon_end_wait_line_names_the_box_and_the_wait pins the text. The daemon sends no signal that separates a takeover from a stop in progress. So a shorter bound for a takeover needs a daemon change in box_actor, which is outside this task's layers.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 5, 2026 05:28
@agent-137
Copy link
Copy Markdown
Member

/revise Round 4 answered only the foundry LOW (thread B00). Arch's conditions at abf760a and its new ruling at 3fb1980 are open. Fix them, and decline B00 in its thread (arch's line 491 rules it out).

New C1 (threads z7WyC, z7WyF; architecture.md line 491, "a one-line notice"): revert 1385327's wait line. Remove the eprintln! "Detached from . Checking why…", the two-step read, DAEMON_END_QUIET, daemon_end_wait_line() and its test. Restore the single bounded DAEMON_END_SETTLE read after a 254. That line also claimed "up to 11 seconds" while each read can take up to client::PROBE_TIMEOUT, so it was not provable.

Arch C1-C3 at abf760a (crates/minimal/src/cmd/boxes/attach.rs ~1092-1119):

  • C1 (z7ElQ): a 255 from a host that still answers (Listed, Gone, Unread) falls to _ and exits 255. Map it to ConnectionLost, exit 7, as (255, HostSilent) already is.
  • C2 (z7ElT): a 254 whose record reads exited ends with 0, and keeps its notice (the box's entrypoint ended, so the attach ended normally). Today ~1104 sends every non-running, non-stopped record through ended(), giving 254.
  • C3 (z7ElW): a 254 with an unread record (Unread) prints one line naming the host, not notice: None.
    Flip the tests that pin the old behaviour (tests.rs ~8139-8158, ~8173-8179, ~8267-8268, ~8303-8320) to the new endings.

C4 (z7ElX) is done: the PR body names #2913 for --exec. Change nothing else.

The design allows one notice line before exit 254. This reverts
1385327 and restores the single DAEMON_END_SETTLE read.
Every ssh 255 is now a lost connection, exit 7. A 254 against a box
that reads exited ends with 0 and keeps its line. A 254 with an
unread record prints one line that names the host.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-a1a4... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-86ec... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-2878... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-e0e9... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-b088... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-06b6... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-d126... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-33d4... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-a098... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-78e6... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-2ad2... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

1c7",
                "span_id": "2f46883269d65580",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "1db779e2154251c7",
                "span_id": "2fec1178ecbc555c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "1db779e2154251c7",
                "queued_behind": "0",
                "span_id": "d2e5b485f6eedc72",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "1db779e2154251c7",
                "queued_behind": "0",
                "span_id": "cd6da1370235bb17",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "cd6da1370235bb17",
                "span_id": "a965843edf00ab5e",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "cd6da1370235bb17",
                "queued_behind": "0",
                "span_id": "0034b989ed8c1540",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.469s] ( 954/2396) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.422s] ( 955/2396) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
        PASS [   2.504s] ( 956/2396) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
────────────
     Summary [  65.936s] 956/2396 tests run: 955 passed, 1 failed, 26 skipped
        FAIL [   3.397s] ( 953/2396) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1440/2396 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/host.rs

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

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/attach.rs:1110: Every ssh 255 now returns ConnectionLost (exit 7), whatever the later read says. The tests expect 7 for Listed, Gone and Unread, and for a live host.
  • 👍 valid — crates/minimal/src/cmd/boxes/attach.rs:1087: A 254 whose record reads exited now ends with code 0 and keeps the ended_box_line text as its notice. The tests check code 0.
  • 👍 valid — crates/minimal/src/cmd/boxes/attach.rs:1110: Added an Unread arm for 254 that prints Detached: host <host> ended the attach to <label>. The test pins that line.
  • 👍 valid — crates/minimal/src/cmd/boxes/attach.rs: Reverted 1385327. The eprintln and the two-step read are gone, and one box_after_attach_settled(..., DAEMON_END_SETTLE) call remains.
  • 👍 valid — crates/minimal/src/cmd/boxes/attach.rs: Deleted daemon_end_wait_line(), DAEMON_END_QUIET and the test daemon_end_wait_line_names_the_box_and_the_wait.
  • 👎 invalid — crates/minimal/src/cmd/boxes/attach.rs:1005: The design (architecture.md line 491) allows one notice line before a 254. A line that prints during the takeover wait needs a design change first, so the wait stays silent and the round 4 wait line is reverted.

min box attach reattaches a terminal box and finds the project's box with no address. It now ends only with 0, 7 or 254 after an attach: every ssh 255 exits 7, a box that exited by itself exits 0 with its one line, and every 254 prints exactly one line.

Notes from the agent: Reverted 1385327 (wait line, DAEMON_END_QUIET, daemon_end_wait_line and its test). The single DAEMON_END_SETTLE read after a 254 is back. A 255 no longer reads the box afterwards, because every 255 now maps to ConnectionLost. C2 follows the ruling literally: every 254 whose record reads exited ends with 0, and that includes the timeout and oom reasons, because those records also read exited. If arch wants timeout and oom to stay 254, that is a one-guard change. The tracing outcome ended by the host now follows exit 254, not the presence of a notice. I ran the ten client test lines as one filtered nextest run (attach_), not one by one. Thread B00 changes to invalid this round, per the /revise note. clippy -p minimal --all-targets is clean.

@agent-137
agent-137 marked this pull request as ready for review November 5, 2026 06:40
@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.

Re-reviewed at 9827817. 4d9fc70 drops the wait line, so a 254 ends with one notice line after one bounded settle read (architecture.md line 491). bc036d2 ends min box attach with 0, 7 or 254 only: every 255 is a lost connection (exit 7), a 254 whose record reads exited ends with 0 and its line, and a 254 with an unread record prints 'Detached: host ended the attach to .'. The tests that pinned the old endings are flipped. The minimal-review takeover-wait thread is declined under line 491.

@agent-137
Copy link
Copy Markdown
Member

/review

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

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

Comment thread crates/minimald/src/box_manager.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: PASS · the full ruling

This head conforms to architecture.md line 491 and line 376. The wait line before a 254 is gone, so a 254 prints one line on stderr. Every ssh 255 is now exit 7. A box that reads exited returns 0, as line 376 says for the entrypoint's own exit. The --exec legs stay with #2913, and the daemon's Disconnecting line stays with #3035.

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

A spec read error listed the box with no terminal, so a bare
min box attach could skip a real session. The listing now falls back
to the Box Type, as for a box with no stored spec, and logs a warning.
@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 compare changes one thing. A box with an unreadable stored spec now lists by its Box Type, the same as a box with no spec. A session is a terminal box by architecture.md line 1184, so a bare min box attach finds it as line 491 requires. The resume and launch gates still refuse an unreadable spec, so the daemon fails closed. The rest of the baseline PASS on 98278174 stands.

Ruled at 3d4c26b against gominimal/arch@7a86ec7bb3c0 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 — advisory review

Verdict COMMENT — 1 finding, 1 inline.

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

Comment thread crates/minimal/src/cmd/boxes/attach.rs Resolved
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 6 of 10 on the runtime's review findings, pushed as 3d4c26bc6ebd.

line exit tail
cargo nextest run -p minimald box_listing_and_show_carry_pty_enabled 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-7e8f... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_reattaches_pty_box 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-46a0... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/wo
cargo nextest run -p minimal box_attach_without_tty_exit2 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-7a8e... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_running_non_pty_box_exit2_names_logs 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-deaf... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_picks_running_else_sole_retained 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-4511... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_ambiguous_exit2_lists 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-0f06... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_none_exit4_hints_start 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-f4b7... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal box_attach_without_address_unreachable_host_exit7 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-0090... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_detach_or_entrypoint_exit_returns_0 0 Applying loadouts: default Running task runtime-implement-test-8 in session task-runtime-implement-test-8-59e0... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_ended_from_other_side_notice_exit254 0 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-590c... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.
cargo nextest run -p minimal attach_connection_failure_exit7 0 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-5e1c... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

42d",
                "span_id": "15fb66928c31ffc0",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "GetPaths",
                "parent_span_id": "25f37822de8a642d",
                "span_id": "69f43fe943d53877",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "25f37822de8a642d",
                "queued_behind": "0",
                "span_id": "d660c2254382bc24",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "25f37822de8a642d",
                "queued_behind": "0",
                "span_id": "c71141d27a5d1cb8",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "c71141d27a5d1cb8",
                "span_id": "4ced11759c3824b4",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "c71141d27a5d1cb8",
                "queued_behind": "0",
                "span_id": "907edba431246f70",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   2.338s] ( 954/2396) minimald box_actor::tests::a_box_nobody_handed_an_address_publishes_at_the_answerers_grant
        PASS [   2.365s] ( 955/2396) minimald box_actor::tests::a_box_re_registered_inside_the_landing_window_keeps_its_grant
        PASS [   2.362s] ( 956/2396) minimald box_actor::tests::a_contended_walk_never_replaces_a_present_verdict
────────────
     Summary [  56.329s] 956/2396 tests run: 955 passed, 1 failed, 26 skipped
        FAIL [   3.023s] ( 953/2396) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
warning: 1440/2396 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes.rs
  • crates/minimal/src/cmd/boxes/list.rs
  • crates/minimal/src/cmd/mod.rs
  • crates/minimald-rpc/src/tests.rs
  • crates/minimald/src/box_actor.rs
  • crates/minimald/src/box_actor/host.rs

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

Review threads the coder judged:

  • 👍 valid — PRRT_kwDOPdfcxM6z88T0: A spec read error in the Listing handler now falls back to the Box Type (a session keeps its terminal), logs at warn, and the listing test pins the case. The per-box read stays: it is one small file read, the same cost as the record read. (not posted on the thread: not an open thread on the pull request)

min box attach reattaches a terminal box. With no address it finds the project's box, and a session whose stored spec cannot be read now still counts as a box with a terminal. Each ending exits with a code a script can read.

Notes from the agent: Revise round 6. The only change is the Listing handler in minimald: a spec read error now falls back to the Box Type, as for a box with no stored spec, and logs at warn, not debug. box_listing_and_show_carry_pty_enabled gains an unreadable-spec session case (a directory at spec.json). The finding also mentions one spec read per box in the manager loop. I left that as it is: it is one small file read per retained box, the same cost as the record read beside it. cargo clippy -p minimald --all-targets is clean. The client files did not change this round.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 5, 2026 07:24
@agent-137
agent-137 marked this pull request as ready for review November 5, 2026 07:40
@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.

Re-reviewed at 3d4c26b. 3d4c26b lists a box whose stored spec cannot be read by its box type's terminal setting, so a bare min box attach no longer skips such a session (minimal-review z88T0). The attach ending table is unchanged. The new LOW on the settle bounds is declined as the approved design.

@agent-137
agent-137 added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 47eba5d Nov 5, 2026
36 checks passed
@agent-137
agent-137 deleted the agent/2904-attach-to-a-box-s-terminal-with-or-without-an-ad branch November 5, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T12 — Attach to a box's terminal, with or without an address

1 participant

0