chore(ocr): upgrade Light OCR to 0.5.6 - #2073
Conversation
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
📝 WalkthroughWalkthroughThe PR upgrades Light OCR from 0.5.5 to 0.5.6, packages PDFium fallback fonts and licenses, strengthens artifact validation, adds Chinese-font PDF smoke coverage, and refreshes ACP registry and model-provider metadata. ChangesLight OCR runtime-assets upgrade
Registry and model metadata refresh
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant PackageBuilder
participant NativePayload
participant PackagedRuntime
participant OCRProcess
PackageBuilder->>NativePayload: validate PDFium files, directories, hashes, and licenses
NativePayload->>PackagedRuntime: materialize verified PDFium resources
PackagedRuntime->>OCRProcess: start packaged OCR process
OCRProcess->>PackagedRuntime: return raster and Chinese PDF recognition results
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/main/scripts/smokeLightOcr.test.ts (1)
352-365: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the aggregate PDFium resource limit.
materializePackagedNativeRuntimenow rejects resource entries whose aggregate size exceeds 16 MiB. Add a fixture with declared font-resource bytes above that limit and assert rejection before materialization.As per coding guidelines, “Add the smallest regression test for user-visible behavior or a documented contract.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/main/scripts/smokeLightOcr.test.ts` around lines 352 - 365, Add a minimal regression test near the existing materializePackagedNativeRuntime coverage that provides a font-resource fixture whose declared aggregate bytes exceed 16 MiB, then assert materializePackagedNativeRuntime rejects before writing or materializing the runtime. Reuse the existing layout/temp-directory setup and verify the rejection reflects the resource-limit failure.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@resources/model-db/providers.json`:
- Around line 151109-151114: Verify the source metadata for the affected model
entry in providers.json and correct either release_date or last_updated so the
dates reflect the actual model timeline, with last_updated not preceding
release_date.
---
Nitpick comments:
In `@test/main/scripts/smokeLightOcr.test.ts`:
- Around line 352-365: Add a minimal regression test near the existing
materializePackagedNativeRuntime coverage that provides a font-resource fixture
whose declared aggregate bytes exceed 16 MiB, then assert
materializePackagedNativeRuntime rejects before writing or materializing the
runtime. Reuse the existing layout/temp-directory setup and verify the rejection
reflects the resource-limit failure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2b16a45a-c665-47bf-afe6-229e2ea87e0f
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (19)
docs/architecture/light-ocr-0.5.6-runtime-assets/plan.mddocs/architecture/light-ocr-0.5.6-runtime-assets/spec.mddocs/architecture/light-ocr-0.5.6-runtime-assets/tasks.mddocs/features/light-ocr-pdf-support/spec.mdpackage.jsonresources/acp-registry/registry.jsonresources/model-db/providers.jsonresources/runtime-versions.jsonscripts/afterPack.jsscripts/light-ocr-artifacts.mjsscripts/smoke-light-ocr.jssrc/main/ocr/lightOcrNativePayload.tstest/main/ocr/lightOcrNativePayload.test.tstest/main/ocr/lightOcrProcessHost.test.tstest/main/ocr/ocrRuntimeAssetResolver.test.tstest/main/ocr/ocrRuntimeService.test.tstest/main/scripts/afterPack.test.tstest/main/scripts/lightOcrArtifacts.test.tstest/main/scripts/smokeLightOcr.test.ts
Summary
0.5.6, runtime to0.1.6, and all six native packages to0.5.6.0.3.4and preserve the existing bundle and Node runtime versions.中文测试.Compatibility
gzip-base64-v1encoding for native code.Summary by CodeRabbit
New Features
Bug Fixes
Tests