Skip to content

fix: learn corrections from the visible reading origin - #25

Merged
helloiamnotth3devnicetomeetyou merged 1 commit into
iamallyouneed:mainfrom
snowykr:fix/confirmation-learning-origin
Oct 24, 2026
Merged

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

Conversation

@snowykr

@snowykr snowykr commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Closes #22.

What changes

Retain the language actually shown immediately before the first explicit correction, while that word's input and context remain valid. This repairs missed English learning for Japanese-visible siasia/ozzy and false learning when cycling back to the original display.

  • One private Option<Language> in WordState; unchanged cycles retain the first origin. No shadow classifier or per-keystroke key snapshots.
  • Private keys plus an invalidating mutable accessor cover append/delete/retype, normalization, extraction and restoration. Context transitions invalidate at the appropriate boundary; pause still commits the legitimate correction first.
  • Valid origins and ordinary confirmation share the existing before-digit confidence policy. Edited/restored/originless forced tokens retain current-token final scoring rather than borrowing a stale prefix's display.
  • Japanese Space receives the repaired baseline through its existing recording path. Learning delivery/dedup timing, persistence format, explicit/stem/shape algorithms, rendering and enabled-language rules are unchanged.
  • Ordinary confirmation, standalone continuation seeding, mixed-ending promotion and explicit Japanese conversion remain intact.

Most production callsite changes are mechanical key-access encapsulation. The old deterministic rr test's forced-final/no-learning expectation is deliberately replaced: visible Korean → explicit English is a correction. Its ordinary ㄱㄱ confirmation/no-learning assertions remain.

Verification

Baseline: upstream/main and v0.10.10, 9a7a219a65414dc8f7ff69bee010e5828e24f2e4. Revision comparisons use separate source/build targets. All learning fixtures are public/synthetic and use fresh persistent stores where persistence is asserted.

Check Result
New/updated baseline regressions, before product edits 6 session + 4 Japanese failures; preservation controls pass
Patched focused suites 8 WordState + 70 session + 77 Japanese tests pass
Workspace, default, excluding Windows-only tacit-tip on this host 349 pass; 1 existing ignored test
Workspace, all features, same exclusion 498 pass; 2 existing ignored tests
Rust fmt + all-target workspace Clippy, default/all features pass, -D warnings
Lab tests 16 pass
Lab report selftests, enko/enkoja; Japanese evaluator --check pass
Installer language isolation 8 checks pass
macOS context/controller suites pass
Release Japanese FFI arm64 and x86_64 builds pass
Swift arm64 native link and x86_64 warnings-as-errors typecheck pass
Changelog validation/selftest and git diff --check pass

Persistent tests verify pending → learned → genuinely reopened engine behavior, full cycles, edits including identical-byte retyping, pins, activation/pause/reset, weak/strong digit boundaries, Japanese Space, cancellation/restoration/dedup, and n-marker normalization. The postboundary control explicitly checks composition closure and UTF-16 caret behavior.

A separate C ABI replay with embedded Japanese and isolated homes/profiles checks two tokens × known/unknown context × three fresh-handle rounds: baseline 0/12 expected English-learning observations, patched 12/12. It selects the actually displayed English reading rather than assuming one Esc for every configured language order. This is synthetic C ABI replay, not installed-IME or physical-key validation.

Accuracy and performance

Identical existing public data, separate baseline/patched lab binaries:

  • --corpus 3000: all 127 enko / 156 enkoja non-timing metrics unchanged, including reported accuracy and allocation/heap metrics.
  • enko --switching --fold 0/3 --corpus 3000: 7,050 lines, all six buckets' non-timing metrics unchanged. English sentence accuracy remains 100%; Korean sentence accuracy remains 97.867%. Existing errors are not described as fixed, and unchanged aggregate metrics are not a claim of universal correctness.
  • The existing switching replay explicitly rejects enkoja. No Japanese corpus-switching replay was performed or claimed; Japanese integration/C ABI coverage is not an equivalent substitute.
  • Five alternating baseline/patched session benchmark pairs per profile. Zero-history p95 medians: enko 22.625 → 22.958 µs (ranges 22.542–23.625 / 22.792–24.916), enkoja 43.500 → 43.833 µs (43.084–46.792 / 43.333–44.875). Ranges overlap; no speedup claim. This benchmark measures NoopClient preview/completion, not commit/disk writes or end-to-end typing latency.

Disclosed verification limits

  • No local Windows/Linux/Android runtime, installed patched IME, physical-key timing, or x86 Swift link/runtime claim. Cross-platform CI remains additional evidence.
  • Full-file Prettier checks warn on historical changelog formatting, also reproduced on the untouched baseline. Both newly added Unreleased sections match pinned prettier@3.3.3; historical content is intentionally unchanged. This is not reported as a clean full-file Prettier result.
  • Initial harness mistakes (Japanese . phrase continuation and language-cycle ordering) were corrected and rerun; those failed attempts are not counted as product regressions.

Separate follow-ups

Neither is bundled into this repair. No learning reset, new token exceptions, model retuning, store migration, version bump, installation, release or merge is included. The installed app remains unchanged.

Planner/architect/critic unanimously approved the bounded plan; independent source and test reviews approved the implementation. Runtime checks above were executed by the integrating parent, not claimed as independent reviewer executions.

Retain the first displayed language only while input and context remain valid. Preserve final scoring for edited or restored forced words and the existing digit-boundary policy. Add persistent and lifecycle regressions without changing learning delivery or storage.

Fixes iamallyouneed#22

Signed-off-by: snowykr <snowykr22@gmail.com>
@helloiamnotth3devnicetomeetyou
helloiamnotth3devnicetomeetyou merged commit 869768b into iamallyouneed:main Oct 24, 2026
5 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.

bug: explicit corrections can fail to learn against the visible reading

2 participants