Skip to content

fix(settings): unify non-leaf occurrence rejection in source_edit and write - #435

Merged
Teakowa merged 1 commit into
mainfrom
fix/426-source-edit-non-leaf
Oct 13, 2026
Merged

Teakowa merged 1 commit into
mainfrom
fix/426-source-edit-non-leaf

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Summary

source_edit already rejected a non-leaf occurrence through value_from_node (the S1 audit fix); this change closes the remaining gap against the issue's acceptance criteria: write now refuses a group/pass-through occurrence with the same InvalidValue ("settings occurrence is not a typed leaf") instead of reaching apply_value's WrongValueKind, so read/write/source_edit refuse identically. The reproducer (Description { Custom: X }) returns the same error from source_edit and write and produces no edit.

Tests

  • source_edit_rejects_non_leaf_occurrence — extended to assert source_edit's error equals write's for the parsed Group occurrence.
  • source_edit_leaf_gate_covers_group_variants_and_leaf — covers a programmatically carried RawGroup occurrence (same identical refusal) and a typed-leaf Description occurrence, where the edit applies and replaces only the value bytes.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --all-targets — all green
  • workshop-catalog-gen check — OK 528 entries
  • git diff --check

Fixes #426

… 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
@Teakowa
Teakowa merged commit 3d63ea3 into main Oct 13, 2026
5 checks passed
@Teakowa
Teakowa deleted the fix/426-source-edit-non-leaf branch October 13, 2026 11:52
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.

SettingDefinition::source_edit corrupts source when the occurrence is a group

2 participants