Source editing and cache ownership¶
The optional bounded text edit model owns grapheme-safe source
replacement/deletion, directional selection and undo/redo snapshots on UI/control
threads. Process-local owner/revision tokens reject stale or foreign mutations.
prepare_layout captures source and token together; check the returned
PreparedTextLayout::matches before treating cached paragraph/caret geometry as
current. Undo restores text and selection with a new revision, so matching old
source bytes does not revive a stale token. This remains source state and geometry;
input adapters, IME, clipboard and native editor/accessibility validation are
separate facilities.