8000 mfile: stop warning about spec keys in [session], [defaults.session] and task tables as unknown fields · Issue #3427 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

mfile: stop warning about spec keys in [session], [defaults.session] and task tables as unknown fields #3427

Done

Description

@agent-137

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.

Scope:

  • Filter [session] and task extras with expand::is_spec_key, as mfile: entry tables and [defaults.<type>] warn as unknown fields #3188 did for entries.
  • Name the table the person wrote ([defaults.session], not "[session]").
  • Leave a real typo to expansion's exit 3.
  • Pin it in an mfile test that a task with network and secrets, and a [defaults.session] with loadout_mode, print no warning.

Refs #2236, #3188, #3096.


This is a residual of epic #2236 (BOX).

Activity

  1. added
    priority:nice-to-have
    on Nov 18, 2026
  2. norrietaylor commented on Nov 25, 2026

    @norrietaylor
    Member

    Status against main at 31e5769 (2026-11-24): partly fixed.

    On main

    Still to do

    • [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.
  3. added
    priority:should-have
    and removed
    priority:nice-to-have
    on Nov 27, 2026
  4. added a commit that references this issue on Nov 30, 2026
    c7adbdd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:should-have

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0