Repository navigation
feat(minimal): T131 — Skip and name each export that cannot be copied, and end a successful command with exit 125 - #3487
Conversation
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).
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
/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
|
…ame-each-export-that-cannot-be-copied
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.
|
Round 1 of 10 on a /revise note, pushed as
Verify 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 Notes from the agent: Revise round 1: all skip lines now use the form |
|
Reviewed: no findings; approval withheld, 3 threads unresolved at 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. |
…ame-each-export-that-cannot-be-copied
There was a problem hiding this comment.
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 withcopied: false, soexit_code_after_exportsturns 0 into 125. Line 514 says this command returns the code it returns with no exports. ReturnVec::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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
|
/revise Arch ruling 1342 on c54ebac set two conditions. Do both. In full:
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. |
|
That 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. |
|
Round 2 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
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 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. |
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.
There was a problem hiding this comment.
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.
| // 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}.") | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
Round 3 of 10 on a /revise note, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
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
cargo nextest run -p minimal missing_export_named_and_others_copiedcargo nextest run -p minimal failed_export_file_leaves_its_destination_unchangedcargo nextest run -p minimal skipped_export_exit125_when_task_succeededcargo nextest run -p minimal skipped_export_keeps_failed_task_exit_codeVerify
min task run agent-verifyexited 100, so this PR is a draft.Closes #3445