8000 docs(minimal): name issue #3302 for the BOX-183 gap in box_entry · gominimal/minimal@fcf1e7d · GitHub
[go: up one dir, main page]

Skip to content

docs(minimal): name issue #3302 for the BOX-183 gap in box_entry

Minimal Arch / arch-review failed Nov 12, 2026

CONDITIONS

Governs (architecture.md at arch 15b603e6. The checkout has no arch-map.md, so I found the sections by search.) minimal.toml layout › Expansion line 1228: layers apply weakest first, and each layer overrides earlier scalars and tables. Line 1234: a loadout applies after the entry, and a table is replaced wholesale. The same line says that min box spec <entry> renders exactly what the host receives. Policy layers and precedence line 1278: later layers override. Line 1287: the render is the single reviewable artifact. Box Spec line 1324: a spec shows which env vars are static and which are inherited from the client.

Baseline. This re-reviews fcf1e7d5 against the PASS_WITH_CONDITIONS on 46b04835 (this PR). pr.diff equals git diff 438af70b fcf1e7d5. The PR's own diff against its base is the same as at 46b04835, apart from a four-line comment in box_entry that names issue #3302 for the BOX-183 gap. The rest of since.diff is the merge of main at 438af70b (#3290, T18, min box spec <entry>).

Ruling. The merge logic in merge_vars matches spec 29 (BOX-180, BOX-183, BOX-184). Both refusals exit 3. Each message names the variable and its sources or its layer, and BOX-183 names the ignore remedy. But the merge from main adds a second expansion path, expand_entry in crates/minimal/src/cmd/box_spec.rs. That path does not fill Layers::host_vars. The refusals compare resolved values, so min box spec <entry> resolves an inherit name to its default, and creation resolves it to the client's value. Thus the render and the creation can refuse different specs. This is contrary to line 1234 (C1). The render also labels vars with only the last layer that wrote the key, though the names now come from several layers. report.vars has the right per-name layers, but report.values does not use them (C2). The spec's merge by name and its loadout refusal are contrary to the design text at lines 1228, 1234 and 1278. Spec 29 records the decision, but no design amendment exists. The code is correct to follow the spec. So the disagreement goes to a person as an escalation, and C3 makes the spec name it.

Departure from precedent. The baseline approved with conditions. This ruling asks for changes, because the min box spec <entry> path in the merge is new since 46b04835 and breaks line 1234 for inherit names. The baseline's own text is truncated in the ledger, so I could not compare its conditions one by one. I took the residual for #3302 to be the one it asked for.

Not checked. I did not compile or run the tests. That issue #3302 exists and is open: no gh and no network in the sandbox. The residual takes the URL from the head's commit and code comment. How the daemon composes loadout vars today (outside this diff). #3302 owns that.

Conditions

  • C1: crates/minimal/src/cmd/box_spec.rs expand_entry() fills layers.host_vars before it calls mfile::expand::expand, the same way box_entry() in crates/minimal/src/cmd/boxes/create.rs does: mfile::expand::inherited_var_names(entry, &layers) filtered through std::env::var. Move that fill into one shared function (for example Layers::with_host_vars(entry, lookup) in crates/mfile/src/expand.rs) and call it from both paths. Add a test: one layer sets TERM = { inherit = true, default = "xterm-256color" } in vars and TERM = screen in vars_lenient. With host TERM=screen, min box spec <entry> and session_box_entry both accept. With host TERM=other, both refuse with exit 3.
  • C2: crates/mfile/src/expand.rs merge_vars() sets report.values["vars"] and report.values["vars_lenient"] to ValueOrigin::List of the origins in report.vars for that key's names, in the order the names appear in the output. Do not set ValueOrigin::Value of the last layer that wrote the key. Then the min box spec <entry> source label names every layer that contributed a variable, and not only the last one. Extend vars_merge_by_name_across_layers to assert the list.
  • C3: Amend the decision record "vars merge by name" in docs/specs/29-spec-box-local-first/29-spec-box-local-first.md, and the BOX-180 and BOX-183 comments. They state that the design (architecture.md lines 1228, 1234, 1278) still replaces every table wholesale and lets a later layer override. They link the gominimal/arch issue that the escalation of this ruling opens. Do not change the merge code for this condition.

Needs a design decision

  • architecture.md line 1234 replaces every table wholesale, and lines 1234 and 1278 let a later layer, a loadout included, override the entry. Spec 29 decided on 2026-11-09 (BOX-048, BOX-064, BOX-180, BOX-183) that vars and vars_lenient merge by variable name, that a loadout only adds names, and that a loadout which gives a set name another resolved value fails the expansion with exit 3. The code in #3300 follows the spec. Does the design adopt this exception and state it in the Expansion paragraph and in Policy layers and precedence? If not, the spec must change back, and BOX-180 and BOX-183 are replaced.

Ruled at fcf1e7d against gominimal/arch@15b603e6afb8 by claude-opus-5-5; arch_rulings 1174, job 94b73afe-4860-4ed9-b337-654b20caef3b.

0