Skip to content

🐜 Recover interrupted PDF enhancement and preserve paragraphs and tables on copy - #235

Merged
JFWooten4 merged 17 commits into
mainfrom
supernova-zap
Nov 28, 2026
Merged

JFWooten4 merged 17 commits into
mainfrom
supernova-zap

Conversation

@kefania-pony

@kefania-pony kefania-pony Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Long AI-assisted OCR jobs can fail when Ollama stops responding, while copying text from an enhanced scan can introduce line breaks within paragraphs or flatten tabular data. This PR addresses both parts of the reading workflow.

  • Check the local Ollama service before starting OCR. Reuse a running service, attempt to launch the macOS app or ollama serve after a refused connection, and wait up to 20 seconds for readiness. Extend the persistent error notice introduced in 🐝 Preserve Enhance errors and fix MIME-handler return navigation #203 with a startup progress stage and a Download Ollama action when the installation is missing.
  • Integrate the retry and checkpoint protocol from 🐝 Resume interrupted AI OCR reviews and retry Ollama connections enhancer#15 so the native helper can attempt to restore Ollama during text review and resume interrupted work on a subsequent Enhance PDF request. Checkpoints are keyed by the input PDF's SHA-256 hash and pipeline version, retained on failure, and removed after a successful or cached result. Resuming OCR and completed page reviews requires a checkpoint-enabled Enhancer checkout.
  • Extend the paragraph reflow introduced in 🐛 Reflow tagged PDF paragraphs when copying #176 to use marked-content paragraph IDs when PDF.js omits Form XObject paragraphs from its structure tree. Join printed lines within each logical paragraph while retaining breaks between paragraphs in both plain-text and Markdown copy.
  • Serialize tagged tables as Markdown pipe tables, and recover tables from scans using positioned text and consistently aligned numeric columns. Join wrapped row labels, omit marked artifacts from geometric reconstruction, escape literal pipes, and retain surrounding captions and source text separately. The geometric fallback is heuristic and does not repair misrecognized OCR text.

Add regression coverage for Ollama startup and reconnect handling, missing-installation errors, Form XObject paragraph reflow, and tagged and geometrically inferred tables. The scan-table fixture includes the DTC historical data that motivated the change.

🔗 Source

Online · Local · Desktop

JFWooten4 and others added 17 commits November 28, 2026 05:36
Provide the newly required PDF text structure helper in the isolated renderPageNow test context and verify that the text layer and marked content are passed through without changing production rendering.

Co-authored-by: ChatGPT 6.2 <[email protected]>
Preserve the branch's Ollama download action and all enhancement and copy changes while incorporating the independent summary artwork replacement and updated credits from main.

Co-authored-by: ChatGPT 6.2 <[email protected]>
Resolve overlapping enhancer changes in favor of checkpoint recovery and retain model selection and dehyphenation from main. Isolate both cached outputs and recovery checkpoints by selected models, preserve Ollama startup and installation guidance, and combine the regression fixtures.

Co-authored-by: ChatGPT 6.2 <[email protected]>
@JFWooten4
JFWooten4 merged commit b7374da into main Nov 28, 2026
14 checks passed
@JFWooten4
JFWooten4 deleted the supernova-zap branch November 28, 2026 16:53
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