8000 feat: T135 — Read every layer's variables from one env_vars table, and refuse vars, vars_lenient and a name that is not POSIX-shaped by minimal-foundry[bot] · Pull Request #3662 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

feat: T135 — Read every layer's variables from one env_vars table, and refuse vars, vars_lenient and a name that is not POSIX-shaped - #3662

Merged
mitodrummer merged 11 commits into
mainfrom
agent/3653-read-every-layer-s-variables-from-one-env-vars-t
Nov 20, 2026
Merged

mitodrummer merged 11 commits into
mainfrom
agent/3653-read-every-layer-s-variables-from-one-env-vars-t

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T135 — Read every layer's variables from one env_vars table, and refuse vars, vars_lenient and a name that is not POSIX-shaped

slice: S5
kind: task
covers: BOX-205, BOX-206, BOX-207, BOX-180
size: L
est: 300 code, 800 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: a file that still sets vars or vars_lenient, or a name that is not POSIX-shaped, prints the exit-3 refusal on stderr naming the file, the table and the key or variable, from min box create, min session start, min task run and min box spec alike
observability: each refusal writes a debug record with the rule, the layer and the file; the expansion report keeps the layer of each variable under env_vars
layers:
- expansion:
- crates/mfile/src/expand.rs: one env_vars table merged by name at every layer, the task entry's included; refuse vars and vars_lenient as a layer key and a non-POSIX name before the fold; drop VAR_KEYS, the lenient table and the BOX-184 check; Layers::loadouts carries each loadout's path
- crates/mfile/src/error.rs: RetiredVarKey and InvalidVarName, exit 3, with the task's text; DuplicateVar goes
- crates/mfile/src/lib.rs: Session reads env_vars and not vars_lenient, keeps any name for the expansion's check; warn_unknown_fields skips vars and vars_lenient
- crates/mfile/src/tasks.rs: Task variables read from env_vars only
- crates/mfile/src/legacy.rs: fixtures move to env_vars; a legacy [session] that sets vars is refused naming [session]
- crates/mfile/src/project_composable.rs: fixtures move to [defaults.session.env_vars]
- crates/boxes/example_project/minimal.toml: [defaults.session.vars] becomes [defaults.session.env_vars]
test: cargo nextest run -p mfile env_vars_read_from_every_layer
test: cargo nextest run -p mfile retired_var_keys_refused_exit3
test: cargo nextest run -p mfile non_posix_env_var_name_refused_exit3
test: cargo nextest run -p mfile env_vars_merge_by_name_across_layers
test: cargo nextest run -p mfile flat_per_entry_keys_and_legacy_keys_keep_meaning
- loadout:
- crates/boxes/src/core/loadout.rs: LoadoutFile reads env_vars, keeps a non-strict name on the lenient list and a raw vars or vars_lenient key for the expansion to refuse; example and tests move to [env_vars]
- crates/boxes/tests/client_flow1.rs: loadout fixtures move from [vars] to [env_vars]
test: cargo nextest run -p boxes loadout_file_reads_env_vars
test: cargo nextest run -p boxes happy_path_one_of_each
- client:
- crates/minimal/src/cmd/boxes/create.rs: SelectedLoadouts::layers passes env_vars, the raw retired keys and each loadout's path; the ignore list, the trust-variable warning and the wire lists read env_vars
- crates/minimal/src/loadouts.rs: the built-in default loadout sets [env_vars]; a loaded loadout keeps its file path
- crates/minimal/src/tests.rs: tests; fixtures move to env_vars
- crates/minimal/tests/cli.rs: [session.vars] fixtures move to [defaults.session.env_vars]
- scripts/session-e2e.sh: the two SHELL loadouts write [env_vars]
test: cargo nextest run -p minimal builtin_default_loadout_sets_env_vars
test: cargo nextest run -p minimal loadout_file_with_retired_key_refused_exit3
test: cargo nextest run -p minimal activate_prints_no_session_id_when_composition_fails
- fixtures:
- crates/mctx/src/lib.rs: [session.vars] fixtures move to env_vars
- crates/minimald/src/box_manager/tests.rs: PENDING_VAR_MFILE sets [defaults.session.env_vars]
test: cargo nextest run -p mctx add_session_package_writes_defaults_session
test: cargo nextest run -p minimald pending_session_activates_on_approving_verdict
produces: none
consumes: none
proof: A minimal.toml and a loadout file that set env_vars start a box with every variable merged by name; a file that still sets vars or vars_lenient, or a name such as my.var, fails with exit 3 naming the file, the table and the key; a fresh install's box still shows the orientation banner.

