@zilijonas/foliark 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/COMMERCIAL-LICENSING.md +33 -0
  2. package/LICENSE +235 -0
  3. package/LICENSE_FOXIT +27 -0
  4. package/LICENSING.md +55 -0
  5. package/NOTICE +14 -0
  6. package/README.md +130 -2
  7. package/SUPPORT_MATRIX.md +126 -0
  8. package/THIRD_PARTY_NOTICES.md +3603 -0
  9. package/cmaps/83pv-RKSJ-H.cmap +312 -0
  10. package/cmaps/90ms-RKSJ-H.cmap +257 -0
  11. package/cmaps/90ms-RKSJ-V.cmap +154 -0
  12. package/cmaps/90msp-RKSJ-H.cmap +255 -0
  13. package/cmaps/90msp-RKSJ-V.cmap +153 -0
  14. package/cmaps/90pv-RKSJ-H.cmap +353 -0
  15. package/cmaps/Add-RKSJ-H.cmap +736 -0
  16. package/cmaps/Add-RKSJ-V.cmap +133 -0
  17. package/cmaps/Adobe-CNS1-UCS2.cmap +18303 -0
  18. package/cmaps/Adobe-GB1-UCS2.cmap +14268 -0
  19. package/cmaps/Adobe-Japan1-UCS2.cmap +19160 -0
  20. package/cmaps/Adobe-Korea1-UCS2.cmap +9265 -0
  21. package/cmaps/B5pc-H.cmap +335 -0
  22. package/cmaps/B5pc-V.cmap +88 -0
  23. package/cmaps/CNS-EUC-H.cmap +488 -0
  24. package/cmaps/CNS-EUC-V.cmap +536 -0
  25. package/cmaps/ETen-B5-H.cmap +341 -0
  26. package/cmaps/ETen-B5-V.cmap +89 -0
  27. package/cmaps/ETenms-B5-H.cmap +77 -0
  28. package/cmaps/ETenms-B5-V.cmap +97 -0
  29. package/cmaps/EUC-H.cmap +205 -0
  30. package/cmaps/EUC-V.cmap +103 -0
  31. package/cmaps/Ext-RKSJ-H.cmap +766 -0
  32. package/cmaps/Ext-RKSJ-V.cmap +115 -0
  33. package/cmaps/GB-EUC-H.cmap +171 -0
  34. package/cmaps/GB-EUC-V.cmap +96 -0
  35. package/cmaps/GBK-EUC-H.cmap +4271 -0
  36. package/cmaps/GBK-EUC-V.cmap +95 -0
  37. package/cmaps/GBK2K-H.cmap +5517 -0
  38. package/cmaps/GBK2K-V.cmap +116 -0
  39. package/cmaps/GBKp-EUC-H.cmap +4270 -0
  40. package/cmaps/GBKp-EUC-V.cmap +95 -0
  41. package/cmaps/GBpc-EUC-H.cmap +173 -0
  42. package/cmaps/GBpc-EUC-V.cmap +96 -0
  43. package/cmaps/H.cmap +198 -0
  44. package/cmaps/HKscs-B5-H.cmap +1329 -0
  45. package/cmaps/HKscs-B5-V.cmap +88 -0
  46. package/cmaps/KSC-EUC-H.cmap +560 -0
  47. package/cmaps/KSC-EUC-V.cmap +92 -0
  48. package/cmaps/KSCms-UHC-H.cmap +774 -0
  49. package/cmaps/KSCms-UHC-HW-H.cmap +773 -0
  50. package/cmaps/KSCms-UHC-HW-V.cmap +91 -0
  51. package/cmaps/KSCms-UHC-V.cmap +92 -0
  52. package/cmaps/KSCpc-EUC-H.cmap +606 -0
  53. package/cmaps/LICENSE.txt +28 -0
  54. package/cmaps/MANIFEST.json +258 -0
  55. package/cmaps/UniCNS-UCS2-H.cmap +16990 -0
  56. package/cmaps/UniCNS-UCS2-V.cmap +88 -0
  57. package/cmaps/UniCNS-UTF16-H.cmap +19146 -0
  58. package/cmaps/UniCNS-UTF16-V.cmap +92 -0
  59. package/cmaps/UniGB-UCS2-H.cmap +14319 -0
  60. package/cmaps/UniGB-UCS2-V.cmap +99 -0
  61. package/cmaps/UniGB-UTF16-H.cmap +14567 -0
  62. package/cmaps/UniGB-UTF16-V.cmap +102 -0
  63. package/cmaps/UniJIS-UCS2-H.cmap +8868 -0
  64. package/cmaps/UniJIS-UCS2-HW-H.cmap +79 -0
  65. package/cmaps/UniJIS-UCS2-HW-V.cmap +277 -0
  66. package/cmaps/UniJIS-UCS2-V.cmap +273 -0
  67. package/cmaps/UniJIS-UTF16-H.cmap +14483 -0
  68. package/cmaps/UniJIS-UTF16-V.cmap +305 -0
  69. package/cmaps/UniKS-UCS2-H.cmap +8723 -0
  70. package/cmaps/UniKS-UCS2-V.cmap +93 -0
  71. package/cmaps/UniKS-UTF16-H.cmap +8893 -0
  72. package/cmaps/UniKS-UTF16-V.cmap +97 -0
  73. package/cmaps/V.cmap +103 -0
  74. package/dist/client.d.ts +48 -0
  75. package/dist/client.js +200 -0
  76. package/dist/document.d.ts +100 -0
  77. package/dist/document.js +108 -0
  78. package/dist/generated/AnnotationPolicy.d.ts +1 -0
  79. package/dist/generated/AnnotationPolicy.js +2 -0
  80. package/dist/generated/Capabilities.d.ts +9 -0
  81. package/dist/generated/Capabilities.js +1 -0
  82. package/dist/generated/Capability.d.ts +9 -0
  83. package/dist/generated/Capability.js +1 -0
  84. package/dist/generated/CapabilityReason.d.ts +5 -0
  85. package/dist/generated/CapabilityReason.js +1 -0
  86. package/dist/generated/CapabilityStatus.d.ts +1 -0
  87. package/dist/generated/CapabilityStatus.js +2 -0
  88. package/dist/generated/ChangeResult.d.ts +12 -0
  89. package/dist/generated/ChangeResult.js +1 -0
  90. package/dist/generated/ChangeSet.d.ts +16 -0
  91. package/dist/generated/ChangeSet.js +1 -0
  92. package/dist/generated/Cluster.d.ts +12 -0
  93. package/dist/generated/Cluster.js +1 -0
  94. package/dist/generated/Collateral.d.ts +5 -0
  95. package/dist/generated/Collateral.js +1 -0
  96. package/dist/generated/Ctl.d.ts +3 -0
  97. package/dist/generated/Ctl.js +1 -0
  98. package/dist/generated/CtlCancel.d.ts +8 -0
  99. package/dist/generated/CtlCancel.js +1 -0
  100. package/dist/generated/CtlEvent.d.ts +1 -0
  101. package/dist/generated/CtlEvent.js +2 -0
  102. package/dist/generated/CtlEventMsg.d.ts +8 -0
  103. package/dist/generated/CtlEventMsg.js +1 -0
  104. package/dist/generated/DocumentFeatures.d.ts +13 -0
  105. package/dist/generated/DocumentFeatures.js +2 -0
  106. package/dist/generated/DocumentInfo.d.ts +12 -0
  107. package/dist/generated/DocumentInfo.js +1 -0
  108. package/dist/generated/EditLayout.d.ts +11 -0
  109. package/dist/generated/EditLayout.js +1 -0
  110. package/dist/generated/EditPreview.d.ts +35 -0
  111. package/dist/generated/EditPreview.js +1 -0
  112. package/dist/generated/EditorFace.d.ts +7 -0
  113. package/dist/generated/EditorFace.js +2 -0
  114. package/dist/generated/EditsReport.d.ts +4 -0
  115. package/dist/generated/EditsReport.js +2 -0
  116. package/dist/generated/ErrorCode.d.ts +4 -0
  117. package/dist/generated/ErrorCode.js +2 -0
  118. package/dist/generated/ErrorDetails.d.ts +20 -0
  119. package/dist/generated/ErrorDetails.js +2 -0
  120. package/dist/generated/ErrorWire.d.ts +11 -0
  121. package/dist/generated/ErrorWire.js +1 -0
  122. package/dist/generated/ExportMode.d.ts +1 -0
  123. package/dist/generated/ExportMode.js +2 -0
  124. package/dist/generated/ExportPlan.d.ts +13 -0
  125. package/dist/generated/ExportPlan.js +1 -0
  126. package/dist/generated/ExportPolicy.d.ts +13 -0
  127. package/dist/generated/ExportPolicy.js +1 -0
  128. package/dist/generated/ExportReport.d.ts +20 -0
  129. package/dist/generated/ExportReport.js +1 -0
  130. package/dist/generated/ExtractOptions.d.ts +7 -0
  131. package/dist/generated/ExtractOptions.js +2 -0
  132. package/dist/generated/Flattened.d.ts +5 -0
  133. package/dist/generated/Flattened.js +2 -0
  134. package/dist/generated/FoliarkError.d.ts +10 -0
  135. package/dist/generated/FoliarkError.js +1 -0
  136. package/dist/generated/FontMatchRule.d.ts +7 -0
  137. package/dist/generated/FontMatchRule.js +2 -0
  138. package/dist/generated/FontResolution.d.ts +12 -0
  139. package/dist/generated/FontResolution.js +1 -0
  140. package/dist/generated/FontRule.d.ts +1 -0
  141. package/dist/generated/FontRule.js +2 -0
  142. package/dist/generated/FontSource.d.ts +10 -0
  143. package/dist/generated/FontSource.js +1 -0
  144. package/dist/generated/FontStyle.d.ts +1 -0
  145. package/dist/generated/FontStyle.js +2 -0
  146. package/dist/generated/GeneratedOrigin.d.ts +4 -0
  147. package/dist/generated/GeneratedOrigin.js +2 -0
  148. package/dist/generated/Hit.d.ts +7 -0
  149. package/dist/generated/Hit.js +1 -0
  150. package/dist/generated/InstancePath.d.ts +5 -0
  151. package/dist/generated/InstancePath.js +1 -0
  152. package/dist/generated/InstanceStep.d.ts +9 -0
  153. package/dist/generated/InstanceStep.js +1 -0
  154. package/dist/generated/InvisibleTextPolicy.d.ts +1 -0
  155. package/dist/generated/InvisibleTextPolicy.js +2 -0
  156. package/dist/generated/KeptReport.d.ts +4 -0
  157. package/dist/generated/KeptReport.js +2 -0
  158. package/dist/generated/LayoutRun.d.ts +6 -0
  159. package/dist/generated/LayoutRun.js +1 -0
  160. package/dist/generated/Limits.d.ts +18 -0
  161. package/dist/generated/Limits.js +2 -0
  162. package/dist/generated/Loss.d.ts +6 -0
  163. package/dist/generated/Loss.js +1 -0
  164. package/dist/generated/LossCode.d.ts +1 -0
  165. package/dist/generated/LossCode.js +2 -0
  166. package/dist/generated/Matrix.d.ts +4 -0
  167. package/dist/generated/Matrix.js +2 -0
  168. package/dist/generated/ObjectId.d.ts +10 -0
  169. package/dist/generated/ObjectId.js +2 -0
  170. package/dist/generated/OkFalse.d.ts +1 -0
  171. package/dist/generated/OkFalse.js +2 -0
  172. package/dist/generated/OkTrue.d.ts +1 -0
  173. package/dist/generated/OkTrue.js +2 -0
  174. package/dist/generated/OpName.d.ts +4 -0
  175. package/dist/generated/OpName.js +2 -0
  176. package/dist/generated/Origin.d.ts +12 -0
  177. package/dist/generated/Origin.js +1 -0
  178. package/dist/generated/PageGeometry.d.ts +24 -0
  179. package/dist/generated/PageGeometry.js +1 -0
  180. package/dist/generated/ParagraphInfo.d.ts +26 -0
  181. package/dist/generated/ParagraphInfo.js +1 -0
  182. package/dist/generated/Phase.d.ts +1 -0
  183. package/dist/generated/Phase.js +2 -0
  184. package/dist/generated/Point.d.ts +4 -0
  185. package/dist/generated/Point.js +2 -0
  186. package/dist/generated/PreviewGlyph.d.ts +13 -0
  187. package/dist/generated/PreviewGlyph.js +2 -0
  188. package/dist/generated/PreviewLine.d.ts +10 -0
  189. package/dist/generated/PreviewLine.js +2 -0
  190. package/dist/generated/Prog.d.ts +7 -0
  191. package/dist/generated/Prog.js +1 -0
  192. package/dist/generated/Progress.d.ts +6 -0
  193. package/dist/generated/Progress.js +1 -0
  194. package/dist/generated/Quad.d.ts +5 -0
  195. package/dist/generated/Quad.js +1 -0
  196. package/dist/generated/RasterPolicy.d.ts +4 -0
  197. package/dist/generated/RasterPolicy.js +2 -0
  198. package/dist/generated/Rect.d.ts +9 -0
  199. package/dist/generated/Rect.js +2 -0
  200. package/dist/generated/Redaction.d.ts +18 -0
  201. package/dist/generated/Redaction.js +1 -0
  202. package/dist/generated/RedactionReport.d.ts +16 -0
  203. package/dist/generated/RedactionReport.js +1 -0
  204. package/dist/generated/RegisteredFont.d.ts +9 -0
  205. package/dist/generated/RegisteredFont.js +1 -0
  206. package/dist/generated/RejectedChange.d.ts +7 -0
  207. package/dist/generated/RejectedChange.js +1 -0
  208. package/dist/generated/RenderWarning.d.ts +5 -0
  209. package/dist/generated/RenderWarning.js +1 -0
  210. package/dist/generated/RenderWarningCode.d.ts +1 -0
  211. package/dist/generated/RenderWarningCode.js +2 -0
  212. package/dist/generated/RenderedPageHeader.d.ts +17 -0
  213. package/dist/generated/RenderedPageHeader.js +1 -0
  214. package/dist/generated/Req.d.ts +13 -0
  215. package/dist/generated/Req.js +1 -0
  216. package/dist/generated/Res.d.ts +3 -0
  217. package/dist/generated/Res.js +1 -0
  218. package/dist/generated/ResErr.d.ts +9 -0
  219. package/dist/generated/ResErr.js +1 -0
  220. package/dist/generated/ResOk.d.ts +8 -0
  221. package/dist/generated/ResOk.js +1 -0
  222. package/dist/generated/RunSource.d.ts +1 -0
  223. package/dist/generated/RunSource.js +2 -0
  224. package/dist/generated/SanitizedItem.d.ts +1 -0
  225. package/dist/generated/SanitizedItem.js +2 -0
  226. package/dist/generated/SearchHit.d.ts +13 -0
  227. package/dist/generated/SearchHit.js +1 -0
  228. package/dist/generated/SearchOptions.d.ts +10 -0
  229. package/dist/generated/SearchOptions.js +2 -0
  230. package/dist/generated/SharedKind.d.ts +1 -0
  231. package/dist/generated/SharedKind.js +2 -0
  232. package/dist/generated/SharedSurvivor.d.ts +6 -0
  233. package/dist/generated/SharedSurvivor.js +1 -0
  234. package/dist/generated/SignedInputPolicy.d.ts +1 -0
  235. package/dist/generated/SignedInputPolicy.js +2 -0
  236. package/dist/generated/SourceLoc.d.ts +9 -0
  237. package/dist/generated/SourceLoc.js +1 -0
  238. package/dist/generated/StyleFlags.d.ts +6 -0
  239. package/dist/generated/StyleFlags.js +2 -0
  240. package/dist/generated/StyleRun.d.ts +18 -0
  241. package/dist/generated/StyleRun.js +1 -0
  242. package/dist/generated/TextEdit.d.ts +11 -0
  243. package/dist/generated/TextEdit.js +1 -0
  244. package/dist/generated/TextPage.d.ts +17 -0
  245. package/dist/generated/TextPage.js +1 -0
  246. package/dist/generated/TextRange.d.ts +11 -0
  247. package/dist/generated/TextRange.js +1 -0
  248. package/dist/generated/TextStats.d.ts +9 -0
  249. package/dist/generated/TextStats.js +2 -0
  250. package/dist/generated/V1.d.ts +1 -0
  251. package/dist/generated/V1.js +2 -0
  252. package/dist/generated/Word.d.ts +27 -0
  253. package/dist/generated/Word.js +1 -0
  254. package/dist/generated/WordSource.d.ts +1 -0
  255. package/dist/generated/WordSource.js +2 -0
  256. package/dist/index.d.ts +42 -0
  257. package/dist/index.js +3 -0
  258. package/dist/inline.d.ts +18 -0
  259. package/dist/inline.js +33 -0
  260. package/dist/layout.d.ts +5 -0
  261. package/dist/layout.js +3 -0
  262. package/dist/lifecycle.d.ts +7 -0
  263. package/dist/lifecycle.js +28 -0
  264. package/dist/protocol.d.ts +162 -0
  265. package/dist/protocol.js +302 -0
  266. package/dist/worker-core.d.ts +15 -0
  267. package/dist/worker-core.js +244 -0
  268. package/dist/worker-supervisor.d.ts +23 -0
  269. package/dist/worker-supervisor.js +41 -0
  270. package/dist/worker.d.ts +1 -0
  271. package/dist/worker.js +9 -0
  272. package/package.json +77 -3
  273. package/wasm/foliark_wasm.d.ts +120 -0
  274. package/wasm/foliark_wasm.js +1050 -0
  275. package/wasm/foliark_wasm_bg.wasm +0 -0
  276. package/wasm/foliark_wasm_bg.wasm.d.ts +32 -0
