fix: index Word, PowerPoint and text files that never got a PDF rendition
The passage indexer read every document through its PDF rendition, falling back to the original file when there was none - but then still parsed those original bytes as a PDF. A Word file whose LibreOffice conversion had failed at upload therefore failed to index with "Invalid PDF structure". Found while indexing existing documents: three real .docx letters failed this way. versionText now reads the PDF rendition when one exists (it carries page numbers), and otherwise reads the original with a reader that suits its type - mammoth for Word, the slide reader for PowerPoint, the sheet reader for a spreadsheet, plain text for a text file - and never parses non-PDF bytes as a PDF. A Word file with no rendition indexes without page numbers, which is correct: a Word document reflows and has no fixed pages. Verified on the live server: the three failed letters now index (5, 3 and 5 passages of clean text), and the full backfill finished with 52 documents and 412 passages, 0 failures. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PoCRDAPyEq4wwBVFFbDzck
| Repository | wardethan2000-eng/mike |
|---|---|
| Author | Ethan Ward <ethanward321@hotmail.com> |
| Authored | |
| Parents | 6f4d2edf |
| Stats | 1 file changed , +37 , -16 |
| Part of | Matter-wide document search and grounded answers |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-dc4ed269.md
from inside the repo you want the change in.