8000 fix(mfile,minimal): a later minimal.toml layer that sets one network sub-table keeps the network by minimal-foundry[bot] · Pull Request #3619 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(mfile,minimal): a later minimal.toml layer that sets one network sub-table keeps the network - #3619

Merged
norrietaylor merged 26 commits into
mainfrom
agent/3600-a-later-minimal-toml-layer-that-sets-one-network
Nov 25, 2026
Merged

norrietaylor merged 26 commits into
mainfrom
agent/3600-a-later-minimal-toml-layer-that-sets-one-network

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Follow-up

Fixes #3600

Task marker
### D3597 — A later minimal.toml layer that sets one network sub-table keeps the network keys of an earlier layer
  kind: task
  size: M
  est: 120 code, 110 tests
  executor: agent
  origin: bug
  epic: 1501
  layers:
    - expand:
      - crates/mfile/src/expand.rs: merge_value merges `network` by sub-table and key across layers, and the report records an origin for each `network.<sub>` key
      test: cargo test -p mfile network_merges_by_sub_table
    - cli:
      - crates/minimal/src/cmd/boxes/create.rs: entry_egress reads the per-sub-table merge and names the layer that set `network.egress`, not the last layer that declares `network`
      - crates/minimal/src/cmd/box_spec.rs: source comments and setting_table read the per-sub-table origins, so `network.bep` and `network.egress` each name their own layer
      - crates/minimal/src/tests.rs: adds the issue reproduce case: the spec of `dev` holds both `bep` and `egress`, and entry_egress sees the `[defaults.network.egress]` hosts
      test: cargo test -p minimal box_spec_keeps_earlier_network_egress
    - docs:
      - docs/specs/29-spec-box-local-first/29-spec-box-local-first.md: BOX-048 states that `network` merges by sub-table, as `vars` merges by name
      - docs/specs/18-spec-box-networking/18-spec-box-networking.md: replaces the text that says the merge replaces the `network` table whole
      test: cargo test -p mfile network_merges_by_sub_table
  proof: With `[defaults.session.network.bep]` and `[defaults.network.egress]` set, `min box spec dev` shows both `bep` and `egress` under `[network]`, each with its source layer.

Proof

With [defaults.session.network.bep] and [defaults.network.egress] set, min box spec dev now shows both bep and egress under [network]. It prints '# network.bep: from [defaults.session]' and '# network.egress: from [defaults]'. The start reads the [defaults.network.egress] hosts and names [defaults] as the table that set them.

Notes from the agent: Merge rule: each key below network (mode, egress, bep, ingress) comes whole from the most specific layer that sets it. A sub-table does not merge key by key. The first commit merged inside sub-tables, but task::tests::task_box_network_reads_the_task_egress_from_minimal_toml (NET-060) pins that a later egress table replaces an earlier one whole, so a later commit narrowed the merge. The flat egress_* keys and egress spell one setting, so a layer that sets any of them replaces all of them. ExpansionReport has a new field, network, with the origin of each key below network. values["network"] still names the last layer. ProjectEgress.layer now names the layer of network.egress, with the last layer that declares network as the fallback when there is no egress. task.rs (out of scope) still uses that one field for the mode layer. Commit 68275d3 also holds the first create.rs edit because of a commit -a. Pre-existing failure: tests::legacy_network_spellings_parse_with_hint fails on the base commit 84b257c too, because its stderr capture is empty. A filtered run of the box_spec/egress/network/ingress/bep tests in minimal otherwise passed (74 passed). just lint-prose did not run, because vale is not installed on this box.

Tests

line exit tail
cargo test -p mfile network_merges_by_sub_table 0 running 1 test test expand::tests::network_merges_by_sub_table ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 223 filtered out; finished in 0.00s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s warning: unknown f
cargo test -p minimal box_spec_keeps_earlier_network_egress 0 ps_earlier_network_egress ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1026 filtered out; finished in 0.01s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 41 filtered out; finished in 0.00s running 0 tests test result: ok. 0 passed; 0 failed;
cargo test -p mfile network_merges_by_sub_table 0 running 1 test test expand::tests::network_merges_by_sub_table ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 223 filtered out; finished in 0.00s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s warning: unknown f

