HaPitaron source release - 2026-10-11

First-party website code and the PDF integration are released under
GNU Affero General Public License version 3 or later (AGPL-3.0-or-later).
See LICENSE. Third-party code, fonts, and icons retain their original licenses.
No warranty is provided.

Deployment:
Upload the contents of public_html to a PHP/Apache HTTPS web root.
The existing .htaccess supplies routes and JavaScript/WebAssembly MIME types.
No Node, Python, paid API, PDF server, or build step is needed in production.
The benefits catalog additionally uses local PHP and private JSON data;
see BENEFITS-SETUP.txt for deployment and optional scheduled collection.
MuPDF is lazy-loaded in a module worker only for editing/unlocking PDFs.
Serve .mjs as application/javascript and .wasm as application/wasm.
Keep /source.html and /source/hapitron-source.zip available to users.
Regenerate the source archive whenever website code changes:
powershell -File scripts/package-source.ps1

Vendored MuPDF.js:
Version: 1.28.1 (unmodified npm package mupdf@1.28.1).
License: AGPL-3.0-or-later; copyright Artifex Software, Inc.
Package SHA-1: c66d2714bafa1f5c14e076504ed43d5e07bbb3e7
Upstream corresponding source:
https://github.com/ArtifexSoftware/mupdf/tree/1.28.1
WASM source/build instructions:
https://github.com/ArtifexSoftware/mupdf/tree/1.28.1/platform/wasm
Retrieve the tag and recursive submodules to build from source; follow the
upstream platform/wasm README and BUILDING instructions for Emscripten.
The package's source headers and full license are preserved under
public_html/assets/vendor/mupdf.

Verification (Node 22+):
node --test tests/pdf-engine.test.mjs tests/repeated-questions.test.cjs

With Playwright installed and Google Chrome available:
node tests/pdf-browser.cjs
The audit tests document unresolved repeated-question defects; passing them
means the defects were reproduced, NOT that the analyzer is correct.

Behavior and limits:
- Region redaction deletes page text, covered image pixels and touched vector
  graphics, then rewrites the PDF with garbage collection (not incremental).
- Text search outside redactions, outside links and standard AcroForm fields
  are preserved. A selected field with multiple widgets is removed entirely.
- Redaction removes metadata, attachments, thumbnails, bookmarks, structure
  tags and XFA copies. Digital signatures cannot remain valid after editing.
- Geometry is measured separately for each displayed page, including rotation
  and cropping. Tiny boundary intersections may remove a whole glyph/path.
- Copies of the same content visibly present elsewhere must also be selected.
- The input file is never overwritten; previous downloaded versions remain.
- Unlocking supports PDFs readable with an empty opening password. It removes
  permission restrictions. It does not guess passwords or break encryption.
- No guarantee is made for every malformed or unusual PDF. Review the output.

Pending separately authorized work:
Repeated-question analyzer fixes, OCR, password creation, and URL-to-PDF.
