docs/solutions/best-practices/2026-05-09-lexical-caret-harvest-rows-need-range-edge-contracts.md
Lexical caret tests are useful, but most of their surface is not portable to Slate. The valuable part is not the caret object API; it is the behavior around traversal, ordering, splitting, and destructive range edges.
Editor.before, Editor.after, positions,
Point, Path, split operation, and text-unit owners.Split caret harvest files by behavior family before writing Slate tests:
For the LexicalCaret pass, the useful Slate proof landed in
.tmp/slate-v2/packages/slate/test/delete-contract.ts:
The Slate contract should prove behavior a user or API caller can observe. Lexical's caret classes are implementation machinery, but range deletion semantics are editor behavior. Keeping the proof at the range edge avoids a giant copied matrix while still covering the bug-prone part.