3 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
1829ae23f0 Fix PDF image mapping, caption refresh, and Grok detection 2026-09-23 10:48:36 +08:00
flower-moon
0b0e693eb7 refactor(reading): own the page-render predicate in the reading layer
The session layer held both the decision ("is this page worth rendering?") and
the injection, and the reading capability had no way to ask the same question
without importing session internals. The predicate and the render record now
live in deeptutor/reading/page_render.py, the session helpers delegate to it,
and the viewport seed says when a rendered page is attached — a model told the
attached image is the page it is being asked about reads it instead of
guessing. With no render the seed is byte-for-byte what it was.
2026-09-17 19:22:11 +08:00
flower-moon
31dfc68181 feat(reading): render the open page when its content is drawn
Extracting a PDF's raster images is not enough for slide decks: the diagrams
are usually vector drawings, and the rasters inside them are the shading
fragments. On a real lecture page — two charged-shell diagrams with Gaussian
surfaces and the field formulas — the four "figures" reaching the model were
186x91pt pink shading blocks, and the honest answer was "these are decorative
bars, not plots".

So when the open page's content is mostly drawn (>= 8 drawing objects) the
page itself is rendered — labels, formulas and all — and rides first in the
turn's image attachments, with the page's own rasters behind it. The ceiling
stays at four images per turn, the render is 110dpi/JPEG (~132KB, ~60ms) and
any failure degrades to the previous behaviour. Pages that are only typed skip
the render: their text already reaches the model.
2026-09-17 19:22:10 +08:00