Verify

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

 {
                "parent_span_id": "51c861eaa81efdb7",
                "rpc": "minimald-v1-GetSessionRecord",
                "span_id": "fc1f2f94fc73f7b9",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "fc1f2f94fc73f7b9",
                "queued_behind": "0",
                "span_id": "faf5f79728046398",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "rpc",
            fields: {
                "parent_span_id": "51c861eaa81efdb7",
                "rpc": "minimald-v1-DestroySession",
                "span_id": "5181cf34c234ed50",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "GetRecord",
                "parent_span_id": "5181cf34c234ed50",
                "queued_behind": "0",
                "span_id": "0ab935e19f0f282c",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "DeleteSession",
                "parent_span_id": "5181cf34c234ed50",
                "queued_behind": "0",
                "span_id": "66b775d4d0cdb508",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "session.message",
            fields: {
                "kind": "Destroy",
                "parent_span_id": "66b775d4d0cdb508",
                "span_id": "510205d58b16f4e7",
                "trace_id": "0af7651916cd43dd8448eb211c803111",
            },
            parent: None,
            closed: true,
        },
        LoggedSpan {
            name: "sessions.manager.message",
            fields: {
                "kind": "HandOverName",
                "parent_span_id": "66b775d4d0cdb508",
                "queued_behind": "0",
                "span_id": "81dfaf8aa9ac240b",
                "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 [  91.673s] 1422 tests run: 1421 passed, 1 failed, 2 skipped
        FAIL [  13.143s] (1422/1422) minimal::otel_cli exec_run_attach_and_task_run_share_the_commands_trace
error: test run failed

Base

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

A later layer that set one network sub-table replaced the whole network
table, so [defaults.network.egress] was lost under a
[defaults.session.network.bep]. The report now records the layer of each
key below network.
With network merged by key, a later egress_allow_dns must replace an
earlier egress.allow_dns_hosts, not union with it.
min box spec now shows network.bep and network.egress from their own
layers, and the start names the table that set network.egress.
NET-060 keeps a later egress table replacing an earlier one, so the merge
goes by the keys of network, not by the keys inside a sub-table.
BOX-048 and the NET egress note said a later layer replaces the network
table whole. The expansion now merges it by its keys.
@coderabbitai
coderabbitai Bot commented Nov 19, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

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: 9b299d83-41f8-42c0-be28-b2d67665f3bb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions
github-actions Bot commented Nov 19, 2026 •
Copy link
Copy Markdown
Contributor

Spec lint

docs/specs/18-spec-box-networking/18-spec-box-networking.md — 10 finding(s)

docs/specs/18-spec-box-networking/18-spec-box-networking.md:171: P004 NET-009 names test 'native_resolution_without_proxy_env', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:378: P004 NET-040 names test 'fresh_install_own_ip_ingress_publishes_loopback', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:388: P004 NET-041 names test 'installer_switch_binary_executable', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:435: P004 NET-048 names test 'linux_amd64_manifest_ships_vm_stack', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:440: P004 NET-049 names test 'fresh_linux_kvm_activate_local_minvmd', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:445: P004 NET-050 names test 'linux_arm64_manifest_ships_vm_stack', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:450: P004 NET-051 names test 'fresh_arm64_kvm_activate_local_minvmd', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:1052: P004 NET-132 names test 'proxy_sees_each_vm_box_by_its_switch_address', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:1078: P004 NET-134 names test 'deny_all_box_reaches_proxy_and_no_other_host_port', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:1102: P004 NET-107 names test 'session_outbound_request', which was not found in the repository

docs/specs/28-spec-box-cli/28-spec-box-cli.md — 11 finding(s)

docs/specs/28-spec-box-cli/28-spec-box-cli.md:227: P004 BCLI-077 names test 'box_spec_renders_merged_vars_once_with_layer', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:248: P004 BCLI-078 names test 'expansion_refusals_exit3_on_spec_and_create_verbs', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:331: P004 BCLI-075 names test 'create_verbs_no_loadouts_empties_loadouts_layer', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:344: P004 BCLI-076 names test 'create_verbs_no_hooks_stores_no_hooks', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:383: P004 BCLI-069 names test 'create_verbs_send_name_flag_as_requested_name', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:400: P004 BCLI-070 names test 'create_derived_name_held_takes_number', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:405: P004 BCLI-079 names test 'create_sends_box_name_as_requested_name', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:410: P004 BCLI-080 names test 'create_without_name_sends_no_requested_name', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:420: P004 BCLI-081 names test 'unattached_create_numbered_prints_one_stderr_line', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:433: P004 BCLI-082 names test 'attached_start_numbered_prints_nothing_before_shell', which was not found in the repository
docs/specs/28-spec-box-cli/28-spec-box-cli.md:652: P004 BCLI-049 names test 'host_stop_stops_boxes_then_daemon_and_vm', which was not found in the repository

docs/specs/29-spec-box-local-first/29-spec-box-local-first.md — 14 finding(s)

docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:72: P004 BOX-004 names test 'name_belongs_to_one_box_on_host_until_reaped_or_renamed', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:91: P004 BOX-212 names test 'derived_name_taken_takes_smallest_free_number_never_refused', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:114: P004 BOX-218 names test 'concurrent_creations_never_share_a_name', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:122: P004 BOX-219 names test 'create_failure_before_run_leaves_no_box_and_frees_name', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:126: P004 BOX-221 names test 'numbered_creation_returns_name_not_taken_and_reason', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:141: P004 BOX-217 names test 'name_comparison_ignores_case', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:148: P004 BOX-223 names test 'upgrade_keeps_legacy_names_including_default', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:152: P004 BOX-005 names test 'unqualified_name_resolves_to_the_box_that_has_it', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:160: P004 BOX-007 names test 'written_name_not_label_reserved_or_id_form_exit3', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:401: P004 BOX-229 names test 'expanded_spec_entry_names_its_entry', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:423: P004 BOX-224 names test 'singular_entry_table_exit3_names_plural', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:597: P004 BOX-182 names test 'loadout_file_ask_without_terminal_denied', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:623: P004 BOX-225 names test 'allow_dns_hosts_rule_for_sibling_without_that_name_warns', which was not found in the repository
docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:628: P004 BOX-226 names test 'expansion_reports_name_and_project_name_provenance', which was not found in the repository

Advisory. None of this blocks the merge; the review decides.

Advisory, and never a merge gate. Linter: gominimal/foundry@8acb0663, spec format: How Minimal Writes Specs.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite: the coder changed nothing. Revise round 1: no change. The failed checks are the macOS 'unit' job and its aggregator 'ci-macos-success'. On macOS, 'just test' runs only -p minvmd -p boxes -p bep. cargo tree shows that none of those crates depends on mfile or minimal, and the branch changes no file in them. So this diff cannot change the result of that job. The log excerpt stops at "error: recipe test fail" and does not name the failed test. On this Linux box, cargo test -p boxes -p bep passed every unit and integration test (293, 33, 1, 612, 15, 25 passed). Its doctest step did not run because this box has no rustdoc binary, so that result is a fact about the box, not the code. I could not run the minvmd tests in their macOS form. I suggest a re-run of the macOS unit job, because the failure is likely flaky or from main. If it fails again, the full job log must name the test.

@norrietaylor
norrietaylor marked this pull request as ready for review November 19, 2026 06:38
@norrietaylor
norrietaylor requested a review from a team as a code owner November 19, 2026 06:38
@norrietaylor
Copy link
Copy Markdown
Member

Un-drafted: the failed job passed on a re-run of the same head (a timing flake in a test this diff does not touch), and every lane is now green.

@norrietaylor
Copy link
Copy Markdown
Member

/review

@norrietaylor
Copy link
Copy Markdown
Member

/arch-review

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

Approved: every review thread resolved at 28dc488629d6.

@norrietaylor resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributo 8000 r 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 — No findings.

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

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 19, 2026
@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: FAIL · the full ruling

This change makes the network table merge by sub-table across minimal.toml layers. The design forbids that. architecture.md line 1253 says a table is replaced wholesale, and it gives network as the example: a layer that sets only egress drops the earlier mode. The spec edits to BOX-048 and spec 18 move the spec away from the design, and rule 9 does not allow that. No code edit can make this merge rule conform, so do not revise the code now. The escalation asks for an owner ruling in gominimal/arch. Bring the change back when that ruling adds network as a merge exception, as arch#177 did for [env_vars].

Ruled at 31c6b77 against gominimal/arch@8b824707cde6 by claude-opus-5-5.

Comment thread crates/mfile/src/expand.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: FAIL · the full ruling

This change makes network merge by sub-table across minimal.toml layers. The design says the opposite. architecture.md line 1253 says a table is replaced wholesale, and it uses network as the example: a later egress drops an earlier mode. The PR edits BOX-048 and the spec 18 note to match the code, but a spec cannot amend the design. The [env_vars] exception came through gominimal/arch#177 first, and this exception needs the same path. I filed the question as an escalation. Bring the change back after the design gives network a per-key merge.

Ruled at 31c6b77 against gominimal/arch@8b824707cde6 by claude-opus-5-5.

Comment thread crates/mfile/src/expand.rs Resolved
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
10000
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The per-sub-table merge fixes the #3600 case, and the new tests cover it. It also has two side effects that this PR does not handle. First, an entry with mode = "none" now inherits an [defaults.network.egress] and fails with exit 3. Second, ProjectEgress.layer changed meaning while the ingress and task-mode refusals still read it, so those refusals can name the wrong table. Separately, the module doc at the top of crates/mfile/src/expand.rs (lines 6-16) still says that every table other than vars replaces wholesale. That is a low nit, and it is not in the diff. The minimal-arch threads already raise the architecture.md divergence and the stale BOX-048 property: line, so this review does not repeat them.


Generated by Claude Code

Comment thread crates/mfile/src/expand.rs Resolved
Comment thread crates/minimal/src/cmd/boxes/create.rs Resolved
Comment thread crates/minimal/src/cmd/box_spec.rs Resolved
@norrietaylor
Copy link
Copy Markdown
Member

/revise Change of approach, decided by the maintainer after the arch escalation: keep the design's whole-table merge and refuse at load instead.

architecture.md lines 1223 and 1253 say every table except [env_vars] is replaced wholesale, with network as the example, so a spec cannot add a per-sub-table merge. Do this instead:

  1. Revert the merge change. crates/mfile/src/expand.rs merge_value merges network whole again, as on main. Revert the BOX-048 text in docs/specs/29-spec-box-local-first/29-spec-box-local-first.md (including the property: line) and the spec 18 text at ~line 659 to main's wording. Revert the ProjectEgress.layer and box_spec.rs per-sub-key origin changes that only served the per-key merge.
  2. Refuse at load. When a later layer (order: [defaults], [defaults.<type>], the entry) declares a network table and an earlier layer set network keys that the later table does not set, so the whole-table merge drops them, loading minimal.toml fails with the same exit status as other load errors. Put the check where the layers merge (crates/mfile/src/expand.rs), so min box spec, min box start and every other loader refuse alike.
  3. The message (user-facing; follow AGENTS.md "User-facing text"), for the issue's reproduce case:
    the network table in [defaults.session] replaces the network table in [defaults], so egress from [defaults] is dropped. Set egress in [defaults.session] too, or move bep to [defaults.network.bep].
    General form: name the later table, the earlier table, and each dropped key (comma-separated), then the two remedies: set the dropped keys in the later table too, or move the later table's keys into the earlier layer's table. Pin the exact text in a test.
  4. Tests: (a) the issue's reproduce case ([defaults.session.network.bep] plus [defaults.network.egress]) is refused with that text; (b) [defaults.network.egress] plus [tasks.offline] network = { mode = "none" } is refused too (the entry's table drops egress), rather than silently dropping it; (c) a file where only one layer sets network, or the later layer sets every key the earlier one set, loads unchanged.

Before you push, check that no checked-in minimal.toml (this repo's .minimal/, examples, test fixtures) now fails to load. If one does, list it in the PR body rather than edit .minimal/minimal.toml.

Revert the per-sub-table network merge, the per-key origins and the
spec text that described it. The merge replaces network whole again, as
architecture.md says. Loading minimal.toml now refuses, with exit 3, a
later network table that leaves out keys an earlier layer sets.
The NetworkTableDropsKeys variant made mfile::Error 128 bytes, so
clippy's result_large_err failed every Result<_, Error> in mctx.
@norrietaylor
Copy link
Copy Markdown
Member

/revise
The design text in gominimal/arch#200 now also says the --network none flag clears the egress and ingress that earlier layers set, the same as a layer's mode = "none". Make the code match:

  1. min session start --network none (the create path) and min box spec <entry> --network none (the render) both drop inherited egress and ingress, including ingress file mappings in the rendered policy. The other network flags still change only the key they name.
  2. Add a test for each path: an entry with egress and ingress plus --network none renders and creates with neither. Run both by name and record the results.

Keep the rest of this head unchanged. The maintainer has approved it, and the arch FAIL waits on gominimal/arch#200 landing.

min session start and min box spec <entry> with --network none clear
the network.egress and network.ingress that minimal.toml layers set, as
a layer's mode = "none" does (gominimal/arch#200).
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

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

line exit tail
cargo test -p mfile network_merges_by_sub_table 0 running 3 tests test expand::tests::network_merges_by_sub_table_mode_none_with_own_egress_is_refused ... ok test expand::tests::network_merges_by_sub_table_mode_none_clears_inherited_egress_and_ingress ... ok test expand::tests::network_merges_by_sub_table ... ok test result: ok. 3 passed; 0 faile
cargo test -p minimal box_spec_keeps_earlier_network_egress 0 gress_beside_entry_egress ... ok test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 1063 filtered out; finished in 0.01s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 43 filtered out; finished in 0.00s running 0 tests test result: ok. 0 passed; 0 failed;
cargo test -p mfile network_merges_by_sub_table 0 running 3 tests test expand::tests::network_merges_by_sub_table_mode_none_with_own_egress_is_refused ... ok test expand::tests::network_merges_by_sub_table_mode_none_clears_inherited_egress_and_ingress ... ok test expand::tests::network_merges_by_sub_table ... ok test result: ok. 3 passed; 0 faile

Verify min task run agent-verify exited 100.

3) minimal::bin/min tests::invalid_project_file_for_box_spec_says_spec_cannot_show
        PASS [   0.006s] (1448/1473) minimal::bin/min tests::invalid_project_file_prints_toml_error_once
        PASS [   0.005s] (1449/1473) minimal::bin/min tests::invalid_project_file_prints_toml_error_once_for_io
        PASS [   0.005s] (1450/1473) minimal::bin/min tests::loadout_not_found_exits_4
        PASS [   0.005s] (1451/1473) minimal::bin/min tests::local_host_not_found_exits_4
        PASS [   0.005s] (1452/1473) minimal::bin/min tests::machine_mode_answers_write_failures
        PASS [   0.005s] (1453/1473) minimal::bin/min tests::machine_mode_error_line_keeps_an_empty_hint
        PASS [   0.005s] (1454/1473) minimal::bin/min tests::machine_mode_error_object_is_one_stamped_line
        PASS [   0.005s] (1455/1473) minimal::bin/min tests::machine_mode_error_object_on_stderr
        PASS [   0.005s] (1456/1473) minimal::bin/min tests::machine_mode_names_the_grant_refusal_code
        PASS [   0.005s] (1457/1473) minimal::bin/min tests::machine_output_mode_keys_on_the_output_flag
        PASS [   0.007s] (1458/1473) minimal::bin/min tests::misplaced_run_flag_exits_2
        PASS [   0.005s] (1459/1473) minimal::bin/min tests::network_flag_refusal_exits_2
        PASS [   0.005s] (1460/1473) minimal::bin/min tests::prune_off_tty_needs_yes_exits_2
        PASS [   0.007s] (1461/1473) minimal::bin/min tests::project_file_not_found_exits_4
        PASS [   0.006s] (1462/1473) minimal::bin/min tests::resume_and_session_attach_refusals_map_to_exit_codes
        PASS [   0.005s] (1463/1473) minimal::bin/min tests::rm_running_box_refuses_naming_force_with_exit_2
        PASS [   0.005s] (1464/1473) minimal::bin/min tests::row_not_back_exit_codes
        PASS [   0.005s] (1465/1473) minimal::bin/min tests::run_verbs_and_wait_timeout_return_124_with_code_timeout
        PASS [   0.005s] (1466/1473) minimal::bin/min tests::task_file_invalid_exits_3
        PASS [   0.006s] (1467/1473) minimal::bin/min tests::start_entry_refusals_exit_with_their_codes
        PASS [   0.005s] (1468/1473) minimal::bin/min tests::task_network_key_a_task_does_not_apply_exits_3
        PASS [   0.006s] (1469/1473) minimal::bin/min tests::task_not_found_exits_4
        PASS [   0.005s] (1470/1473) minimal::bin/min tests::task_run_is_a_stdout_contract
        PASS [   0.005s] (1471/1473) minimal::bin/min tests::type_refusals_exit_3_and_4
        PASS [   2.055s] (1472/1473) minimal::named_vm named_vm_reaches_autospawn
  stdout ───

    running 1 test
    test exec_run_attach_and_task_run_share_the_commands_trace ... FAILED

    failures:

    failures:
        exec_run_attach_and_task_run_share_the_commands_trace

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

  stderr ───

    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
error: test run failed

Outside the task's layers::

  • crates/minimal/src/task.rs

Converted to a draft: verify exited 100; outside the task's layers:: crates/minimal/src/task.rs.

Review threads the coder judged:

  • 👎 invalid — crates/mfile/src/expand.rs:1375: The maintainer approved the by-key network merge on this head and asked to keep it unchanged. gominimal/arch#200 now states that rule in the design, and the arch check waits for smoke test: route after sequence fix (retry, workflow re-enabled) #200 to land. No code change this round.
  • 👎 invalid — crates/mfile/src/expand.rs:1399: gominimal/arch#200 now states the mode = "none" clearing, and the maintainer approved this head. This round adds the same clearing for --network none, as smoke test: route after sequence fix (retry, workflow re-enabled) #200 says. merge_network is unchanged.
  • 👎 invalid — docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:290: The design amendment is gominimal/arch#200, which the maintainer says the arch check waits on. The maintainer approved this BOX-048 text and asked to keep it unchanged.
  • 👎 invalid — docs/specs/29-spec-box-local-first/29-spec-box-local-first.md:849: The maintainer approved this text and asked to keep the head unchanged until gominimal/arch#200 lands in the design of record. No change this round.

With [defaults.session.network.bep] and [defaults.network.egress] set, min box spec dev shows both bep and egress under [network], each with its source layer. In addition, min session start --network none and min box spec <entry> --network none now drop the egress and ingress that minimal.toml layers set, and neither command refuses.

Notes from the agent: Round 5 /revise note: the new helper clear_file_network_on_none_flag (create.rs) clears the file's egress, ingress and ingress layer when --network is none. session_box_network calls it, so the create path and the bare min box spec render get it. The entry render in box_spec.rs calls it for session entries and also removes the inherited network.ingress row and its source comment. The other network flags are unchanged. Task entries are not changed: min task run resolves its network in crates/minimal/src/task.rs, which is outside this task's layers. So the task branch of the render still matches what min task run does. If the arch#200 rule must apply to min task run --network none too, that needs a follow-up in task.rs and in the task branch of box_spec.rs. The rest of the head is unchanged, as the note asks. Docs keep their gominimal/arch#188 citations. A wider run (cargo test -p minimal -- network egress ingress) had one failure: tests::legacy_network_spellings_parse_with_hint, at tests.rs:4618. It also fails on the previous head when it runs alone. It captures process stderr, so this box is the probable cause, not this change. cargo clippy -p minimal --all-targets printed no warnings.

@minimal-foundry minimal-foundry Bot added the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Nov 21, 2026
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: the diff is +719/-27 (746 lines), past 3x the plan's estimate of 230 lines (est: 120 code, 110 tests, as #3600 reads now), at round 5 (the last trigger was a /revise note). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #3600 by hand.

@norrietaylor
norrietaylor marked this pull request as ready for review November 21, 2026 18:16
@norrietaylor
Copy link
Copy Markdown
Member

Marked ready: CI is green at 6cea830. The only verify failure, otel_cli exec_run_attach_and_task_run_share_the_commands_trace, is in code this PR does not touch, and it passes in CI. The arch FAIL waits on gominimal/arch#200; the maintainer has approved this PR over it.

@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: FAIL · the full ruling

This change makes network merge by key between minimal.toml layers. The design of record says the opposite. architecture.md line 1294 says a later layer replaces the network table whole and must restate the keys it keeps. The spec edits cite gominimal/arch#188, but the design checkout does not contain that decision. No code edit can fix #3600 and also conform, so this PR waits for the design question in the escalation. When the design changes, push again for a new ruling.

Ruled at 6cea830 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

Comment thread crates/mfile/src/expand.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: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/mfile/src/expand.rs Resolved
Comment thread crates/minimal/src/cmd/box_spec.rs Resolved
@norrietaylor norrietaylor removed the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Nov 24, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/revise
The maintainer merges this PR on the gominimal/arch#188 ruling, ahead of gominimal/arch#200. Do not revert the per-key merge for the arch-review FAIL. Make these changes in this round:

  1. Merge main. The branch conflicts with main. Keep main's changes and this PR's network merge.
  2. BOX-048's proof must test the network rule (docs/specs/29-spec-box-local-first/29-spec-box-local-first.md). Its property: line now says network merges by key, but defaults_merge_lists_union_scalars_replace_property in crates/mfile/src/expand.rs generates keys [k-n] only and never a network table. Extend the generator so a layer can carry a network table with any of mode, egress, ingress and bep, and assert the rule over generated layers: each network key comes whole from the most specific layer that sets it, a later mode = "none" drops the inherited egress and ingress, and a layer that sets egress or a flat egress_* key replaces all of them. Add verify: lines under BOX-048 for network_merges_by_sub_table, network_merges_by_sub_table_mode_none_clears_inherited_egress_and_ingress and network_merges_by_sub_table_mode_none_with_own_egress_is_refused.
  3. A requirement for what --network none clears. In docs/specs/28-spec-box-cli/28-spec-box-cli.md, add a sub-requirement under BCLI-024, in EARS: WHEN --network none is given, the system clears the egress and ingress that earlier layers set, as a layer's mode = "none" does. Every other override flag still changes only the key it names. Give it verify: lines for network_none_flag_drops_file_egress_and_ingress_in_box_spec and network_none_flag_drops_file_egress_and_ingress_on_start. BCLI-024 covers min task run too, but only the session branch calls clear_file_network_on_none_flag, and task_box_network in crates/minimal/src/task.rs refuses an inherited egress under --network none. Make min task run --network none clear them the same way, and add a test and a verify: line for it.
  4. Refusals that name the wrong table. ProjectEgress.layer now names the layer of network.egress, but refuse_file_ingress_off_own_ip (create.rs) reads it as the layer that set network.ingress and network.mode, and task_box_network reads it as mode_layer. With [defaults.network.egress] allow_dns_hosts = ["a"] and [sessions.dev] network = { mode = "host_ip", ingress = [{ proto = "tcp", port = 8080 }] }, the refusal names [defaults], but [sessions.dev] sets both. Track a layer per key (mode, ingress, egress) and pass the right one to each refusal. Pin both messages in tests.
  5. Source order. In the min box spec render, the # network: source line lists layers in key order. List them from least to most specific, as every other source line does, and pin it in a test.

Run just fix and the test lines you touch, and record them in the PR's Tests section.

…nimal-toml-layer-that-sets-one-network

# Conflicts:
#	crates/mfile/src/expand.rs
The generator gives a layer an optional network table with mode,
egress, ingress, bep and a flat egress_* key. The property checks each
key against a per-key model: the most specific setter wins, mode none
drops inherited egress and ingress, and any egress key replaces all.
BOX-048 gains verify lines for the three network merge tests.
task_box_network clears the egress and ingress that the task's layers
set when --network none is given, as a session start does. BCLI-024
gains the sub-requirement with its verify lines. New tests pin the
ingress refusal and the task own_ip refusal, each naming the table
that sets the key.
BCLI-024 now clears the file's egress on --network none, so the
file-layer cases expect the box to run, and an egress flag is still
refused naming only the flag.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a /revise note, pushed as 28dc488629d6.

Resolved conflicts in: crates/mfile/src/expand.rs

line exit tail
cargo test -p mfile network_merges_by_sub_table 0 running 3 tests test expand::tests::network_merges_by_sub_table_mode_none_with_own_egress_is_refused ... ok test expand::tests::network_merges_by_sub_table_mode_none_clears_inherited_egress_and_ingress ... ok test expand::tests::network_merges_by_sub_table ... ok test result: ok. 3 passed; 0 faile
cargo test -p minimal box_spec_keeps_earlier_network_egress 0 rk_egress_until_mode_none ... ok test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 1118 filtered out; finished in 0.02s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 45 filtered out; finished in 0.00s running 0 tests test result: ok. 0 passed; 0 failed;
cargo test -p mfile network_merges_by_sub_table 0 running 3 tests test expand::tests::network_merges_by_sub_table_mode_none_with_own_egress_is_refused ... ok test expand::tests::network_merges_by_sub_table ... ok test expand::tests::network_merges_by_sub_table_mode_none_clears_inherited_egress_and_ingress ... ok test result: ok. 3 passed; 0 faile

Verify min task run agent-verify exited 100.

/1542) minimal::bin/min tests::invalid_project_file_prints_toml_error_once
        PASS [   0.007s] (1517/1542) minimal::bin/min tests::invalid_project_file_prints_toml_error_once_for_io
        PASS [   0.008s] (1518/1542) minimal::bin/min tests::loadout_not_found_exits_4
        PASS [   0.009s] (1519/1542) minimal::bin/min tests::local_host_not_found_exits_4
        PASS [   0.987s] (1520/1542) minimal::otel_cli a_silent_collector_costs_min_ls_little_and_prints_nothing
        PASS [   0.009s] (1521/1542) minimal::bin/min tests::machine_mode_answers_write_failures
        PASS [   0.012s] (1522/1542) minimal::bin/min tests::machine_mode_error_line_keeps_an_empty_hint
        PASS [   0.009s] (1523/1542) minimal::bin/min tests::machine_mode_error_object_is_one_stamped_line
        PASS [   0.009s] (1524/1542) minimal::bin/min tests::machine_mode_error_object_on_stderr
        PASS [   0.009s] (1525/1542) minimal::bin/min tests::machine_mode_names_the_grant_refusal_code
        PASS [   0.007s] (1526/1542) minimal::bin/min tests::machine_output_mode_keys_on_the_output_flag
        PASS [   0.007s] (1527/1542) minimal::bin/min tests::misplaced_run_flag_exits_2
        PASS [   0.007s] (1528/1542) minimal::bin/min tests::network_flag_refusal_exits_2
        PASS [   0.007s] (1529/1542) minimal::bin/min tests::project_file_not_found_exits_4
        PASS [   0.006s] (1530/1542) minimal::bin/min tests::prune_off_tty_needs_yes_exits_2
        PASS [   0.009s] (1531/1542) minimal::bin/min tests::resume_and_session_attach_refusals_map_to_exit_codes
        PASS [   0.007s] (1532/1542) minimal::bin/min tests::rm_running_box_refuses_naming_force_with_exit_2
        PASS [   0.007s] (1533/1542) minimal::bin/min tests::run_verbs_and_wait_timeout_return_124_with_code_timeout
        PASS [   0.009s] (1534/1542) minimal::bin/min tests::row_not_back_exit_codes
        PASS [   0.008s] (1535/1542) minimal::bin/min tests::start_entry_refusals_exit_with_their_codes
        PASS [   0.007s] (1536/1542) minimal::bin/min tests::task_file_invalid_exits_3
        PASS [   0.007s] (1537/1542) minimal::bin/min tests::task_not_found_exits_4
        PASS [   0.009s] (1538/1542) minimal::bin/min tests::task_network_key_a_task_does_not_apply_exits_3
        PASS [   0.007s] (1539/1542) minimal::bin/min tests::task_run_is_a_stdout_contract
        PASS [   0.010s] (1540/1542) minimal::bin/min tests::type_refusals_exit_3_and_4
        PASS [   2.063s] (1541/1542) minimal::named_vm named_vm_reaches_autospawn
  stdout ───

    running 1 test
    test exec_run_attach_and_task_run_share_the_commands_trace ... FAILED

    failures:

    failures:
        exec_run_attach_and_task_run_share_the_commands_trace

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

  stderr ───

    ]
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 
────────────
error: test run failed

