Repository navigation
fix(mfile,minimal): a later minimal.toml layer that sets one network sub-table keeps the network - #3619
Conversation
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.
…nimal-toml-layer-that-sets-one-network
|
Important Review skippedBot 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.
|
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
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 |
|
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. |
|
/review |
|
/arch-review |
|
Approved: every review thread resolved at @norrietaylor resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
There was a problem hiding this comment.
arch-review: 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
/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
Before you push, check that no checked-in |
…nimal-toml-layer-that-sets-one-network
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.
…nimal-toml-layer-that-sets-one-network
The NetworkTableDropsKeys variant made mfile::Error 128 bytes, so clippy's result_large_err failed every Result<_, Error> in mctx.
|
/revise
Keep the rest of this head unchanged. The maintainer has approved it, and the arch FAIL waits on gominimal/arch#200 landing. |
…nimal-toml-layer-that-sets-one-network
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).
|
Round 5 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: verify exited 100; outside the task's Review threads the coder judged:
With 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. |
|
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 |
|
Marked ready: CI is green at 6cea830. The only verify failure, |
There was a problem hiding this comment.
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.
|
/revise
Run |
…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.
|
Round 1 of 10 on a /revise note, pushed as Resolved conflicts in:
Verify Outside the task's
Converted to a draft: verify exited 100; outside the task's Review threads the coder judged:
With [defaults.session.network.bep] and [defaults.network.egress] set, 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 |
|
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of 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.
There was a problem hiding this comment.
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.
Follow-up
Fixes #3600
crates/mfile/src/expand.rscrates/minimal/src/cmd/boxes/create.rscrates/minimal/src/cmd/box_spec.rscrates/minimal/src/tests.rsdocs/specs/29-spec-box-local-first/29-spec-box-local-first.mddocs/specs/18-spec-box-networking/18-spec-box-networking.mdTask marker
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
cargo test -p mfile network_merges_by_sub_tablecargo test -p minimal box_spec_keeps_earlier_network_egresscargo test -p mfile network_merges_by_sub_tableVerify
min task run agent-verifyexited 100, so this PR is a draft.Base
The base branch moved while the coder worked; it was merged in before the tests ran.