8000 fix(minimal): a session box takes its entry's network.mode and network.ingress, beneath the by minimal-foundry[bot] · Pull Request #3416 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimal): a session box takes its entry's network.mode and network.ingress, beneath the - #3416

Merged
mitodrummer merged 5 commits into
mainfrom
agent/3414-a-session-box-takes-its-entry-s-network-mode-and
Nov 14, 2026
Merged

mitodrummer merged 5 commits into
mainfrom
agent/3414-a-session-box-takes-its-entry-s-network-mode-and

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Defect

Fixes #3414

Task marker
### D3238 — A session box takes its entry's network.mode and network.ingress, beneath the command-line override flags
  kind: task
  size: M
  est: 140 code, 120 tests
  executor: agent
  defect: bug
  epic: 2879
  layers:
    - session:
      - crates/minimal/src/cmd/boxes/create.rs: entry_egress reads network.ingress into ProjectEgress. activate_box applies ProjectEgress.mode and ingress when no --network or --ingress flag is given. Drop the not-yet note on mode.
      - crates/minimal/src/cli.rs: ActivateArgs.network (or ActivationOptions) tells a typed --network from the default, so the entry's network.mode can apply. Update the help that says a session box is host_ip.
      - crates/minimal/src/cmd/box_spec.rs: min box spec for a session entry shows the entry's network.mode and network.ingress with their layer source, as min box start now sends them
      - crates/minimal/src/tests.rs: adds a test of a session entry that sets network.mode = own_ip and network.ingress, with and without the override flags
      test: cargo test -p minimal session_entry_network_mode_and_ingress
    - docs:
      - docs/reference/cli-min.md: drops the sentence that a session box does not take the entry's network.mode or network.ingress yet (#3238), and fixes the --network row default
      test: cargo test -p minimal session_entry_network_mode_and_ingress
  proof: A session entry with network.mode = own_ip and a network.ingress mapping starts an own_ip box with that mapping, and --network or --ingress on the command line still replaces them.

Proof

A session entry with network.mode = "own_ip" and a network.ingress list now gives an own_ip box with those port mappings, from min session start, min box start and min session activate. min box spec shows that mode and those mappings with the entry's table as the source. --network replaces the entry's mode and --ingress replaces its mappings. A start whose mode is not own_ip but whose entry sets network.ingress is refused before anything is created, with a message that names the table and the fix.

Notes from the agent: Out-of-layer files: ActivateArgs.network is now Option, as the cli.rs layer asks. Struct literals and asserts in crates/minimal/src/cmd/list.rs (bare min activation, now network: None, the same as an unflagged min session activate), crates/minimal/src/cmd/boxes/vm_host.rs (2 test literals) and crates/minimal/tests/cli.rs (6 test literals) needed a mechanical Some(...) wrap to compile. The create.rs test module also got 2 of these wraps. File format: network.ingress items take { port = N } (host port N to box port N) or { external_port, internal_port }, with an optional proto of tcp or udp (tcp by default). This follows the box.toml { proto, port } shape that mfile's validator and tests use. Any other item refuses the file with exit 3. New printed refusals, pinned in the test: "[sessions.default] in minimal.toml sets network.ingress, but the box is host_ip, so it cannot publish ports. Set network.mode = "own_ip" in [sessions.default], or run the command again with --network own_ip." A second form is printed when --network was typed. The dynamic-ingress and --ingress refusals moved from the check_arguments step to check_project, because they now need the entry's mode. Both steps still run before the daemon starts. Other checks: clippy -p minimal --all-targets is clean. Filtered lib runs (network, ingress, box_spec, start, activat, egress) passed. One exception is tests::legacy_network_spellings_parse_with…[truncated]

Tests

line exit tail
cargo test -p minimal session_entry_network_mode_and_ingress 0 running 1 test test tests::session_entry_network_mode_and_ingress ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 961 filtered out; finished in 0.03s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0 tes
cargo test -p minimal session_entry_network_mode_and_ingress 0 running 1 test test tests::session_entry_network_mode_and_ingress ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 961 filtered out; finished in 0.02s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0 tes

