Repository navigation
A page or slide of text names the pictures, charts and diagrams it does not read - #301
Merged
Merged
Conversation
zlareb1
force-pushed
the
fix/extractor-unread-images
branch
from
November 7, 2026 07:09
625160c to
149eca0
Compare
… never dropped in silence Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…tures, fills, charts Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…gain Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…, never listed as well Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…e unit, the docs say Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
fix/extractor-unread-images
branch
from
November 7, 2026 07:22
5171179 to
54f3119
Compare
…ys what it holds Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…trip its text fills is tested Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…what they hold Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
This was referenced Nov 7, 2026
Merged
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.
Related: #157
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
A PDF page or PPTX slide whose text is read but which shows a picture OCR does not read (one under a fifth of it, a picture fill or background), a chart, a diagram or an embedded object is now named in the artifact (
attrs.images_unread) and in one warning, and a DOCX of text with pictures, charts, diagrams or embedded objects warns; before, such a file reported complete coverage and said nothing about the text inside them.Why
Scoring the reference extractor on the parsing bench's corpus (
bench/docparse/corpus) found silent loss on decks: PPTX slides and PDF slide exports whose text the artifact holds but whose image text (a chart's labels, a screenshot) it drops while reporting the file complete. OCR in the extractor now reads a scanned page and a picture covering a fifth of a page or slide, and makes the page or slide partial where it cannot. A smaller picture, a picture fill, a chart, a diagram and an embedded object are still not read, and nothing said so. What the extractor owes the caller is to say so.This is the first fix the qualification gates of the issue's last workstream need; the gates themselves follow in their own pull request.
Design
pdflayout.drawing) already collects every picture a page draws, as an image XObject or inline, for OCR. On a page of text, a picture shown at least a point wide and a point high that is under a fifth of the page (ocr.PICTURE_SHARE), and that the page's own text does not fill (a scan's text layer), is one OCR leaves: the page is listed inattrs.images_unread. A larger picture is read with OCR, or the page is partial naming why, as before; a page whose drawing cannot be read or collected whole is partial as before, so the list needs no fallback search. A page partial for its pictures is named by that reason and not listed, as a PPTX slide is. Nothing is decoded or searched again: the list reads what the walk collected._Slide.charts). It now also tracks a picture OCR never sees (_Slide.unread_picture): a shape, a group or a table cell filled with a picture, a picture as the slide's own background (p:bg/p:bgPr/a:blipFill), and alternate content whose choice the walk does not read (ink, or an equation, whose math is no text the walk reads) when the fallback holds a picture. A background from the slide's layout, master or theme is not read. A slide of text (its speaker notes count) with a picture OCR did not read, a fill, a chart, a diagram or an embedded object is listed inattrs.images_unread, unless it already failed for what it shows (a large picture without OCR, or a chart beside text OCR read alone), whose failure names it. A slide of these and no text is a failed unit, as a slide of a picture alone already is.a:blip, which a picture, a group's picture and a shape's picture fill all use;v:imagedatain VML; a VML shape'sv:fillnaming an image part, but for a pattern fill, whose part is the pattern's tile. It is also drawn text (WordArt'sv:textpath, a locked canvas'sa:t), a chart or a diagram (by itsa:graphicDatauri), or an embedded object (w:object). One walk finds them (_pictures), over what the reader keeps: tracked deletions, and a table's deleted rows and cells, are left out. It searches an alternate-content fallback, which the text reader skips, for images, as a drawing the reader does not know, such as a 3D model, keeps its only picture there; drawn text in a fallback does not count, as the choice's text is read (WordArt as Word writes it now). It covers the body, its tables, and its footnotes and endnotes. The same walk decides the failure of a document with no text: a document of these and no text is a failed unit, and a document of a line or a plain shape and no text reads as empty, since it holds nothing to read (before, any drawing failed it). A DOCX page background is not looked at, as the docs say. The DOCX reader runs no OCR.attrs.images_unread. Coverage stays complete: the text these units hold is read, and a small image's text is a capability the release does not offer, not an omitted unit. Making it acoverage.lostcapability would make every file with a logopartial, refused by default withoutallow_partial.Alternatives: a warning per page (unbounded on long files);
coverage.lost(refuses most real documents by default); OCR for every picture however small (an icon or a logo per page would spend the file's OCR budget on no text); leaving it to the bench's silent-loss count (the artifact still says nothing to a caller).Scope and risk
Touches the reference extractor's PDF, PPTX and DOCX parsers and their docs. No server, wire or schema change:
attrsandwarningsare already free fields the server validates and carries, andknowledge.ingest_statusalready returns the warnings. A source extracted again gets a new artifact (new parser version), as any parser change does.Compatibility, rollout and rollback
attrs.images_unread(a list of page or slide numbers) and a warning; the contract allows both.Tests
tests/unit/test_document_extraction_office.py: a PDF page of text that draws a small image (an image XObject, one in a form, one inline, one inline in a form) is read and listed ([2]) with one warning, coverage complete; a page whose resources hold an image its content never draws is not listed; PPTX slides of text with a picture, with a chart, with a picture and speaker notes alone, and with a picture-filled shape are listed ([2, 3, 4, 5]); a PPTX table cell filled with a picture (a:tcPr/a:blipFill) is listed, a run's text fill in a cell is not, a slide with a 3D model is, as is a slide of text with ink, and one with an equation (real OMML, its fallback a picture-filled shape, as PowerPoint writes it), and a slide with a shape whose choice is read is not; a PPTX slide of text over a picture background, and one with a picture-filled group, are listed; a DOCX of text with a picture, a chart, a diagram, a grouped picture, a picture-filled shape, a VML image, a VML picture fill (named by its relationship or its Office id), a 3D model or an embedded object warns, as does one with a picture in a table cell or a footnote, and one with no drawing, a text box (bare, or in alternate content with its VML copy, as Word writes it), WordArt as Word writes it now (its text read through the choice, its VML copy in the fallback), a horizontal rule, a plain shape, a pattern-filled box, a picture inside a tracked deletion or one in a deleted table row or cell does not; a PPTX slide of only a picture background and no text is a failed unit; a DOCX of an embedded object, a chart, a 3D model or WordArt and no text is a failed unit, and one of text with a 3D model or WordArt warns. The PDF fixture builder (tests/fixtures/office_files.py) takes a page as(lines, kind), lines that also draw an image of that kind.tests/unit/test_document_extraction_ocr.py: a large picture OCR read on a text page or slide is not listed, a small one is; a scan's own text layer over its image is not listed; a text page or slide partial or failed for a large picture without OCR is not listed, its reason naming it (the PDF case beside a small picture fails without the rule); a slide with a chart beside text OCR read fails and is not listed; a slide with a chart beside a picture OCR read fails with the new reason; a slide or a page with a picture OCR read and a small one is listed; a page-wide image under a point high is not listed. A small image a scan's own text layer fills (a scan in strips) is not listed.deck_export_0.pdfanddeck_export_2.pdflisted,deck_export_1.pdflisted (page 5) and partial (page 6),deck_1/3/5.pptxandweb_deck_2.pdfpartial (each corpus file extracted in process withloom_extractor.extract, itsattrs.images_unreadand coverage read). The qualification gates that follow will run this check as a test.make format lint typecheck.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked: which corpus files the change flags against their gold, the cost of the image check, and a review at every push.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited. (Not applicable: no migration.)hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version. (Not applicable: no plugin file changes.)npm --prefix frontend run build) and its tests pass, iffrontend/changed. (Not applicable.)docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code