Skip to content

Add bounded EPUB reading with local terminal I/O - #109

Merged
m1ngsama merged 4 commits into
mainfrom
agent/epub-reader
Aug 31, 2026
Merged

m1ngsama merged 4 commits into
mainfrom
agent/epub-reader

Conversation

@m1ngsama

Copy link
Copy Markdown
Owner

Summary

  • Add bounded EPUB 2 and EPUB 3 reading for DRM-free, reflowable books.
  • Project only the linear spine into inert UTF-8 text, with book layout and section navigation.
  • Replace Crossterm and its maintenance fork with a small in-tree Unix terminal adapter.
  • Remove recurring security-audit runs while keeping pull request, main-branch push, and manual triggers.

Why

TUT is meant to stay focused and lightweight. The former Crossterm fork carried terminal behavior that was specific to this project. The new adapter implements only the raw mode, keyboard input, resize, ANSI output, and restoration behavior that TUT needs.

The locked dependency graph drops from 99 packages to 84 packages, even after adding EPUB support.

Safety and limits

EPUB input keeps explicit limits for archive size, entry count, expanded data, linear-spine data, projected text, XML depth, metadata, and section indexes. Terminal input is bounded to 64 KiB per incomplete sequence and incomplete sequences time out.

The reader does not execute scripts or fetch remote resources. It ignores CSS layout, fixed-layout pages, embedded fonts, bitmap rendering, DRM, and link activation.

Validation

  • Current Rust: formatting, strict Clippy, and all-target tests
  • Rust 1.88.0: strict Clippy and all-target tests
  • Release tests with overflow checks enabled
  • Bounded memory and PTY stress checks
  • Exact 64 KiB terminal-sequence boundary tests
  • RustSec audit of the locked dependencies
  • GitHub Actions and man-page lint
  • Distribution package build, unpacked tests, install check, and uninstall check

Project EPUB 2 and EPUB 3 linear spines into bounded UTF-8 text, then add book layout and section navigation.

Replace the Crossterm maintenance fork with a small in-tree Unix adapter for raw mode, bounded input parsing, ANSI output, resize handling, and reliable terminal restoration.
Run the RustSec audit for pull requests, main-branch pushes, and explicit manual requests only. Add a documentation contract test so recurring workflow triggers are not reintroduced accidentally.
Use the standard integer multiple check when rounding sub-millisecond poll durations. This keeps the Linux implementation warning-free on Rust 1.97 while remaining compatible with Rust 1.88.
@m1ngsama
m1ngsama merged commit 05961a2 into main Aug 31, 2026
4 checks passed
@m1ngsama
m1ngsama deleted the agent/epub-reader branch August 31, 2026 08:37
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.

1 participant