Repository navigation
feat(minimal): T136 — Carry a box's variables as one env_vars table from the loadout to the daemon - #3691
Conversation
A loadout holds one variable table, StrictVarName accepts lower-case POSIX names, WireBoxEntry carries one env_vars table, and a contribution carries its variables under env_vars on the wire.
The entry's wire env_vars is the expanded spec's env_vars whole, and min loadout list counts a loadout's variables from vars() alone.
StrictVarName now accepts lower-case names for env_vars. A [secrets] grant name keeps its own rule until gominimal/arch#185 decides it.
…x-s-variables-as-one-env-vars-table-fr
|
Important Review skippedBot 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.
|
StrictVarName now accepts lower-case POSIX names, so my_var in the session defaults lands in vars, not vars_lenient.
|
Round 1 of 10 on a failed check suite, pushed as
Verify Outside the task's
Converted to a draft: verify exited 100; outside the task's A box started from a minimal.toml and a loadout whose env_vars set EDITOR and http_proxy has both in its environment, and min loadout list counts each variable once. This round makes the CI tests lane pass again: the one failing test now expects the new behaviour. Notes from the agent: The CI tests job failed on mfile expand::tests::env_vars_read_from_every_layer. That test expected the lower-case name my_var in the session defaults to go to vars_lenient. This task makes StrictVarName accept lower-case POSIX names, so my_var now reads into vars. I updated the assertion in crates/mfile/src/expand.rs. That file is outside the task's layers, but the test pins behaviour that this task changes on purpose. ci-linux-native-success is only the lane aggregator, and it failed because the tests job failed. I did not re-run the full mfile suite after the fix. Its other 889 tests passed before the change, and the change touches only this test. I did not run the workspace-wide suite. |
|
Approved: no findings at Nothing to do. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: PASS · the full ruling
The change conforms to the design. A loadout and an expanded entry now carry one env_vars table to the daemon. The daemon sets each variable by name over the project's value. This matches [loadouts.env_vars] and the merge-by-name rule in the minimal.toml layout section. The wire rename has no alias, but the must_match_version gate refuses a skewed daemon before the contribution is sent. The design states no case rule for [secrets] names. The client and the daemon now apply different rules there, and gominimal/arch#185 must decide which is correct.
Ruled at 35ce73f against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
T136 — Carry a box's variables as one env_vars table from the loadout to the daemon
slice: S5
kind: enablement
covers: none
size: M
est: 190 code, 300 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: min loadout list shows, in its var column, the number of variables a loadout's env_vars sets, each once
observability: the daemon's compose record for a received entry counts env_vars in place of vars and vars_lenient
layers:
- loadout:
- crates/boxes/src/core/loadout.rs: Loadout holds one variable table; vars_lenient(), with_var_lenient and the lenient half of all_vars go
- crates/boxes/src/core/primitives.rs: StrictVarName accepts lower-case POSIX names; NotPosixName drops the vars_lenient advice
test: cargo nextest run -p boxes loadout_env_vars_hold_one_table
test: cargo nextest run -p boxes strict_var_name_accepts_lower_case_names
- wire:
- crates/boxes/src/wire/request.rs: WireBoxEntry carries one env_vars table; WireContribution carries a loadout's variables under env_vars
- crates/boxes/src/daemon/composer.rs: compose_entry sets each variable of the entry's one table over the project's, and reads a contribution's env_vars
- crates/boxes/src/client/composer.rs: the loadout contribution writes its variables under env_vars
test: cargo nextest run -p boxes wire_box_entry_carries_one_env_vars_table
test: cargo nextest run -p boxes compose_entry_sets_each_env_var
- client:
- crates/minimal/src/cmd/boxes/create.rs: the entry's wire env_vars is the expanded spec's env_vars whole, with no lenient route
- crates/minimal/src/loadouts.rs: min loadout list counts vars() alone
test: cargo nextest run -p minimal loadout_list_counts_each_env_var_once
produces: none
consumes: none
proof: A box started from a minimal.toml and a loadout whose env_vars set EDITOR and http_proxy has both in its environment, and min loadout list counts each variable once.
depends on:
- blocked by #3653
Proof
A loadout or minimal.toml whose env_vars sets EDITOR and http_proxy reads both as variables of one table: the client sends the entry's env_vars whole, the daemon sets each one over the project's value, and a loadout's variables travel under env_vars. min loadout list shows 2 var for such a loadout, so each variable counts once. Tests pin this at the unit level. No live box was started in this session.
Notes from the agent: Touched outside the layers: crates/minimal/src/tests.rs, one line (task.vars -> task.env_var 8000 s), because the WireBoxEntry field rename broke its compile. In-layer extra: create.rs keeps the old capital-letter rule for [secrets] grant names (is_secret_variable_name). It did this because StrictVarName now accepts lower case, and a_grant_whose_name_is_not_a_variable_name_is_refused failed. The spec says [secrets] names are for gominimal/arch#185. The minimald checks in box_manager.rs:269 and box_runtime.rs:851 still use StrictVarName, so the daemon now accepts a lower-case grant name. The client refuses it first. Those checks are outside the layers and are not changed. WireContribution keeps the Rust field
varswith serde rename toenv_vars, because minimald builds that struct in many places outside the layers. The wire name changes, so an older daemon and a newer client do not agree on the contribution. Not changed: boxes/src/core/expansion.rs validate_strict_var_name still allows only upper-case names in $VAR pattern expansion, and its doc says [A-Z_][A-Z0-9_]*. mfile::Session still has vars_lenient, and minimald still folds stack variables into it. VarError::NotPosixName now prints: variable name<n>is not POSIX-shaped: a name holds only ASCII letters, digits and_, and does not start with a digit. Other runs: cargo nextest run -p boxes (655 passed), cargo nextest run -p minimal (all passed after the secret-name fix), cargo clippy -p minimald --all-targets (clean), and a filtered minimald run (35 passed).Tests
cargo nextest run -p boxes loadout_env_vars_hold_one_tablecargo nextest run -p boxes strict_var_name_accepts_lower_case_namescargo nextest run -p boxes wire_box_entry_carries_one_env_vars_tablecargo nextest run -p boxes compose_entry_sets_each_env_varcargo nextest run -p minimal loadout_list_counts_each_env_var_onceVerify
min task run agent-verifyexited 100, so this PR is a draft.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/minimal/src/cmd/boxes/create.rscrates/minimal/src/tests.rsOut of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimal/src/tests.rsCloses #3654