Skip to content

fix(config): name the problem in the remaining untagged config errors - #864

Open
wan9chi wants to merge 4 commits into
mainfrom
fix/untagged-config-errors
Open

wan9chi wants to merge 4 commits into
mainfrom
fix/untagged-config-errors

Conversation

@wan9chi

@wan9chi wan9chi commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Motivation

#815 made task definitions and the task cache setting report the real parse error instead of data did not match any variant of untagged enum .... The other config values that accept more than one form were still #[serde(untagged)], so any mistake in them still got the generic error, which names an internal Rust type and not the problem:

Config Before After
command: 123 ... untagged enum Command invalid type: integer `123`, expected a command string or an array of command strings
dependsOn: [{ task: "build", form: "dependencies" }] ... untagged enum UserDependsOnEntry unknown field `form`, expected `task` or `from`
dependsOn: [{ task: "build", from: "devDeps" }] ... untagged enum UserDependsOnEntry unknown variant `devDeps`, expected one of `dependencies`, `devDependencies`, `peerDependencies`
cache: { input: [{ pattern: "src/**", bas: "workspace" }] } ... untagged enum UserInputEntry unknown field `bas`, expected one of `pattern`, `base`, `auto`
cache: { input: [{ pattern: "src/**" }] } ... untagged enum UserInputEntry missing field `base`
cache: { output: [{ auto: true, pattern: "src/**" }] } ... untagged enum UserOutputEntry `auto` can't be combined with `pattern` or `base`
root cache: { script: true } ... untagged enum UserGlobalCacheConfig unknown field `script`, expected one of `scripts`, `tasks`, `remote`

Command, UserDependsOnEntry, UserDependsOnFrom, and UserGlobalCacheConfig pick the variant from the value's type with UntaggedEnumVisitor, like #815. UserInputEntry and UserOutputEntry have two object forms, { pattern, base } and { auto }, so both forms are parsed as one struct and then checked. That way a mistyped key is listed with every accepted key. Valid configs parse as before, and run-config.ts is unchanged.

🤖 Generated with Claude Code

wan9chi and others added 2 commits October 19, 2026 10:26
`command`, `dependsOn` entries and their `from`, `input` and `output`
entries, and the root `cache` setting were still `#[serde(untagged)]`, so
any mistake in them failed with `data did not match any variant of
untagged enum ...`. They now pick the variant with `UntaggedEnumVisitor`,
as #815 did for task definitions and the task `cache` setting.

`input` and `output` entries have two object forms, so both are parsed as
one struct, and a mistyped key is reported along with `pattern`, `base`,
and `auto`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.38%  [ -2.73% ..  +3.43%]  overhead   +49.89%
dynamic/access             change  +0.00%  [ -1.95% ..  +1.08%]  overhead   +10.35%
dynamic/access-relative    change  -0.21%  [ -2.30% ..  +1.16%]  overhead   +60.95%
dynamic/access-contended   change  -0.39%  [ -2.60% ..  +1.46%]  overhead   +12.73%
static/launch              change  +0.62%  [ -2.07% ..  +4.39%]  overhead  +181.17%
static/access              change  +0.72%  [ -8.63% .. +13.02%]  overhead  +834.73%
static/access-relative     change  +0.22%  [ -1.41% ..  +2.19%]  overhead +1350.44%
static/access-contended    change  +0.20%  [ -0.69% ..  +2.04%]  overhead +3206.11%

macos

dynamic/launch             change  +0.03%  [ -3.21% ..  +2.83%]  overhead  +214.16%
dynamic/access             change  +0.00%  [ -3.13% ..  +2.00%]  overhead    +3.38%
dynamic/access-relative    change  +0.12%  [ -2.72% ..  +2.00%]  overhead  +242.12%
dynamic/access-contended   change  +0.10%  [ -4.06% ..  +5.45%]  overhead    +4.29%

windows

dynamic/launch             change  -0.48%  [ -2.41% ..  +1.24%]  overhead   +25.55%
dynamic/access             change  -0.20%  [ -0.96% ..  +0.58%]  overhead    +0.78%
dynamic/access-relative    change  +0.19%  [ -0.76% ..  +0.77%]  overhead    +1.17%
dynamic/access-contended   change  +0.00%  [ -0.91% ..  +0.93%]  overhead    +1.30%

wan9chi and others added 2 commits October 19, 2026 10:36
- Suggest `{ auto: true }` in the expected forms of an input or output
  entry.
- Say that `from` takes package.json dependency field names, with
  `dependencies` and `devDependencies` as examples.
- Move the object form of the root `cache` setting into
  `DetailedGlobalCacheConfig`, like `UserCacheConfig::Config`, so its
  fields aren't repeated in the `Deserialize` impl. `ts(inline)` keeps
  `run-config.ts` unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parsing both object forms into one struct of `Option` fields treated an
explicit `null` as an absent field, so `{ pattern, base, auto: null }` and
`{ auto: false, pattern: null }` were accepted. Before, both forms
rejected them. A present field is now parsed with its own type, so `null`
is an error again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant