Skip to content

T122 — Egress rules in minimal.toml reach the box - #3121

Merged
agent-137 merged 14 commits into
mainfrom
agent/2702-egress-rules-in-minimal-toml-reach-the-box
Nov 7, 2026
Merged

agent-137 merged 14 commits into
mainfrom
agent/2702-egress-rules-in-minimal-toml-reach-the-box

Conversation

@minimal-foundry

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

Copy link
Copy Markdown
Contributor

T122 — Egress rules in minimal.toml reach the box

slice: S20
kind: task
covers: NET-060
size: M
est: 120 code, 180 tests
executor: agent
difficulty: routine
model: light
diagnostics: min session policy shows each egress field with where it came from, the project's minimal.toml or a flag, pinned by project_egress_table_reaches_box_policy
observability: the create request's existing debug line carries the effective egress policy, now including fields read from the project file
layers:
- create:
- crates/minimal/src/cmd/boxes/create.rs: the egress keys the project's minimal.toml declares, as the mfile network module parses them, become the box policy's egress, and a flag replaces the file's value for the field it names
test: cargo nextest run -p boxes spec_accepts_egress_fields
test: cargo nextest run -p minimal project_egress_table_reaches_box_policy
test: cargo nextest run -p minimal egress_flag_replaces_the_project_field
produces: none
consumes: none
proof: Egress rules written in a project's minimal.toml apply to every box activated from it, as min session policy shows.
depends on:
- blocked by #2414

Proof

A project that writes network.egress keys (allow_subnets, allow_protocols, allow_dns_hosts, deny_subnets) in [defaults], [defaults.session] or [sessions.default] of its minimal.toml now gets those rules on the policy of every session box that min activates from it. The rules are on the create request and in the stored box spec, which is what min session policy reads. A flag such as --allow-subnets replaces only the field it names, and --deny-all-egress replaces all of them.

Notes from the agent: The project egress is read in create.rs only. The layers are [defaults], [defaults.session] and [sessions.default], through mfile::expand and mfile::network::canonicalize. Only the network key of each layer is read, so other keys there never refuse an activation. Legacy flat keys print the same hint that --network prints. A malformed egress table refuses the start. The expand error exits 3 through ProjectFileInvalid. A canonicalize error or a bad value (for example an unknown protocol) exits 1, because main.rs is outside the layers. The [session.network] table still refuses an egress key: mfile SessionNetwork has deny_unknown_fields, and mfile is outside the layers. So the session's own table cannot declare egress. Use [defaults.network.egress] or [sessions.default.network.egress]. The diagnostics line asks min session policy to show where each field came from. This change records the source of each field (minimal.toml or a flag) in the new debug line 'the create request's effective egress'. policy.rs is outside the layers, so min session policy does not print the source yet. The task said this debug line already existed, but create.rs had none, so this change adds it. The [network] mode in minimal.toml does not set the box's network mode. Only --network sets it. A file with sessions at the top level still gets the existing 'unknown fields' log warning from mfile. clippy -p minimal --all-targets is clean, and all 31 tests in the create module pass.

Tests

