Repository navigation
feat(reader): private bounded EPUB 2/3 XHTML ingestion - #296
Merged
Merged
Conversation
This was referenced Oct 23, 2026
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.
Closes #289.
User outcome. Import one local, unencrypted EPUB 2/3 with a standard OPF XHTML spine into the existing 29-metric Reader report/compare contract.
scriptorium epub book.epub --output analysis.json --provenance-output identity.jsonrecords separate immutable archive, extracted UTF-8 body and analyzer-normalized identities. No uploaded manuscripts, raw prose in reports, DRM bypass or external network/resource access.Implementation. New
scriptorium/epub.pyparses the ZIP, container, OPF and XHTML spine in reading order with bounded archive/member/expanded/body size and compression-ratio controls; rejects traversal, duplicate entries/IDs, encrypted/unsupported members, remote spine references, unsafe XML, missing chapters and malformed XHTML. Nonlinear and unreferenced resources are ignored. Existing analysis/rendering/create-only write primitives are reused. Reader CLI/help, README, standalone safety documentation and canonical queue updated.Verification. Four isolated parser regression tests passed locally with original synthetic UTF-8 EPUBs. A fifth test exercises real Reader JSON/HTML/CSV, private sidecar hashes and output non-overwrite; the full repository/wheel/hosted CI suite was NOT_RUN in the local environment (GitHub DNS unavailable to the execution container). Fresh exact-head Actions checks and installed-wheel exercise are mandatory at later-run acceptance. No same-run merge or self-approval.
Scientific/publishing gates. EPUB body projection is an explicitly versioned extension, not proof of FantLab source identity, edition or parity. M2 remains 0/5; no corpus admission, copyrighted full-book fixtures, external publication or Pages admin changes. No live visual verification.