Repository navigation
Description
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,runorbox spec <entry>was given: a flag per[network]key (--network,--ingress, …), each changing only the key it names,--deny-all-egress, which emptiesallow_dns_hostsandallow_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, emptiesallow_dns_hostsandallow_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-protocolsreplaces 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_protocolsoverride 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_protocolsreplaces the list; - the deny-all-egress override empties
egress.allow_dns_hostsandegress.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
- fix(minimal): align command-line egress flags with the union merge (BOX-064) #3143: the egress flags replace the file's list instead of adding to it. That is the implementation side of the same rule.
- BCLI-024 and BCLI-076 in spec 28 list this issue as a Rollout dependency.
- docs(specs): gate loadouts on loadout_mode in spec 29 #3069 is also amending spec 29. Its IDs and paragraphs do not overlap with this change.
Activity
docs(specs): give BOX-064 the command-line layer's merge rule
docs(specs): point spec 28's BOX-064 dependency at #3200
docs(specs): settle the review findings on the spec 29 amendments
docs(specs): deny-all-egress empties every allow list and refuses others
docs(specs): give egress.allow_protocols one command-line rule
docs(specs): settle the last review round on the spec 29 amendments
docs(specs): add restart, hook declarer and command-line merge rule t…
docs(specs): reconcile spec 28 with arch#166 and the gominimal#2877/g…