fix(desktop): prevent fast correction input races

This commit is contained in:
Yun Chan 2026-11-04 07:06:10 +09:00
parent 5ec063c744
commit 21a684d572
12 changed files with 134 additions and 18 deletions

View file

@ -0,0 +1,29 @@
# 2026-11-02 Windows GUI verification and typing-race follow-up
All dates below are KST. Runtime artifacts are under `test-results/recovery-2026-11-02/` (ignored). The tested installed application is `C:\Users\encep\AppData\Local\Programs\@d3rodesktop\D3RO Voice.exe`, file version **1.16.0**. No Electron process was launched from the agent shell; the existing installation was restored through its taskbar button.
## Desktop meeting import — PASS
- Restored the existing installation, opened Meetings → **녹음 파일 가져오기**, selected the real 8.498-second `local-speech.wav` through the native file picker, and reached the `local-speech` meeting detail.
- The transcript tab shows `[00:00] Hello. This is a local meeting import test. We will review the project tomorrow.` with the expected timestamp.
- **요약 만들기** used the existing local pipeline and produced a Korean summary plus `내일 프로젝트 검토 진행` as an action item; the Documents tab count is 1. No cloud or paid inference was requested.
- Screenshots: `meeting-list.png`, `meeting-import-transcript.png`, `meeting-summary-progress.png`. The test meeting was left in place; no personal data was deleted or reset.
## Native Korean IME under CPU and model load — PASS with method limits
- `installed-1.16.0-hangul.json`: calibration plus idle/CPU cases at requested 60/30/15 ms pacing, **7/7 exact matches**. All 240/240 injected events per corpus case were accepted. CPU cases used 23 bounded workers and recorded approximately 100% system CPU.
- `installed-1.16.0-hangul-model-load.json`: **7/7 exact matches**, including native IME composition evidence and all 240/240 events per corpus case.
- `/api/ps` was empty before the model test. A direct local `gemma4:e4b` generate request returned HTTP 200 in **9.389 s**, with **9.275 s model-load duration**. Its inferred request interval overlaps the report's `idle-60` and `idle-30` cases, both exact matches. This is direct Ollama cold-load overlap, not a claim about product-triggered warmup.
- The model was explicitly unloaded after the test; final `/api/ps` is empty. Responses: `ollama-cold-generate.json`, `ollama-ps-before.json`, `ollama-ps-after.json`, `ollama-ps-final.json`.
- These are synthetic scan-code tests in the fixture's own WinForms field, not physical-keyboard, Chromium, terminal, or hardware-IME proof. An initial run aborted on the fixture's foreground guard and is not counted as a pass.
## Latin-layout correction control — defect reproduced, source fixed, updated-app GUI still pending
- `installed-1.16.0-latin-control.json` passed only the IME calibration (**1/7**). The six layout-correction cases failed. Examples include `d안녕하세요`, an injected next-word `r` appearing during backspaces, and earlier words remaining unconverted.
- Installed-app logs reported successful `SendInput` replacement counts while the fixture recorded different final text. A single native call therefore does not establish that concurrent input cannot interleave with the replacement.
- Source changes, not yet shipped in the running 1.16.0 installation:
- `InputTelemetryService` waits for a 140 ms gap at a word boundary instead of taking the 40 ms snapshot during a faster burst.
- `TypoCorrectionService` does not partially correct a contiguous trailing chain during the short idle window. At the 650 ms idle checkpoint it corrects the current correction region, up to the existing 120-character core limit, in one replacement. Unrelated earlier text still does not force whole-line rewriting.
- The Win32 comment no longer claims that other processes cannot interleave input.
- Regression coverage: 140 ms rescheduling and deferral of a 120-character burst, followed by one exact Korean replacement. Targeted **48/48**, full desktop **192 files / 2,773 tests**, desktop typecheck, touched-scope lint, `git diff --check`, and production `electron-vite build` all PASS.
- The source fix has **not** been exercised in an updated Electron GUI. Re-run the same Latin control after packaging/installing the change, then expand to physical keyboard and Chromium/terminal surfaces before closing GAP-INPUT-11.

View file

