mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The text layer went to the model as the authority for digits. It is not one: a scanned PDF often carries an invisible OCR layer with its own mistakes, a subset font can map to the wrong characters, and a crafted PDF can carry invisible text that differs from what the reviewer sees. The prompt now calls it a hint only, makes the image authoritative, forbids adding a value the image does not show, and asks for a low value confidence where the two disagree. The layer is fenced with the document text markers, which it cannot close, and so is text mode's OCR'd text. Each page's layer is capped while it is collected, and a read shares its text budget out per page, cut at a line and marked, so a long first page no longer pushes the later ones out. A further read now first books what the reads so far cost beyond their reservation, then its own ceiling, both against the cap of the owner the route judged the first read by, so the counter the next read is judged against never lags. The wire is re-checked before every read, the first included. A re-check or reservation that itself fails stops the scan with the pages read rather than failing it, and a scan stopped before any row answers with the stop's reason (budget, or the wire's own refusal) instead of an unreadable page.
3.1 MiB
3.1 MiB