Skip to content

fix: make plain confirmation accept the visible reading - #18

Merged
helloiamnotth3devnicetomeetyou merged 1 commit into
iamallyouneed:mainfrom
snowykr:fix/confirmation-contract
Oct 23, 2026
Merged

helloiamnotth3devnicetomeetyou merged 1 commit into
iamallyouneed:mainfrom
snowykr:fix/confirmation-contract

Conversation

@snowykr

@snowykr snowykr commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #17. Builds on #15's completed-reading protection; does not change the Shift-overlap classifier or address #16.

Plain confirmation accepts the reading already displayed, including unfinished input. It no longer means “run language selection again with final context.”

  • Keep the displayed engine language for ordinary confirmation; retain final inference for newly typed digit evidence and the existing explicit-correction learning baseline.
  • Route Japanese Enter/Space by the visible language.
  • Share Japanese preview/confirmation rendering, preserving segmentation and the visible live candidate. Complete only a genuinely pending Japanese n → ん, not an English segment's final n. Learn the visible candidate with its original reading/context metadata.
  • Display a standalone letter's final-scored decision immediately, so Tom's does not rely on confirmation to repair Tom'ㄴ. Retain a separate, one-use partial-language seed for the next letter's original hysteresis transition. Force, pin, reset and conversion transitions invalidate it.
  • Preserve explicit Esc, Japanese Space/candidate/kana conversion, successful Tab completion, numeric evidence, correction storage and coordinate protections. No new settings, dictionaries, token exceptions or platform ABI changes.

Regressions and intentional behavior

Observed baseline failures: ㄴ → s on confirmation; わたしはg → わたしhag; and a deterministic live-converter fixture replacing 今日はいい天気でs with きょうはいいtenkides. Added tests fail against exact upstream ce7bd934 and pass on this patch.

The matrix covers Enter, Other, failed Tab, direct commit/new-context commit, non-converting punctuation/Space, pending consonants and n, English segments ending n, live conversion off/on, candidate-learning metadata, explicit conversion, Return consumption, forced/pinned edits, first-letter continuation lifecycle and numeric context. FFI coverage also asserts UTF-16 caret positions, surrounding text, consumed boundaries and unavailable surrounding-text access.

The existing ozzy test now explicitly corrects its visible Japanese guess with Esc before Space, rather than depending on a hidden final English decision. That is intentional: a mistaken preview needs explicit correction, not an unseen language switch on confirmation.

The two session golden snapshots are intentionally updated for preview events: 522/674 enko rows and 597/1,349 enkoja rows change events; all 2,023 final texts remain identical. Decision golden snapshots are unchanged. The repository treats these snapshots as binary; git diff --text exposes their event changes.

Local verification completed before opening this PR

On Apple Silicon macOS:

  • cargo test --workspace --exclude tacit-tip: 332 passed, one existing ignored subprocess helper.
  • cargo test --workspace --exclude tacit-tip --all-features: 472 passed, two existing ignored subprocess helpers (their parent concurrency tests pass).
  • Focused core session/Japanese suites: 63 + 70 passed; expanded FFI regression passed in both editions.
  • cargo fmt --all -- --check; default and all-feature workspace/all-target Clippy with -D warnings; git diff --check.
  • macOS context/controller suites; installer language isolation 8 checks.
  • Release Japanese FFI builds for aarch64 and x86_64 macOS; arm64 Swift executable linked; x86_64 Swift typecheck with warnings as errors.
  • Lab 16 tests, both report self-tests, Japanese evaluator/Mozc self-tests, bilingual changelog validation.
  • Two bounded independent static review lanes approved the final policy/state and Japanese renderer. These reviews are not independent runtime replications.

Windows-only tacit-tip is excluded on macOS as in Unix CI. Windows/Linux/Android runtime, physical keyboard timing and a newly installed IME were not tested. Universal Swift linking is not claimed: the previously established local x86_64 Swift compatibility-library limitation remains; no packaging workaround was added. Platform source/ABI is unchanged, and the existing native controller tests were rerun. Installed app, personal settings/learning and rollback files were not changed.

Accuracy and performance scope

Compared exact upstream baseline with the final candidate, using the existing evaluators and the same datasets:

  • --profile enko/enkoja --corpus 3000: 127/156 non-timing model metrics unchanged. This is classifier-level evidence, not proof of session confirmation behavior.
  • Actual enko InputSession + FakeTextField switching replay, --corpus 3000 --fold 0/3, covers 7,050 lines across English/Korean sentences, Korean comments and three scenario sets. No previously correct complete sentence became incorrect; all six bucket final-accuracy values are unchanged. One already-incorrect mixed comment changes output (rlac → 김ㅊ, intended 김c); it remains incorrect. This is not a claim of zero per-character changes or representative accuracy.
  • Preview tradeoff is explicit: English-sentence wrong-prefix rate 13.682% → 0.769%, Korean-sentence 1.330% → 3.451%, because standalone Latin letters may appear before Korean composition grows. English preservation is reported separately, not hidden in a net score. These are evaluator-defined prefix rates, not real-world user error rates.
  • Five alternating runs of the existing no-commit/no-disk session-preview benchmark: zero-history p95 median 31.417 → 31.709 µs enko, 62.875 → 63.875 µs enkoja; run ranges overlap. The first-key path adds a bounded extra inference. These are synthetic preview/completion timings, not end-to-end latency or a speedup claim.

An initial implementation contaminated growing-word hysteresis with the standalone first-key guess. The wider replay caught 10년/소재 regressions despite the focused suites passing. The separate continuation seed and focused lifecycle regressions address that cause; the final case-level comparison above was rerun afterward.

No release or app installation is included.

Signed-off-by: snowykr <snowykr22@gmail.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the exact change from ce7bd93 to 8b00148. No blocking findings in the standards or issue #17 contract review.

Independently verified on Windows:

  • cargo test --workspace --all-features
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • The focused unfinished-reading and Japanese confirmation regressions fail on the exact upstream baseline and pass on this patch.
  • 9,000 additional deterministic synthetic sequences preserve the visible reading on confirmation, except the permitted pending Japanese n -> ん completion.
  • Both session snapshots retain all 2,023 final texts; the 522/597 changed event rows are preview changes.

The first-key continuation lifecycle, explicit-correction provenance, shared Japanese rendering, and visible-candidate learning are consistent with the proposed contract. The disclosed first-key Korean preview tradeoff and explicit correction for a mistaken Japanese preview are understood.

Issue #16 remains a separate classifier regression and is not resolved by this PR. Physical-keyboard timing, installed IME behavior, and the submitted accuracy/performance measurements were not independently revalidated.

Thanks for the careful reproductions and for documenting the tradeoffs and evidence limits.

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.

bug: plain confirmation still reinterprets unfinished and live Japanese previews

2 participants