Repository navigation
fix(settings): unify non-leaf occurrence rejection in source_edit and write - #435
Merged
Merged
Conversation
… write source_edit now shares the leaf gate read applies: write rejects group and pass-through occurrences with the same 'not a typed leaf' InvalidValue instead of a WrongValueKind from inside apply_value, so all three operations refuse identically. Fixes #426
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
source_editalready rejected a non-leaf occurrence throughvalue_from_node(the S1 audit fix); this change closes the remaining gap against the issue's acceptance criteria:writenow refuses a group/pass-through occurrence with the sameInvalidValue("settings occurrence is not a typed leaf") instead of reachingapply_value'sWrongValueKind, soread/write/source_editrefuse identically. The reproducer (Description { Custom: X }) returns the same error fromsource_editandwriteand produces no edit.Tests
source_edit_rejects_non_leaf_occurrence— extended to assertsource_edit's error equalswrite's for the parsedGroupoccurrence.source_edit_leaf_gate_covers_group_variants_and_leaf— covers a programmatically carriedRawGroupoccurrence (same identical refusal) and a typed-leafDescriptionoccurrence, where the edit applies and replaces only the value bytes.Verification
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --all-targets— all greenworkshop-catalog-gen check— OK 528 entriesgit diff --checkFixes #426