Skip to content

feat(reader): private bounded EPUB 2/3 XHTML ingestion - #296

Merged
andy-zen-dev merged 14 commits into
masterfrom
scrip-ingest-epub-local-v1
Oct 23, 2026
Merged

andy-zen-dev merged 14 commits into
masterfrom
scrip-ingest-epub-local-v1

Conversation

@andy-zen-dev

Copy link
Copy Markdown
Collaborator

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.json records 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.py parses 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.

@andy-zen-dev
andy-zen-dev merged commit e60738b into master Oct 23, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt the deferred private EPUB ingestion prototype into the canonical Reader

1 participant