Skip to content

Complete word-count and character correction flows - #34

Merged
HusseinBaraja merged 2 commits into
mainfrom
Complete-automatic-correction
Oct 3, 2026
Merged

HusseinBaraja merged 2 commits into
mainfrom
Complete-automatic-correction

Conversation

@HusseinBaraja

@HusseinBaraja HusseinBaraja commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Automatic confidence skips previously returned checked segments to executable context, and character matching missed configured sequences entered across keystrokes. Verified word-count and character skips now commit the original as informative context and release the pending segment. Character matching preserves the complete active pre-caret segment, including earlier skipped boundaries.

Both triggers remain optional and configurable: word count defaults to 10 completed words and character triggering defaults to .. Correction runs asynchronously while new typing starts a fresh executable context. Disabled correction does not freeze new segments. Conservative session, control, range, app-rule and security checks remain enforced, along with context shrinking, clipboard preservation, app-level undo and metadata-only logging.

Verification

  • Rust tests: 385 passed; 6 ignored desktop/helper or pending tests.
  • UI tests: 151 passed.
  • Focused native automatic-trigger smoke passed, covering correction, confidence skips, context shrinking, newer typing, text after the caret and undo.
  • Solution build, Clippy with warnings denied, formatting and diff checks passed.
  • Built app startup, default trigger settings, IPC status and graceful shutdown passed with isolated settings.

The broader native replacement smoke failed existing live caret/clipboard verification checks; the focused automatic-trigger smoke passed.

Summary by CodeRabbit

  • Behavior Updates
    • Word-count and character-triggered corrections now respect whether correction is enabled.
    • Character triggers match configured boundaries before the caret, including sequences entered across multiple keystrokes, and process the full active segment.
    • Automatic results suppressed by confidence settings can finish safely without changing text or creating an undo entry.
  • Documentation
    • README guides now describe trigger defaults, configuration, safety checks, confidence handling, and undo behavior.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
README.md — configured
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3423dfb5-1a42-4c2b-82e9-987b103df03f
📥 Commits

Reviewing files that changed from the base of the PR and between a7d40be and cf040b7.

📒 Files selected for processing (8)
  • README.md
  • app-core-rust/README.md
  • app-core-rust/src/background/pipeline.rs
  • app-core-rust/src/background/pipeline/tests.rs
  • app-core-rust/src/background/pipeline/tests/character.rs
  • app-core-rust/src/background/pipeline/tests/word_count.rs
  • app-core-rust/src/background/replacement/tests.rs
  • app-core-rust/src/background/triggers.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The change updates automatic word-count and character triggers to process completed active text, adds handling for verified unchanged results suppressed by confidence policy, and adds pipeline and Windows native-editor tests for trigger execution, validation, context, and undo behavior.

Changes

Automatic Word-Count and Character Triggers

Layer / File(s) Summary
Match and form automatic trigger segments
app-core-rust/src/background/triggers.rs, README.md, app-core-rust/README.md
Automatic triggering now stops when correction is disabled. Character triggers match configured boundaries in active pre-caret text and pass the full active text as executable context. The documentation describes word-count thresholds, character boundaries, and segment behavior.
Complete confidence-suppressed unchanged results
app-core-rust/src/background/pipeline.rs, app-core-rust/src/background/pipeline/tests.rs, app-core-rust/README.md
The pipeline accepts verified unchanged results suppressed by confidence policy for pending word-count and character work. It records the confidence-policy reason and reports the corresponding skip. Shared tests cover completion and context behavior.
Validate trigger execution and native-editor behavior
app-core-rust/src/background/pipeline/tests/*, app-core-rust/src/background/replacement/tests.rs
Pipeline tests cover trigger admission, queued segments, confidence tiers, dispatch denial, and live-range validation. Windows smoke tests exercise automatic triggers through InputProcessor and check editor text, session state, metadata, and undo.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to cf040

Automatic word-count and character corrections now handle full active segments, and they finish cleanly when confidence settings choose to skip a correction. The existing safety checks still apply, and the new behavior is broadly tested. No concrete merge-blocking risk was found.

Security Architecture Review

Security architecture risk: 🔵 Low · up to cf040

The changes affect when automatic corrections run and when checked text is released. The inspected authorization and document-range safeguards remain intact, and no introduced security flaw was established. Wider security coverage and live-editor verification remain incomplete.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected path can expose an admitted session segment to the configured correction engine and can affect its owned range in the focused application. Cross-keystroke boundary recognition adds triggering opportunities, but does not itself grant access to other applications, arbitrary document ranges or additional providers.

Security Findings and Attack Paths

  • observed — An engine-supplied confidence-suppressed result cannot use the new branch to authorize a native edit: changed output or inconsistent suppression is rejected, and accepted unchanged output bypasses the replacement callback. This bounds the inspected completion path; it is not a claim of complete security coverage.

Trust Boundaries and Controls

  • observed — Executable text is checked against app policy before correction. API send authorization reacquires policy storage, checks request permission and cancellation, and denies authorization when storage is unavailable. Completion independently revalidates target, session and live range before committing ownership.

Resilience and Maintainability Implications

  • observed — Failed verification of the newly accepted unchanged result follows the existing restoration path instead of marking unchecked text as informative. Successful retirement requires segment identity, original-text equality, caret ownership and front-of-queue ordering, preserving failure containment while newer typing continues.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: completing the word-count and character correction flows.
Docstring Coverage ✅ Passed Docstring coverage is 95.83% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 6 files. (2 skipped: 2 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@HusseinBaraja

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@HusseinBaraja
HusseinBaraja merged commit 6416041 into main Oct 3, 2026
3 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