fix: make OCR portable and reliable across AMD64 and ARM64 (#519)

* fix: make OCR portable and reliable

* fix: harden OCR installation portability

* fix: pin OCR partials across downloads

* fix: make OCR execution reliably asynchronous

* fix: harden OCR portability and docs routes

* fix: preserve decoder and docs safeguards
This commit is contained in:
SnapOtter
2026-07-15 03:34:24 +08:00
committed by GitHub
parent 58121f205f
commit 991c981529
409 changed files with 67151 additions and 8076 deletions
+9
View File
@@ -59,6 +59,15 @@ describe("missingBundleForScript", () => {
expect(missingBundleForScript("unknown_script")).toBeNull();
});
it("does not gate built-in OCR through the legacy shared environment", () => {
setInstalled([]);
expect(SCRIPT_BUNDLE_MAP).not.toHaveProperty("ocr");
expect(SCRIPT_BUNDLE_MAP).not.toHaveProperty("ocr_pdf");
expect(missingBundleForScript("ocr")).toBeNull();
expect(missingBundleForScript("ocr_pdf.py")).toBeNull();
});
it("fails closed when installed.json is missing", () => {
// No setInstalled(): the file does not exist. Like the dispatcher, an
// unreadable installed.json reads as "nothing installed", so a gated