Verify

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

 {
                "parent_span_id": "056787615fc0d8b9",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "36fa82b7d23a139c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "36fa82b7d23a139c",
                "queued_behind": "0",
                "span_id": "9d2a3f8d2b89057f",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "056787615fc0d8b9",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "8190fa99fa32d953",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "8190fa99fa32d953",
                "queued_behind": "0",
                "span_id": "f89d7dad0d40f264",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "8190fa99fa32d953",
                "queued_behind": "0",
                "span_id": "71678c05882b3170",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "71678c05882b3170",
                "span_id": "da0f6229ed00251a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "71678c05882b3170",
                "queued_behind": "0",
                "span_id": "01df399032af1fb5",
                "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 [  70.833s] 1122 tests run: 1121 passed, 1 failed, 2 skipped
        FAIL [   2.967s] (1122/1122) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Out of scope

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

  • crates/minimal/src/cmd/boxes/vm_host.rs
  • crates/minimal/src/cmd/list.rs
  • crates/minimal/tests/cli.rs

A session entry's network.mode and network.ingress now reach the box
that min session start, min box start and min session activate create.
--network and --ingress still replace them. min box spec shows them
with the entry's table as the source. ActivateArgs.network is now an
Option, so an activation can tell a typed --network from the default.
@coderabbitai
coderabbitai Bot commented Nov 14, 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: eff1fbe4-e4d8-4d16-97ef-4e987b7eeaae

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

Undrafted by the BCLI babysitter under the owner's standing rules. The three files outside layers: (cmd/boxes/vm_host.rs, cmd/list.rs, tests/cli.rs) adapt their call sites to network becoming an Option, and the change needs them. Reviewers: in cmd/list.rs the hardcoded HostNet becomes None, so that path now takes the entry's network.mode.

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

Approved: every review thread resolved at 7551eee2f052.

@agent-137 resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

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

The network.mode half conforms. The network.ingress half does not. With any --ingress, the start drops the entry's whole network.ingress list. architecture.md line 1228 says that each layer unions its lists, and line 1278 says it again. Spec 28 BCLI-024 says a list flag adds to the list. Make --ingress add to the entry's mappings in session_box_network (C1) and in expand_entry (C2). Then update the test and the reference to match (C3).

Ruled at 6647ae5 against gominimal/arch@15b603e6afb8 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/box_spec.rs Resolved
Comment thread crates/minimal/src/tests.rs Resolved
Comment thread docs/reference/cli-min.md Resolved
@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: 2 of 3 personas ran (correctness, supply-chain); did not complete: security.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
A session box now takes the entry's network.ingress mappings and then each
--ingress mapping, as BCLI-024 says a list flag adds to the list. min box
spec renders the same list, with both layers as its source. A
network.ingress proto now parses in any case, as --ingress does.
@agent-137
Copy link
Copy Markdown
Member

/revise

Head 6647ae5b. Arch ruling 1275 has three conditions, and there's one minimal-review finding. A list flag adds to the list (BCLI-024, architecture line 1228). Change nothing else.

1. C1: --ingress adds to the entry's network.ingress at start.
In session_box_network() (crates/minimal/src/cmd/boxes/create.rs), take project.ingress without the .filter(|_| args.ingress.is_empty()), and return the file mappings followed by flag_mappings. Keep refuse_file_ingress_off_own_ip on the file part and refuse_ingress_off_own_ip on the flag part. Update the doc comment that says --ingress replaces network.ingress.

2. C2: the render shows the same union.
In the expand_entry() session branch (crates/minimal/src/cmd/box_spec.rs), build port_mappings as the entry's network.ingress followed by the --ingress mappings. Drop the .filter(|_| overrides.ingress.is_empty()) and the file_ingress.unwrap_or(port_mappings) replace. Set the network.ingress source to every layer that contributed: the entry's table label, then the command line when --ingress is given.

3. C3: tests and docs.
In session_entry_network_mode_and_ingress (crates/minimal/src/tests.rs), the --ingress 7000:70 and --network own_ip --ingress 7000:70 cases assert the entry's two mappings followed by 7000:70. The flagged min box spec case asserts that union with both sources. In docs/reference/cli-min.md, replace "With no --ingress, a session box takes the entry's network.ingress" with: each --ingress adds a mapping to the entry's network.ingress.

4. proto in network.ingress is case-insensitive (thread PRRT_kwDOPdfcxM63WN5E).
file_port_mappings treats proto case-sensitively, but --ingress lowercases it (parse_ingress_proto in cli.rs). So proto = "UDP" in minimal.toml fails with exit 3, while --ingress 53:53/UDP works. Reuse the flag's parser for the file value, and add a test.

Reply on the threads with the commit. Run the whole minimal suite.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

That /revise is held, not dropped. A coder is already running on #3414. 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 1 of 10 on the runtime's review findings, pushed as 7551eee2f052.

line exit tail
cargo test -p minimal session_entry_network_mode_and_ingress 0 running 1 test test tests::session_entry_network_mode_and_ingress ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 970 filtered out; finished in 0.02s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0 tes
cargo test -p minimal session_entry_network_mode_and_ingress 0 running 1 test test tests::session_entry_network_mode_and_ingress ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 970 filtered out; finished in 0.03s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 34 filtered out; finished in 0.00s running 0 tes

Verify min task run agent-verify exited 100.

 {
                "parent_span_id": "225cd90f32f5cfeb",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "13a59565272ce5cb",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "13a59565272ce5cb",
                "queued_behind": "0",
                "span_id": "d44eded69eff6179",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "225cd90f32f5cfeb",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "a9f41d52e907a83a",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "a9f41d52e907a83a",
                "queued_behind": "0",
                "span_id": "fc4403ca05d0b4ee",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "a9f41d52e907a83a",
                "queued_behind": "0",
                "span_id": "33e5a4179fb2dcda",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "33e5a4179fb2dcda",
                "span_id": "55880ba5dc01436e",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "33e5a4179fb2dcda",
                "queued_behind": "0",
                "span_id": "e12ed31870cb335a",
                "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 [  70.582s] 1131 tests run: 1130 passed, 1 failed, 2 skipped
        FAIL [   3.041s] (1131/1131) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Outside the task's layers::

  • crates/minimal/src/cmd/boxes/vm_host.rs
  • crates/minimal/src/cmd/list.rs
  • crates/minimal/tests/cli.rs

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

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: session_box_network now keeps the entry's network.ingress and appends the --ingress mappings through union_ingress.
  • 👍 valid — crates/minimal/src/cmd/box_spec.rs: min box spec renders the same union, and network.ingress lists the entry's table and the command line as its sources.
  • 👍 valid — crates/minimal/src/tests.rs: The test now asserts the entry's two mappings followed by 7000:70, and that a duplicate flag mapping is not added twice.
  • 👍 valid — docs/reference/cli-min.md: The reference now says a session box takes the entry's network.ingress and each --ingress adds one mapping after it.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs:1651: file_port_mappings now parses proto with parse_ingress_proto, so proto = "UDP" works. The test uses "UDP" to pin it.

A session entry with network.mode = own_ip and a network.ingress mapping starts an own_ip box with that mapping. --network on the command line still replaces the mode. Each --ingress adds its mapping after the entry's mappings, and min box spec shows that same list with both layers as its source.

Notes from the agent: This round changes --ingress from a replace to a union, as the review asked. The task's proof says --ingress replaces the entry's mappings, but BCLI-024 (spec 28) says a list flag adds to the list, so the spec wins. A flag mapping equal to one of the entry's is not added twice. The network.ingress proto now parses through parse_ingress_proto, so it accepts any case. The docs test line is the same command and passes. just clippy-strict was not run.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 14, 2026 01:18
@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 change conforms. --network replaces the entry's network.mode. Each --ingress now adds to the entry's network.ingress, as architecture.md line 1228 requires for lists. min box spec uses the same union_ingress as the start, so it renders what the host receives (line 1234). This closes the baseline's objection on 6647ae5b.

Ruled at 7551eee against gominimal/arch@15b603e6afb8 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: 5 unresolved threads — minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs, minimal-arch[bot] crates/minimal/src/cmd/box_spec.rs, minimal-arch[bot] crates/minimal/src/tests.rs, minimal-arch[bot] docs/reference/cli-min.md, minimal-foundry[bot] crates/minimal/src/cmd/boxes/create.rs:1651. No findings.

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

@agent-137
agent-137 marked this pull request as ready for review November 14, 2026 01:45
@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 — approved

Verdict APPROVE — every review thread is resolved; @agent-137 closed the last one. The review of 7551eee2f052 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.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 14, 2026
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note: the coder changed nothing. This round needs no new commit. The directive was written against head 6647ae5, but the branch head 7551eee already addresses all four items. (1) session_box_network in create.rs keeps the entry's network.ingress and appends the --ingress mappings, and the doc comment says so. (2) expand_entry in box_spec.rs renders the union, with the network.ingress source ["[sessions.default]", "the command line"]. (3) session_entry_network_mode_and_ingress asserts the union for the --ingress and --network own_ip --ingress cases and for the flagged min box spec case, and cli-min.md says each --ingress adds one mapping after the entry's mappings. (4) file_port_mappings calls crate::cli::parse_ingress_proto, and the test fixture uses proto = "UDP". One addition beyond the directive is already in 7551eee: a --ingress mapping that the entry already has is not added a second time, and the test asserts this. The verdicts on the five answered threads do not change, so result.json repeats non…[truncated]

@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 14, 2026
Merged via the queue into main with commit aaccde2 Nov 14, 2026
40 checks passed
@mitodrummer
mitodrummer deleted the agent/3414-a-session-box-takes-its-entry-s-network-mode-and branch November 14, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D3238 — A session box takes its entry's network.mode and network.ingress, beneath the command-line override flags

2 participants

0