Proof

A minimal.toml and a loadout file that set env_vars now expand with every variable merged by name across [box_types.] defaults, [defaults], [defaults.], the entry (a task entry too) and each loadout. A layer that still sets vars or vars_lenient, or an env_vars name such as my.var, fails with exit 3. The message names the file (minimal.toml, or the loadout file's path), the table and the key, for example: "[sessions.dev] in minimal.toml sets vars. This key is no longer read. Move its variables to env_vars in [sessions.dev]." The built-in default loadout now sets [env_vars], so a fresh install's box still gets the orientation banner variables.

Notes from the agent: Files outside the layers: (1) crates/minimald/src/rpc/tests.rs. Its stream_workspace_files_refuses_a_session_awaiting_its_verdict fixture set [session.vars], which the daemon no longer reads, so that test failed. I moved it to [defaults.session.env_vars]. (2) crates/diagnostics/src/redact.rs. A bug bundle masked vars and vars_lenient but not env_vars, so the values of a moved loadout or project table would leak into min bug bundles. I added env_vars to ENV_TABLE_NAMES, with a test assertion. Revert either change if the reviewer wants a separate task for it.

Design: the Session and LoadoutFile Rust fields keep their strict and lenient lists, so minimald's composables.rs and compose.rs did not change. Both read one env_vars table and split it by name shape. A name that the kernel does not accept is dropped from Session with a debug record, and the loadout keeps it for the expansion to refuse. Layers::loadouts is now Vec<LoadoutLayer { name, path, table }>. Loadout has a path() and with_path(), and resolve_active_loadouts sets it. A new pub mfile::expand::check_loadout_vars runs the same two refusals for one loadout. prepare_activation_inputs_with_config calls it, so a start in a folder with no minimal.toml refuses too, because no expansion runs there. The wire lists split the …[truncated]

Tests

line exit tail
cargo nextest run -p mfile env_vars_read_from_every_layer 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mfile retired_var_keys_refused_exit3 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mfile non_posix_env_var_name_refused_exit3 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mfile env_vars_merge_by_name_across_layers 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mfile flat_per_entry_keys_and_legacy_keys_keep_meaning 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p boxes loadout_file_reads_env_vars 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p boxes happy_path_one_of_each 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p minimal builtin_default_loadout_sets_env_vars 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p minimal loadout_file_with_retired_key_refused_exit3 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p minimal activate_prints_no_session_id_when_composition_fails 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mctx add_session_package_writes_defaults_session 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p minimald pending_session_activates_on_approving_verdict 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru

Verify

min task run agent-verify exited 125, so this PR is a draft.

log-438092e92453965a,libbstr-e486a46c74a4ad7c,libregex_automata-78493a18fcc8828b,libregex_syntax-913a3a1c2b02ab63,libaho_corasick-c7544a0898654238,libmemchr-64a87164b387290e,libwalkdir-8278203427ac3159,libsame_file-0d4c610508a69e8c,libnutype-2060fd37b9d379f2,libclient_config-b967f21a883cbf40,libtoml-2aea33601fef026d,libtoml_writer-14581a9d8fee7cd3,libtoml_parser-9d71f9449b11f073,libwinnow-0b86322c90e7afd1,libserde_spanned-d96ed742cfb92972,libtoml_datetime-be2b7a398aebdb67,libtracing-83feaaf26e80a884,libpin_project_lite-965c2dcbe863fe30,libtracing_core-84f58f17c6893e81,libonce_cell-9a2fd160c1da4076,libportable_atomic-0dd514cc30f274c2,libpaths-38d338f2d2882e54,libdirs-460e2d244a8fc274,libdirs_sys-5e8776d10c678365,liboption_ext-b0ea52c3b95d09a1,libthiserror-d936554554fa5dac,libcamino-0c63145602122330,libuuid-2ad4c678aa627cb6,libgetrandom-3bfdefd1957f2b79,liblibc-4f2d736fc0e30dce,librand_core-d44f5774360f5730,libcfg_if-5af2d58a3df8aa54,libserde-a2d31a39ef0e3ca2,libserde_core-149b29d4f6c47ae0}.rlib" "<sysroot>/lib64/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/work/build-cache/cargo-home/build/debug/deps/rustc7ynKSI/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/work/build-cache/cargo-home/build/debug/build/tree-sitter-6abcf750100a3ada/out" "-L" "/work/build-cache/cargo-home/build/debug/build/tree-sitter-nickel-4d55240ed02e956b/out" "-L" "/work/build-cache/cargo-home/build/debug/build/blake3-493bdc0df5a171ff/out" "-L" "/work/build-cache/cargo-home/build/debug/build/aws-lc-sys-467e076f78a0a3c4/out" "-L" "/work/build-cache/cargo-home/build/debug/build/zstd-sys-0d91391d9ed43bde/out" "-L" "<sysroot>/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/work/build-cache/cargo-home/build/debug/deps/client_flow1-52cb4fa96caa0772" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /usr/bin/ld: final link failed: No space left on device
          collect2: error: ld returned 1 exit status
          

