After the selection-replacement autocorrect on the phone, Gboard's
local text was out of sync with ours and it re-sent the same empty
fix-up commit in an endless loop (~one per 150 ms, each drift-snapped
to the caret and applied as a no-op). The file was never damaged, but
the IME never converged because it kept 'fixing' text that did not
exist in its own model.
The app cannot see the IME's model; the only recovery the IME
contract offers is a restartInput, which makes it re-fetch the
real text and selection around the caret. Arm that recovery
automatically: three consecutive anomalous commits (drift-snapped,
or empty text) set IMEForceResync, and the next frame ships the
snippet trimmed by one rune, which changes the pushed text and
forces the restart. The streak resets on any normal commit, so
isolated anomalies never trigger it, and the resync is one-shot.
TestRealFile_IMEForceResync pins the arm/reset/consume cycle.