openspec: pdf-anonymisation-discovery research#1591
Open
rjzondervan wants to merge 1 commit into
Open
Conversation
Discovery doc capturing the design analysis for anonymising PDF inputs in OpenRegister's DocumentProcessingHandler. Status: research, not yet a change. Exists to be reviewed by the team before scaffolding a real change, because the FOSS-PHP-native space for PDF text replacement is narrow enough to warrant collective agreement on trade-offs first. Documents the hard constraints (no PII leakage, identifiable placeholders, layout preservation, FOSS-only, no sidecars), the considered approaches (8 paths A-H), and a recommended two-tier architecture: Path A primary via ddn/sapp byte-replace with Helvetica fallback and multi-encoding stream filter support; Path B fallback via NC Office API ODT round-trip. Includes detailed work breakdown, open questions for team review (Q1-Q6), and a proposed empirical spike before commitment.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| composer | ✅ | ✅ 162/162 | |||
| npm | ✅ | ✅ 602/602 | |||
| PHPUnit | ✅ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-05-19 09:31 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What's in this PR
One file:
openspec/changes/pdf-anonymisation-discovery/discovery.md(~600 lines).Structure:
Why this isn't a change yet
The FOSS-PHP-native space for true PDF text replacement is narrow. Setasign's SetaPDF-Redactor exists commercially because nobody filled it in OSS. The recommended path uses
ddn/sapp(LGPL-3.0-or-later) as a structural substrate + custom encoding/CMap/replacement-injection layers we'd build on top.That's ~4-5 weeks of engineering for Path A + ~1-2 weeks for Path B. Worth doing IF the team agrees on the trade-offs before commitment. Discovery doc exists so we can have that conversation against a written artifact rather than ad-hoc.
Composition
References:
office-document-sanitization(openspec: office-document-sanitization scaffolding #1589) andtext-extraction-office-completeness(openspec: text-extraction-office-completeness scaffolding #1590) — Path B fallback reuses both.anonymise-output-as-pdf-by-default(DocuDesk) andocr-document-scanning(DocuDesk) — Path B output and scan-PDF preprocessing.Status
For team review. After review and decisions on Q1-Q6:
Test plan
[<TYPE>: <id>]or switch to subset-safe)