error: could not compile `boxes` (test "client_flow1") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
rustc-LLVM ERROR: IO failure on output stream: No space left on device
rustc-LLVM ERROR: IO failure on output stream: No space left on device
error: could not compile `minimald-rpc` (lib)

Caused by:
  No space left on device (os error 28)

Caused by:
writing stderr I/O error at path : No space left on device (os error 28)
error: sandbox command failed.
Kept box runtime-implement-verify-1. Remove it with min box rm runtime-implement-verify-1.

Base

The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:

  • crates/mctx/src/lib.rs
  • crates/minimald/src/rpc/tests.rs

Out of scope

These files are outside the task's layers:, so this PR is a draft:

  • crates/diagnostics/src/redact.rs
  • crates/minimald/src/rpc/tests.rs

Closes #3653

Every layer that minimal.toml or a loadout supplies sets its variables
in one env_vars table, merged by name (BOX-180, BOX-205). A layer that
still sets vars or vars_lenient, or an env_vars name that is not
POSIX-shaped, fails the expansion with exit 3 naming the file, the
table and the key (BOX-206, BOX-207). BOX-184 is retired, so
DuplicateVar goes.
LoadoutFile reads one [env_vars] table (BOX-205). A name that is not
strict POSIX goes on the lenient list, and a raw vars or vars_lenient
key is kept for the expansion to refuse (BOX-206). A loaded loadout
can carry the file it came from.
check_loadout_vars applies the BOX-206 and BOX-207 refusals to one
loadout layer, for a start that has no minimal.toml to expand.
The selected-loadouts layer carries env_vars, the raw vars and
vars_lenient keys and the loadout's file, so the expansion refuses a
retired key or a bad name and names the file (BOX-206, BOX-207). The
wire lists and the trust-variable warning read env_vars. The built-in
default loadout and the test fixtures move to [env_vars].
The project's session variables now read from env_vars only
(BOX-205), so the fixtures that set [session.vars] move.
The fixture set [session.vars], which the daemon no longer reads
(BOX-205), so the session never pended.
Project and loadout files now set every variable in env_vars
(BOX-205), so the bundle masks that table as it masks vars.
@coderabbitai
coderabbitai Bot commented Nov 19, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 144fdf96-f195-43fb-9050-dd72a60151c9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-foundry
minimal-foundry Bot commented Nov 20, 2026 •
Copy link
Copy Markdown
Contributor Author

Reviewed: 1 finding, none blocking at 07287fa24e52.

Address the comments on the diff.

Clobber: none found in the hunks read.

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONDITIONS · 1 condition · the full ruling

The merge and the refusals are in the right crates and they fail closed. One path is open. min box spec <entry> does not check the selected loadouts, so it renders a box that the start refuses. A loadout file that sets vars, or a name such as my.var, shows this. Section "minimal.toml layout" line 1253 says the render is exactly what a Box Host receives. Make the change in C1.

