Repository navigation
fix(config): refuse unknown keys in [tool.fastskill] and metrics files - #363
Merged
Merged
Conversation
A misspelt key under [tool.fastskill] (say `skip_transitiv`), inside a
[[tool.fastskill.repositories]] entry (`brnach`), or in an eval metrics
file (`critera`, `suite`) parsed cleanly and was then ignored.
serde's deny_unknown_fields cannot help here, and neither can
serde_ignored: repository entries flatten an untagged enum and metrics
flatten an internally tagged one, and serde buffers those keys where
neither sees them. core::unknown_keys instead serializes the parsed value
back and reports every input key the round trip lost. That also catches a
key dropped because an untagged enum chose a variant without it.
The rest of the manifest stays permissive, per the lifecycle PRD
("preserved or rejected before writing, never dropped"). Two
preservation tests used [tool.fastskill.extension] as their example
unknown table; they now use [tool.other].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FastSkill ignored misspelt settings in the two places where a typo changes what it does:
[tool.fastskill]inskill-project.toml:skip_transitiv = trueor a mistyped repository field was dropped without a word.criterionmade a metric score nothing, and the run still looked successful.Both are now refused, and the error names every unknown key with its path:
The rest of the manifest stays permissive. Top-level keys and other tools' tables such as
[tool.other]are still accepted and kept on save, as lifecycle PRD S-01 requires ("preserved or rejected before writing, never dropped").How unknown keys are found
core/unknown_keys.rsparses the file, serializes the typed value back to TOML, and reports every raw key that is missing from the result.We didn't use
serde(deny_unknown_fields)orserde_ignored. Neither can see keys inside#[serde(flatten)]or untagged enums, because serde buffers that content before choosing a variant, andRepositoryDefinitionuses both. The round-trip diff also catches keys that an untagged enum silently discarded when it picked a variant without them.Compatibility
[tool.fastskill]key. The error message says so.[tool.fastskill.extension]as an "unknown table" example now use[tool.other], which is the permissive case the PRD describes.Tests
manifest/tests.rs: typos under[tool.fastskill]are refused, a typo in a flattened repository entry is refused, and tables outside[tool.fastskill]stay permissive.eval/scorecard/metrics.rs: a misspelt metrics key is refused, and new tests cover the read, parse and missing-checks.tomlerrors, which keep the changed file above the 90% coverage gate.core/unknown_keys.rs: unit tests for the diff.scripts/run-tests.shpasses locally.🤖 Generated with Claude Code