Outside the task's layers::

  • crates/minimal/src/task.rs
  • docs/specs/28-spec-box-cli/28-spec-box-cli.md

Converted to a draft: verify exited 100; outside the task's layers:: crates/minimal/src/task.rs, docs/specs/28-spec-box-cli/28-spec-box-cli.md.

Review threads the coder judged:

  • 👎 invalid — PRRT_kwDOPdfcxM66apED: The maintainer ruled on gominimal/arch#188 that this PR merges network by key, ahead of the architecture.md amendment in gominimal/arch#200, and asked that the merge stay. The design text lags the ruling. The code keeps the ruled behaviour. (not posted on the thread: not an open thread on the pull request)
  • 👎 invalid — PRRT_kwDOPdfcxM66apEF: BOX-048 follows the maintainer's gominimal/arch#188 ruling, which this PR merges ahead of the architecture.md change in gominimal/arch#200. This round also extends BOX-048's property test and verify lines to cover the network rule. (not posted on the thread: not an open thread on the pull request)
  • 👎 invalid — PRRT_kwDOPdfcxM66apEL: The spec 18 text follows the same gominimal/arch#188 ruling as BOX-048. The maintainer merges it before architecture.md changes in gominimal/arch#200. (not posted on the thread: not an open thread on the pull request)
  • 👎 invalid — PRRT_kwDOPdfcxM66apY-: The ruling is settled: the maintainer merges the per-key merge on gominimal/arch#188 and said not to revert it. The earlier revert and refusal were replaced on purpose. An earlier mode that survives a later egress-only layer is the ruled behaviour, and the BOX-048 property now checks it. (not posted on the thread: not an open thread on the pull request)
  • 👍 valid — crates/minimal/src/cmd/box_spec.rs:1203: task_box_network now calls clear_file_network_on_none_flag, so min task run --network none drops inherited egress and ingress like a session. The new test is network_none_flag_drops_file_egress_and_ingress_on_task_run, and BCLI-024 has the rule.