Outside the diff

  • crates/minimal/src/cmd/box_spec.rs:931: C1 · Add a loop over active.loadouts here. Call crate::loadout_layer(loadout, None)?, then mfile::expand::check_loadout_vars(&layer).map_err(invalid)?. Then min box spec refuses a loadout that the start refuses.

Ruled at ff54e0f against gominimal/arch@8b824707cde6 by claude-opus-5-5.

}
.into());
}
// BOX-206, BOX-207: a loadout that sets `vars` or `vars_lenient`, or a
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C1 · This check runs for a start, but min box spec <entry> does not run it. Add the same loop in crates/minimal/src/cmd/box_spec.rs, after the BOX-172 check at line 931. Map the error with invalid. Line 1253 says the render is exactly what a Box Host receives.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 07287fa24e52: min box spec now runs check_loadout_vars on each selected loadout after the BOX-172 check, mapped with invalid. A new test pins exit 3 and the text.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 1 unresolved thread — minimal-arch[bot] crates/minimal/src/loadouts.rs:784. No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@agent-137
Copy link
Copy Markdown
Member

/revise

Arch ruling CONDITIONS on ff54e0f (arch_rulings 1537). The two off-plan files are accepted. Apply this condition as written:

  • C1: crates/minimal/src/cmd/box_spec.rs: in the function that resolves active (line 923), right after the BOX-172 sets_loadout_mode() check (lines 931-938), add a loop over active.loadouts that calls crate::loadout_layer(loadout, None)? and then mfile::expand::check_loadout_vars(&layer).map_err(invalid)?, as prepare_activation_inputs_with_config in crates/minimal/src/loadouts.rs (lines 784-791) does. Then min box spec <entry> refuses with exit 3 a selected loadout file that sets vars or vars_lenient or an env_vars name such as my.var, with the same text the start prints. Add a test beside loadout_file_with_retired_key_refused_exit3 in crates/minimal/src/tests.rs that runs the min box spec path with that loadout file and pins exit 3 and the text.

Keep every other change as it is.

min box spec <entry> now checks each selected loadout file as the start
does, so a file that sets vars or vars_lenient, or an env_vars name such
as my.var, fails with exit 3 and the same text.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a /revise note, pushed as 07287fa24e52.

line exit tail
cargo nextest run -p mfile env_vars_read_from_every_layer 0 .9.0 Compiling tokio-util v0.7.20 Compiling tokio-rustls v0.26.5 Compiling getrandom v0.3.4 Compiling futures-executor v0.3.34 Compiling rand_core v0.9.5 Compiling sha2 v0.11.1 Compiling h2 v0.4.18 Compiling tower v0.5.3 Compiling tokio-stream v0.1.19 Compiling hashbrow
cargo nextest run -p mfile retired_var_keys_refused_exit3 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mfile non_posix_env_var_name_refused_exit3 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mfile env_vars_merge_by_name_across_layers 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mfile flat_per_entry_keys_and_legacy_keys_keep_meaning 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p boxes loadout_file_reads_env_vars 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p boxes happy_path_one_of_each 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p minimal builtin_default_loadout_sets_env_vars 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p minimal loadout_file_with_retired_key_refused_exit3 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p minimal activate_prints_no_session_id_when_composition_fails 0 warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: network warning: unknown fields in task runtime-implement-test-10: network warning: unknown fields in task runtime-implement-test-11: network warning: unknown fields in task ru
cargo nextest run -p mctx add_session_package_writes_defaults_session 0 iber v0.3.23 Compiling url v2.5.8 Compiling google-cloud-wkt v1.9.0 Compiling rand v0.10.3 Compiling opentelemetry_sdk v0.33.1 Compiling google-cloud-rpc v1.6.0 Compiling tokio-util v0.7.20 Compiling tokio-rustls v0.26.5 Compiling h2 v0.4.18 Compiling tower v0.5.3 Compi
cargo nextest run -p minimald pending_session_activates_on_approving_verdict 0 v0.5.3 Compiling tokio-stream v0.1.19 Compiling google-cloud-rpc v1.6.0 Compiling tower-http v0.6.11 Compiling tracing-opentelemetry v0.34.0 Compiling hyper v1.11.0 Compiling google-cloud-gax v1.15.0 Compiling tempfile v3.27.0 Compiling terminal_size v0.4.4 Compiling hype

