You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Aggressive/Maximum merging swaps the values of two keys that normalize alike (e.g. related / page_related) instead of merging them #131
In FindBasicCanonicalName (Frontmatter/PropertyMerger.cs, around lines 219–233), the exact-normalized-match loop maps each key to the other key in its equivalence class. With related and page_related:
related → page_related
page_related → related
MergeSimilarProperties then groups by canonical name and gets two single-key groups instead of one merged group. MergeArrayValues (around line 189) writes each group under the other key's name.
Output: page_related: [a] and related: [b]. The values are swapped, and nothing is merged.
With scalar values the two keys never merge either. So for this whole class of keys, the documented Aggressive/Maximum behaviour (merging redundant properties) does nothing, and for lists it corrupts which value belongs to which key.
Suggested fix
Pick one deterministic canonical name per equivalence class, so that every key in the class maps to the same target. For example:
use the known mapping if there is one;
otherwise use the unprefixed or shortest key;
break any remaining tie ordinally.
As a safety net, a group with a single original key should keep that key's own name.
Acceptance:
the input above produces a single related: [a, b], or whichever canonical name is chosen, with both values;
Priority: Medium. Aggressive/Maximum merging of normalize-alike keys does nothing for scalars and swaps values for lists. The output is wrong, but only under the opt-in aggressive strategies.
Notes: The "single original key keeps its own name" safety net is cheap and worth adding even with the deterministic rule. It guarantees no key can be renamed without a merge happening.
Activity
matt-edmondson commentedon Sep 26, 2026
Triage
PropertyMerger.FindBasicCanonicalName/MergeSimilarPropertiesPropertyMerger's canonical-name resolution, and the deterministic-canonical-name fix here changes exactly what Merge-strategy cache is keyed only on the property name, so an Aggressive run makes a later Conservative run drop properties #130's cache would store. Fix together. Also related to Delegate property-name fuzzy matching to ktsu.FuzzySearch #113 (delegate fuzzy matching toktsu.FuzzySearch), which rewrites the same similarity path, so sequence it after these correctness fixes, with their tests as the regression net.Notes: The "single original key keeps its own name" safety net is cheap and worth adding even with the deterministic rule. It guarantees no key can be renamed without a merge happening.
Generated by Claude Code