Skip to content

fix: reject near-total text replacements in correction learning - #93

Merged
IchenDEV merged 2 commits into
mainfrom
cursor/4d773f36
Sep 17, 2026
Merged

IchenDEV merged 2 commits into
mainfrom
cursor/4d773f36

Conversation

@IchenDEV

Copy link
Copy Markdown
Owner

Outcome

Fixes accidental correction learning when the target app replaces the entire text field content (e.g. UI navigation changing the field to "Follow up"). Previously, CorrectionObservationPolicy only rejected appends and prepends but allowed near-total replacements to pass through as valid corrections.

SDLC bundle and risk

  • Bundle: N/A (low-risk bugfix with focused scope)
  • Risk: low
  • Human decisions still required: none

Verification

  • swift test — all 8 CorrectionCandidateClassifierTests pass, including 2 new tests
  • bash scripts/ci-basic-checks.sh
  • python3 scripts/sdlc.py validate --worktree

Residual risk and rollback

Minimal. The new guard only applies to texts >4 characters and requires ≥25% overlap (common prefix + suffix ≥ max(2, length/4)). Legitimate corrections that change a small part of the text are unaffected. Revert is a single commit.

Reviewer focus

The overlap threshold (insertedCount / 4) — verify it balances false-positive rejection against genuine short-text corrections.

Made with Cursor

IchenDEV and others added 2 commits September 11, 2026 16:01
When no speech is present but background noise passes the energy
threshold, Whisper may hallucinate "Do anything". Add a
whole-transcript hallucination phrase set checked during weak-audio
filtering so the phrase is rejected instead of being forwarded to the
LLM. Strong audio keeps the phrase intact for genuine dictation.

Co-authored-by: Cursor <cursoragent@cursor.com>
CorrectionObservationPolicy now requires at least 25% overlap
(common prefix + suffix) for texts longer than 4 characters.
This prevents accidental learning when the target app replaces
the entire text field content (e.g. UI navigation changing the
field to 'Follow up'), which was being misclassified as a user
correction.

Co-authored-by: Cursor <cursoragent@cursor.com>
@IchenDEV
IchenDEV marked this pull request as ready for review September 17, 2026 05:13
@IchenDEV
IchenDEV merged commit f40e752 into main Sep 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant