KeyType
KeyType copied to clipboard
Feature: Measure post-acceptance completion and correction reversions locally
Problem
KeyType records when a completion or correction is accepted, but does not currently measure whether the user immediately removes or replaces that accepted insertion. Acceptance alone is therefore an incomplete quality signal, especially for future autocorrect work.
Proposal
Add privacy-preserving, local-only post-acceptance reversion telemetry.
- Keep an accepted insertion's range and text only in memory for a short observation window.
- On a subsequent focused-field update, classify the outcome as retained, partially removed, fully reverted, replaced, expired, or unobservable.
- Persist aggregate counters only; never persist accepted text, field contents, raw keystrokes, or a per-event history.
- Clear the pending observation on field/app change, secure/sensitive targets, or timeout.
- Ignore KeyType's own synthesized insertion events and app-specific backspace-after-paste workarounds.
Suggested implementation
- Introduce a pure, unit-tested
AcceptedInsertionTrackerstate machine. - Add aggregate completion/correction accepted, reverted, and unobservable counters to
CompletionTelemetryStore. - Wire normal completion acceptance through
CompletionControllerand correction acceptance throughCorrectionController. - Surface only aggregate rates in local Statistics/Settings after the telemetry is established.
Acceptance criteria
- Tests cover retained text, exact and partial deletion, replacement, timeout, focus/app changes, secure fields, and synthesized insertion events.
- No text or keystroke sequence reaches persistent telemetry, logs, exports, or writing history.
- The feature remains local-only and is disabled/suppressed wherever KeyType does not observe text safely.
This is intentionally separate from #42, which improves correction validation scoring.