Skip to content

feat(minimal): T131 — Skip and name each export that cannot be copied, and end a successful command with exit 125 - #3487

Merged
mitodrummer merged 6 commits into
mainfrom
agent/3445-skip-and-name-each-export-that-cannot-be-copied
Nov 17, 2026
Merged

mitodrummer merged 6 commits into
mainfrom
agent/3445-skip-and-name-each-export-that-cannot-be-copied

Conversation

@minimal-foundry

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

Copy link
Copy Markdown
Contributor

T131 — Skip and name each export that cannot be copied, and end a successful command with exit 125

slice: S2
kind: task
covers: BOX-190, BOX-191, BOX-193, BOX-194
size: M
est: 170 code, 230 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: each skipped or refused export is named on stderr with its path
observability: the box's record carries a file_exported event for each export
layers:
- client:
- crates/minimal/src/cmd/boxes/exports.rs: skip and name each failing export; a partly written export counts as skipped
- crates/minimal/src/task.rs: exit 125 in place of 0 when an export is skipped; other codes stand
- crates/minimal/src/cmd/boxes/attach.rs: the same for an attach
- crates/minimal/src/cmd/boxes/wait.rs: the same for min box wait
- crates/minimal/src/tests.rs: tests
test: cargo nextest run -p minimal missing_export_named_and_others_copied
test: cargo nextest run -p minimal failed_export_file_leaves_its_destination_unchanged
test: cargo nextest run -p minimal skipped_export_exit125_when_task_succeeded
test: cargo nextest run -p minimal skipped_export_keeps_failed_task_exit_code
produces: none
consumes:
- crates/minimal/src/cmd/boxes/exports.rs
proof: a task whose export is missing, one whose destination is a symlink out of the project, and one whose source leaves /workbench each name the export, copy the rest, and exit 125; a task that timed out still exits 124.
depends on:
- blocked by #3444

Proof

Three exports are skipped in the tests: one that is missing in the box, one whose destination is a symlink out of the project, and one whose source leads out of /workbench. Each one gets its own stderr line with its path, and the other exports are still copied. When the entrypoint exited 0, an attached task run, min box attach and min box wait now exit 125. A run that timed out still ends as a box timeout (exit 124). A failed or stopped box keeps its own code.

Notes from the agent: The skip logic and the per-export stderr lines (BOX-190, BOX-191, BOX-192, BOX-196) were already in exports.rs from T130. This task adds exit_code_after_exports and any_export_skipped in exports.rs, plus task::exit_after_exports. These are wired into the attached run in task.rs, into attach.rs and into wait.rs, and the interim doc comments that cited #3445 are updated. The attach and wait paths give 125 only when the record shows state exited with exit_code 0. Note that an attach to a box whose entrypoint exited non-zero still exits 0, as before (attach_ending returns 0 for an exited box). BOX-194 keeps that code. Every skip line now reads Export <path> was not copied: <reason>., the text T131's plan fixes for BOX-190 and BOX-191, after the /revise of 2026-11-16. The behaviour is proved with unit tests on copy_exports and the exit-code helpers, and with one daemon-harness wait on a stopped box. No test drives an exited-0 box through the daemon harness to observe 125 end to end, because the harness has no cheap way to run an entrypoint to exit 0. Related export tests (17, filter 'export', 'exit_outcome', 'detached_start', 'attached_run') also pass.

Tests

line exit tail
cargo nextest run -p minimal missing_export_named_and_others_copied 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal failed_export_file_leaves_its_destination_unchanged 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal skipped_export_exit125_when_task_succeeded 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal skipped_export_keeps_failed_task_exit_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new

Verify

min task run agent-verify exited 100, so this PR is a draft.

 {
                "parent_span_id": "7653d6fc5798ae71",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "6b227c57c3ed202b",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "6b227c57c3ed202b",
                "queued_behind": "0",
                "span_id": "ac40a057da766a97",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "7653d6fc5798ae71",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "fa10ca26b05fa024",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "fa10ca26b05fa024",
                "queued_behind": "0",
                "span_id": "648c762f75409641",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "fa10ca26b05fa024",
                "queued_behind": "0",
                "span_id": "c2fa3591a502ceba",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "c2fa3591a502ceba",
                "span_id": "4fd810190be1ca9d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "c2fa3591a502ceba",
                "queued_behind": "0",
                "span_id": "6234a81ee4e6a2d1",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  85.336s] 1164 tests run: 1163 passed, 1 failed, 2 skipped
        FAIL [  13.101s] (1164/1164) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Closes #3445