With [defaults.session.network.bep] and [defaults.network.egress] set, min box spec dev shows both bep and egress under [network]. Each key names its own layer, and the # network: line lists the layers from least to most specific. min task run --network none now also drops the egress and ingress that the task inherits.

Notes from the agent: Revise round 1. (1) The merge with main conflicted only in ExpansionReport. I kept both main's secret_name_warnings and this PR's network field, and committed the merge first. (2) The BOX-048 property now runs over 2 to 4 generated layers. Each layer can carry a network table with mode (legacy spelling included), egress, ingress, bep and a flat egress_* key. A per-key model checks the result: the most specific setter wins, mode = "none" drops the inherited egress and ingress, and any egress key replaces all of them. The property failed when I removed the ingress clearing, so it detects that rule. BOX-048 gains the three verify lines, and its property line now states the rule. (3) task_box_network now calls clear_file_network_on_none_flag. A new test, network_none_flag_drops_file_egress_and_ingress_on_task_run, is in the task.rs test module because task_box_network is private. BCLI-024 has the new sub-requirement with three verify lines. (4) An earlier round already added the per-key layers (mode_layer, ingress_layer) and passed them to each refusal. This round pins both messages with the exact case from the directive: box_spec_keeps_earlier_network_egress_ingress_refusal_names_entry_table and task_box_network_own_ip_refusal_names_the_mode_table. (5) An earlier round already sorts the # network: sources by layer, and box_spec_keeps_earlier_network_egress pins # network: from [defaults], [defaults.session] (in key order the line would start with [defaults.session]). Out of the task's layers, the directive required crates/minimal/src/task.rs and docs/specs/28-spec-box-cli/28-spec-box-cli.md. I could not run `j…[truncated]

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 25, 2026 19:14
@minimal-foundry minimal-foundry Bot added the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Nov 25, 2026
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: the diff is +998/-82 (1080 lines), past 3x the plan's estimate of 230 lines (est: 120 code, 110 tests, as #3600 reads now), and more than that estimate past the 746 lines accepted when needs-human was last cleared, at round 1 (the last trigger was a /revise note). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #3600 by hand.

