8313c4a584
RFC 9420 §7.8: the ratchet tree has no trailing blank leaves — when a Remove blanks the rightmost leaf, everyone MUST shrink `leaf_count` and drop the (now-orphaned) parent nodes so future `direct_path`, `resolution`, and `treeHash` computations see the new shape. Quartz was blanking the leaf and its direct path but leaving `_leafCount` untouched. Openmls / mdk shrink, so after e.g. `amy removes C (leaf 2)` quartz still had `leafCount = 3` while B's openmls had `leafCount = 2`. Amy's `direct_path` from leaf 0 then had two entries (to the 3-leaf-tree root), but B's tree layout expected one — and openmls rejected the commit with `UpdatePathError(PathLengthMismatch)`. Fix: after blanking the leaf + direct path, walk `leafCount` down past any trailing blanks and truncate the `nodes` list to `nodeCount(leafCount)`. https://claude.ai/code/session_016kAxdp6ubB5CnF9URhCEzP