A command that waits for a box (an attached task or box run, box attach,
box wait) now ends with exit 125 in place of 0 when the entrypoint exited 0
and an export was missing, refused or only partly written. Every other code
stands, so a timeout still exits 124 (BOX-193, BOX-194).

Tests pin the per-export skip lines and the unchanged destinations
(BOX-190, BOX-191).
@coderabbitai

coderabbitai Bot commented Nov 16, 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: 5bd93eff-3466-4dbd-84b6-65532c552eb6

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

@agent-137

Copy link
Copy Markdown
Member

/revise Use the stderr text T131's plan fixes for BOX-190 and BOX-191. This PR keeps T130's interim wording, so one export run can print two styles. T134's lines already use the planned style. In crates/minimal/src/cmd/boxes/exports.rs:

  • NotCopied::NotFound (BOX-190): Export <path> was not copied: it was not found in the box.
  • NotCopied::Failed(reason) (BOX-191): Export <path> was not copied: <reason the system gave>.
  • the not_copied closure near line 807, which prints min did not copy ... because {reason}. for every path: Export <path> was not copied: <reason>.
  • NotCopied::Outside, so every skip line has one form: Export <path> was not copied: it leads outside the project folder. This is the same line as LeadsOutsideProject, because a person learns the same thing from both.

<path> is the export's path as minimal.toml declares it, shown bare as in T134's lines. Update every test that pins the old text, including the one at crates/minimal/src/tests.rs near line 21198. Make the tests this task names pin the new lines. Do not rewrite history and do not force-push.

Every export that min does not copy now prints
"Export <path> was not copied: <why>." on stderr, the form the plan
fixes for BOX-190 and BOX-191. The tests pin the new lines.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p minimal missing_export_named_and_others_copied 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal failed_export_file_leaves_its_destination_unchanged 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal skipped_export_exit125_when_task_succeeded 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal skipped_export_keeps_failed_task_exit_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new

Verify min task run agent-verify exited 100.

 {
                "parent_span_id": "cf8c5a9c8d1f08e1",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "e4de375239604a93",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "e4de375239604a93",
                "queued_behind": "0",
                "span_id": "f69fd62d62109e73",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "cf8c5a9c8d1f08e1",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "11743692e7d674b7",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "11743692e7d674b7",
                "queued_behind": "0",
                "span_id": "6a7b07660358d733",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "11743692e7d674b7",
                "queued_behind": "0",
                "span_id": "3a691eb6725c13a9",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "3a691eb6725c13a9",
                "span_id": "7ce3f81fa315b040",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "3a691eb6725c13a9",
                "queued_behind": "0",
                "span_id": "f20929e13e6ca78d",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  83.355s] 1165 tests run: 1164 passed, 1 failed, 2 skipped
        FAIL [  12.977s] (1165/1165) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

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

A task with a missing export, an export whose destination is a symlink out of the project, or an export whose source leaves /workbench prints one stderr line for each skipped export, in the form Export <path> was not copied: <why>.. min copies the other exports and exits 125. A task that timed out still exits 124.

Notes from the agent: Revise round 1: all skip lines now use the form Export <path> was not copied: <why>.. This covers NotFound, Failed(reason), Outside (now the same line as LeadsOutsideProject) and the not_copied closure. NotCopied::text no longer takes the box label. The tests at the old line 21198 and 21380, in missing_export_named_and_others_copied and in failed_export_file_leaves_its_destination_unchanged now pin the new text. skipped_export_exit125_when_task_succeeded now pins its three full stderr lines. I also ran cargo nextest run -p minimal export, and its 15 tests passed. The closure's reasons stay as before, so it prints lines such as Export <path> was not copied: min could not read the box's files..