@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: FAIL · the full ruling

The change merges the network table key by key across layers. It also makes --network none clear the file's egress and ingress. architecture.md line 1294 says a table is replaced wholesale, not merged key by key. Lines 1294 and 1346 say that each network flag changes only the key it names. The spec edits cite gominimal/arch#188 and #200, but the design at 4f2eb87d holds neither ruling. No code edit can make the change conform. Land arch#188 and arch#200 in gominimal/arch first, then request a new review on that arch sha.

Ruled at 28dc488 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

Comment thread crates/mfile/src/expand.rs Resolved
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 — approval withheld

Verdict COMMENT — APPROVE withheld: 6 unresolved threads — norrietaylor crates/minimal/src/cmd/boxes/create.rs, norrietaylor crates/minimal/src/cmd/box_spec.rs, minimal-foundry[bot] crates/minimal/src/cmd/box_spec.rs:1203, minimal-arch[bot] crates/mfile/src/expand.rs:1534, minimal-arch[bot] crates/minimal/src/cmd/boxes/create.rs:192, …. No findings.

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

@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; @norrietaylor closed the last one. The review of 28dc488629d6 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 25, 2026
@norrietaylor
norrietaylor marked this pull request as ready for review November 25, 2026 19:57
@norrietaylor norrietaylor 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.

Maintainer approval at 28dc488, merged on the gominimal/arch#188 ruling ahead of gominimal/arch#200. minimal-review approved, every lane aggregator is green, and no threads are open. The verify failure was exec_run_attach_and_task_run_share_the_commands_trace, a tracing test this PR does not touch.

@norrietaylor
norrietaylor added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 64ce3a1 Nov 25, 2026
40 of 42 checks passed
@norrietaylor
norrietaylor deleted the agent/3600-a-later-minimal-toml-layer-that-sets-one-network branch November 25, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D3597 — A later minimal.toml layer that sets one network sub-table keeps the network keys of an earlier layer

1 participant

0