8000 spec 29: BOX-064 needs the command-line override layer's merge rule (arch#166) · Issue #3200 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

spec 29: BOX-064 needs the command-line override layer's merge rule (arch#166) #3200

Open

Description

@agent-137

BOX-064's merge rule contradicts the architecture's command-line override layer. BCLI found it while reconciling spec 28 with gominimal/arch#166 in #3194.

The conflict

BOX-064 (docs/specs/29-spec-box-local-first) expands an entry in layer order, "unioning lists in that order and replacing scalars and tables wholesale". Its T1 property says expansion "equals the fold of the merge rule over the layers in the stated order".

The architecture at gominimal/arch@9495216 (#166, merged 2026-11-09) gives the last layer, the command-line overrides, rules of its own. From Policy layers and precedence, layer 7:

the command-line overrides a start, run or box spec <entry> was given: a flag per [network] key (--network, --ingress, …), each changing only the key it names, --deny-all-egress, which empties allow_dns_hosts and allow_subnets, and --no-hooks (gominimal/arch#161).

From the expansion-order note:

Note that a table is replaced wholesale rather than merged key-by-key … The create-time network flags are the exception: each changes only the key it names, and --deny-all-egress, which has no key, empties allow_dns_hosts and allow_subnets, as Type nouns says; the rest of the expanded [network] table stays in place.

From Type nouns:

A flag for a list key adds to the list and a flag for a scalar key replaces the value, as the layers merge. --allow-protocols replaces its list instead, wider or narrower, because the key restricts protocols. … The same layer takes --no-hooks, which empties the composed lifecycle-hook list

A plain union or wholesale replacement cannot give any of these:

  • An override that sets one [network] key, under wholesale table replacement, would drop the rest of [network].
  • The allow_protocols override replaces its list rather than unioning it.
  • The deny-all-egress override empties two lists.
  • The no-hooks override empties lifecycle_hooks.

Scope

Amend BOX-064 with the command-line layer's own merge rule:

  • an override changes only the [network] key it names, and the rest of the expanded [network] table stays;
  • an override for a list key adds its values to the list, and one for a scalar key replaces the value;
  • an override of egress.allow_protocols replaces the list;
  • the deny-all-egress override empties egress.allow_dns_hosts and egress.allow_subnets;
  • the no-hooks override empties the composed lifecycle_hooks.

Restate the T1 property so that the fold uses the merge rule for the file and loadout layers, and these rules for the override layer.

Related

Refs #2236, #3143, #3194.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0