@agent-137
agent-137 marked this pull request as ready for review November 17, 2026 00:50
@agent-137
agent-137 requested a review from a team as a code owner November 17, 2026 00:50
@minimal-foundry

minimal-foundry Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: no findings; approval withheld, 3 threads unresolved at d252dd305ed2.

APPROVE withheld: 3 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/wait.rs:241, minimal-arch[bot] crates/minimal/src/cmd/boxes/exports.rs:786, minimal-foundry[bot] crates/minimal/src/cmd/boxes/exports.rs:484. Resolving the last thread releases the approval on this head.

Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required.

Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it.

Clobber: none seen.

@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/wait.rs Resolved

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arch-review: CONDITIONS · 2 conditions · the full ruling

The exit code follows line 517 on the main path, but one path breaks line 514. A min box wait or min box attach from another project returns 125 when the box exited 0. The cause is that the BOX-199 branch of copy_box_exports returns none_copied(), and the exit-code helper counts each of those outcomes as a skip. Return no outcomes on that branch, and add a test (C1). Also write in the interim comments and in #3446 that a later wait returns 125 again until the BOX-198 claim lands (C2).

Outside the diff

  • crates/minimal/src/cmd/boxes/exports.rs:848: C1 · This branch copies nothing for a command in another project. It returns outcomes with copied: false, so exit_code_after_exports turns 0 into 125. Line 514 says this command returns the code it returns with no exports. Return Vec::new() here, and keep the stderr line.

Ruled at c54ebac against gominimal/arch@327e1b57d16b by claude-opus-5-5.

// exited by itself into 125 (BOX-193). A stop, a timeout and
// any other code stand (BOX-194).
//
// Interim: each wait on an ended box copies again. The claim

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · Until BOX-198 lands, a later wait on the same end copies again and now also returns 125 again. Line 512 says a later command does not return 125 for a recorded result. Write that effect in this interim comment, and add it to #3446.

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.

Addressed in d252dd305ed2: The Interim comment in box_wait_on_hosts now says that until BOX-198 lands, a later wait or attach returns 125 again when an export is still skipped.

