Repository navigation
Description
Task
| slice | size | difficulty | model | who | estimated lines |
|---|---|---|---|---|---|
| Types only narrow | M | needs care | strongest | an agent | 300 (140 code, 160 tests) |
On top of T124's gate: a loadout named on a sealed box, a loadout that sets
loadout_mode, and an entry that contradicts a type constraint on the mode each fail the expansion with exit 3, before any loadout is applied. A sealed box never reads its default loadouts, and prints nothing about skipping them.
Covers:
- BOX-171
- BOX-172
- BOX-173
- BOX-175
- BOX-181
Layers:
- expansion:
- crates/mfile/src/expand.rs: three more checks at T124's gate, all before any loadout is applied. A Box Type constraint that holds
loadout_modeat another value is refused as BOX-061 refuses, without reading any loadout (BOX-181). Onsealed, a loadout a flag named is refused (BOX-173). Onopen, a selected loadout whose table setsloadout_modeis refused (BOX-172).Layersgains the names of the loadouts a flag named, beside the foldedloadoutstable. - crates/mfile/src/error.rs: the BOX-172 and BOX-173 refusals, with the text below
cargo nextest run -p mfile loadout_setting_loadout_mode_refused_exit3cargo nextest run -p mfile named_loadout_on_sealed_box_refused_exit3cargo nextest run -p mfile constrained_loadout_mode_refused_before_loadouts
- crates/mfile/src/expand.rs: three more checks at T124's gate, all before any loadout is applied. A Box Type constraint that holds
- loadout:
- crates/boxes/src/core/loadout.rs:
LoadoutFiledrops a key it does not know, so the loader reads the rawloadout_modekey and hands it on, so BOX-172 can see it
- crates/boxes/src/core/loadout.rs:
- client:
- crates/minimal/src/loadouts.rs:
resolve_active_loadoutstakes the box'sloadout_mode. Onsealedit reads neither the config'sdefault_loadoutsnor the built-indefaultloadout, so a missing or malformed default cannot fail the box (BOX-175). Loadouts that--loadoutnames are still passed on, so the expansion refuses them under BOX-173. - crates/minimal/src/cmd/boxes/create.rs: reads the mode from the expansion of the layers up to the entry before it resolves loadouts, and prints nothing about a skipped default loadout (BOX-171)
- crates/minimal/src/task.rs: the same for
min task run - crates/minimal/src/tests.rs: tests
cargo nextest run -p minimal sealed_task_run_prints_nothing_about_loadoutscargo nextest run -p minimal sealed_box_ignores_broken_default_loadout
- crates/minimal/src/loadouts.rs:
User-facing text. These messages are new. Each one ends the command with exit 3, from both the creating command and min box spec <entry>. <layer> is the words expand.rs's layer_words gives today.
- BOX-172, a selected loadout sets the key:
Loadout <name> sets loadout_mode. A loadout cannot set loadout_mode. Remove loadout_mode from loadout <name>. - BOX-173, a flag names a loadout for a sealed box, where no type constraint holds the mode:
Cannot apply loadout <name>. This box's loadout_mode is sealed, set by <layer>. Run the command without --loadout <name>, or set loadout_mode = "open" in <entry layer>. - BOX-173, where a type constraint holds the mode:
Cannot apply loadout <name>. This box's loadout_mode is sealed, set by <layer>. The <type> box type requires loadout_mode = "sealed". Run the command without --loadout <name>. - BOX-181 uses BOX-061's existing constraint refusal unchanged.
Code spans mark the key, the value, the flag and the loadout name. They are shown bare above so the line reads as printed. The mfile tests above pin each text. BOX-171 adds no text: sealed_task_run_prints_nothing_about_loadouts pins that min task run on a sealed box prints nothing about loadouts on stdout or stderr.
Observability. The daemon log names the box's mode at creation.
Owner decisions this task follows:
- docs(specs): gate loadouts on loadout_mode in spec 29 #3069 merged these requirements into spec 29 on 2026-11-10. Their requirement comments carry the 2026-11-05 and 2026-11-09 decisions.
- In-session on 2026-11-10: the gate is split into T124 (T124 — Gate loadouts on loadout_mode: session open, task sealed, an unknown mode refused #3247) and this task, under S5, because the runtime caps a task at 6 IDs.
Plan block
### T126 — Refuse a named loadout on a sealed box, a loadout that sets loadout_mode, and a contradicted constraint; a sealed box reads no default loadouts
slice: S5
kind: task
covers: BOX-171, BOX-172, BOX-173, BOX-175, BOX-181
size: M
est: 140 code, 160 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: each refusal names the loadout and the layer that set loadout_mode; the daemon log names the box's mode
observability: the daemon log names the box's mode at creation
layers:
- expansion:
- crates/mfile/src/expand.rs: refuse a constrained mode, a named loadout on a sealed box and a loadout-set mode before the loadouts layer
- crates/mfile/src/error.rs: the two loadout refusals
test: cargo nextest run -p mfile loadout_setting_loadout_mode_refused_exit3
test: cargo nextest run -p mfile named_loadout_on_sealed_box_refused_exit3
test: cargo nextest run -p mfile constrained_loadout_mode_refused_before_loadouts
- loadout:
- crates/boxes/src/core/loadout.rs: the loader keeps the raw loadout_mode key
- client:
- crates/minimal/src/loadouts.rs: a sealed box reads no default loadouts
- crates/minimal/src/cmd/boxes/create.rs: reads the mode before resolving loadouts; prints nothing for a skipped default
- crates/minimal/src/task.rs: the same for min task run
- crates/minimal/src/tests.rs: tests
test: cargo nextest run -p minimal sealed_task_run_prints_nothing_about_loadouts
test: cargo nextest run -p minimal sealed_box_ignores_broken_default_loadout
produces: none
consumes:
- crates/mfile/src/expand.rs
proof: Each refusal fails before a loadout is applied, and a sealed task never reads a broken default loadout or prints about it.
depends on:
- blocked by #3247
Activity
minimal-foundry commentedon Nov 12, 2026
Done. #3301 merged.
branch
agent/3254-refuse-a-named-loadout-on-a-sealed-box-a-loadout· epic #2236 · PR #330161197ac3e2629ee1e83115616a21d572a661c489420ca786b4ba1af3d51b5655Updated 2026-11-13T03:27:12.286Z.