Repository navigation
fix(mfile,minimal): every create path stores the expanded spec's file_exports, so min task run, min - #3558
Conversation
BoxSpec::build copies the [[file_exports]] items of the entry table into the spec, and a task's file_exports is no longer an unknown field.
The task run puts the expanded task entry's [[file_exports]] items on the stored spec, so min task run, min box run and min box start copy them when the box ends.
The declared-export tests build two requests that never reach the daemon. Only their stored specs do, so each site asserts nothing.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Reviewed: no findings; approval withheld, 1 thread unresolved at APPROVE withheld: 1 unresolved thread — minimal-foundry[bot] crates/minimal/src/task.rs. 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. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change stores the declared [[file_exports]] in the spec on every create path. So the command that waits for the box can copy them, as architecture.md File exports line 508 requires for every Box Type. Bad paths are still refused at expansion with exit 3 before the create (line 516), and the copy checks them again. The new comments cite BOX-203. Spec 29 gives that id to the multi-box wait order, and BOX-185 is the requirement that governs. That is a note for review, not a design condition.
Ruled at 08fb3c5 against gominimal/arch@327e1b57d16b by claude-opus-5-5.
| // command that waits for the box copies them when it ends. | ||
| if let (Some(spec), Some(expanded)) = (spec.as_mut(), expanded.as_ref()) { | ||
| take_expanded_exports(spec, &expanded.spec); | ||
| crate::put_spec(&mut request, spec)?; | ||
| } |
There was a problem hiding this comment.
MEDIUM · correctness · confidence 0.80 · in run_entry
This second put_spec rebuilds request.spec from the local spec. That drops the --vpn-network-names values that add_vpn_network_names wrote into the stored JSON at about line 1598. After this change, min task run --vpn-network-names X on a task with [[file_exports]] stores a spec without the names. Fix: put the exports on spec before the first put_spec, or set spec.network.vpn_network_names on the typed spec. Alternatively, only edit the file_exports key of the stored JSON.
What the reviewer checked
task.rs:1598 add_vpn_network_names(&mut request, ...); task.rs:1639 crate::put_spec(&mut request, spec)?; put_spec sets request.spec = to_value(spec)
Hand this to an agent
Act on a code-review finding.
File: crates/minimal/src/task.rs
Lines: 1636-1640
Category: correctness
Severity: medium (reviewer confidence 0.80)
Finding:
This second `put_spec` rebuilds `request.spec` from the local `spec`. That drops the `--vpn-network-names` values that `add_vpn_network_names` wrote into the stored JSON at about line 1598. After this change, `min task run --vpn-network-names X` on a task with `[[file_exports]]` stores a spec without the names. Fix: put the exports on `spec` before the first `put_spec`, or set `spec.network.vpn_network_names` on the typed spec. Alternatively, only edit the `file_exports` key of the stored JSON.
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.
Addressed in 2d13ec6af393: run_entry now puts the exports on the spec before its only put_spec, through put_task_spec, which calls add_vpn_network_names last. task_run_stores_vpn_network_names_with_declared_file_exports pins the names and the export together.
|
/revise Owner ruling (Karl, 2026-11-19): round 1 has shown "running" since 22:01Z with no update, so this is a fresh round. Do these:
|
…te-path-stores-the-expanded-spec-s-fil # Conflicts: # crates/mfile/src/spec.rs
The stored spec takes the expansion's exports before put_spec, and add_vpn_network_names runs once, last, through put_task_spec. A second put_spec no longer drops the names.
|
Round 1 of 10 on a /revise note, pushed as Resolved conflicts in:
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
After min task run build with one [[file_exports]] item, the file is in the project and the record holds one file_exported event. min task run --vpn-network-names corp build now stores a spec that has both the names and the export. Notes from the agent: Merged origin/main. The one conflict was in crates/mfile/src/spec.rs, in BoxSpec::build. The resolution keeps this PR's file_exports and the kept_keys field from #3557. The rest of #3557 merged without conflict. In run_entry, the project root resolution and the task entry expansion now run before the spec is stored. The new helper put_task_spec puts the exports on the spec, calls put_spec once, and then calls add_vpn_network_names last. So the refusal of --vpn-network-names for an interactive task now comes after the upload-root check and the expansion, not before them. A new test, task_run_stores_vpn_network_names_with_declared_file_exports, pins the names and the export together through put_task_spec. The vpn_network_names tests and every_create_session_asserts_the_daemon_build also pass. The runner keeps the PR body line 'Closes #3527 (the original issue this task was triaged from).' No commit message carries a closing keyword. I did not run just clippy-strict. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The new commit stores the task spec once, through task::put_task_spec. The expansion's [[file_exports]] go on the spec before put_spec, and --vpn-network-names goes on after. The names now stay on the stored spec, as the Box Isolation Model requires (architecture.md lines 1333-1339). The merge from main keeps file_exports and kept_keys in BoxSpec::build. The rest of the change keeps the PASS at 08fb3c57. Verify still reports one failing otel test, exec_run_attach_and_task_run_share_the_commands_trace. Make it pass before the PR leaves draft.
Ruled at 2d13ec6 against gominimal/arch@327e1b57d16b by claude-opus-5-5.
Follow-up
Fixes #3550
crates/mfile/src/spec.rscrates/mfile/src/expand.rscrates/mfile/src/lib.rscrates/minimal/src/task.rscrates/minimal/src/cmd/boxes/create.rscrates/minimal/src/tests.rsTask marker
Proof
Take a project whose minimal.toml gives task build one [[file_exports]] item. min task run build now stores that item in the box's spec. When the box ends, the file is copied into the project and the record holds one file_exported event. The load no longer prints an unknown fields warning for file_exports on the task. min box run and min box start of a session entry with a declared export store and copy it in the same way.
Notes from the agent: BoxSpec::build reads file_exports from the entry table: the expanded table for a session entry, and the task's extra keys for a task. The new helper mfile::expand::stored_file_exports does the read. task_box_entry now returns the whole BoxEntryExpansion, not only the wire entry. run_entry puts the expansion's file_exports on the task spec with the new task::take_expanded_exports and stores the spec again with put_spec, so [defaults] exports reach a task box too. The layer note said task_box_spec builds from the expansion. The expansion runs later in run_entry than task_box_spec, so a separate helper applies it after the expansion, and task_box_spec is unchanged. stamp_session_spec_as needed no change, because for_session_entry now carries the exports. The lib.rs change adds file_exports to SPEC_READ_ENTRY_KEYS. That list applies to [session] too, which is correct because for_session also reads the key now. I added the test file_exports_entry_key_is_not_reported_unknown in lib.rs. Two existing tests in tests.rs now read .wire from task_box_entry. The minimal end-to-end tests build the spec through the same functions that run_entry and the start path call, then create the box on the harness daemon, stop it and run box wait. They do not run a task entrypoint, because the harness daemon cannot run one. I did not run just ci or clippy-strict. The full mfile suite passed (226), and the minimal tests matching export or entry passed (60).
Tests
cargo nextest run -p mfile for_session_entry_stores_file_exportscargo nextest run -p mfile for_task_stores_file_exportscargo nextest run -p minimal task_run_copies_declared_file_exportscargo nextest run -p minimal box_run_copies_declared_file_exportscargo nextest run -p minimal box_start_detach_then_wait_copies_declared_file_exportsVerify
min task run agent-verifyexited 100, so this PR is a draft.Closes #3527 (the original issue this task was triaged from).