line exit tail
cargo nextest run -p boxes spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal project_egress_table_reaches_box_policy 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal egress_flag_replaces_the_project_field 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.0.1 (/workbe

Verify

min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

sts::range_program_applies_exactly_the_reserved_range
        PASS [   0.022s] (546/948) minimal resolver::tests::range_step_custody_failure_resurfaces_the_advisory
        PASS [   0.014s] (547/948) minimal resolver::tests::range_step_custody_follows_the_program_the_plist_names
        PASS [   0.185s] (548/948) minimal resolver::tests::privileged_copy_refuses_a_source_swapped_after_render
        PASS [   0.017s] (549/948) minimal resolver::tests::range_step_custody_is_root_owned
        PASS [   0.012s] (550/948) minimal resolver::tests::range_step_custody_walks_every_path_component
        PASS [   0.016s] (551/948) minimal resolver::tests::resolver_file_hook_parses_nameserver_and_port
        PASS [   0.013s] (552/948) minimal resolver::tests::resolver_file_hook_states_its_gaps
        PASS [   0.016s] (553/948) minimal resolver::tests::routing_domain_hook_finds_the_carrying_link_and_its_port
        PASS [   0.018s] (554/948) minimal resolver::tests::routing_domain_hook_states_its_gaps
        PASS [   0.017s] (555/948) minimal resolver::tests::session_advisory_agrees_with_the_hook_it_detected
        PASS [   0.012s] (556/948) minimal resolver::tests::session_start_points_at_finalize_install_without_the_advisory
        PASS [   0.027s] (557/948) minimal resolver::tests::session_advisory_without_a_port_stays_quiet
        PASS [   0.013s] (558/948) minimal resolver::tests::the_app_bundle_layout_matches_packaging
        PASS [   0.016s] (559/948) minimal resolver::tests::the_bundle_record_mirrors_the_probe
        FAIL [   0.045s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
  stdout ───

    running 1 test
    test resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling ... FAILED

    failures:

    failures:
        resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 794 filtered out; finished in 0.03s

  stderr ───

    thread 'resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling' (3592) panicked at crates/minimal/src/resolver.rs:7689:9:
    the liveness proof still ran at the holder's port
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.361s] (561/948) minimal resolver::tests::privileged_copy_refuses_a_user_writable_ancestor
        PASS [   1.340s] (562/948) minimal resolver::tests::finalize_install_undo_succeeds_on_a_clean_host
        PASS [   0.627s] (563/948) minimal resolver::tests::the_lists_two_queries_run_under_one_deadline
────────────
     Summary [  13.275s] 563/948 tests run: 562 passed, 1 failed, 1 skipped
        FAIL [   0.045s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
warning: 385/948 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

Residuals

Closes #2702

The network.egress keys a project declares in [defaults],
[defaults.session] or [sessions.default] become the box policy's
egress. A flag replaces the file's value for the field it names, and
--deny-all-egress replaces every field (NET-060).
@coderabbitai

coderabbitai Bot commented Nov 7, 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: 79a9b560-0b51-4539-81c7-fcec768b47e1

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

@minimal-foundry

minimal-foundry Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed: 2 findings, none blocking at 3aa0e30ac902.

Address the comments on the diff.

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 — 2 findings, 2 inline.

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

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.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 · 4 conditions · the full ruling

The project's egress rules reach the box through the right owners, and the flat keys get the hint that the design requires. Three parts deviate. effective_egress replaces a file list with a flag's list, but architecture.md line 1196 unions lists in every layer. The replace also drops the project's deny ranges (C1). Two refusals of an invalid minimal.toml exit 1, but line 364 requires 3 (C2). The read always takes [sessions.default], so a [sessions.dev] egress table is dropped without a message (line 1178, C3). File an issue for the min session policy source display, and name it in the PR body (C4).

Ruled at ca8c95f against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
…icit

A legacy network spelling in minimal.toml still loads, so its hint now
goes to the log instead of printing before the box shell. The project
egress read sets the implicit flag that the merged base added to
BoxEntry, which the branch head did not compile without.

@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/create.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 layering, default-deny and placement conform. Two parts do not. A [network] table that does not load ends with exit 1, but the Exit codes table (line 364) gives exit 3 to an invalid minimal.toml. C1 returns ProjectFileInvalid for both errors. The legacy-key hint now goes only to an info log, and min hides that level by default. Lines 916–919 accept the flat keys only with a hint. C2 prints the hint on a headless start and logs it at warn on an interactive one.

Ruled at a315a8c against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as a315a8c2c9c0.

line exit tail
cargo nextest run -p boxes spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal project_egress_table_reaches_box_policy 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal egress_flag_replaces_the_project_field 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.0.1 (/workbe

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

sts::privileged_copy_refuses_a_source_swapped_after_render
        PASS [   0.013s] (546/948) minimal resolver::tests::range_program_applies_exactly_the_reserved_range
        PASS [   0.013s] (547/948) minimal resolver::tests::range_step_custody_failure_resurfaces_the_advisory
        PASS [   0.012s] (548/948) minimal resolver::tests::range_step_custody_follows_the_program_the_plist_names
        PASS [   0.014s] (549/948) minimal resolver::tests::range_step_custody_is_root_owned
        PASS [   0.012s] (550/948) minimal resolver::tests::range_step_custody_walks_every_path_component
        PASS [   0.013s] (551/948) minimal resolver::tests::resolver_file_hook_parses_nameserver_and_port
        PASS [   0.013s] (552/948) minimal resolver::tests::resolver_file_hook_states_its_gaps
        PASS [   0.015s] (553/948) minimal resolver::tests::routing_domain_hook_finds_the_carrying_link_and_its_port
        PASS [   0.015s] (554/948) minimal resolver::tests::routing_domain_hook_states_its_gaps
        PASS [   0.016s] (555/948) minimal resolver::tests::session_advisory_without_a_port_stays_quiet
        PASS [   0.024s] (556/948) minimal resolver::tests::session_advisory_agrees_with_the_hook_it_detected
        PASS [   0.013s] (557/948) minimal resolver::tests::session_start_points_at_finalize_install_without_the_advisory
        PASS [   0.014s] (558/948) minimal resolver::tests::the_app_bundle_layout_matches_packaging
        PASS [   0.037s] (559/948) minimal resolver::tests::the_bundle_record_mirrors_the_probe
        FAIL [   0.140s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
  stdout ───

    running 1 test
    test resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling ... FAILED

    failures:

    failures:
        resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 794 filtered out; finished in 0.12s

  stderr ───

    thread 'resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling' (3661) panicked at crates/minimal/src/resolver.rs:7689:9:
    the liveness proof still ran at the holder's port
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.331s] (561/948) minimal resolver::tests::privileged_copy_refuses_a_user_writable_ancestor
        PASS [   1.264s] (562/948) minimal resolver::tests::finalize_install_undo_succeeds_on_a_clean_host
        PASS [   0.627s] (563/948) minimal resolver::tests::the_lists_two_queries_run_under_one_deadline
────────────
     Summary [  13.209s] 563/948 tests run: 562 passed, 1 failed, 1 skipped
        FAIL [   0.140s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
warning: 385/948 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Review threads the coder judged:

  • 👎 invalid — PRRT_kwDOPdfcxM60whe-: The finding is accurate about the code, but the fix is outside this task's layers: min session policy rendering (policy.rs) and the stored box record would have to change, and the task names only create.rs. The per-field source stays in the debug line, which the observability line asks for. The gap (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — PRRT_kwDOPdfcxM60whfB: Replaced the eprintln of legacy-spelling hints in project_egress_from with a tracing::info! record, so nothing prints before the box shell. (not posted on the thread: not an open thread on the pull request)

Egress rules written in a project's minimal.toml become the policy of every box activated from it, and min session policy shows that egress. A flag replaces the file's value for the field it names.

Notes from the agent: The branch head (after the merge of main, which added BoxEntry.implicit in #3103) did not compile. This round sets implicit from whether the file declares [sessions.default]. The diagnostics line says min session policy shows the source of each egress field. That is not delivered: it needs the box record and crates/minimal/src/cmd/session/policy.rs (or wherever policy rendering lives), which are outside this task's layers. Today the per-field source is in the create request's debug line only. Legacy-spelling hints from the project's network keys now go to the log at info level, not to stderr.

A malformed [network] or [network.egress] value in minimal.toml is now
a ProjectFileInvalid, so the start ends with exit 3. The read takes the
one declared session entry when no [sessions.default] exists. Legacy
key hints print on a start with no terminal. --deny-all-egress keeps
the file's deny_subnets under the file's name.
The create-site inventory in tests.rs lists every CreateSessionRequest
the crate builds. The egress test now builds SpecFlags directly, so it
adds no site to that inventory.

@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/create.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 egress read does not pick the session entry the way the design says. It reads only [sessions.*], so a [boxes.<name>] type = "session" entry does not count (lines 1176 and 1178). When it cannot decide, it uses the implicit default entry, and the declared egress drops away. Line 1178 says no implicit entry exists then, and line 458 says the start ends with exit 2. Use mfile's read_entries and implicit_default_entry for the pick (C1). Refuse the undecidable case with exit 2 (C2). The rest of the compare conforms: exit 3 for a bad egress table, the legacy-key hint, and deny_subnets under --deny-all-egress.

Ruled at 85ff226 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a failed check suite, pushed as 85ff226331b5.

line exit tail
cargo nextest run -p boxes spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal project_egress_table_reaches_box_policy 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal egress_flag_replaces_the_project_field 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.0.1 (/workbe

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

mes_holder_without_restart
        PASS [   0.011s] (544/948) minimal resolver::tests::range_alias_with_a_wide_mask_resurfaces_the_advisory
        PASS [   0.014s] (545/948) minimal resolver::tests::range_program_applies_exactly_the_reserved_range
        PASS [   0.011s] (546/948) minimal resolver::tests::range_step_custody_failure_resurfaces_the_advisory
        PASS [   0.011s] (547/948) minimal resolver::tests::range_step_custody_follows_the_program_the_plist_names
        PASS [   0.015s] (548/948) minimal resolver::tests::range_step_custody_is_root_owned
        PASS [   0.010s] (549/948) minimal resolver::tests::range_step_custody_walks_every_path_component
        PASS [   0.010s] (550/948) minimal resolver::tests::resolver_file_hook_parses_nameserver_and_port
        PASS [   0.011s] (551/948) minimal resolver::tests::resolver_file_hook_states_its_gaps
        PASS [   0.012s] (552/948) minimal resolver::tests::routing_domain_hook_finds_the_carrying_link_and_its_port
        PASS [   2.068s] (553/948) minimal mint::tests::a_refused_client_key_is_replaced_and_registered_before_the_mint
        PASS [   0.011s] (554/948) minimal resolver::tests::routing_domain_hook_states_its_gaps
        PASS [   0.014s] (555/948) minimal resolver::tests::session_advisory_agrees_with_the_hook_it_detected
        PASS [   0.018s] (556/948) minimal resolver::tests::session_advisory_without_a_port_stays_quiet
        PASS [   0.012s] (557/948) minimal resolver::tests::session_start_points_at_finalize_install_without_the_advisory
        FAIL [   0.019s] (558/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
  stdout ───

    running 1 test
    test resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling ... FAILED

    failures:

    failures:
        resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 794 filtered out; finished in 0.01s

  stderr ───

    thread 'resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling' (3712) panicked at crates/minimal/src/resolver.rs:7689:9:
    the liveness proof still ran at the holder's port
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.018s] (559/948) minimal resolver::tests::the_app_bundle_layout_matches_packaging
        PASS [   0.263s] (560/948) minimal resolver::tests::privileged_copy_refuses_a_user_writable_ancestor
        PASS [   1.114s] (561/948) minimal resolver::tests::finalize_install_undo_succeeds_on_a_clean_host
────────────
     Summary [  11.310s] 561/948 tests run: 560 passed, 1 failed, 1 skipped
        FAIL [   0.019s] (558/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
warning: 387/948 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Review threads the coder judged:

  • 👎 invalid — crates/minimal/src/cmd/boxes/create.rs:512: The task fixes this behaviour: 'a flag replaces the file's value for the field it names', pinned by egress_flag_replaces_the_project_field. A union of lists for flags needs a change to the plan task, not this round.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: --deny-all-egress now keeps the file's deny_subnets with source ProjectFile and records Flag only for the three allow lists. The test pins both.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: The canonicalize error is now a ProjectFileInvalid (InvalidSpecKey naming the key), which main.rs maps to exit 3. main.rs is outside the layers, so it is not changed.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: A bad egress value now returns ProjectFileInvalid { error: mfile::Error::Format(error) }, so the start exits 3. A test checks it with an unknown protocol.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: The read now takes [sessions.default] when declared, or else the only [sessions.] entry. With several entries and no default, only the [defaults] layers apply. A test covers [sessions.dev].
  • 👎 invalid — PRRT_kwDOPdfcxM60wpXm: The task's proof requires that egress rules in minimal.toml apply to every box the project activates. A consent step is new design outside NET-060 and this task. I raised it in the notes for the spec owner. (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: The NetworkError now maps to ProjectFileInvalid with mfile::Error::InvalidSpecKey, and the key names the NetworkError's key (network.mode or network.egress.).
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: An unknown protocol now refuses with ProjectFileInvalid (mfile::Error::Format, which keeps serde's detail) and exits 3. A test downcasts both refusals.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: project_egress now returns the hints. activate_box prints them with eprintln! on a headless start and logs them at warn otherwise.

Egress rules in a project's minimal.toml become the egress policy of each box that the project activates. Each field shows its source, the file or a flag. A malformed egress value in the file now refuses the start with exit 3.

Notes from the agent: CI failure: the tests lane failed on tests::every_create_session_asserts_the_daemon_build. The egress test built an unsent CreateSessionRequest, and the inventory in tests.rs does not list it. The test now builds SpecFlags directly, so tests.rs (outside the layers) stays as it is. resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling also fails on this box. This branch does not change resolver.rs, and the test probes a host port, so I think the cause is this environment. The CI excerpt did not name a failing test, so I cannot confirm that CI saw it.
Exit 3: canonicalize errors become ProjectFileInvalid with mfile::Error::InvalidSpecKey (layer "minimal.toml", WrongShape). An unknown protocol becomes ProjectFileInvalid with mfile::Error::Format, which keeps serde's detail about the bad value. main.rs is outside the layers, but it already maps ProjectFileInvalid to exit 3. Printed text: the mode-none-with-egress refusal now reads "minimal.toml sets network.egress.<key> to a value, but network.egress.<key> takes no value while network.mode is "none". Fix the value." It loses the NetworkError's remedy (set mode to host_ip or own_ip). A dedicated mfile::Error variant for NetworkError needs a change in crates/mfile.
Entry choice: no code in this tree picks a named session entry for a bare start. The read takes [sessions.default] when it is declared, or else the one [sessions.] entry when the file declares exactly one. Several entries with no default give the [defaults] layers only.
Security thread: whether project-declared egress needs consent is a design question for the spec owner. It is not part of this task.
just clippy-strict was not run.

@agent-137

Copy link
Copy Markdown
Member

/revise Arch conditions C1 and C2 (arch_rulings 1043, head 85ff226), in substance. The plan now also names crates/minimal/src/main.rs (owner-approved amendment for C2).

C1. In crates/minimal/src/cmd/boxes/create.rs project_egress_from, replace the hand-read of file.get("sessions") (sessions, declared_entry) with mfile::entry::read_entries(bytes), and map its error to ProjectFileInvalid (exit 3). The candidates are the entries whose box_type is "session", so a [boxes.<name>] type = "session" entry counts the same as [sessions.<name>]. Pick the candidate named default, else the only candidate. With no candidate, use mfile::entry::implicit_default_entry(&entries, …) in place of the hand-built BoxEntry { implicit: declared_entry.is_none(), .. }. Pass the picked entry's box_type to with_file_defaults, and keep the network_of filter on the picked entry's body. Add a case to project_egress_table_reaches_box_policy for a file whose only session entry is [boxes.dev] with type = "session" and an egress table.

C2. In the same function, when the pick cannot decide, refuse the activation before the create request, and do not read the defaults layers as an implicit entry. The pick cannot decide in two cases: two or more session candidates and none named default; or no candidate while implicit_default_entry returns None, because a non-session entry is named default. Give the refusal its own error type in create.rs. Its message lists the candidate names, or names the blocking default entry, and names min session start as the verb. Follow AGENTS.md "User-facing text": say what was refused, why, and the next step. Pin the exact text in the test. Add one arm to crates/minimal/src/main.rs failure_exit_code that maps the type to exit 2. Do not map it to ProjectFileInvalid (exit 3). Pin both cases in project_egress_table_reaches_box_policy. Change nothing else.

A [boxes.<name>] entry with type = "session" now counts as a session
entry. When the start cannot pick a session entry, it refuses before the
create request with SessionEntryUndecided, which exits 2.

@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 — 2 findings, 2 inline.

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

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.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 · 1 condition · the full ruling

The entry pick now follows the bare-start rule in architecture.md lines 458 and 1178 for built-in types. One case is open. The design also counts an entry whose type has the built-in root session, but pick_session_entry counts only the literal type session. Such an entry is skipped without a message, so the start can read the wrong entry's egress. The client cannot resolve that root yet. Make the pick refuse with exit 2 in that case, as C1 states.

Ruled at 074e567 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p boxes spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal project_egress_table_reaches_box_policy 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal egress_flag_replaces_the_project_field 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling version v0.8.0 (/workbench/crates/version) Compiling decode v0.0.1 (/workbench/crates/decode) Compiling mlog v0.0.1 (/workbe

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

sts::range_program_applies_exactly_the_reserved_range
        PASS [   0.012s] (546/948) minimal resolver::tests::range_step_custody_failure_resurfaces_the_advisory
        PASS [   0.013s] (547/948) minimal resolver::tests::range_step_custody_follows_the_program_the_plist_names
        PASS [   0.012s] (548/948) minimal resolver::tests::range_step_custody_is_root_owned
        PASS [   0.012s] (549/948) minimal resolver::tests::range_step_custody_walks_every_path_component
        PASS [   0.201s] (550/948) minimal resolver::tests::privileged_copy_refuses_a_source_swapped_after_render
        PASS [   0.013s] (551/948) minimal resolver::tests::resolver_file_hook_parses_nameserver_and_port
        PASS [   0.015s] (552/948) minimal resolver::tests::resolver_file_hook_states_its_gaps
        PASS [   0.016s] (553/948) minimal resolver::tests::routing_domain_hook_finds_the_carrying_link_and_its_port
        PASS [   0.013s] (554/948) minimal resolver::tests::routing_domain_hook_states_its_gaps
        PASS [   0.016s] (555/948) minimal resolver::tests::session_advisory_agrees_with_the_hook_it_detected
        PASS [   0.018s] (556/948) minimal resolver::tests::session_advisory_without_a_port_stays_quiet
        PASS [   0.016s] (557/948) minimal resolver::tests::session_start_points_at_finalize_install_without_the_advisory
        PASS [   0.012s] (558/948) minimal resolver::tests::the_app_bundle_layout_matches_packaging
        PASS [   0.013s] (559/948) minimal resolver::tests::the_bundle_record_mirrors_the_probe
        FAIL [   0.089s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
  stdout ───

    running 1 test
    test resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling ... FAILED

    failures:

    failures:
        resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 794 filtered out; finished in 0.07s

  stderr ───

    thread 'resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling' (3610) panicked at crates/minimal/src/resolver.rs:7689:9:
    the liveness proof still ran at the holder's port
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.370s] (561/948) minimal resolver::tests::privileged_copy_refuses_a_user_writable_ancestor
        PASS [   1.359s] (562/948) minimal resolver::tests::finalize_install_undo_succeeds_on_a_clean_host
        PASS [   0.626s] (563/948) minimal resolver::tests::the_lists_two_queries_run_under_one_deadline
────────────
     Summary [  13.640s] 563/948 tests run: 562 passed, 1 failed, 1 skipped
        FAIL [   0.089s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
warning: 385/948 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Review threads the coder judged:

  • 👎 invalid — crates/minimal/src/cmd/boxes/create.rs:1932: This is deliberate. The proof says the project's egress applies to every box activated from the project. The CLI reference says a --network none box rejects the whole egress declaration, so the refusal is the documented behaviour, not a lost start. The refusal text is PolicyError::EgressRequiresNetw
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: project_egress_from now reads the entries with mfile::entry::read_entries and picks from the entries whose box_type is "session". The test has a [boxes.dev] type = "session" case.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: With two or more session entries and none named default, pick_session_entry returns SessionEntryUndecided::NoDefault. main.rs failure_exit_code maps it to exit 2. The test pins the text.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: The implicit entry now comes from mfile::entry::implicit_default_entry. When it returns None, the start refuses with SessionEntryUndecided::DefaultNotSession, which exits 2. The test pins the text.

Egress rules in a project's minimal.toml apply to every box activated from it, and min session policy shows them. The rules come from [defaults], [defaults.session] and the session entry. The session entry can be [sessions.] or [boxes.] with type = "session". When the start cannot pick a session entry, it refuses before the create request and exits 2.

Notes from the agent: C1: project_egress_from reads the entries with mfile::entry::read_entries. A read error maps to ProjectFileInvalid (exit 3). The candidates are the entries whose box_type is "session". The pick is the candidate named default, else the only candidate, else implicit_default_entry. The picked box_type goes to with_file_defaults. C2: the new pick_session_entry returns SessionEntryUndecided (NoDefault with the candidate names, or DefaultNotSession with the type of the default entry). main.rs failure_exit_code maps it to exit 2. project_egress and project_egress_from now return anyhow::Result, so that one function can carry both refusals. The tests downcast the result. The refusal applies to every activation, also one that declares no egress, as C2 asks. The 31 create:: tests pass. Printed text: the directive asks the message to name min session start as the verb. That command does not exist in this tree. The CLI has min session activate, and bare min activates through the same path. BCLI-029 plans min session start [<entry>], but nothing ships it. AGENTS.md says an instruction must name a command that the user can run as written. So the message says "Cannot start the box", which is the same prefix as ProjectFileInvalid. Its next step is an edit to minimal.toml that the code can prove. Pinned text, case 1: "Cannot start the box: the project's minimal.toml declares the session entries web, dev. None of them is named "default", so the start cannot pick one. Rename the entry to start to "default" in minimal.toml." Case 2: "Cannot start the box: the project's minimal.toml de…[truncated]

@agent-137

Copy link
Copy Markdown
Member

/revise Arch condition C1 (arch_rulings 1045, head 074e567), in substance. In crates/minimal/src/cmd/boxes/create.rs pick_session_entry(): an entry whose box_type is None, or is not in mfile::expand::BUILTIN_BOX_TYPES, is an entry whose session root the client cannot resolve. Today the candidates filter skips it, so [boxes.dev] type = "devbox" gets the implicit entry and loses its own egress, and [boxes.default] type = "devbox" gets a DefaultNotSession message that says the file has no session entry. Keep the early return for a session entry named default. Before the match candidates.as_slice(), if any entry has an unresolved type, return a new SessionEntryUndecided::TypeUnresolved { name, box_type } (exit 2, EXIT_CODE). Its message names the entry and its type, and tells the user to set type = "session" or rename the session entry to default; follow AGENTS.md "User-facing text" and pin the exact text. Add one case for each of the two files above to project_egress_table_reaches_box_policy. Do not add a Box Type resolver to create.rs: resolution is mfile's work. Change nothing else.

An entry whose type is not a built-in Box Type now refuses the start
with exit 2 and names the entry, in place of a silent skip. A file
that declares no egress keys no longer needs a decidable pick.

@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/create.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 new TypeUnresolved refusal is correct. It fails closed where the client cannot resolve a type root (lines 1178 and 1232). The bypass for files without egress has a gap. declares_network does not read [box_types.<name>.defaults], which is an expansion layer (lines 1199 and 1213–1215). A file with egress only there starts with no project egress. C1 adds that layer to the check. C2 removes a fix from the refusal text that cannot work when the entry is already named default.

Ruled at 824c125 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on a /revise note, pushed as 824c125795cf.

line exit tail
cargo nextest run -p boxes spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal project_egress_table_reaches_box_policy 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal egress_flag_replaces_the_project_field 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

ks_every_path_component
        PASS [   0.010s] (550/948) minimal resolver::tests::resolver_file_hook_parses_nameserver_and_port
        PASS [   0.011s] (551/948) minimal resolver::tests::resolver_file_hook_states_its_gaps
        PASS [   2.046s] (552/948) minimal mint::tests::a_refused_client_key_is_replaced_and_registered_before_the_mint
        PASS [   0.012s] (553/948) minimal resolver::tests::routing_domain_hook_finds_the_carrying_link_and_its_port
        PASS [   0.012s] (554/948) minimal resolver::tests::routing_domain_hook_states_its_gaps
        PASS [   0.020s] (555/948) minimal resolver::tests::session_advisory_agrees_with_the_hook_it_detected
        PASS [   0.017s] (556/948) minimal resolver::tests::session_advisory_without_a_port_stays_quiet
        PASS [   0.011s] (557/948) minimal resolver::tests::session_start_points_at_finalize_install_without_the_advisory
        PASS [   0.010s] (558/948) minimal resolver::tests::the_app_bundle_layout_matches_packaging
        PASS [   0.013s] (559/948) minimal resolver::tests::the_bundle_record_mirrors_the_probe
        PASS [   0.263s] (560/948) minimal resolver::tests::privileged_copy_refuses_a_user_writable_ancestor
        PASS [   1.082s] (561/948) minimal resolver::tests::finalize_install_undo_succeeds_on_a_clean_host
        PASS [   0.011s] (562/948) minimal resolver::tests::the_resolve_module_is_looked_up_under_glibcs_module_name
        PASS [   0.011s] (563/948) minimal resolver::tests::vm_host_answerer_line_names_the_holder
        FAIL [   0.088s] (564/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
  stdout ───

    running 1 test
    test resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling ... FAILED

    failures:

    failures:
        resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 794 filtered out; finished in 0.07s

  stderr ───

    thread 'resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling' (3811) panicked at crates/minimal/src/resolver.rs:7689:9:
    the liveness proof still ran at the holder's port
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.016s] (565/948) minimal resolver::tests::vm_host_name_surface_decides_the_status_settled_arms_alone
        PASS [   0.017s] (566/948) minimal resolver::tests::vm_host_answerer_line_says_dns_service_or_host_daemon
        PASS [   0.630s] (567/948) minimal resolver::tests::the_lists_two_queries_run_under_one_deadline
────────────
     Summary [  12.197s] 567/948 tests run: 566 passed, 1 failed, 1 skipped
        FAIL [   0.088s] (564/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
warning: 381/948 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Review threads the coder judged:

  • 👎 invalid — PRRT_kwDOPdfcxM60xZCp: The task and its proof require the egress rules in a project's minimal.toml to apply to every box activated from it. The spec's own story makes the project spec the reviewed list of allowed destinations. A trust or approval gate for project egress is a design decision that the spec does not make, so (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: An undecided pick now refuses only when the file declares a network key (declares_network). A file with no egress keys starts with no project egress, as before. The no_egress case in project_egress_table_reaches_box_policy pins it.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs:122: pick_session_entry returns SessionEntryUndecided::TypeUnresolved (exit 2) for an entry with no type or a type outside BUILTIN_BOX_TYPES, unless a session entry named default decides the pick. Both files from C1 are pinned in the test.

Egress rules in a project's minimal.toml become the policy of every box activated from it, as min session policy shows. A file whose session entry cannot be picked now gets a refusal that names the entry. A file of an unresolved type is not skipped without a message.

Notes from the agent: Arch C1: pick_session_entry keeps the early return for a session entry named default. Then it returns the new SessionEntryUndecided::TypeUnresolved (exit 2 through the existing main.rs arm) when any entry has no type or a type outside BUILTIN_BOX_TYPES. The pinned text: 'Cannot start the box: the project's minimal.toml declares the entry "dev" with the type "devbox", so the start cannot tell whether it is a session entry. If "dev" is the session to start, set type = "session" in it. Otherwise, rename the session entry to start to "default" in minimal.toml.' project_egress_table_reaches_box_policy has one case for [boxes.dev] type = "devbox" and one for [boxes.default] type = "devbox". The directive said to change nothing else. I also fixed thread PRRT_kwDOPdfcxM60xZCs, because the new refusal makes that regression wider: an undecided pick now refuses only when the file declares a network key in [defaults], a [defaults.] table or an entry. Otherwise the start gets no project egress, as before this pull request. One test case pins this. cargo clippy -p minimal --all-targets printed no warnings. I did not run just clippy-strict.

@agent-137

Copy link
Copy Markdown
Member

/revise Arch condition C1 (arch_rulings 1050, head f1495e6), in substance. In crates/minimal/src/cmd/boxes/create.rs impl Display for SessionEntryUndecided, arm TypeUnresolved: every fix the refusal names must make pick_session_entry succeed. (a) In the name == DEFAULT_ENTRY_NAME branch (about line 224), replace "or rename that entry and add a [sessions.] entry to {file}." with "or rename that entry and add a [sessions.default] entry to {file}.", because a session entry of any other name still refuses while the renamed entry keeps its unresolved type. (b) In the other branch (about line 231), replace "Otherwise, rename the session entry to start to "default" in {file}." with "Otherwise, name the session entry to start "default", or add a [sessions.default] entry to {file}.", because the file can lack a session entry (for example one with only [boxes.dev] type = "devbox"). Update the strings project_egress_table_reaches_box_policy pins (about lines 5149 and 5163) to match. Add one assertion: a file with [boxes.dev] type = "devbox", [sessions.default], and egress in [defaults] gives the [sessions.default] egress. Change nothing else.

The unresolved-type refusal now names a [sessions.default] entry as the
fix, because only that entry makes the pick succeed.

@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 — 3 findings, 3 inline.

Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.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: PASS_WITH_CONDITIONS · 1 condition · the full ruling

The refusal texts now name only fixes that make the session pick succeed. That closes the baseline's open item. One residual has no issue. The start refuses an entry of a project Box Type even when its built-in root is session. Lines 388 and 1178 make that entry a session entry. The refusal fails closed, so the change can merge. File the issue and name it, as C1 says.

Ruled at b135337 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 6 of 10 on a /revise note, pushed as b135337f497d.

line exit tail
cargo nextest run -p boxes spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal project_egress_table_reaches_box_policy 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal egress_flag_replaces_the_project_field 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

ange_program_applies_exactly_the_reserved_range
        PASS [   0.011s] (546/948) minimal resolver::tests::range_step_custody_failure_resurfaces_the_advisory
        PASS [   0.011s] (547/948) minimal resolver::tests::range_step_custody_follows_the_program_the_plist_names
        PASS [   0.012s] (548/948) minimal resolver::tests::range_step_custody_is_root_owned
        PASS [   0.011s] (549/948) minimal resolver::tests::range_step_custody_walks_every_path_component
        PASS [   0.010s] (550/948) minimal resolver::tests::resolver_file_hook_parses_nameserver_and_port
        PASS [   0.009s] (551/948) minimal resolver::tests::resolver_file_hook_states_its_gaps
        PASS [   2.052s] (552/948) minimal mint::tests::a_refused_client_key_is_replaced_and_registered_before_the_mint
        PASS [   0.010s] (553/948) minimal resolver::tests::routing_domain_hook_finds_the_carrying_link_and_its_port
        PASS [   0.011s] (554/948) minimal resolver::tests::routing_domain_hook_states_its_gaps
        PASS [   0.017s] (555/948) minimal resolver::tests::session_advisory_agrees_with_the_hook_it_detected
        PASS [   0.017s] (556/948) minimal resolver::tests::session_advisory_without_a_port_stays_quiet
        PASS [   0.012s] (557/948) minimal resolver::tests::session_start_points_at_finalize_install_without_the_advisory
        PASS [   0.016s] (558/948) minimal resolver::tests::the_app_bundle_layout_matches_packaging
        PASS [   0.010s] (559/948) minimal resolver::tests::the_bundle_record_mirrors_the_probe
        FAIL [   0.048s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
  stdout ───

    running 1 test
    test resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling ... FAILED

    failures:

    failures:
        resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 794 filtered out; finished in 0.04s

  stderr ───

    thread 'resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling' (8371) panicked at crates/minimal/src/resolver.rs:7689:9:
    the liveness proof still ran at the holder's port
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.256s] (561/948) minimal resolver::tests::privileged_copy_refuses_a_user_writable_ancestor
        PASS [   1.065s] (562/948) minimal resolver::tests::finalize_install_undo_succeeds_on_a_clean_host
        PASS [   0.623s] (563/948) minimal resolver::tests::the_lists_two_queries_run_under_one_deadline
────────────
     Summary [  11.528s] 563/948 tests run: 562 passed, 1 failed, 1 skipped
        FAIL [   0.048s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
warning: 385/948 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Review threads the coder judged:

  • 👎 invalid — crates/minimal/src/cmd/boxes/create.rs:495: Deliberate. The spec refuses an undecided session pick with exit 2. The exemption covers only a file with no network settings at all, because a network table in an unpicked entry is ambiguous too. This round's note also bars changes beyond C1.
  • 👎 invalid — crates/minimal/src/cmd/boxes/create.rs:2002: NET-060 requires the project file's egress to apply to the box, and the policy shows each field's source. A trust prompt or a start notice is a new surface outside this task, and AGENTS.md bars a new message before the shell on a healthy start.
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs:224: The default-entry branch now says "add a [sessions.default] entry".
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: The other branch now says "name the session entry to start "default", or add a [sessions.default] entry".
  • 👍 valid — crates/minimal/src/cmd/boxes/create.rs: Updated both pinned strings, and added an assertion that the named fix makes the pick succeed.

Egress rules written in a project's minimal.toml apply to every box activated from it, as min session policy shows. When the start cannot pick a session entry because an entry has a type the client cannot resolve, the refusal now names only fixes that make the pick succeed: a [sessions.default] entry.

Notes from the agent: Round 6 applies arch condition C1 only: the two TypeUnresolved refusal strings, their pinned text in project_egress_table_reaches_box_policy, and one new assertion that [boxes.dev] type = "devbox" beside [sessions.default] with egress in [defaults] gives the defaults egress through [sessions.default]. Nothing else changed, as the note asks. just clippy-strict was not run.

@agent-137

Copy link
Copy Markdown
Member

/revise Arch condition C1 (arch_rulings 1052, head b135337). The issue is filed: #3140 (resolve a project Box Type's session root in pick_session_entry). Name it in two places. First, in crates/minimal/src/cmd/boxes/create.rs, in the comment above the TypeUnresolved check ("An entry whose type is not built in has a session root that only mfile can resolve"), add that #3140 tracks resolving it and that the refusal stays until then. Second, in the PR body, add it as a residual of T122. Keep the refusal as it is. Change nothing else.

@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 — 2 findings, 2 inline.

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

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.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: PASS_WITH_CONDITIONS · 1 condition · the full ruling

The compare adds one comment that names #3140 at the refusal for an entry of a project Box Type. The code does not change, so the earlier ruling stands. Project egress reaches the box in the layer order of the Expansion section, and flags stay the last layer. C1 stays open: architecture.md lines 1173 and 1178 make an entry whose root is session a session entry, and pick_session_entry() refuses it. The refusal fails closed and #3140 tracks the fix, so the change can merge with C1 open.

Ruled at 4a1ded4 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 7 of 10 on a /revise note, pushed as 4a1ded45585c.

line exit tail
cargo nextest run -p boxes spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal project_egress_table_reaches_box_policy 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal egress_flag_replaces_the_project_field 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

ange_program_applies_exactly_the_reserved_range
        PASS [   0.010s] (546/948) minimal resolver::tests::range_step_custody_failure_resurfaces_the_advisory
        PASS [   0.010s] (547/948) minimal resolver::tests::range_step_custody_follows_the_program_the_plist_names
        PASS [   0.010s] (548/948) minimal resolver::tests::range_step_custody_is_root_owned
        PASS [   0.010s] (549/948) minimal resolver::tests::range_step_custody_walks_every_path_component
        PASS [   0.009s] (550/948) minimal resolver::tests::resolver_file_hook_parses_nameserver_and_port
        PASS [   0.009s] (551/948) minimal resolver::tests::resolver_file_hook_states_its_gaps
        PASS [   0.010s] (552/948) minimal resolver::tests::routing_domain_hook_finds_the_carrying_link_and_its_port
        PASS [   0.010s] (553/948) minimal resolver::tests::routing_domain_hook_states_its_gaps
        PASS [   0.012s] (554/948) minimal resolver::tests::session_advisory_agrees_with_the_hook_it_detected
        PASS [   0.012s] (555/948) minimal resolver::tests::session_advisory_without_a_port_stays_quiet
        PASS [   0.009s] (556/948) minimal resolver::tests::session_start_points_at_finalize_install_without_the_advisory
        PASS [   0.948s] (557/948) minimal resolver::tests::finalize_install_undo_succeeds_on_a_clean_host
        PASS [   0.010s] (558/948) minimal resolver::tests::the_app_bundle_layout_matches_packaging
        PASS [   0.011s] (559/948) minimal resolver::tests::the_bundle_record_mirrors_the_probe
        FAIL [   0.029s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
  stdout ───

    running 1 test
    test resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling ... FAILED

    failures:

    failures:
        resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 794 filtered out; finished in 0.02s

  stderr ───

    thread 'resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling' (8359) panicked at crates/minimal/src/resolver.rs:7689:9:
    the liveness proof still ran at the holder's port
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.231s] (561/948) minimal resolver::tests::privileged_copy_refuses_a_user_writable_ancestor
        PASS [   2.055s] (562/948) minimal mint::tests::a_refused_client_key_is_replaced_and_registered_before_the_mint
        PASS [   0.619s] (563/948) minimal resolver::tests::the_lists_two_queries_run_under_one_deadline
────────────
     Summary [  11.455s] 563/948 tests run: 562 passed, 1 failed, 1 skipped
        FAIL [   0.029s] (560/948) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
warning: 385/948 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Review threads the coder judged:

Egress rules written in a project's minimal.toml apply to every box activated from it, and min session policy shows each egress field with its source, the project's minimal.toml or a flag. This round adds no behaviour change. The comment above the TypeUnresolved refusal in pick_session_entry now names #3140 as the issue that tracks resolving a project Box Type's session root.

Notes from the agent: Round 7 did only what the /revise note asked: one comment in create.rs that names #3140 and says the refusal stays until then. The refusal is unchanged. Residual of T122 for the PR body: #3140 (#3140) tracks resolving a project Box Type's session root in pick_session_entry. Until that issue is done, an entry with a type that is not built in makes the start refuse with exit 2 when the file declares network keys and no [sessions.default] entry exists. The note said to change nothing else, so this round does not fix threads 4500132482 and 4500132484, even though their findings hold. Their thread notes give the fix for a later round.

@agent-137

Copy link
Copy Markdown
Member

/revise Fix the finding on SessionEntryUndecided (thread PRRT_kwDOPdfcxM60yN4v), confirmed on 4a1ded4. In crates/minimal/src/cmd/boxes/create.rs impl Display for SessionEntryUndecided, the DefaultNotSession and TypeUnresolved arms print the entry's box_type raw (format!("the type \"{t}\""), about lines 205 and 216). Entry names are DNS-validated by mfile, but box_type is any TOML string, so a hostile minimal.toml can write terminal escape sequences to stderr. Print it through the existing printable() helper in this file (about line 948), or {t:?} as mfile's TypeMismatch does, and update the pinned strings in project_egress_table_reaches_box_policy if their output changes. Add one assertion that a box_type containing \u001b[31m is printed escaped. Also add #3140 to the PR body as a residual of T122 (arch asked for it in the body as well as the code comment). Change nothing else.

A box type in minimal.toml is any TOML string. The refusal now prints it
through printable(), so a hostile file cannot write terminal escapes.

@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_WITH_CONDITIONS · 1 condition · the full ruling

The new commit escapes the entry type in the session pick refusal. It changes no behaviour that the design decides, so the ruling on 4a1ded4 stands. The entry names need no escape, because mfile accepts only DNS-safe names. C1 stays open as issue #3140: the pick must resolve a project Box Type's root (architecture.md line 1178).

Ruled at 3aa0e30 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5.

Comment thread crates/minimal/src/cmd/boxes/create.rs 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 — 2 findings, 2 inline.

Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.

Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo nextest run -p boxes spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in box runtime-implement-test-0-1... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal project_egress_table_reaches_box_policy 0 Applying loadouts: default Running task runtime-implement-test-1 in box runtime-implement-test-1-1... Compiling paths v0.0.1 (/workbench/crates/paths) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling client-config v0.0.1 (/workbench/crat
cargo nextest run -p minimal egress_flag_replaces_the_project_field 0 Applying loadouts: default Running task runtime-implement-test-2 in box runtime-implement-test-2-1... Compiling version v0.8.0 (/workbench/crates/version) Compiling stdlib v0.0.22 (/workbench/crates/stdlib) Compiling mfile v0.0.1 (/workbench/crates/mfile) Compiling mlog v0.0.1 (/workbenc

Verify min task run agent-verify exited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

ks_every_path_component
        PASS [   0.009s] (554/953) minimal resolver::tests::resolver_file_hook_parses_nameserver_and_port
        PASS [   0.008s] (555/953) minimal resolver::tests::resolver_file_hook_states_its_gaps
        PASS [   0.010s] (556/953) minimal resolver::tests::routing_domain_hook_finds_the_carrying_link_and_its_port
        PASS [   0.009s] (557/953) minimal resolver::tests::routing_domain_hook_states_its_gaps
        PASS [   0.013s] (558/953) minimal resolver::tests::session_advisory_agrees_with_the_hook_it_detected
        PASS [   0.979s] (559/953) minimal resolver::tests::finalize_install_undo_succeeds_on_a_clean_host
        PASS [   0.015s] (560/953) minimal resolver::tests::session_advisory_without_a_port_stays_quiet
        PASS [   0.011s] (561/953) minimal resolver::tests::session_start_points_at_finalize_install_without_the_advisory
        PASS [   0.010s] (562/953) minimal resolver::tests::the_app_bundle_layout_matches_packaging
        PASS [   0.010s] (563/953) minimal resolver::tests::the_bundle_record_mirrors_the_probe
        PASS [   0.229s] (564/953) minimal resolver::tests::privileged_copy_refuses_a_user_writable_ancestor
        PASS [   0.011s] (565/953) minimal resolver::tests::the_resolve_module_is_looked_up_under_glibcs_module_name
        PASS [   0.018s] (566/953) minimal resolver::tests::vm_host_answerer_line_names_the_holder
        PASS [   2.050s] (567/953) minimal mint::tests::a_refused_client_key_is_replaced_and_registered_before_the_mint
        FAIL [   0.078s] (568/953) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
  stdout ───

    running 1 test
    test resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling ... FAILED

    failures:

    failures:
        resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling

    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 798 filtered out; finished in 0.07s

  stderr ───

    thread 'resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling' (8409) panicked at crates/minimal/src/resolver.rs:7689:9:
    the liveness proof still ran at the holder's port
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.014s] (569/953) minimal resolver::tests::vm_host_name_surface_decides_the_status_settled_arms_alone
        PASS [   0.017s] (570/953) minimal resolver::tests::vm_host_answerer_line_says_dns_service_or_host_daemon
        PASS [   0.620s] (571/953) minimal resolver::tests::the_lists_two_queries_run_under_one_deadline
────────────
     Summary [  11.914s] 571/953 tests run: 570 passed, 1 failed, 1 skipped
        FAIL [   0.078s] (568/953) minimal resolver::tests::the_answerer_facts_ride_beside_a_down_proxy_sibling
warning: 382/953 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed

Review threads the coder judged:

Egress rules written in a project's minimal.toml apply to every box activated from it, as min session policy shows. When the start cannot pick the session entry, the refusal now prints the entry's type escaped, so a hostile minimal.toml cannot write terminal escape sequences to stderr.

Notes from the agent: This round changes only the SessionEntryUndecided Display: the DefaultNotSession and TypeUnresolved arms print box_type through printable(). The pinned strings in project_egress_table_reaches_box_policy use plain types, so their output did not change. One assertion now checks that a box_type with \u001b[31m prints as \u{1b}[31m. Residual of T122 for the PR body: #3140 tracks resolving a project Box Type's session root, so the TypeUnresolved refusal can go. I cannot edit the PR body. The runner or a person must add #3140 there. Thread PRRT_kwDOPdfcxM60y_xp: the note for this round says to change nothing else, so declares_network is unchanged. A task-only network key beside two non-default session entries still refuses the start with exit 2. This is a candidate for a follow-up.

@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.

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.

T122 — Egress rules in minimal.toml reach the box

2 participants