@@ -0,0 +1,126 @@
1
+ # Foliark support matrix and regression budgets (NEW-65)
2
+
3
+ Frozen 2026-10-22 for `@zilijonas/foliark` 0.1.0 (public release candidate, AGPL-3.0-only) from receipts already in this repository. Nothing here is a new claim: each row names the
4
+ document or test that produced it. Machine-readable budgets: `tools/bench/budgets.json`, checked by `tools/bench/check-budgets.mjs`.
5
+
6
+ Words used with one meaning:
7
+ - **supported**: exercised by the cited receipt on the cited corpus. It says nothing about files outside that corpus.
8
+ - **refused (CODE)**: the engine returns that typed `FoliarkError` and produces no output (spec 0.1). Not a bug; the caller decides what to do.
9
+ - **not proven**: no receipt covers it. It may work. Do not rely on it.
10
+ - **not established**: needs a device or access this project does not have. Treated as unsupported until measured.
11
+
12
+ ## 1. Browsers and devices
13
+
14
+ | Target | Status | Evidence | Gaps |
15
+ |---|---|---|---|
16
+ | Chromium 151.0.7922.34, desktop, macOS arm64 (Playwright headless) | supported | perf budgets (section 5); `pnpm smoke chromium`; `tests/package-consumers/run.sh` (Vite, esbuild, no bundler, at `/` and `/app/`); `tests/browser/run.sh` (CSP, offline, full flow) | one machine (Apple M4, 24 GB) |
17
+ | WebKit 26.5, desktop engine (Playwright) | supported as an engine, **not as Safari** | perf budgets (section 5); `pnpm smoke webkit`; `tests/browser/run.sh` | Playwright WebKit is not Safari evidence. Under Playwright, `page.reload()` while offline with a service worker fails, so the offline spec stops the origin instead (`docs/deployment.md`) |
18
+ | Firefox 153.0, desktop (Playwright) | functional only | `tests/browser/run.sh`: CSP policy, prepared offline, only-own-origin requests, missing-asset errors, full open/extract/render/redact/export flow | no perf numbers, no budgets, no `pnpm smoke firefox`, package consumers run in chromium only |
19
+ | Safari on macOS (real) | not established | none | needs a real Safari run |
20
+ | Safari on iPhone and iPad (real devices) | **not established, pending NEW-64 (owner device access NEW-22)** | none. No iOS Simulator on the build Mac | memory ceiling, worker lifetime, wasm limits on iOS are unknown; mobile default `Limits` stay undecided (spec 17.4) |
21
+ | Chrome on Android (real device) | **not established, pending NEW-64 (owner device access NEW-22)** | none. No Android emulator on the build Mac | same as above |
22
+ | Windows, Linux, other Chromium-based browsers | not established | none | |
23
+ | Browser version floors | not measured | only the versions above were run | The wasm needs SIMD, bulk memory, sign extension, mutable globals, reference types and multivalue (`scripts/build-wasm.sh`). No older browser was tested, so no minimum version is promised |
24
+
25
+ Host requirements, each tested in the browser specs: static files only, `application/wasm`, CSP `script-src 'self' 'wasm-unsafe-eval'; worker-src 'self'`
26
+ (without `'wasm-unsafe-eval'` init fails `ASSET_LOAD_FAILED`), no COOP/COEP, no SharedArrayBuffer, no network after the files are cached. Details: `docs/deployment.md`.
27
+
28
+ ## 2. Features
29
+
30
+ | Feature | Status | Evidence | Typed refusals and warnings | Not proven |
31
+ |---|---|---|---|---|
32
+ | Open | supported | 35 manifest fixtures: 25 open and round-trip, 8 refused, `docs/evidence/native-roundtrip.md` | `MALFORMED_PDF`, `REPAIRED_PDF` (unless `allowRepaired`), `DECODE_FAILED`, `LIMIT_EXCEEDED`, `PASSWORD_REQUIRED`, `PASSWORD_INCORRECT`, `ENCRYPTION_UNSUPPORTED` | files unlike the synthetic corpus |
33
+ | Encrypted input | supported: RC4-40/128, AES-128/256 with the password; output is never encrypted | `native-roundtrip.md`, `strict-native.md` (4 encrypted fixtures) | `PASSWORD_*`, `ENCRYPTION_UNSUPPORTED` for unknown handlers | encrypted raster fidelity (5 fixtures judged by `objects.py` only) |
34
+ | Extract text | supported | HDDN parity: 21 fixtures against PyMuPDF 1.26.5, equal text, offsets, keys, worst box deviation 0.211 pt (spec allows 0.75), `docs/integration/hddn-adapter.md` | none beyond open | CID fonts without ToUnicode, vertical and RTL text |
35
+ | Search, hit test, select | supported on the multi-column Unicode fixture (diacritic folding, column drag stays on its line) | `hddn-adapter.md` (NEW-67) | `INVALID_ARGUMENT` | regex and hyphenation-aware search are absent by design (spec 16); not wired into HDDN's UI |
36
+ | Render | supported with warnings | `native-roundtrip.md` (0 channel values off by more than 2/255 between input and output renders); reduced vs exact decode max diff 1 (`docs/performance/comparison.md`) | warnings `FONT_SUBSTITUTED`, `IMAGE_DECODE_FAILED`, `ANNOTATION_APPEARANCE_MISSING`, `CMAP_MISSING` (page is `complete:false`); `LIMIT_EXCEEDED` over `maxRenderPixels` | pixel accuracy against a second renderer on real documents (PyMuPDF differs by mean 0.02 to 3.1 levels on the scan fixtures) |
37
+ | Predefined CMaps (legacy CJK encodings) | supported (pack in the package) | `cmaps/` 63 Adobe files; fixture `generated/cjk-predefined-cmaps.pdf`: extract equals PyMuPDF, render has no `CMAP_MISSING`, redaction + native export judged by `objects.py`/PyMuPDF (`crates/foliark-engine/tests/cmaps.rs`), packed-package browser specs in 3 engines (`tests/browser/cmaps.spec.ts`) | `ASSET_LOAD_FAILED` at `open` for a missing or corrupt pack file; `CMAP_MISSING` for a name outside the predefined set; the pack must be served or copied by the caller (`docs/deployment.md`) | text redaction/edit on mixed-length encodings (RKSJ, EUC, UTF16): `FONT_UNSUPPORTED`; CJK glyphs of a non-embedded font are drawn missing |
38
+ | Paragraph edit | supported for horizontal, unrotated, left-to-right text in a registered or reusable font | `docs/adr/0003`, `0004`, `0005`; acceptance scenario E over 80 cases; HDDN adapter NEW-68 | `EDIT_NO_FONT`, `EDIT_NO_FIT`, `EDIT_NO_STYLE`, `EDIT_UNSUPPORTED_SCRIPT` (non-BMP, RTL), `EDIT_ROTATED_TEXT`, `FONT_UNSUPPORTED`, `STALE_REVISION` | CFF/Type1 embedded faces, RTL, CJK, vertical, auto-fit (spec 16) |
39
+ | Native export (sanitized rewrite) | supported | `strict-native.md`: 39 fixtures, 31 supported + 8 refused, 0 skipped, independent oracles, negative controls caught; acceptance 80 cases x 6 scenarios | `FORM_APPEARANCE_MISSING`, `XFA_UNSUPPORTED`, `OPTIONAL_CONTENT_UNSUPPORTED`, `SIGNED_INPUT` (policy `refuse`), `REDACT_*`, `STALE_PLAN`, `PLAN_CONSUMED` | what sections 3 and 4 list |
40
+ | Raster export (image-only, redactions burned in) | supported; needs `policy.raster.acknowledgeLosses` | acceptance: 143 SAFE + 17 refused raster results; `comparison.md` (30 pages, 10 regions, 0 words in the regions) | `CONSENT_REQUIRED`, `RENDER_INCOMPLETE {pages}` (3 acceptance cases, annotation-comment pinned by NEW-56) | encrypted raster fidelity; edge pixels touching a region are checked with a 0.26 pt inset |
41
+ | Cancellation | supported before an operation starts; results of aborted operations are atomic | acceptance: 27 attempts, finals byte-equal to a clean run | `CANCELLED` | abort while an operation runs through the packed SDK (only 3 pre-aborted attempts ended `CANCELLED`) |
42
+ | Worker recovery | supported | `docs/deployment.md`, smoke hang test (120 MB page, watchdog resets the worker) | `WORKER_RESET`, `DOCUMENT_GONE`, `OUT_OF_MEMORY` | real out-of-memory on a phone |
43
+
44
+ ## 3. Native redaction by content class
45
+
46
+ Native export is: edits, flatten, redact, sanitize, rewrite, verify (spec 5). "Supported" means the independent oracles found no leftover and no collateral outside the declared regions on the cited corpus.
47
+
48
+ | Content under a region | Status | Evidence | Typed refusal or disclosure |
49
+ |---|---|---|---|
50
+ | Text: visible, invisible (Tr 3/7), Type3, inside Forms, flattened annotations and widgets | supported | `strict-native.md` (secret in every `mustRemove` string removed from bytes, streams and both extractors); acceptance cases tj-kerning, split-ops, hex-escaped, quote-ops, render-modes, ligature, rotated-text-30, type3-glyphs, form-both-places | none |
51
+ | Text inside a tiling-pattern cell | refused | acceptance case pattern-text-cell | `REDACT_PATTERN_UNSUPPORTED {pages}` (raster export of the same page works) |
52
+ | Images: DCT and Flate, XObject, inline, inside Forms, SMask | supported; re-encoded to 8-bit Flate | `strict-native.md` (mixed-regions, jpeg-payload-secret, ocr-over-image); acceptance image-inline, image-smask-only | `IMAGE_REENCODED`; shared images with untouched occurrences are cloned and listed in `sharedSurvivors` |
53
+ | Images: JPX, JBIG2, CCITT payloads | **not proven** (kept byte for byte when untouched, no control for redaction) | `strict-native.md`, `security-acceptance.md` | |
54
+ | Image inside a tiling-pattern cell | refused | acceptance case pattern-image-cell | `REDACT_PATTERN_UNSUPPORTED {pages}` |
55
+ | Vectors | supported: filled paths and clip outlines are cut precisely by region subtraction (nonzero and even-odd, holes, curves, any transform, nested clips); strokes are expanded (width, caps, joins, miters, dashes, non-uniform transforms), cut the same way and written as filled outlines in the stroking colour; a cut stroke needing an inherited or pattern stroking colour, `CA` != `ca`, or alpha under 1 in a `B` is refused | `strict-native.md` (shared-vector, mixed-regions); spec 5.4; ADR 0009 | `VECTOR_CUT_APPROXIMATED` (cut curves become 0.01 pt polylines; a cut stroke loses its dash, cap and join structure and viewers draw a cut hairline at its nominal width); `REDACT_VECTOR_UNSUPPORTED {feature, pages}`. Work caps: 250,000 vertices per group, 100,000 dashes, 131,072 pt coordinates |
56
+ | Form XObjects | supported: occurrences needing change are cloned, shared ones are never edited in place | form-reuse-matrices, form-both-places, shared-stream-pages | none |
57
+ | Soft-mask groups | refused | acceptance case smask-group-text | `INVALID_ARGUMENT {feature: redactionSoftMaskGroup}` (spec 5.3 plans support; raster export works) |
58
+ | Fonts touched by removal | TrueType glyphs emptied, ToUnicode rebuilt; **CFF and Type1 programs are kept** | `strict-native.md` (font-payload-secret); spec 5.6 | `FONT_GLYPH_INVENTORY_RETAINED`, names in `report.kept.fontsWithGlyphInventory`. Whether a retained CFF/Type1 inventory leaks removed glyph shapes is not proven |
59
+ | Hidden text: OCG-off, invisible, white-on-white, clipped out, covered | supported when under a region (default policy keeps invisible text elsewhere) | acceptance cases ocg-off-in-form, invisible-tr3, white-and-covered, clipped-text | occlusion-aware detection outside regions is absent (spec 16) |
60
+ | Unused fonts, Forms, images reachable from Resources | removed from every Resources dictionary | `docs/adr/0007-unused-resources.md`; acceptance unused-xobject, unused-font | `SanitizedItem unusedResources` |
61
+ | Verification | in-engine strict reparse plus zero re-extracted clusters in each region | spec 5.7; acceptance negative controls 109/109 caught | `REDACT_VERIFY_FAILED` (a bug guard; no fixture triggers it). It is not a privacy certificate |
62
+
63
+ ## 4. Sanitization classes (native export; raster export drops all by construction)
64
+
65
+ Each class is removed and reported, or refused. Evidence is `strict-native.md` (manifest, oracles `objects.py`, `fidelity.py`, PyMuPDF, pypdf, pikepdf) plus the acceptance matrix (41 adversarial cases) unless stated.
66
+
67
+ | Class | Status | Report |
68
+ |---|---|---|
69
+ | Info and XMP metadata, PieceInfo, private keys | supported (removed) | `METADATA_REMOVED` |
70
+ | Embedded files, /AF | supported (removed) | `ATTACHMENTS_REMOVED` |
71
+ | JavaScript, OpenAction, AA, all actions | supported (removed) | `SCRIPTS_REMOVED` |
72
+ | Annotations | supported (flatten with appearance, or remove) | `ANNOTATIONS_FLATTENED`, `ANNOTATIONS_REMOVED`, `LINKS_REMOVED` |
73
+ | AcroForm and widgets | supported (appearances flattened, values removed); a value without a usable appearance is refused | `FORMS_FLATTENED`; `FORM_APPEARANCE_MISSING {fields}`, `XFA_UNSUPPORTED` (engine tests `sanitize_interactive.rs`; no manifest fixture, no independent oracle) |
74
+ | Optional content | supported (default configuration flattened, `/VE` And/Not evaluated, hidden layers removed) | `LAYERS_FLATTENED`; `OPTIONAL_CONTENT_UNSUPPORTED` when visibility cannot be evaluated (no manifest fixture) |
75
+ | Thumbnails, outlines, page labels, structure tree, ActualText/Alt, output intents, viewer preferences | supported (removed) | `thumbnails`, `OUTLINES_REMOVED`, `PAGE_LABELS_REMOVED`, `ACCESSIBILITY_REMOVED`, `PDFA_CLAIM_REMOVED` |
76
+ | Prior revisions, orphan objects, trailing bytes, unreachable object-stream entries | supported (absent by construction) | none needed |
77
+ | Encryption | supported (decrypted, never re-encrypted) | `ENCRYPTION_REMOVED` |
78
+ | Signatures | stripped with disclosure, or refused by policy (engine tests `sanitize_interactive.rs`, `raster_plans.rs`; no independent oracle) | `SIGNATURES_INVALIDATED`; `SIGNED_INPUT` |
79
+ | Content outside the crop box | supported (removed) | `offPage` |
80
+ | Invisible text | kept by default (so detection sees it), `remove` by policy, `keepOcr` keeps only OCR over drawn images (ADR 0008) | `report.kept.invisibleTextClusters`, `removed.invisibleText` |
81
+
82
+ Not proven for sanitization: content inside an ICC profile's declared size, Type3 CharProcs drawing with other fonts, inline images in the image oracle, secrets that are not ASCII markers, files that are not like the 80 synthetic cases (`security-acceptance.md`, "Not proven").
83
+
84
+ ## 5. Measured cost (desktop, regression budgets)
85
+
86
+ Source: `tools/bench/sdk.mjs --extended` and `tools/bench/scans-sdk.mjs` on the build commit named in `budgets.json` (wasm sha256 in the file). Apple M4 24 GB, headless, localhost, identity encoding, other agents' jobs may have been running, so differences under about 10% are noise.
87
+ Medians in ms, best of the runs listed in `budgets.json`; "budget" is the frozen limit. The full list (76 timing and size budgets, both browsers) is in `budgets.json`.
88
+
89
+ | Operation (input) | Chromium measured / budget | WebKit measured / budget |
90
+ |---|---|---|
91
+ | wasm raw / gzip -9 | 5,567,725 B / 2,126,019 B (budget 5,846,112 / 2,232,320) | same file |
92
+ | cold init, bytes downloaded | 5,615,475 B (budget 5,896,249) | same |
93
+ | cold init (fresh profile) | 22 / 36 | 26.7 / 44 |
94
+ | warm init | 12.9 / 23 | 21.9 / 36 |
95
+ | open + extract + render@1.35 every page (30-page text file) | 223.7 / 339 | 235.9 / 357 |
96
+ | render@1.35 per page (30-page text file) | 4.2 / 10 | 4.8 / 11 |
97
+ | extract text, 30 pages | 32.5 / 52 | 37.3 / 59 |
98
+ | search (30 pages, 840 hits) | 10.3 / 19 | 13.8 / 24 |
99
+ | paragraph edit, prepare + apply | 5.6 + 65 / 12 + 101 | 6.2 + 63.3 / 13 + 98 |
100
+ | native export, 10 regions, 30 pages | 233 / 353 | 203.4 / 309 |
101
+ | raster export @2, 10 regions, 30 pages | 1,026.5 / 1,543 | 917.4 / 1,380 |
102
+ | image-heavy 6-page file: first render of a page / cached repeat | 110.2 / 169 and 2.2 / 7 | 98.9 / 152 and 2.7 / 8 |
103
+ | scanned 300 dpi A4, first render @1.35: JPEG baseline RGB / progressive RGB / JBIG2 / CCITT G4 / Flate gray | 41.6 / 80.7 / 21.3 / 6.9 / 16.6 | 42.7 / 87 / 24 / 8.1 / 16.9 |
104
+ | scanned page, repeat render @1.35 | 1.2 to 2.0 (budget 5 to 6) | 1.3 to 2.2 (budget 5 to 7) |
105
+ | wasm linear memory after all operations (30 pages) | 74,711,040 B (budget 93,388,800) | same |
106
+
107
+ How the budgets were set: each timing budget is `ceil(measured x 1.5 + 3 ms)`, each size budget `measured x 1.05`, memory `measured x 1.25`. The two chromium runs differed by at most 10% on medians above 5 ms, so 50%
108
+ headroom flags a real slowdown without tripping on a busy machine. `check-budgets.mjs` compares the best median across the fresh files you give it (rerun to isolate noise), exits 1 on any
109
+ regression and on any budgeted number that was not measured, and reports browsers without a fresh file as skipped. `tools/bench/check-budgets.test.mjs` proves it fails on an injected 2x slowdown and on injected wasm growth and passes on noise.
110
+ Whole-browser RSS is recorded in `docs/performance/comparison.json` but not budgeted (process tree, noisy; WebKit's value misses helper processes).
111
+
112
+ Known performance limits, from `docs/performance/comparison.md`: progressive-JPEG RGB scans at scale 1.35 are not faster than HDDN (80.7 ms vs 76 ms; entropy decoding dominates, no upstream scaled decode); the first draw of an image-heavy page costs about 100 ms;
113
+ a re-render within the 16 MiB per-document image cache is cheap, an evicted one is not. These numbers are from synthetic fixtures on one machine and say nothing about phones.
114
+
115
+ ## 6. Limits and what is not established
116
+
117
+ - Mobile: every iPhone, iPad and Android row above, mobile default `Limits`, memory ceilings and thermal behaviour: not established (NEW-64, NEW-22).
118
+ - Documents: the corpus is 80 small synthetic and HDDN cases (39 manifest fixtures plus 41 adversarial) and 7 synthetic scan fixtures. No real-world document set has been run, and the speed numbers are not a promise for large or unusual files.
119
+ - Default limits (`docs/spec/v1.md` section 9): 64 MiB input, 1000 pages, 50 Mpx per render, 256 MiB output, 4 open documents. Over a limit is `LIMIT_EXCEEDED` with no output.
120
+ - Independent proof used one PDF renderer (MuPDF) for pixels and PyMuPDF/pypdf/pikepdf for structure; none is a certificate that a redacted file is private.
121
+ - No universal speed or security claim is made. Comparisons with HDDN are in `docs/performance/comparison.md` with their caveats.
122
+
123
+ ## 7. Refreshing this file
124
+
125
+ When the engine or its dependencies change: rebuild (`scripts/build-wasm.sh`, `pnpm build:sdk`), rerun `node tools/bench/sdk.mjs --extended` and `node tools/bench/scans-sdk.mjs` per browser through the memory queue,
126
+ run `node tools/bench/check-budgets.mjs <files>`, and only after a deliberate decision regenerate the budgets with `--derive`. A new real device or browser becomes a row only with its own receipt.