fix(desktop): add precise local OCR reading

This commit is contained in:
Yun Chan 2026-11-21 10:15:49 +09:00
parent 59cdddbecb
commit 25fd3ac004
30 changed files with 626 additions and 15 deletions

View file

@ -1,7 +1,7 @@
# 02 — Repository & Infrastructure Map
> Surface: whole repo
> Last updated: 2026-11-20 — `v1.18.4` 데스크톱 업데이트 피드 복구: Electron 43 패키지의 100 MiB 업로드 한도 초과를 패키지 중복·미사용 플랫폼 바이너리 제거와 Windows full-only 최대 압축으로 해소하고 실제 설치본·서명 매니페스트를 검증
> Last updated: 2026-11-21 — 화면 OCR에 선택 영역 전용 GLM-OCR 정밀 읽기 추가: 설치본에는 모델을 포함하지 않고 명시적 첫 요청 시 다운로드하며, loopback 전용 이미지 처리·2분 상주·출력/시간 제한을 적용. `v1.18.4` full-only 패키지·피드 계약은 변경하지 않음
> Source of truth for: layout, workspaces, build/test commands, CI/CD, Docker, deploy, scripts, resources
---
@ -267,6 +267,7 @@ Version sync is enforced by `scripts/ci/sync-version.mjs` and `verify-release-me
- `resources/ffmpeg/` — optional bundled ffmpeg (CI or manual); `getFfmpegPath()` also resolves the `@ffmpeg-installer/ffmpeg` binary from `app.asar.unpacked`.
- `apps/desktop/sidecar-dist/` — PyInstaller sidecar bundle consumed by `extraResources` (gitignored; built by `npm --prefix apps/desktop run sidecar:build`).
- `resources/icons/` — empty; electron-builder falls back to `build/icon.ico|png`.
- GLM-OCR precise screen reading (`apps/desktop/src/main/services/screen-ocr/ollama-precision-engine.ts`) uses the existing Ollama server and downloads `glm-ocr:latest` (about 2.7 GB) only on the user's first explicit precise-reading request. The model is **not bundled in the installer**. Only a selected crop is sent to a loopback server, remote Ollama URLs are rejected, the model stays loaded for 2 minutes, and output length/timeouts are bounded. No Paddle/PyTorch runtime was added to the product.
- Desktop tests: `apps/desktop/tests/` — `unit/`, `main/`, `red/`, `shared/`, `integration/`, `eval/` run under Vitest; `e2e/` holds Playwright specs plus the shared `e2e/support/electron-app.ts` fixture (per-test temp user-data dir). Artifacts in `apps/desktop/test-results/`.
- Test taxonomy + hygiene gate: `docs/tdd-red/06-repo-application.md`. `npm run test:hygiene` (+ `:test`) rejects `.only`, reason-less `.skip()`, trivial assertions, `isVisible()`-gated assertions, machine-specific paths, `waitForTimeout`, and `.e2e.test.ts` names; wired into CI `quality`.
- Test-system gates (TDD 2.0 Phases 0–5, 2026-11-08..13):