Verify min task run agent-verify exited 125.

/sandbox)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking minimal-client v0.8.0 (/workbench/crates/minimal-client)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking mctx v0.0.1 (/workbench/crates/mctx)
    Checking minimald v0.8.0 (/workbench/crates/minimald)
    Checking minimal v0.8.0 (/workbench/crates/minimal)
    Finished `dev` profile [unoptimized] target(s) in 1m 45s
   Compiling opentelemetry v0.33.1
   Compiling version v0.8.0 (/workbench/crates/version)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling serial_test v4.0.1
   Compiling diagnostics v0.0.1 (/workbench/crates/diagnostics)
   Compiling opentelemetry_sdk v0.33.1
   Compiling tracing-opentelemetry v0.34.0
   Compiling opentelemetry-http v0.33.1
   Compiling opentelemetry-appender-tracing v0.33.1
   Compiling google-cloud-gax-internal v0.7.20
   Compiling opentelemetry-proto v0.33.0
   Compiling opentelemetry-otlp v0.33.0
   Compiling google-cloud-longrunning v1.14.0
   Compiling google-cloud-iam-v1 v1.13.0
   Compiling mlog v0.0.1 (/workbench/crates/mlog)
   Compiling google-cloud-lro v1.11.0
   Compiling google-cloud-storage v1.20.0
   Compiling common v0.0.1 (/workbench/crates/common)
   Compiling boxes v0.0.1 (/workbench/crates/boxes)
   Compiling sandbox v0.0.1 (/workbench/crates/sandbox)
   Compiling mfile v0.0.1 (/workbench/crates/mfile)
   Compiling minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
   Compiling decode v0.0.1 (/workbench/crates/decode)
   Compiling checkouts v0.0.1 (/workbench/crates/checkouts)
   Compiling minimal-client v0.8.0 (/workbench/crates/minimal-client)
   Compiling graph v0.0.1 (/workbench/crates/graph)
   Compiling minvmd v0.8.0 (/workbench/crates/minvmd)
   Compiling lcache v0.0.1 (/workbench/crates/lcache)
   Compiling rcache v0.0.1 (/workbench/crates/rcache)
   Compiling op v0.0.1 (/workbench/crates/op)
   Compiling orchestrator v0.0.1 (/workbench/crates/orchestrator)
   Compiling check v0.0.1 (/workbench/crates/check)
   Compiling mctx v0.0.1 (/workbench/crates/mctx)
   Compiling minimald v0.8.0 (/workbench/crates/minimald)
   Compiling minimal v0.8.0 (/workbench/crates/minimal)
rustc-LLVM ERROR: IO failure on output stream: No space left on device
error: could not compile `minimald` (lib)

Caused by:
  No space left on device (os error 28)

Caused by:
writing stderr I/O error at path : No space left on device (os error 28)
error: sandbox command failed.
Kept box runtime-implement-verify-1. Remove it with min box rm runtime-implement-verify-1.

Outside the task's layers::

  • crates/diagnostics/src/redact.rs
  • crates/minimal/src/cmd/box_spec.rs
  • crates/minimald/src/rpc/tests.rs

Converted to a draft: verify exited 125; outside the task's layers:: crates/minimal/src/cmd/box_spec.rs, crates/minimald/src/rpc/tests.rs.

Review threads the coder judged:

  • 👍 valid — crates/minimal/src/loadouts.rs:784: min box spec now runs check_loadout_vars on each selected loadout after the BOX-172 check, mapped with invalid. A new test pins exit 3 and the text.

A minimal.toml and a loadout file that set env_vars start a box with every variable merged by name. A loadout file that still sets vars or vars_lenient, or the name my.var, now fails with exit 3 naming the file, the table and the key from min box spec too, with the same text the start prints.

