Repository navigation
fix(minimal): a network key only in a task does not refuse a session start, and a session egress - #3394
Conversation
A network key in a task entry or [defaults.task] no longer refuses a session start whose session entry the client cannot pick. A session start with project egress and --network none now refuses before the create request, and names the minimal.toml table the egress came from. The none-mode refusal is shared with min task run and min box run.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: every review thread resolved at @norrietaylor resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The NET-065 refusal on a session start conforms, and the shared helper is in the right place. The declares_network narrowing removes too much. It now reads [defaults.session] only, so a [defaults.<name>] table for a project Box Type no longer counts. Line 1205 of architecture.md says that layer reaches every entry of its type, and the client cannot tell whether a project type is a session (#3140). Such a start now drops the declared egress and does not refuse. Make the change in C1.
Ruled at 8fb8c5f against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
There was a problem hiding this comment.
APPROVE withheld: 1 unresolved thread — minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs:1345.
minimal-review — advisory review
Verdict COMMENT — No findings.
Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.
|
/revise The arch review at 8fb8c5f ruled CONDITIONS (arch 15b603e6, architecture.md line 1205). C1: in |
A [defaults.<name>] table reaches every entry of type <name>, and a project Box Type can be a session. Its network key now refuses an undecided session pick again, in place of a start that drops the declared egress.
|
Round 1 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 minimal.toml with two session entries and a network key only in [tasks.build] or [defaults.task] starts a session. A [defaults.] network key still refuses an undecided pick with the unresolved-type refusal. A session start with project egress and --network none names the minimal.toml table in its refusal. Notes from the agent: Revise round 1: C1 addressed. declares_network now counts a [defaults.] table with a network key when is session or not a built-in Box Type, the same rule as can_be_session. The test adds the [boxes.dev] type = "mydev" case with [defaults.mydev.network.egress], which fails with SessionEntryUndecided::TypeUnresolved. task.rs is unchanged this round. clippy -p minimal --all-targets and cargo fmt --check are clean. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The compare resolves the condition on 8fb8c5ff. declares_network now counts [defaults.<name>] for a type that is not built in, because line 1205 says that form works for a project type. A key in [defaults.task] or in a task entry still does not refuse a session start. The session refusal on --network none keeps the daemon check and names the minimal.toml table. Issues #3140 and #3238 own the two open edges.
Ruled at 83affb0 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.
norrietaylor
left a comment
There was a problem hiding this comment.
Reviewed against D3144 at 83affb04. declares_network now reads only the layers a session start can reach: [defaults], [defaults.session], a session entry, and a project Box Type's [defaults.<name>] or [box_types.<name>.defaults], by the same rule as can_be_session. So a network key only in a task, or in [defaults.task], no longer refuses a session pick, and a project type's network key still does (arch C1). session_effective_egress refuses project egress on --network none before the create request and names the minimal.toml table (NET-065), through the same refuse_egress_on_none as min task run. Both plan tests cover these cases. Arch: PASS on head.
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of 83affb046054 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
bryan-minimal
left a comment
There was a problem hiding this comment.
Read at 83affb0 against NET-060/NET-065, the two source issues and every session-start path. The code is
right and fails closed everywhere: the --network none refusal runs before the create request, names the
real table ([defaults], [defaults.session] or [sessions.<name>]), and reuses the task wording through
the shared helper. The narrowed declares_network still counts a project Box Type's entry and
[box_types.<name>.defaults], so #3140's refusal stays. Two things to change before it merges:
- The Proof overclaims (PR body, and the test name). A minimal.toml with two session entries and egress
only in[tasks.build]does not "now start a session". The egress read no longer refuses it, but every
start then runssession_loadout_mode(create.rs:1247, called at 3477) andsession_box_entry
(create.rs:1531, called at 3533), and both callpick_session_entry(..)?when no entry is named. The start
exits 2 with the same "no default" text, one step later. The only production callers of the egress read
areactivate_box(which runs both picks after it) andmin box spec(which always passes the entry it
already picked), so the narrowing changes no outcome anywhere; it removes a redundant refusal and adds
the test #3144 asked for. Say that in the Proof: "the egress read no longer refuses a file whose only
network key is in a task; such a start still needs a decided session entry". Neither #3383 nor #3144
reports an observed failure, so nothing in the ticket is lost. - The session-request test helper drifted (crates/minimal/src/tests.rs:14748, and 18698). Its doc says
it builds the request with the functionsactivate_boxcalls, but it still calls the old merge, not
session_effective_egress. A later test of--network nonewith egress would build a request the real
start refuses. One call to change.
Comments, no ask here:
min box spec(crates/minimal/src/cmd/box_spec.rs:729-734) renders a spec with--network noneand
project egress that the start now refuses; it did the same for tasks before. A follow-up issue is enough.[box_types.<name>.defaults]counts for any type, even one extendingtask(create.rs:1355-1364). The
egress read never uses that layer, so it only adds a refusal; #3140 covers it.
Traced and fine: egress only in a task with zero or one session entry starts as before; session egress with
--network none is refused with the table named, a [boxes.<name>] session entry named as written; egress
in both layers names only the layer of the box being started; the task path with --network none is
unchanged, VM-host remedy included; a loadout cannot add egress today (#3236, #3302), so nothing is dropped
there; --deny-all-egress with --network none refuses as NET-065 says; a network mode set without egress
is not a source; the extracted refusal reproduces the task path's old text exactly.
Defect
Fixes #3383
crates/minimal/src/cmd/boxes/create.rscrates/minimal/src/task.rsTask marker
Proof
A minimal.toml with two session entries and an egress key only in [tasks.build] (or [defaults.task]) now starts a session with no egress, where before the start refused because it could not pick a session entry. A session start with --network none and egress in [defaults], [defaults.session] or [sessions.] now refuses before the create request with: "... The box's egress rules come from
in minimal.toml. Run it with --network host_ip or --network own_ip."Notes from the agent: declares_network still counts the network keys of a project Box Type: an entry whose type is not built in, and [box_types..defaults]. The client cannot resolve those roots (#3140), so they can be sessions, and the TypeUnresolved refusal stays for them. The none-mode refusal moved to task::refuse_egress_on_none, which the task path and the new create::session_effective_egress share. The task wording does not change, and task_box_network_none_refuses_egress still passes. The session remedy always offers --network own_ip, because no session path refuses own_ip on a VM host. The session check reads --network only, not network.mode from the file, because a session start does not read the file mode yet (#3238). I ran the two test lines, the task_box_network tests, and clippy -p minimal --all-targets (clean). I did not run the whole crate suite or just ci.
Tests
cargo test -p minimal network_key_only_in_task_does_not_refuse_session_pickcargo test -p minimal session_network_none_refusal_names_minimal_tomlVerify
min task run agent-verifyexited 100, so this PR is a draft.