You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mfile: stop warning about spec keys in [session], [defaults.session] and task tables as unknown fields #3427
Found by pc's manual run of the Box CLI Test Plan on 0.8.0-dev.527.gdd7d8cf2 (U7). Still true on main at 8f6ca07.
min prints "unknown fields … help: do you need to update to a newer version of minimal?" for spec keys that expansion reads and applies: a task's network (which takes effect) and secrets, and [defaults.session] loadout_mode, lifetime and box. The warning also calls [defaults.session] "[session]".
Cause: File::warn_unknown_fields (crates/mfile/src/lib.rs:1754-1784) filters [session]'s and a task's extra keys only through SPEC_READ_ENTRY_KEYS = ["timeout"] (lib.rs:988) plus hooks_on_resume. Every other spec key that lands in extra is reported as unknown. It says "[session]" because legacy::settle folds [defaults.session] into File::session (legacy.rs:291-297). #3188 fixed the same class for entry tables and [defaults.<type>] with expand::is_spec_key (lib.rs:1726), but not for [session] and task extras. #3096 does not cover this: it replaces SPEC_KEYS in expand.rs, not this warning.
This breaks BOX-049 and BOX-076, which say these keys are accepted. For a real typo, BOX-076 refuses with exit 3 from expansion, and the "update minimal" hint does not apply.
[session] and task extras are still filtered by the four-key allow-list (network, timeout, file_exports, secrets) plus hooks_on_resume, not by expand::is_spec_key (crates/mfile/src/lib.rs:1117-1128, 2895-2899, 2911-2914; is_spec_key is at crates/mfile/src/expand.rs:1494). [defaults.session] with loadout_mode, lifetime or box therefore still prints the warning and the 'update to a newer version of minimal' help line, because Session has no such fields (crates/mfile/src/lib.rs:515-540) and they land in its extra. Any other spec key a task sets that Task does not model (crates/mfile/src/tasks.rs:7-36), for example lifetime or box, warns the same way.
The warning still says [session] section whichever table the person wrote (crates/mfile/src/lib.rs:2902). legacy::settle folds [defaults.session] into File::session before the warning runs and keeps no record of which table the keys came from (crates/mfile/src/legacy.rs:308-315; crates/mfile/src/lib.rs:1456).
No mfile test loads a [defaults.session] with loadout_mode and asserts no warning. The only [defaults.session] case in the unknown-field tests sets packages (crates/mfile/src/lib.rs:5520-5545), and loadout_mode does not appear in crates/mfile/src/lib.rs.
Activity
norrietaylor commentedon Nov 25, 2026
Status against
mainat 31e5769 (2026-11-24): partly fixed.On
mainnetworktable no longer prints the unknown-fields warning:networkis in the allow-listSPEC_READ_ENTRY_KEYS, merged in fix(mfile,minimal): read a task's network table, and refuse the keys a task box does not apply #3252 (crates/mfile/src/lib.rs:1114), and the testtask_network_table_is_not_reported_unknownpins it (crates/mfile/src/lib.rs:5246).secretstable no longer prints the unknown-fields warning:secretsjoined the same allow-list in fix(mfile,minimal): a box create sends the expanded spec with the client store rules, so a task's #3676 (crates/mfile/src/lib.rs:1114), and the testsecrets_entry_key_is_not_reported_unknownpins it (crates/mfile/src/lib.rs:5199).Still to do
[session]and task extras are still filtered by the four-key allow-list (network,timeout,file_exports,secrets) plushooks_on_resume, not byexpand::is_spec_key(crates/mfile/src/lib.rs:1117-1128, 2895-2899, 2911-2914;is_spec_keyis at crates/mfile/src/expand.rs:1494).[defaults.session]withloadout_mode,lifetimeorboxtherefore still prints the warning and the 'update to a newer version of minimal' help line, becauseSessionhas no such fields (crates/mfile/src/lib.rs:515-540) and they land in itsextra. Any other spec key a task sets thatTaskdoes not model (crates/mfile/src/tasks.rs:7-36), for examplelifetimeorbox, warns the same way.[session] sectionwhichever table the person wrote (crates/mfile/src/lib.rs:2902).legacy::settlefolds[defaults.session]intoFile::sessionbefore the warning runs and keeps no record of which table the keys came from (crates/mfile/src/legacy.rs:308-315; crates/mfile/src/lib.rs:1456).[defaults.session]withloadout_modeand asserts no warning. The only[defaults.session]case in the unknown-field tests setspackages(crates/mfile/src/lib.rs:5520-5545), andloadout_modedoes not appear in crates/mfile/src/lib.rs.fix(mfile): stop warning about spec keys in [defaults.session] and ta…