KeyType icon indicating copy to clipboard operation
KeyType copied to clipboard

Feature: Measure post-acceptance completion and correction reversions locally

Open deCoderick opened this issue 3 weeks ago • 0 comments

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

  1. Introduce a pure, unit-tested AcceptedInsertionTracker state machine.
  2. Add aggregate completion/correction accepted, reverted, and unobservable counters to CompletionTelemetryStore.
  3. Wire normal completion acceptance through CompletionController and correction acceptance through CorrectionController.
  4. 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.

deCoderick avatar Nov 07 '26 00:11 deCoderick