@ -2,7 +2,7 @@
> Status: ACTIVE
> Last full audit: 2026-09-13
> Last update: 2026-11-01 — 미완료 작업 복구·Windows 1.16.0 및 엔진 배포 완료. 회의 import 계정 전환 경합을 수정했고, 입력 A/B는 이전 2/17 → 현재 17/17이다. 공개 엔진을 1.10.0에서 1.16.0으로 올려 CPU/UIA 수정을 전달한다. 모바일 `.3`의 격리 에뮬레이터 auth/signup 2/2 PASS와 기존 Fold6 실패, `.2` 과거 증거를 구분했다. 실제 부하 타이핑과 모바일 운영 배포는 남아 있다. 상세 증거: [completion report](../evidence/2026-11-01-completion.md).
> Last update: 2026-11-02 — Windows 1.16.0 실GUI에서 회의 파일 선택→전사→로컬 요약 생성을 확인했다. 네이티브 한글 IME는 100% CPU 및 `gemma4:e4b` 콜드 로딩 중 7/7 정확히 통과했다. 한영 자판 교정 대조군은 다음 키가 백스페이스에 섞이는 결함을 재현했고, 소스에서는 140ms 입력 간격 게이트와 유휴 후 현재 영역 일괄 교정으로 수정했다. 데스크톱 2,773개 테스트·빌드는 GREEN이지만 수정본 설치 GUI와 모바일 운영 배포는 남아 있다. 상세 증거: [2026-11-02 verification](../evidence/2026-11-02-verification.md).
>
> Previous update: 2026-11-01 — **기존 녹음 파일을 회의로 가져오기(`MTG-13`).** 데스크톱은 기존 ffmpeg 파일 전사를 재사용해 타임스탬프 전사와 재생용 WAV를 회의에 저장하고 일반 기록 중복을 피하며, 모바일은 회의 생성 후 기존 durable meeting import queue로 연결한다. 데스크톱 2,768개·모바일 599개·core 572개 테스트와 실제 MP3/M4A 변환 2개가 GREEN이다. 실제 Electron GUI와 인증 모바일 기기 E2E는 남아 있어 두 표면 모두 `[~]`다 (`04`, `06`, `11` GAP-MTG-03).
>

View file

@ -272,4 +272,6 @@ DB schema (`src/main/db/schema.ts`, drizzle SQLite): `history`, `dictionary`, `s
| Path/loopback resolution | `src/main/utils/paths.ts`, `src/main/utils/loopback.ts` |
| Sidecar source / packaging | `sidecar/main.py`, `scripts/setup-sidecar.mjs`, `scripts/build-sidecar.mjs`, `scripts/ci/verify-sidecar-bundle.mjs` |
2026-11-01 verification: source A/B 2/17 before vs 17/17 current; real MP3/M4A conversion 2/2; account-switch regression 3/3 after reproducing all three failures; local packaged STT transcribed the synthetic 8.498 s fixture exactly. Windows 1.16.0 installer, portable and runtime are published; the rebuilt sidecar passed separate-process startup/health and the packaged Windows keyboard N-API binding loaded successfully without starting hooks. Required sidecar minimum 1.16.0 delivers CPU budgeting and terminal UIA changes. Windows GUI/native helper remained unavailable; physical typing/model-load overlap and installation into the user's running app are still unverified. [Recovery evidence](../evidence/2026-11-01-completion.md).
2026-11-01 verification: source A/B 2/17 before vs 17/17 current; real MP3/M4A conversion 2/2; account-switch regression 3/3 after reproducing all three failures; local packaged STT transcribed the synthetic 8.498 s fixture exactly. Windows 1.16.0 installer, portable and runtime are published; the rebuilt sidecar passed separate-process startup/health and the packaged Windows keyboard N-API binding loaded successfully without starting hooks. Required sidecar minimum 1.16.0 delivers CPU budgeting and terminal UIA changes. [Recovery evidence](../evidence/2026-11-01-completion.md).
2026-11-02 verification: installed 1.16.0 passed the actual Electron picker→timestamped transcript→local minutes/action-item journey. Native Korean IME passed 7/7 under bounded 100% CPU and 7/7 with a direct 9.389 s `gemma4:e4b` cold-load request overlapping two typing cases. The Latin-layout control exposed next-key/backspace interleaving; source now waits 140 ms at boundaries and batches the current trailing correction region after a 650 ms pause. Full desktop 2,773 tests and production build pass, but the fixed source still needs an updated-app GUI run. Synthetic WinForms input is not physical-keyboard/Chromium/terminal proof. [Verification evidence](../evidence/2026-11-02-verification.md).

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long