Notes from the agent: Revise round 1 applies condition C1 only. expand_entry's loadout block in crates/minimal/src/cmd/box_spec.rs (the BOX-172 check is now near line 1057, not 931) runs crate::loadout_layer and mfile::expand::check_loadout_vars for each selected loadout, mapped with invalid. The new test box_spec_loadout_file_with_retired_key_refused_exit3 sits beside loadout_file_with_retired_key_refused_exit3 and pins exit 3 and the text for vars, vars_lenient and my.var. cargo clippy -p minimal --all-targets and cargo fmt --check are clean. In this round I ran only the client layer's test lines. The mfile, boxes, mctx and minimald lines are unchanged since the earlier round, and I did not re-run them.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 20, 2026 03:26
@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment on lines +787 to +790
for loadout in &active.loadouts {
let layer = crate::loadout_layer(loadout, None)?;
mfile::expand::check_loadout_vars(&layer)
.map_err(|error| crate::ProjectFileInvalid { error })?;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW · correctness · confidence 0.55 · in prepare_activation_inputs_with_config

This check builds the loadout layer with None for the ignore list. SelectedLoadouts::layers in create.rs passes the user policy [vars] ignore globs and drops matching names before the expansion checks them. A loadout with a non-POSIX name that the user ignores passes min box create but fails here with exit 3. min box spec at box_spec.rs:1067 has the same None, so the spec refuses what create accepts. Pass the policy ignore list in both places, or check the table before it is filtered in every path.

What the reviewer checked

loadouts.rs:788 crate::loadout_layer(loadout, None)?; vs create.rs:4231 ignore: Some(inputs.user_policy.vars().ignore().clone())

Hand this to an agent
Act on a code-review finding.

File:       crates/minimal/src/loadouts.rs
Lines:      787-790
Category:   correctness
Severity:   low (reviewer confidence 0.55)

Finding:
This check builds the loadout layer with `None` for the `ignore` list. `SelectedLoadouts::layers` in `create.rs` passes the user policy `[vars] ignore` globs and drops matching names before the expansion checks them. A loadout with a non-POSIX name that the user ignores passes `min box create` but fails here with exit 3. `min box spec` at `box_spec.rs:1067` has the same `None`, so the spec refuses what create accepts. Pass the policy ignore list in both places, or check the table before it is filtered in every path.

First verify this against the code yourself. It is model output and
may be wrong. If it is wrong, or the tradeoff was deliberate, say so
and change nothing.

👍 useful · 👎 noise — react to tell the reviewer. Replying works too, and says more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed — not addressed: The premise is wrong. min box create calls prepare_activation_inputs_with_config (create.rs:4218) before it builds SelectedLoadouts with the ignore list (create.rs:4231). That call runs the unfiltered check at loadouts.rs:788, so create refuses an ignored non-POSIX name with exit 3, as min box spec does. BOX-207 refuses any such name in an env_vars table, and the ignore list does not exempt it. The ignore filter in SelectedLoadouts::layers only drops names for the BOX-183 conflict check.

@minimal-arch minimal-arch Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

C1 is met. min box spec <entry> now checks each selected loadout with check_loadout_vars, as the start does. So a loadout that sets vars, vars_lenient or a name such as my.var fails with exit 3 in both places, as architecture.md line 1253 requires. The merge of main is clean and brings in no retired variable key. Separately, a loadout refusal still says that the project's minimal.toml does not load. Fix this text in a follow-up.

Ruled at 07287fa against gominimal/arch@8b824707cde6 by claude-opus-5-5.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on the runtime's review findings: the coder changed nothing. Revise round 2: the one open thread is invalid, so this round changes no code. All test lines pass at the branch head 07287fa.

Review threads the coder judged:

  • 👎 invalid — crates/minimal/src/loadouts.rs:790: The premise is wrong. min box create calls prepare_activation_inputs_with_config (create.rs:4218) before it builds SelectedLoadouts with the ignore list (create.rs:4231). That call runs the unfiltered check at loadouts.rs:788, so create refuses an ignored non-POSIX name with exit 3, as min box spec

@agent-137
agent-137 marked this pull request as ready for review November 20, 2026 05:31
@mitodrummer mitodrummer left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@mitodrummer
mitodrummer added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 73d4068 Nov 20, 2026
39 checks passed
@mitodrummer
mitodrummer deleted the agent/3653-read-every-layer-s-variables-from-one-env-vars-t branch November 20, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T135 — Read every layer's variables from one env_vars table, and refuse vars, vars_lenient and a name that is not POSIX-shaped

2 participants

0