8000 A network table in a later minimal.toml layer silently drops the network keys of an earlier layer · Issue #3597 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

A network table in a later minimal.toml layer silently drops the network keys of an earlier layer #3597

Open

Description

@norrietaylor

Defect

A network table in a later layer of minimal.toml replaces the network table of an earlier layer whole. Keys the earlier layer set are dropped, and nothing tells the user.

Reproduce

min 0.8.0-dev.607.g81832ac6, macOS arm64.

[defaults.session]
packages = ["base"]

[defaults.session.network.bep]
steering = "proxy_env"

[defaults.network.egress]
allow_dns_hosts = ["api.anthropic.com", "github.com"]

[sessions.dev]
$ min box spec dev
# network: from [defaults.session]
# network.mode: from the default
[network]
mode = "host_ip"

[network.bep]
steering = "proxy_env"

The egress table from [defaults.network] is gone. Moving bep to [defaults.network.bep] gives a spec with both bep and egress.

In practice the user saw only an indirect symptom: a start refused because a secret's host was not in egress.allow_dns_hosts, while the file plainly listed it.

Cause

Layers merge network as one value. entry_egress in crates/minimal/src/cmd/boxes/create.rs states it: "The merge replaces a table whole, so the last layer that declares network holds the expanded entry's network table." The order is [defaults], [defaults.<type>], the entry.

So this is the designed merge. The defect is that a file that sets network keys in two layers loads with no message, and the result differs from what the file reads as.

Expected

network merges by sub-table (egress, bep, ingress, ...), so a later layer replaces only the sub-tables and keys it sets, and an earlier layer's other network keys survive. entry_egress reads the same merge. min box spec <entry> still shows which layer each network key came from. A test covers the reproduce case above: the spec holds both bep and egress.

Related

[defaults.session.network] currently refuses egress, mode and ingress, so bep and egress cannot both be set in that layer. A user who starts with [defaults.session.network.bep] has no table in the same layer for egress.

Footprint

  • crates/mfile/src/expand.rs (layer merge, or a load-time check)
  • crates/minimal/src/cmd/boxes/create.rs (entry_egress reads the same merge)
  • tests beside each

epic: #1501


This is a residual of epic #1501 (BEP).

Activity

  1. norrietaylor commented on Nov 19, 2026

    @norrietaylor
    MemberAuthor

    Approach changed after the arch review on #3619: architecture.md replaces every table but [env_vars] wholesale, network included. The fix is now the issue's second option: a file whose later layer's network table drops keys an earlier layer set is refused at load, naming both tables and the dropped keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:should-haveShould be done. Applied by the inbox-route classifier or a human.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0