/// The callers set their exit code from the outcomes, with
/// [`exit_code_after_exports`] (BOX-193, BOX-194).
///
/// Interim: this copies again on each call. No claim stops a later command

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C2 · Add the exit-code effect to this interim: each later call returns 125 again for an export that is still skipped, until the claim of BOX-198 (#3446) gates this call.

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.

Addressed in d252dd305ed2: The copy_box_exports doc comment now says that each later wait or attach returns 125 again for a still-skipped export until the BOX-198 claim gates the call.

A wait or attach in another project copies no export (BOX-199). It now
gives no export outcome, so the 0 of a clean exit stays 0 (BOX-194).
@agent-137

Copy link
Copy Markdown
Member

/revise Arch ruling 1342 on c54ebac set two conditions. Do both. In full:

  • C1: crates/minimal/src/cmd/boxes/exports.rs copy_box_exports: in the BOX-199 branch (if here != Some(project_root)), return Vec::new() in place of none_copied(), so that a command in another project, or in no project, keeps its code without exports. Keep the exports_elsewhere_line stderr line. In crates/minimal/src/tests.rs exports_not_copied_from_another_project, call cmd::copy_box_exports_on_host with the other project's root and assert that the outcomes are empty and that cmd::exit_code_after_exports(0, true, &outcomes) == 0.
  • C2: State the interim effect on the exit code where the interim is written. In crates/minimal/src/cmd/boxes/wait.rs box_wait_on_hosts (the Interim: comment) and in the copy_box_exports doc comment in crates/minimal/src/cmd/boxes/exports.rs, add that until the BOX-198 claim lands (T132 — Claim each export from the daemon before copying, and record a file_exported event for each #3446), each later min box wait or min box attach on the same end copies again and returns 125 again when an export is still skipped, where line 512 says a later command does not return 125. Add the same item to T132 — Claim each export from the daemon before copying, and record a file_exported event for each #3446 so that its flip removes it.

For C2's last sentence, the item on #3446 is added there by the babysitter, not by this PR. The tests this task names must still pass. Do not rewrite history and do not force-push.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #3445. Your note is kept and goes into the next round here, which starts when that coder finishes.

Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on the runtime's review findings, pushed as 6c4c70208045.

line exit tail
cargo nextest run -p minimal missing_export_named_and_others_copied 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal failed_export_file_leaves_its_destination_unchanged 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal skipped_export_exit125_when_task_succeeded 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal skipped_export_keeps_failed_task_exit_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new

Verify min task run agent-verify exited 100.

 {
                "parent_span_id": "0923b0d86c296606",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "5bfc53e7be0d87e4",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "5bfc53e7be0d87e4",
                "queued_behind": "0",
                "span_id": "f1b0e2618ba9a5eb",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "0923b0d86c296606",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "d0db0f027b487456",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "d0db0f027b487456",
                "queued_behind": "0",
                "span_id": "bd6dc4c20db2c979",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "d0db0f027b487456",
                "queued_behind": "0",
                "span_id": "c697d13e47019c64",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "c697d13e47019c64",
                "span_id": "a4d3200d4402fe19",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "c697d13e47019c64",
                "queued_behind": "0",
                "span_id": "7e93c37d3aa520d6",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  85.170s] 1165 tests run: 1164 passed, 1 failed, 2 skipped
        FAIL [  13.002s] (1165/1165) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

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

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/wait.rs:260: copy_box_exports now returns no outcome for a box from another project, so wait and attach keep the exit code. The BOX-199 test asserts an empty result and exit 0.

A task with a missing export, an export whose destination is a symlink out of the project, or an export whose source leaves /workbench prints one stderr line that names the export, copies the other exports, and exits 125. A task that timed out still exits 124. A min box wait or attach from another project copies nothing and keeps the box's exit code.

Notes from the agent: Revise round 2: copy_box_exports now returns no outcome when the command runs in another project (BOX-199), so exit_code_after_exports leaves the code unchanged. The exports_not_copied_from_another_project test now checks this directly with an exit of 0. The earlier version of that test used a stopped box, so it did not catch the defect. This fix also covers attach.rs, because attach calls the same function through copy_box_exports_on_host.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 17, 2026 01:25
Until the BOX-198 claim lands (#3446), each later wait or attach on the
same end copies again and returns 125 again for a skipped export.

@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 head conforms to the File exports design. A skipped export is named on stderr, the other exports copy, and the run, attach and wait commands return 125 in place of 0 (lines 371 and 517). The last commit closes the gap from the earlier ruling. A command in another project now keeps the code it gives with no exports (line 514). The file_exported event and the claim stay as interims under #3446.

Ruled at 6c4c702 against gominimal/arch@327e1b57d16b 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 on lines +472 to 484
// BOX-190, BOX-191: every skip line has the one form
// `Export <path> was not copied: <why>.`
fn text(&self, path: &str) -> String {
let why = match self {
NotCopied::Outside | NotCopied::LeadsOutsideProject => {
"it leads outside the project folder"
}
}
NotCopied::LeadsOutsideBox => "it leads outside the box's copy of the project",
NotCopied::NotFound => "it was not found in the box",
NotCopied::Failed(reason) => reason.as_str(),
};
format!("Export {path} was not copied: {why}.")
}

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.

LOW · printed-text · confidence 0.55 · in NotCopied::text

The skip lines no longer name the box, and a partly written export now reads like a whole skip. The PR body says existing printed text is unchanged, but this hunk rewrites every skip line. The old Failed line said did not copy all of .... The new one says was not copied for both cases. With exports from several boxes, wait or attach stderr no longer shows which box lost a file. The label argument is still passed in but no longer printed here. Keep the box name in the line, or remove the unused argument and say in the PR that the text changed.

What the reviewer checked

old: "min did not copy {path} from box {label}, because it was not found in the box." new: format!("Export {path} was not copied: {why}.")

Hand this to an agent
Act on a code-review finding.

File:       crates/minimal/src/cmd/boxes/exports.rs
Lines:      472-484
Category:   printed-text
Severity:   low (reviewer confidence 0.55)

Finding:
The skip lines no longer name the box, and a partly written export now reads like a whole skip. The PR body says existing printed text is unchanged, but this hunk rewrites every skip line. The old `Failed` line said `did not copy all of ...`. The new one says `was not copied` for both cases. With exports from several boxes, `wait` or `attach` stderr no longer shows which box lost a file. The `label` argument is still passed in but no longer printed here. Keep the box name in the line, or remove the unused argument and say in the PR that the text changed.

First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.

👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.

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.

Disputed: the new lines are the text T131's plan fixes for BOX-190 and BOX-191 (#3445, "User-facing text"), applied by the /revise of 2026-11-16. Every skip line now has one form, Export <path> was not copied: <reason>., the same as T134's lines. The partly written case is BOX-191, whose reason the line carries. The PR body's "existing printed text is unchanged" was out of date, and it is corrected.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on a /revise note, pushed as d252dd305ed2.

line exit tail
cargo nextest run -p minimal missing_export_named_and_others_copied 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal failed_export_file_leaves_its_destination_unchanged 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal skipped_export_exit125_when_task_succeeded 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new
cargo nextest run -p minimal skipped_export_keeps_failed_task_exit_code 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-2: network warning: unknown fields in task runtime-implement-test-3: network help: do you need to update to a new

Verify min task run agent-verify exited 100.

 {
                "parent_span_id": "af45094e6dce8398",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "952fcff83282b363",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "952fcff83282b363",
                "queued_behind": "0",
                "span_id": "9a599031321a4f79",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "af45094e6dce8398",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "c7b60a63343de174",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "c7b60a63343de174",
                "queued_behind": "0",
                "span_id": "351de5657c374938",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "c7b60a63343de174",
                "queued_behind": "0",
                "span_id": "8c190ab612eef4b4",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "8c190ab612eef4b4",
                "span_id": "cb2cac298ac46a04",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "8c190ab612eef4b4",
                "queued_behind": "0",
                "span_id": "e96d5f84467d5a97",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
     Summary [  85.119s] 1165 tests run: 1164 passed, 1 failed, 2 skipped
        FAIL [  13.066s] (1165/1165) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

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

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/wait.rs:241: The Interim comment in box_wait_on_hosts now says that until BOX-198 lands, a later wait or attach returns 125 again when an export is still skipped.
  • 👍 valid — crates/minimal/src/cmd/boxes/exports.rs:786: The copy_box_exports doc comment now says that each later wait or attach returns 125 again for a still-skipped export until the BOX-198 claim gates the call.

A task with a missing export, a destination that is a symlink out of the project, or a source outside /workbench names that export on stderr, copies the other exports and exits 125. A task that timed out still exits 124. A wait or attach in another project copies nothing and keeps the exit code of the box.

Notes from the agent: C1 was already on the branch at 6c4c702: the BOX-199 branch returns Vec::new(), and exports_not_copied_from_another_project asserts empty outcomes and exit_code_after_exports(0, true, &outcomes) == 0. This round only adds C2: the interim comments in wait.rs box_wait_on_hosts and in the copy_box_exports doc comment now say that a later wait or attach returns 125 again for a skipped export until the BOX-198 claim lands. The item on #3446 is for the babysitter, as the note says.

@agent-137
agent-137 marked this pull request as ready for review November 17, 2026 02:50

@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 new commit adds only comments. They state that a later wait or attach can return 125 again until the BOX-198 claim lands. Section File exports line 512 forbids that, and #3446 owns the fix. This interim is honest and filed, so I record it as a residual. The code keeps the PASS on 6c4c702.

Ruled at d252dd3 against gominimal/arch@327e1b57d16b 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 — approval withheld

Verdict COMMENT — APPROVE withheld: 3 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/wait.rs:241, minimal-arch[bot] crates/minimal/src/cmd/boxes/exports.rs:786, minimal-foundry[bot] crates/minimal/src/cmd/boxes/exports.rs:484. No findings.

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

@mitodrummer mitodrummer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved.

@mitodrummer
mitodrummer added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 1905509 Nov 17, 2026
41 checks passed
@mitodrummer
mitodrummer deleted the agent/3445-skip-and-name-each-export-that-cannot-be-copied branch November 17, 2026 04:05
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.

T131 — Skip and name each export that cannot be copied, and end a successful command with exit 125

2 participants